Level selection menu: fix trophy palettes not being faded out when spawning to level (#12)

This commit is contained in:
xCrystal 2024-01-29 20:02:50 +01:00
parent 9d0fbf3883
commit 403d2aee7e
3 changed files with 9 additions and 6 deletions

View File

@ -129,7 +129,7 @@ DEF NUM_PREDEF_PALS EQU const_value
const_def const_def
const RGBFADE_TO_BLACK_6BGP const RGBFADE_TO_BLACK_6BGP
const RGBFADE_TO_LIGHTER_6BGP const RGBFADE_TO_LIGHTER_6BGP
const RGBFADE_TO_WHITE_6BGP_3OBP const RGBFADE_TO_WHITE_6BGP_7OBP
const RGBFADE_TO_WHITE_8BGP_8OBP const RGBFADE_TO_WHITE_8BGP_8OBP
const RGBFADE_TO_BLACK_6BGP_1OBP2 const RGBFADE_TO_BLACK_6BGP_1OBP2
const RGBFADE_TO_LIGHTER_6BGP_1OBP2 const RGBFADE_TO_LIGHTER_6BGP_1OBP2

View File

@ -277,12 +277,16 @@ RGBFadeEffectJumptable:
table_width 2, RGBFadeEffectJumptable table_width 2, RGBFadeEffectJumptable
dw _RGBFadeToBlack_6BGP ; RGBFADE_TO_BLACK_6BGP dw _RGBFadeToBlack_6BGP ; RGBFADE_TO_BLACK_6BGP
dw _RGBFadeToLighter_6BGP ; RGBFADE_TO_LIGHTER_6BGP dw _RGBFadeToLighter_6BGP ; RGBFADE_TO_LIGHTER_6BGP
dw _RGBFadeToWhite_6BGP_3OBP ; RGBFADE_TO_WHITE_6BGP_3OBP dw _RGBFadeToWhite_6BGP_7OBP ; RGBFADE_TO_WHITE_6BGP_7OBP
dw _RGBFadeToWhite_8BGP_8OBP ; RGBFADE_TO_WHITE_8BGP_8OBP dw _RGBFadeToWhite_8BGP_8OBP ; RGBFADE_TO_WHITE_8BGP_8OBP
dw _RGBFadeToBlack_6BGP_1OBP2 ; RGBFADE_TO_BLACK_6BGP_1OBP2 dw _RGBFadeToBlack_6BGP_1OBP2 ; RGBFADE_TO_BLACK_6BGP_1OBP2
dw _RGBFadeToLighter_6BGP_1OBP2 ; RGBFADE_TO_LIGHTER_6BGP_1OBP2 dw _RGBFadeToLighter_6BGP_1OBP2 ; RGBFADE_TO_LIGHTER_6BGP_1OBP2
assert_table_length NUM_RGB_FADE_EFFECTS assert_table_length NUM_RGB_FADE_EFFECTS
; in RGBFadeEffectJumptable functions, use DelayFrame calls appropriately
; inside the loop to adjust loop duration, accounting for whether a loop
; takes up less or more than one frame.
_RGBFadeToBlack_6BGP: _RGBFadeToBlack_6BGP:
ld c, 32 / 2 ld c, 32 / 2
.loop .loop
@ -376,7 +380,7 @@ _RGBFadeToLighter_6BGP_1OBP2:
jr nz, .loop jr nz, .loop
ret ret
_RGBFadeToWhite_6BGP_3OBP: _RGBFadeToWhite_6BGP_7OBP:
ld c, 32 / 2 ld c, 32 / 2
.loop .loop
push bc push bc
@ -388,13 +392,12 @@ _RGBFadeToWhite_6BGP_3OBP:
; fade OBP to white ; fade OBP to white
ld de, wOBPals2 ld de, wOBPals2
ld c, 3 * NUM_PAL_COLORS ld c, 7 * NUM_PAL_COLORS
call FadeStepColorsToWhite call FadeStepColorsToWhite
; commit pals ; commit pals
ld a, TRUE ld a, TRUE
ldh [hCGBPalUpdate], a ldh [hCGBPalUpdate], a
call DelayFrame
pop bc pop bc
dec c dec c

View File

@ -195,7 +195,7 @@ LevelSelectionMenu::
ret ret
.EnterLevelFadeOut: .EnterLevelFadeOut:
ld b, RGBFADE_TO_WHITE_6BGP_3OBP ld b, RGBFADE_TO_WHITE_6BGP_7OBP
jp DoRGBFadeEffect jp DoRGBFadeEffect
.exit .exit