Level cleared transition: placeholder screen, update wCoins with wCurLevelCoins, advance time of day (#35)

This commit is contained in:
xCrystal
2024-01-16 18:08:19 +01:00
parent 20e7791a83
commit f6320585bf
8 changed files with 103 additions and 3 deletions

View File

@@ -1883,7 +1883,9 @@ GetCoinsAccount:
LoadCoinsAmountToMem:
ld bc, hCoinsTemp
call GetScriptByte
cp HIGH(BLUE_RED_SPACE_COINS)
cp COINS_FROM_RAM >> 16
jr z, .coins_from_ram
cp BLUE_RED_SPACE_COINS >> 16
jr z, .blue_red_space_coins
push bc
ld [bc], a
@@ -1896,6 +1898,26 @@ LoadCoinsAmountToMem:
pop bc
ret
.coins_from_ram
; if the highest byte was COINS_FROM_RAM, the lowest two bytes are a RAM address.
; but the script argument is dt, which is big endian rather than little endian like dw.
call GetScriptByte
ld h, a
call GetScriptByte
ld l, a
push bc
ld a, [hli]
ld [bc], a
inc bc
ld a, [hli]
ld [bc], a
inc bc
ld a, [hl]
ld [bc], a
pop bc
ret
.blue_red_space_coins
push de
call GetScriptByte
@@ -2435,6 +2457,7 @@ ReturnFromCredits:
Script_exitoverworld:
call GetScriptByte
ld [wExitOverworldReason], a
call Script_endall
ld a, MAPSTATUS_DONE
call LoadMapStatus