Skip to content

Commit

Permalink
Fix Balcony crash
Browse files Browse the repository at this point in the history
  • Loading branch information
andwn committed Jun 21, 2023
1 parent fe5afc7 commit de1f7f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/md/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ void _error() {
char buf[16];
// Don't completely clear the screen or rewrite the palettes
// Only what is needed to display the error
disable_ints();

vdp_sprites_clear();
vdp_sprites_update();
vdp_font_load(UFTC_SysFont);
Expand Down
9 changes: 7 additions & 2 deletions src/stage.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,23 +507,28 @@ void stage_draw_background() {
void stage_draw_moonback() {
const uint16_t *topTiles, *btmTiles;
const uint16_t *topMap, *btmMap;
uint16_t topNum, btmNum;
if(stageBackgroundType == 1) {
// Moon
topTiles = UFTC_bkMoonTop;
btmTiles = UFTC_bkMoonBtm;
topMap = MAP_bkMoonTop;
btmMap = MAP_bkMoonBtm;
topNum = 12;
btmNum = 188;
} else {
// Fog
topTiles = UFTC_bkFogTop;
btmTiles = UFTC_bkFogBtm;
topMap = MAP_bkFogTop;
btmMap = MAP_bkFogBtm;
topNum = 5;
btmNum = 174;
}
// Load the top section in the designated background area
vdp_tiles_load_uftc(topTiles, TILE_BACKINDEX, 0, 12);
vdp_tiles_load_uftc(topTiles, TILE_BACKINDEX, 0, topNum);
// Load the clouds under the map, it just fits
vdp_tiles_load_uftc(btmTiles, TILE_MOONINDEX, 0, 188);
vdp_tiles_load_uftc(btmTiles, TILE_MOONINDEX, 0, btmNum);
memset(hscrollTable, 0, 128);
//for(uint8_t y = 0; y < 60; y++) hscrollTable[y] = 0;
vdp_vscroll(VDP_PLANE_B, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void window_open(uint8_t mode) {
window_clear();

if(!paused) {
if(showingFace > 0) window_draw_face(showingFace);
if(showingFace > 0) window_draw_face();
vdp_set_window(0, mode ? 8 : (pal_mode ? 245 : 244));
} else showingFace = 0;

Expand Down

0 comments on commit de1f7f9

Please sign in to comment.