Skip to content

Commit

Permalink
Improve some innacurate function names, labels, and comments (#1078)
Browse files Browse the repository at this point in the history
  • Loading branch information
xCrystal committed Jan 7, 2024
1 parent dbf6044 commit bd6ceec
Show file tree
Hide file tree
Showing 107 changed files with 340 additions and 337 deletions.
2 changes: 1 addition & 1 deletion constants/map_data_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ DEF MAP_LENGTH EQU _RS
const DUNGEON
DEF NUM_ENVIRONMENTS EQU const_value - 1

; map palettes (wEnvironment)
; map palettes (wMapTimeOfDay)
const_def
const PALETTE_AUTO
const PALETTE_DAY
Expand Down
2 changes: 1 addition & 1 deletion constants/wram_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ DEF NUM_FRAMES EQU const_value
; wTextboxFlags::
const_def
const FAST_TEXT_DELAY_F ; 0
const NO_TEXT_DELAY_F ; 1
const TEXT_DELAY_F ; 1

; wGBPrinterBrightness::
DEF GBPRINTER_LIGHTEST EQU $00
Expand Down
8 changes: 4 additions & 4 deletions data/events/special_pointers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ SpecialsPointers::
add_special CardFlip
add_special UnusedMemoryGame ; unused
add_special ClearBGPalettesBufferScreen ; unused
add_special FadeOutPalettes
add_special FadeOutToWhite
add_special BattleTowerFade
add_special FadeBlackQuickly
add_special FadeInPalettes
add_special FadeInQuickly
add_special FadeOutToBlack
add_special FadeInFromWhite
add_special FadeInFromBlack
add_special ReloadSpritesNoPalettes ; bank 0
add_special ClearBGPalettes ; bank 0
add_special UpdateTimePals ; bank 0
Expand Down
4 changes: 2 additions & 2 deletions data/maps/setup_script_pointers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ MapSetupCommands:
add_mapsetup LoadMapAttributes ; 1a
add_mapsetup LoadMapAttributes_SkipObjects ; 1b
add_mapsetup ClearBGPalettes ; 1c
add_mapsetup FadeOutPalettes ; 1d
add_mapsetup FadeInPalettes ; 1e
add_mapsetup FadeOutToWhite ; 1d
add_mapsetup FadeInFromWhite ; 1e
add_mapsetup GetMapScreenCoords ; 1f
add_mapsetup GetWarpDestCoords ; 20
add_mapsetup SpawnInFacingDown ; 21
Expand Down
16 changes: 8 additions & 8 deletions data/maps/setup_scripts.asm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ENDM
MapSetupScript_Teleport:
mapsetup ResetPlayerObjectAction
MapSetupScript_Fly:
mapsetup FadeOutPalettes
mapsetup FadeOutToWhite
mapsetup JumpRoamMons
MapSetupScript_Warp:
mapsetup DisableLCD
Expand All @@ -45,7 +45,7 @@ MapSetupScript_Warp:
mapsetup RefreshMapSprites
mapsetup PlayMapMusicBike
mapsetup FadeInToMusic
mapsetup FadeInPalettes
mapsetup FadeInFromWhite
mapsetup ActivateMapAnims
mapsetup LoadWildMonData
db -1 ; end
Expand All @@ -69,7 +69,7 @@ MapSetupScript_BadWarp:
mapsetup SpawnInFacingDown
mapsetup RefreshMapSprites
mapsetup FadeToMapMusic
mapsetup FadeInPalettes
mapsetup FadeInFromWhite
mapsetup ActivateMapAnims
mapsetup LoadWildMonData
db -1 ; end
Expand All @@ -96,7 +96,7 @@ MapSetupScript_Connection:
MapSetupScript_Fall:
mapsetup ResetPlayerObjectAction
MapSetupScript_Door:
mapsetup FadeOutPalettes
mapsetup FadeOutToWhite
MapSetupScript_Train:
mapsetup EnterMapWarp
mapsetup LoadMapAttributes
Expand All @@ -114,7 +114,7 @@ MapSetupScript_Train:
mapsetup LoadMapPalettes
mapsetup RefreshMapSprites
mapsetup FadeToMapMusic
mapsetup FadeInPalettes
mapsetup FadeInFromWhite
mapsetup ActivateMapAnims
mapsetup LoadWildMonData
mapsetup UpdateRoamMons
Expand All @@ -133,7 +133,7 @@ MapSetupScript_ReloadMap:
mapsetup LoadMapPalettes
mapsetup RefreshMapSprites
mapsetup ForceMapMusic
mapsetup FadeInPalettes
mapsetup FadeInFromWhite
mapsetup ActivateMapAnims
mapsetup LoadWildMonData
db -1 ; end
Expand All @@ -151,7 +151,7 @@ MapSetupScript_LinkReturn:
mapsetup LoadMapPalettes
mapsetup RefreshMapSprites
mapsetup PlayMapMusicBike
mapsetup FadeInPalettes
mapsetup FadeInFromWhite
mapsetup ActivateMapAnims
mapsetup LoadWildMonData
mapsetup EnableTextAcceleration
Expand All @@ -172,7 +172,7 @@ MapSetupScript_Continue:
mapsetup LoadMapPalettes
mapsetup RefreshMapSprites
mapsetup PlayMapMusicBike
mapsetup FadeInPalettes
mapsetup FadeInFromWhite
mapsetup ActivateMapAnims
mapsetup LoadWildMonData
db -1 ; end
Expand Down
20 changes: 10 additions & 10 deletions engine/battle/core.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2745,7 +2745,7 @@ ForcePlayerMonChoice:
call LoadTilemapToTempTilemap
call WaitBGMap
call GetMemSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
xor a
ld c, a
ret
Expand All @@ -2764,7 +2764,7 @@ ForcePlayerMonChoice:
call _LoadHPBar
call CloseWindow
call GetMemSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
call SendOutMonText
call NewBattleMonStatus
call BreakAttraction
Expand Down Expand Up @@ -2830,7 +2830,7 @@ JumpToPartyMenuAndPrintText:
farcall WritePartyMenuTilemap
farcall PrintPartyMenuText
call WaitBGMap
call SetPalettes
call SetDefaultBGPAndOBP
call DelayFrame
ret

Expand Down Expand Up @@ -2961,7 +2961,7 @@ LostBattle:
; Grayscale
ld b, SCGB_BATTLE_GRAYSCALE
call GetSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
jr .end

.LostLinkBattle:
Expand Down Expand Up @@ -5045,7 +5045,7 @@ BattleMenu_Pack:
and BATTLERESULT_BITMASK
ld [wBattleResult], a ; WIN
call ClearWindowData
call SetPalettes
call SetDefaultBGPAndOBP
scf
ret

Expand Down Expand Up @@ -5095,7 +5095,7 @@ BattleMenuPKMN_Loop:
call CloseWindow
call LoadTilemapToTempTilemap
call GetMemSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
jp BattleMenu

.GetMenu:
Expand Down Expand Up @@ -5181,7 +5181,7 @@ TryPlayerSwitch:
call _LoadHPBar
call CloseWindow
call GetMemSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
ld a, [wCurPartyMon]
ld [wCurBattleMon], a
PlayerSwitch:
Expand Down Expand Up @@ -6963,7 +6963,7 @@ FinishBattleAnim:
push hl
ld b, SCGB_BATTLE_COLORS
call GetSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
call DelayFrame
pop hl
pop de
Expand Down Expand Up @@ -8459,7 +8459,7 @@ _DisplayLinkRecord:
call WaitBGMap2
ld b, SCGB_DIPLOMA
call GetSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
ld c, 8
call DelayFrames
call WaitPressAorB_BlinkCursor
Expand Down Expand Up @@ -8940,7 +8940,7 @@ InitBattleDisplay:
call HideSprites
ld b, SCGB_BATTLE_COLORS
call GetSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
ld a, $90
ldh [hWY], a
xor a
Expand Down
2 changes: 1 addition & 1 deletion engine/battle/move_effects/baton_pass.asm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ BattleCommand_BatonPass:
call ClearBox
ld b, SCGB_BATTLE_COLORS
call GetSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
call BatonPass_LinkPlayerSwitch

; Mobile link battles handle entrances differently
Expand Down
2 changes: 1 addition & 1 deletion engine/battle/returntobattle_useball.asm
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ _ReturnToBattle_UseBall:
call CloseWindow
call LoadStandardMenuHeader
call WaitBGMap
jp SetPalettes
jp SetDefaultBGPAndOBP
2 changes: 1 addition & 1 deletion engine/battle/trainer_huds.asm
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ _ShowLinkBattleParticipants:
farcall LinkBattle_TrainerHuds ; no need to farcall
ld b, SCGB_DIPLOMA
call GetSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
ld a, $e4
ldh [rOBP0], a
ret
2 changes: 1 addition & 1 deletion engine/debug/color_picker.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ TilesetColorPicker: ; unreferenced
ld [wDebugTilesetCurColor], a
ldh [hMapAnims], a
call ClearSprites
call OverworldTextModeSwitch
call LoadOverworldTilemapAndAttrmapPals
call WaitBGMap2
xor a
ldh [hBGMapMode], a
Expand Down
2 changes: 1 addition & 1 deletion engine/debug/debug_room.asm
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ DebugRoom_EditPagedValues:
call WaitBGMap
ld b, SCGB_DIPLOMA
call GetSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
.resume
call DelayFrame
call JoyTextDelay
Expand Down
4 changes: 2 additions & 2 deletions engine/events/battle_tower/battle_tower.asm
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ Function1704e1:
bit 7, a
jr nz, .done
call .DoJumptable
farcall ReloadMapPart
farcall HDMATransferTilemapAndAttrmap_Overworld
jr .loop

.done
Expand Down Expand Up @@ -654,7 +654,7 @@ Function1704e1:
jr .NextJumptableFunction

.Jumptable_1:
call SetPalettes
call SetDefaultBGPAndOBP
call .NextJumptableFunction

.Jumptable_2:
Expand Down
2 changes: 1 addition & 1 deletion engine/events/bug_contest/display_stats.asm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ DisplayCaughtContestMonStats:
call WaitBGMap
ld b, SCGB_DIPLOMA
call GetSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
ret

.Health:
Expand Down
2 changes: 1 addition & 1 deletion engine/events/diploma.asm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ PlaceDiplomaOnScreen:
call WaitBGMap
ld b, SCGB_DIPLOMA
call GetSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
call DelayFrame
ret

Expand Down
6 changes: 3 additions & 3 deletions engine/events/field_moves.asm
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ PlayWhirlpoolSound:
ret

BlindingFlash:
farcall FadeOutPalettes
farcall FadeOutToWhite
ld hl, wStatusFlags
set STATUSFLAGS_FLASH_F, [hl]
farcall ReplaceTimeOfDayPals
farcall UpdateTimeOfDayPal
ld b, SCGB_MAPPALS
call GetSGBLayout
farcall LoadOW_BGPal7
farcall FadeInPalettes
farcall FadeInFromWhite
ret

ShakeHeadbuttTree:
Expand Down Expand Up @@ -59,7 +59,7 @@ ShakeHeadbuttTree:
jr .loop

.done
call OverworldTextModeSwitch
call LoadOverworldTilemapAndAttrmapPals
call WaitBGMap
xor a
ldh [hBGMapMode], a
Expand Down
10 changes: 5 additions & 5 deletions engine/events/halloffame.asm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RedCredits::
ld [wMusicFadeID + 1], a
ld a, 10
ld [wMusicFade], a
farcall FadeOutPalettes
farcall FadeOutToWhite
xor a
ld [wVramState], a
ldh [hMapAnims], a
Expand All @@ -63,7 +63,7 @@ HallOfFame_FadeOutMusic:
ld [wMusicFadeID + 1], a
ld a, 10
ld [wMusicFade], a
farcall FadeOutPalettes
farcall FadeOutToWhite
xor a
ld [wVramState], a
ldh [hMapAnims], a
Expand Down Expand Up @@ -256,7 +256,7 @@ AnimateHOFMonEntrance:
ldh [hBGMapMode], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
call HOF_SlideBackpic
xor a
ld [wBoxAlignment], a
Expand Down Expand Up @@ -389,7 +389,7 @@ _HallOfFamePC:
call WaitBGMap
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
decoord 6, 5
ld c, ANIM_MON_HOF
predef HOF_AnimateFrontpic
Expand Down Expand Up @@ -543,7 +543,7 @@ HOF_AnimatePlayerPic:
ld [wCurPartySpecies], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
call SetPalettes
call SetDefaultBGPAndOBP
call HOF_SlideBackpic
xor a
ld [wBoxAlignment], a
Expand Down
4 changes: 2 additions & 2 deletions engine/events/overworld.asm
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ CutDownTreeOrGrass:
ld [hl], a
xor a
ldh [hBGMapMode], a
call OverworldTextModeSwitch
call LoadOverworldTilemapAndAttrmapPals
call UpdateSprites
call DelayFrame
ld a, [wCutWhirlpoolAnimationType]
Expand Down Expand Up @@ -1179,7 +1179,7 @@ DisappearWhirlpool:
ld [hl], a
xor a
ldh [hBGMapMode], a
call OverworldTextModeSwitch
call LoadOverworldTilemapAndAttrmapPals
ld a, [wCutWhirlpoolAnimationType]
ld e, a
farcall PlayWhirlpoolSound
Expand Down
2 changes: 1 addition & 1 deletion engine/events/pokecenter_pc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ _PlayersHousePC:
call _PlayersPC
and a
jr nz, .changed_deco_tiles
call OverworldTextModeSwitch
call LoadOverworldTilemapAndAttrmapPals
call ApplyTilemap
call UpdateSprites
call PC_PlayShutdownSound
Expand Down
2 changes: 1 addition & 1 deletion engine/events/pokepic.asm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ClosePokepic::
call GetMemSGBLayout
xor a
ldh [hBGMapMode], a
call OverworldTextModeSwitch
call LoadOverworldTilemapAndAttrmapPals
call ApplyTilemap
call UpdateSprites
call LoadStandardFont
Expand Down

0 comments on commit bd6ceec

Please sign in to comment.