Clear BGMap before clear level screen to avoid glitch due to SCX=4 [bugfix to f6320585bf] (#35)

This commit is contained in:
xCrystal 2024-01-17 14:25:29 +01:00
parent f6320585bf
commit 0abe559e11
6 changed files with 19 additions and 21 deletions

View File

@ -107,10 +107,7 @@ _SlotMachine:
call PlayMusic call PlayMusic
call DelayFrame call DelayFrame
call DisableLCD call DisableLCD
hlbgcoord 0, 0 call ClearBGMap0or2
ld bc, vBGMap1 - vBGMap0
ld a, " "
call ByteFill
ld b, CGB_SLOT_MACHINE ld b, CGB_SLOT_MACHINE
call GetCGBLayout call GetCGBLayout
callfar ClearSpriteAnims callfar ClearSpriteAnims

View File

@ -4,13 +4,16 @@ ClearedLevelScreen:
ldh [hSCY], a ldh [hSCY], a
ld a, -$4 ld a, -$4
ldh [hSCX], a ldh [hSCX], a
call DisableLCD
call ClearTilemap call ClearTilemap
call ClearBGMap0or2
call LoadFrame call LoadFrame
call LoadStandardFont call LoadStandardFont
call ClearMenuAndWindowData call ClearMenuAndWindowData
ld b, CGB_DIPLOMA ld b, CGB_DIPLOMA
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetPalettes
call EnableLCD
ld hl, .LevelCleared1Text ld hl, .LevelCleared1Text
bccoord 3, 1 bccoord 3, 1
call PrintHLTextAtBC call PrintHLTextAtBC

View File

@ -14,11 +14,12 @@ GameMenu:
GameMenu_KeepMusic: GameMenu_KeepMusic:
xor a xor a
ldh [hMapAnims], a ldh [hMapAnims], a
ldh [hSCX], a
ldh [hSCY], a
call ClearTilemap call ClearTilemap
call LoadFrame call LoadFrame
call LoadStandardFont call LoadStandardFont
xor a
ldh [hSCX], a
ldh [hSCY], a
call ClearMenuAndWindowData call ClearMenuAndWindowData
ld b, CGB_DIPLOMA ld b, CGB_DIPLOMA
call GetCGBLayout call GetCGBLayout

View File

@ -5,10 +5,7 @@ InitDisplayForHallOfFame:
call DisableLCD call DisableLCD
call LoadStandardFont call LoadStandardFont
call LoadFontsBattleExtra call LoadFontsBattleExtra
hlbgcoord 0, 0 call ClearBGMap0or2
ld bc, vBGMap1 - vBGMap0
ld a, " "
call ByteFill
hlcoord 0, 0, wAttrmap hlcoord 0, 0, wAttrmap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
xor a xor a
@ -34,10 +31,7 @@ InitDisplayForRedCredits:
call DisableLCD call DisableLCD
call LoadStandardFont call LoadStandardFont
call LoadFontsBattleExtra call LoadFontsBattleExtra
hlbgcoord 0, 0 call ClearBGMap0or2
ld bc, vBGMap1 - vBGMap0
ld a, " "
call ByteFill
hlcoord 0, 0, wAttrmap hlcoord 0, 0, wAttrmap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
xor a xor a

View File

@ -239,17 +239,13 @@ LoadMapTimeOfDay:
ldh [rVBK], a ldh [rVBK], a
xor a xor a
ld bc, vBGMap1 - vBGMap0 call FillBGMap0or2
hlbgcoord 0, 0
call ByteFill
pop af pop af
ldh [rVBK], a ldh [rVBK], a
ld a, "■" ld a, "■"
ld bc, vBGMap1 - vBGMap0 call FillBGMap0or2
hlbgcoord 0, 0
call ByteFill
ret ret
.PushAttrmap: .PushAttrmap:

View File

@ -1,3 +1,10 @@
ClearBGMap0or2::
ld a, " "
FillBGMap0or2::
hlbgcoord 0, 0
ld bc, vBGMap1 - vBGMap0
jp ByteFill
ClearBGPalettes:: ClearBGPalettes::
call ClearPalettes call ClearPalettes
WaitBGMap:: WaitBGMap::