Consolidate behavior of fading to/from white in overworld (#2), Fix naming screen tiles (#3) (bug fix to 6e3c5fd008)

This commit is contained in:
xCrystal
2023-08-04 23:54:53 +02:00
parent 55a38ff2de
commit f64bbf700d
12 changed files with 112 additions and 67 deletions

View File

@@ -10,14 +10,14 @@ PlayWhirlpoolSound:
ret
BlindingFlash:
farcall FadeOutPalettes
farcall FadeOutPalettesToWhite
ld hl, wStatusFlags
set STATUSFLAGS_FLASH_F, [hl]
farcall ReplaceTimeOfDayPals
farcall UpdateTimeOfDayPal
ld b, CGB_MAPPALS
call GetCGBLayout
farcall FadeInPalettes
farcall FadeInPalettesFromWhite
ret
ShakeHeadbuttTree:

View File

@@ -41,7 +41,7 @@ RedCredits::
ld [wMusicFadeID + 1], a
ld a, 10
ld [wMusicFade], a
farcall FadeOutPalettes
farcall FadeOutPalettesToWhite
xor a
ld [wVramState], a
ldh [hMapAnims], a
@@ -63,7 +63,7 @@ HallOfFame_FadeOutMusic:
ld [wMusicFadeID + 1], a
ld a, 10
ld [wMusicFade], a
farcall FadeOutPalettes
farcall FadeOutPalettesToWhite
xor a
ld [wVramState], a
ldh [hMapAnims], a

View File

@@ -49,12 +49,12 @@ SacredAshScript:
special HealParty
reloadmappart
playsound SFX_WARP_TO
special FadeOutPalettes
special FadeInPalettes
special FadeOutPalettes
special FadeInPalettes
special FadeOutPalettes
special FadeInPalettes
special FadeOutPalettesToWhite
special FadeInPalettesFromWhite
special FadeOutPalettesToWhite
special FadeInPalettesFromWhite
special FadeOutPalettesToWhite
special FadeInPalettesFromWhite
waitsfx
writetext .UseSacredAshText
playsound SFX_CAUGHT_MON

View File

@@ -9,7 +9,7 @@ OverworldWhiteoutScript::
Script_Whiteout:
writetext .WhitedOutText
waitbutton
special FadeOutPalettes
special FadeOutPalettesToWhite
pause 40
special HealParty
checkflag ENGINE_BUG_CONTEST_TIMER

View File

@@ -670,15 +670,6 @@ NamePlayer:
.Kris:
db "KRIS@@@@@@@"
GSShowPlayerNamingChoices: ; unreferenced
call LoadMenuHeader
call VerticalMenu
ld a, [wMenuCursorY]
dec a
call CopyNameFromMenu
call CloseWindow
ret
StorePlayerName:
ld a, "@"
ld bc, NAME_LENGTH

View File

@@ -1,8 +1,8 @@
DEF NAMINGSCREEN_CURSOR EQU $7e
DEF NAMINGSCREEN_BORDER EQU "■" ; $60
DEF NAMINGSCREEN_MIDDLELINE EQU "" ; $eb
DEF NAMINGSCREEN_UNDERLINE EQU "." ; $e8
DEF NAMINGSCREEN_BORDER EQU "■" ; $ba
DEF NAMINGSCREEN_MIDDLELINE EQU "" ; $bb
DEF NAMINGSCREEN_UNDERLINE EQU "" ; $bc
_NamingScreen:
call DisableSpriteUpdates
@@ -832,7 +832,7 @@ LoadNamingScreenGFX:
lb bc, BANK(NamingScreenGFX_UnderLine), 1
call Get1bpp
ld de, vTiles2 tile NAMINGSCREEN_BORDER
ld de, vTiles0 tile NAMINGSCREEN_BORDER
ld hl, NamingScreenGFX_Border
ld bc, 1 tiles
ld a, BANK(NamingScreenGFX_Border)

View File

@@ -111,45 +111,44 @@ _UpdateTimePals::
call DmgToCgbTimePals
ret
FadeInPalettes::
FadeInPalettesFromWhite::
; fades from white to normal palettes in four steps
; all palettes use white color of Pal0 before step 3
call BackupWhiteColorFromBGPals1
call FillWhiteBGColor
ld c, $12
call GetTimePalFade
ld b, $4
ld b, $2
call ConvertTimePalsDecHL
call RestoreWhiteColorToBGPals1
ld c, $c
call GetTimePalFade
ld b, $2
call ConvertTimePalsDecHL
ret
FadeOutPalettes::
call FillWhiteBGColor
FadeOutPalettesToWhite::
; fades from normal palettes to white in four steps
; all palettes use white color of Pal0 after step 2
ld c, $9
call GetTimePalFade
ld b, $4
ld b, $2
call ConvertTimePalsIncHL
call FillWhiteBGColor
ld c, $f
call GetTimePalFade
ld b, $2
call ConvertTimePalsIncHL
ret
BattleTowerFade:
call FillWhiteBGColor
ld c, $9
call GetTimePalFade
ld b, $4
.loop
call DmgToCgbTimePals
inc hl
inc hl
inc hl
ld c, $7
call DelayFrames
dec b
jr nz, .loop
ret
FadeInQuickly:
FadeInPalettesFromBlack:
ld c, $0
call GetTimePalFade
ld b, $4
call ConvertTimePalsIncHL
ret
FadeBlackQuickly:
FadeOutPalettesToBlack:
ld c, $9
call GetTimePalFade
ld b, $4
@@ -157,6 +156,7 @@ FadeBlackQuickly:
ret
FillWhiteBGColor:
; copy white palette of wBGPals1 Pal0 into white palette of wBGPals1 Pal1-Pal6
ldh a, [rSVBK]
push af
ld a, BANK(wBGPals1)
@@ -184,6 +184,60 @@ endr
ldh [rSVBK], a
ret
BackupWhiteColorFromBGPals1:
ldh a, [rSVBK]
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
ld hl, wBGPals1
ld de, wBGPalsRegularWhiteColors
ld c, 8
.loop
ld a, [hli]
ld [de], a
inc de
ld a, [hli]
ld [de], a
inc de
rept PALETTE_SIZE - 1 * PAL_COLOR_SIZE
inc hl
endr
dec c
jr nz, .loop
pop af
ldh [rSVBK], a
ret
RestoreWhiteColorToBGPals1:
ldh a, [rSVBK]
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
ld hl, wBGPalsRegularWhiteColors
ld de, wBGPals1
ld c, 8
.loop
ld a, [hli]
ld [de], a
inc de
ld a, [hli]
ld [de], a
inc de
rept PALETTE_SIZE - 1 * PAL_COLOR_SIZE
inc de
endr
dec c
jr nz, .loop
pop af
ldh [rSVBK], a
ret
ReplaceTimeOfDayPals:
ld a, [wMapTimeOfDay]
bit IN_DARKNESS_F, a