Apply most of pokecrystal PR 1105

This commit is contained in:
xCrystal
2024-02-11 00:16:00 +01:00
parent 971c4aa2c7
commit 5c4d982702
74 changed files with 276 additions and 276 deletions

View File

@@ -53,10 +53,10 @@ SpecialsPointers::
add_special CardFlip add_special CardFlip
add_special UnusedMemoryGame ; unused add_special UnusedMemoryGame ; unused
add_special ClearBGPalettesBufferScreen ; unused add_special ClearBGPalettesBufferScreen ; unused
add_special FadeOutPalettesToWhite add_special FadeOutToWhite
add_special FadeOutPalettesToBlack add_special FadeOutToBlack
add_special FadeInPalettesFromWhite add_special FadeInFromWhite
add_special FadeInPalettesFromBlack add_special FadeInFromBlack
add_special ReloadSpritesNoPalettes ; bank 0 add_special ReloadSpritesNoPalettes ; bank 0
add_special ClearBGPalettes ; bank 0 add_special ClearBGPalettes ; bank 0
add_special UpdateTimePals ; bank 0 add_special UpdateTimePals ; bank 0

View File

@@ -33,8 +33,8 @@ MapSetupCommands:
add_mapsetup LoadMapAttributes ; 1a add_mapsetup LoadMapAttributes ; 1a
add_mapsetup LoadMapAttributes_SkipObjects ; 1b add_mapsetup LoadMapAttributes_SkipObjects ; 1b
add_mapsetup ClearBGPalettes ; 1c add_mapsetup ClearBGPalettes ; 1c
add_mapsetup FadeOutPalettesToWhite ; 1d add_mapsetup FadeOutToWhite ; 1d
add_mapsetup FadeInPalettesFromWhite ; 1e add_mapsetup FadeInFromWhite ; 1e
add_mapsetup GetMapScreenCoords ; 1f add_mapsetup GetMapScreenCoords ; 1f
add_mapsetup GetWarpDestCoords ; 20 add_mapsetup GetWarpDestCoords ; 20
add_mapsetup SpawnInFacingDown ; 21 add_mapsetup SpawnInFacingDown ; 21

View File

@@ -44,7 +44,7 @@ MapSetupScript_EnterLevel:
mapsetup RefreshMapSprites mapsetup RefreshMapSprites
mapsetup PlayMapMusicBike mapsetup PlayMapMusicBike
mapsetup FadeInToMusic mapsetup FadeInToMusic
mapsetup FadeInPalettesFromWhite mapsetup FadeInFromWhite
mapsetup ConstructAndEnableOverworldHUD mapsetup ConstructAndEnableOverworldHUD
mapsetup ActivateMapAnims mapsetup ActivateMapAnims
mapsetup LoadWildMonData mapsetup LoadWildMonData
@@ -54,7 +54,7 @@ MapSetupScript_EnterLevel:
MapSetupScript_Teleport: MapSetupScript_Teleport:
mapsetup ResetPlayerObjectAction mapsetup ResetPlayerObjectAction
MapSetupScript_Fly: MapSetupScript_Fly:
mapsetup FadeOutPalettesToWhite mapsetup FadeOutToWhite
mapsetup JumpRoamMons mapsetup JumpRoamMons
MapSetupScript_Warp: MapSetupScript_Warp:
mapsetup DisableLCD mapsetup DisableLCD
@@ -78,7 +78,7 @@ MapSetupScript_Warp:
mapsetup RefreshMapSprites mapsetup RefreshMapSprites
mapsetup PlayMapMusicBike mapsetup PlayMapMusicBike
mapsetup FadeInToMusic mapsetup FadeInToMusic
mapsetup FadeInPalettesFromWhite mapsetup FadeInFromWhite
mapsetup ActivateMapAnims mapsetup ActivateMapAnims
mapsetup LoadWildMonData mapsetup LoadWildMonData
mapsetup AnchorPointAfterWarp mapsetup AnchorPointAfterWarp
@@ -106,7 +106,7 @@ MapSetupScript_BadWarp:
mapsetup SpawnInFacingDown mapsetup SpawnInFacingDown
mapsetup RefreshMapSprites mapsetup RefreshMapSprites
mapsetup FadeToMapMusic mapsetup FadeToMapMusic
mapsetup FadeInPalettesFromWhite mapsetup FadeInFromWhite
mapsetup ActivateMapAnims mapsetup ActivateMapAnims
mapsetup LoadWildMonData mapsetup LoadWildMonData
mapsetup AnchorPointAfterWarp mapsetup AnchorPointAfterWarp
@@ -138,7 +138,7 @@ MapSetupScript_Connection:
MapSetupScript_Fall: MapSetupScript_Fall:
mapsetup ResetPlayerObjectAction mapsetup ResetPlayerObjectAction
MapSetupScript_Door: MapSetupScript_Door:
mapsetup FadeOutPalettesToWhite mapsetup FadeOutToWhite
MapSetupScript_Train: MapSetupScript_Train:
mapsetup BackupMapObjects mapsetup BackupMapObjects
mapsetup EnterMapWarp mapsetup EnterMapWarp
@@ -158,7 +158,7 @@ MapSetupScript_Train:
mapsetup LoadMapPalettes mapsetup LoadMapPalettes
mapsetup RefreshMapSprites mapsetup RefreshMapSprites
mapsetup FadeToMapMusic mapsetup FadeToMapMusic
mapsetup FadeInPalettesFromWhite mapsetup FadeInFromWhite
mapsetup ActivateMapAnims mapsetup ActivateMapAnims
mapsetup LoadWildMonData mapsetup LoadWildMonData
mapsetup UpdateRoamMons mapsetup UpdateRoamMons
@@ -180,7 +180,7 @@ MapSetupScript_ReloadMap:
mapsetup LoadMapPalettes mapsetup LoadMapPalettes
mapsetup RefreshMapSprites mapsetup RefreshMapSprites
mapsetup ForceMapMusic mapsetup ForceMapMusic
mapsetup FadeInPalettesFromWhite mapsetup FadeInFromWhite
mapsetup EnableOverworldHUD mapsetup EnableOverworldHUD
mapsetup ActivateMapAnims mapsetup ActivateMapAnims
mapsetup LoadWildMonData mapsetup LoadWildMonData
@@ -205,7 +205,7 @@ MapSetupScript_ExitViewMap:
mapsetup LoadMapPalettes mapsetup LoadMapPalettes
mapsetup SpawnInCustomFacing ; restore player's facing if in branch space mapsetup SpawnInCustomFacing ; restore player's facing if in branch space
mapsetup RefreshMapSprites mapsetup RefreshMapSprites
mapsetup FadeInPalettesFromWhite mapsetup FadeInFromWhite
mapsetup EnableOverworldHUD mapsetup EnableOverworldHUD
mapsetup ActivateMapAnims mapsetup ActivateMapAnims
mapsetup LoadWildMonData mapsetup LoadWildMonData
@@ -226,7 +226,7 @@ MapSetupScript_LinkReturn:
mapsetup LoadMapPalettes mapsetup LoadMapPalettes
mapsetup RefreshMapSprites mapsetup RefreshMapSprites
mapsetup PlayMapMusicBike mapsetup PlayMapMusicBike
mapsetup FadeInPalettesFromWhite mapsetup FadeInFromWhite
mapsetup ActivateMapAnims mapsetup ActivateMapAnims
mapsetup LoadWildMonData mapsetup LoadWildMonData
mapsetup EnableTextAcceleration mapsetup EnableTextAcceleration
@@ -249,7 +249,7 @@ MapSetupScript_Continue:
mapsetup LoadMapPalettes mapsetup LoadMapPalettes
mapsetup RefreshMapSprites mapsetup RefreshMapSprites
mapsetup PlayMapMusicBike mapsetup PlayMapMusicBike
mapsetup FadeInPalettesFromWhite mapsetup FadeInFromWhite
mapsetup ConstructAndEnableOverworldHUD mapsetup ConstructAndEnableOverworldHUD
mapsetup ActivateMapAnims mapsetup ActivateMapAnims
mapsetup LoadWildMonData mapsetup LoadWildMonData

View File

@@ -35,14 +35,14 @@
#### Overworld map scrolling #### Overworld map scrolling
- **LoadScreenTilemap**: From the metatile-based 24x20 map in wSurroundingTiles, load the corresponding 20x18 tiles to wTilemap. Later, BackupBGMap* from ScrollMap* copies new row/column from wTilemap to wBGMapBuffer. _ScrollBGMapPalettes populates wBGMapPalBuffer based on the tiles at wBGMapBuffer. These are read during vblank by UpdateBGMapBuffer. - **LoadOverworldTilemap**: From the metatile-based 24x20 map in wSurroundingTiles, load the corresponding 20x18 tiles to wTilemap. Later, BackupBGMap* from ScrollMap* copies new row/column from wTilemap to wBGMapBuffer. _ScrollBGMapPalettes populates wBGMapPalBuffer based on the tiles at wBGMapBuffer. These are read during vblank by UpdateBGMapBuffer.
- **LoadScreenAttrmapPals**: Load wAttrmap palette numbers based on the tileset palettes of the current map. Called only by LoadScreenTilemapAndAttrmapPals. - **LoadOverworldAttrmapPals**: Load wAttrmap palette numbers based on the tileset palettes of the current map. Called only by LoadOverworldTilemapAndAttrmapPals.
- **LoadScreenTilemapAndAttrmapPals**: LoadScreenTilemap + LoadScreenAttrmapPals. Often used to reload screen after closing a text box. - **LoadOverworldTilemapAndAttrmapPals**: LoadOverworldTilemap + LoadOverworldAttrmapPals. Often used to reload screen after closing a text box.
#### Overworld map anchoring #### Overworld map anchoring
- **ReanchorBGMap_NoOAMUpdate**: LoadScreenTilemapAndAttrmapPals + HDMATransferTilemapAndAttrmap_OpenAndCloseMenu, then fill BG map with all black while Window is displayed, finally anchor map and objects. Shall by followed by CopyTilemapAtOnce or by a HDMATransferTilemapAndAttrmap_* to redraw the screen. - **ReanchorBGMap_NoOAMUpdate**: LoadOverworldTilemapAndAttrmapPals + HDMATransferTilemapAndAttrmap_Menu, then fill BG map with all black while Window is displayed, finally anchor map and objects. Shall by followed by CopyTilemapAtOnce or by a HDMATransferTilemapAndAttrmap_* to redraw the screen.
- **OpenText1bpp**, **OpenText2bpp**: ClearMenuAndWindowData + ReanchorBGMap_NoOAMUpdate + SpeechTextbox1bpp + HDMATransferTilemapAndAttrmap_OpenAndCloseMenu + hide Window - **OpenText1bpp**, **OpenText2bpp**: ClearMenuAndWindowData + ReanchorBGMap_NoOAMUpdate + SpeechTextbox1bpp + HDMATransferTilemapAndAttrmap_Menu + hide Window
- **OpenText1bpp**: Loads 1bpp font (LoadFont_NoOAMUpdate) - **OpenText1bpp**: Loads 1bpp font (LoadFont_NoOAMUpdate)
- **OpenText2bpp**: Doesn't load 2bpp font - **OpenText2bpp**: Doesn't load 2bpp font
- **RefreshScreen**: Same as OpenText functions but doesn't call any SpeechTextbox - **RefreshScreen**: Same as OpenText functions but doesn't call any SpeechTextbox
@@ -55,7 +55,7 @@
- **HDMATransfer1bpp**: Copy 1bpp tiles via HDMA. Maximum 16 tiles per frame - **HDMATransfer1bpp**: Copy 1bpp tiles via HDMA. Maximum 16 tiles per frame
- **HDMATransfer2bpp**: Copy 2bpp tiles via HDMA. No hardcoded limit. Timing considers 1 tile per hblank - **HDMATransfer2bpp**: Copy 2bpp tiles via HDMA. No hardcoded limit. Timing considers 1 tile per hblank
- **Get1bppViaHDMA**, **Get2bppViaHDMA**: Call Copy1bpp or Copy2bpp if LCD disabled. HDMATransfer1bpp or HDMATransfer2bpp otherwise - **Get1bppViaHDMA**, **Get2bppViaHDMA**: Call Copy1bpp or Copy2bpp if LCD disabled. HDMATransfer1bpp or HDMATransfer2bpp otherwise
- **HDMATransferTilemapAndAttrmap_OpenAndCloseMenu**, **HDMATransferTilemapAndAttrmap_OverworldEffect**: Similar, but with slightly different scanline timing. So they're essentially like RefreshScreen minus the anchoring part. - **HDMATransferTilemapAndAttrmap_Menu**, **HDMATransferTilemapAndAttrmap_Overworld**: Similar, but with slightly different scanline timing. So they're essentially like RefreshScreen minus the anchoring part.
#### HUD #### HUD
@@ -69,8 +69,8 @@
## Scripts ## Scripts
- **refreshscreen**: RefreshScreen - **reanchormap**: RefreshScreen
- **reloadmappart**: LoadScreenTilemapAndAttrmapPals + GetMovementPermissions + HDMATransferTilemapAndAttrmap_OverworldEffect + UpdateSprites. Similar to refreshscreen, but does not reanchor. On the other hand, it refreshes movement permissions. Often used after a block change or field move, which can affect collisions. - **refreshmap**: LoadOverworldTilemapAndAttrmapPals + GetMovementPermissions + HDMATransferTilemapAndAttrmap_Overworld + UpdateSprites. Similar to reanchormap, but does not reanchor. On the other hand, it refreshes movement permissions. Often used after a block change or field move, which can affect collisions.
## Changes ## Changes
@@ -130,19 +130,19 @@
### Overworld workflow ### Overworld workflow
1) ``OverworldLoop`` is called from ``GameMenu_WorldMap`` with either ``hMapEntryMethod`` = ``MAPSETUP_ENTERLEVEL`` or ``hMapEntryMethod`` = ``MAPSETUP_CONTINUE``. 1) ``OverworldLoop`` is called from ``GameMenu_WorldMap`` with either ``hMapEntryMethod`` = ``MAPSETUP_ENTERLEVEL`` or ``hMapEntryMethod`` = ``MAPSETUP_CONTINUE``.
2) ``StartMap`` resets ``wCurTurn`` and ``wCurSpace`` if ``MAPSETUP_ENTERLEVEL``. ``StartMap`` sets ``hCurBoardEvent`` to ``BOARDEVENT_DISPLAY_MENU``. ``wScriptFlags2`` is cleared. ``wMapStatus`` is set to ``MAPSTATUS_HANDLE`` causing ``HandleMap`` to be called. 2) ``StartMap`` resets ``wCurTurn`` and ``wCurSpace`` if ``MAPSETUP_ENTERLEVEL``. ``StartMap`` sets ``hCurBoardEvent`` to ``BOARDEVENT_DISPLAY_MENU``. ``wEnabledPlayerEvents`` is cleared. ``wMapStatus`` is set to ``MAPSTATUS_HANDLE`` causing ``HandleMap`` to be called.
3) ``MapEvents`` (from ``HandleMap``) calls ``PlayerEvents``. ``CheckBoardEvent`` queues ``BoardMenuScript`` which is executed by ``ScriptEvents``. 3) ``MapEvents`` (from ``HandleMap``) calls ``PlayerEvents``. ``CheckBoardEvent`` queues ``BoardMenuScript`` which is executed by ``ScriptEvents``.
4) ``BoardMenuScript.Upkeep`` saves the game, clears ``wTurnData[]``, increases ``wCurTurn``, and loads current space to ``wCurSpaceStruct[]``. 4) ``BoardMenuScript.Upkeep`` saves the game, clears ``wTurnData[]``, increases ``wCurTurn``, and loads current space to ``wCurSpaceStruct[]``.
- If player exits, the ``exitoverworld`` script sets ``wMapStatus`` to ``MAPSTATUS_DONE``. This causes ``OverworldLoop`` to return back to the game menu. **Exit this workflow**. - If player exits, the ``exitoverworld`` script sets ``wMapStatus`` to ``MAPSTATUS_DONE``. This causes ``OverworldLoop`` to return back to the game menu. **Exit this workflow**.
5) Player rolls die and the animation plays. After the animation, ``wDisplaySecondarySprites.SECONDARYSPRITES_SPACES_LEFT_F`` is set and ``hCurBoardEvent`` is set to ``BOARDEVENT_HANDLE_BOARD``. At the end of this ``HandleMap`` iteration, ``CheckPlayerState`` sets ``wMapEventStatus`` to ``MAPEVENTS_ON`` (``wScriptFlags2`` is not touched so it remains cleared). 5) Player rolls die and the animation plays. After the animation, ``wDisplaySecondarySprites.SECONDARYSPRITES_SPACES_LEFT_F`` is set and ``hCurBoardEvent`` is set to ``BOARDEVENT_HANDLE_BOARD``. At the end of this ``HandleMap`` iteration, ``CheckPlayerState`` sets ``wMapEventStatus`` to ``MAPEVENTS_ON`` (``wEnabledPlayerEvents`` is not touched so it remains cleared).
6) In the next ``HandleMap`` iteration, ``CheckBoardEvent`` from ``PlayerEvents`` jumps to ``.board`` and then to ``.no_space_effect`` due to ``wScriptFlags2[4]`` not being set. 6) In the next ``HandleMap`` iteration, ``CheckBoardEvent`` from ``PlayerEvents`` jumps to ``.board`` and then to ``.no_space_effect`` due to ``wEnabledPlayerEvents[4]`` not being set.
7) Execution continues in ``PlayerEvents``; ``OWPlayerInput`` is eventually called, and thus ``DoPlayerMovement``. Here, ``StepTowardsNextSpace`` computes based on ``wCurSpaceNextSpace`` what direction key to write to ``wCurInput``, causing the player to begin a movement in that direction. 7) Execution continues in ``PlayerEvents``; ``OWPlayerInput`` is eventually called, and thus ``DoPlayerMovement``. Here, ``StepTowardsNextSpace`` computes based on ``wCurSpaceNextSpace`` what direction key to write to ``wCurInput``, causing the player to begin a movement in that direction.
8) The player may need to turn to a different direction through the ``ChangeDirectionScript`` (when ``DoPlayerMovement`` returns with ``PLAYERMOVEMENT_TURN``). Otherwise or after that, ``CheckPlayerState`` sets ``wMapEventStatus`` to ``MAPEVENTS_OFF``, 8) The player may need to turn to a different direction through the ``ChangeDirectionScript`` (when ``DoPlayerMovement`` returns with ``PLAYERMOVEMENT_TURN``). Otherwise or after that, ``CheckPlayerState`` sets ``wMapEventStatus`` to ``MAPEVENTS_OFF``,
9) When the step finishes (i.e. ``PLAYERSTEP_STOP_F`` becomes set) in some ``HandleMap`` iteration, ``CheckPlayerState`` sets ``wScriptFlags2`` to $ff and ``wMapEventStatus`` to ``MAPEVENTS_ON``. 9) When the step finishes (i.e. ``PLAYERSTEP_STOP_F`` becomes set) in some ``HandleMap`` iteration, ``CheckPlayerState`` sets ``wEnabledPlayerEvents`` to $ff and ``wMapEventStatus`` to ``MAPEVENTS_ON``.
10) In the next ``HandleMap`` iteration, ``CheckBoardEvent.board`` is called with ``wScriptFlags2[4]`` set. 10) In the next ``HandleMap`` iteration, ``CheckBoardEvent.board`` is called with ``wEnabledPlayerEvents[4]`` set.
- If ``wCurSpaceNextSpace`` matches ``NEXT_SPACE_IS_ANCHOR_POINT``: If player is at a tile with an anchor event, ``wCurSpaceNextSpace`` is updated with the next space byte of salid anchor event. ``wScriptFlags2[4]`` is reset. **Go back to 7**. - If ``wCurSpaceNextSpace`` matches ``NEXT_SPACE_IS_ANCHOR_POINT``: If player is at a tile with an anchor event, ``wCurSpaceNextSpace`` is updated with the next space byte of salid anchor event. ``wEnabledPlayerEvents[4]`` is reset. **Go back to 7**.
- If player is not above a tile (``wPlayerTile``) with a space collision: ``wScriptFlags2[4]`` is reset. **Go back to 7**. - If player is not above a tile (``wPlayerTile``) with a space collision: ``wEnabledPlayerEvents[4]`` is reset. **Go back to 7**.
- If player is above a tile, the corresponding space script is queued to be executed by ``ScriptEvents`` in the current ``HandleMap`` iteration. ``wScriptFlags2[4]`` is reset. **Continue to 11**. - If player is above a tile, the corresponding space script is queued to be executed by ``ScriptEvents`` in the current ``HandleMap`` iteration. ``wEnabledPlayerEvents[4]`` is reset. **Continue to 11**.
11) The space script loads the value of ``wCurSpaceNextSpace`` into ``wCurSpace``, and loads the new space data to ``wCurSpaceStruct[]``. Unless the space is a Branch Space or a Union Space, ``wSpacesLeft`` is decreased. 11) The space script loads the value of ``wCurSpaceNextSpace`` into ``wCurSpace``, and loads the new space data to ``wCurSpaceStruct[]``. Unless the space is a Branch Space or a Union Space, ``wSpacesLeft`` is decreased.
- If the space is a Branch Space, the branch data is loaded to ``wTempSpaceBranchStruct``. Then the player is prompted to choose a valid direction. ``wCurSpaceNextSpace`` is populated with the next space that corresponds to the chosen direction. **Go back to 6**. - If the space is a Branch Space, the branch data is loaded to ``wTempSpaceBranchStruct``. Then the player is prompted to choose a valid direction. ``wCurSpaceNextSpace`` is populated with the next space that corresponds to the chosen direction. **Go back to 6**.
- If the space is an End Space, a fading out animation plays and then the ``exitoverworld`` script sets ``wMapStatus`` to ``MAPSTATUS_DONE``. This causes ``OverworldLoop`` to return back to the game menu. **Exit this workflow**. - If the space is an End Space, a fading out animation plays and then the ``exitoverworld`` script sets ``wMapStatus`` to ``MAPSTATUS_DONE``. This causes ``OverworldLoop`` to return back to the game menu. **Exit this workflow**.

View File

@@ -257,7 +257,7 @@ If <code><i>item_id</i></code> = `USE_SCRIPT_VAR`, then it uses `[hScriptVar]` i
## `$47`: `opentext` ## `$47`: `opentext`
## `$48`: <code>refreshscreen [<i>dummy</i>=0]</code> ## `$48`: <code>reanchormap [<i>dummy</i>=0]</code>
## `$49`: `closetext` ## `$49`: `closetext`
@@ -419,7 +419,7 @@ If <code><i>item_id</i></code> = `USE_SCRIPT_VAR`, then it uses `[hScriptVar]` i
## `$7B`: `reloadmap` ## `$7B`: `reloadmap`
## `$7C`: `reloadmappart` ## `$7C`: `refreshmap`
## `$7D`: <code>writecmdqueue <i>queue_pointer</i></code> ## `$7D`: <code>writecmdqueue <i>queue_pointer</i></code>

View File

@@ -2655,7 +2655,7 @@ ForcePlayerMonChoice:
call LoadTilemapToTempTilemap call LoadTilemapToTempTilemap
call WaitBGMap call WaitBGMap
call GetMemCGBLayout call GetMemCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
xor a xor a
ld c, a ld c, a
ret ret
@@ -2674,7 +2674,7 @@ ForcePlayerMonChoice:
call _LoadHPBar call _LoadHPBar
call CloseWindow call CloseWindow
call GetMemCGBLayout call GetMemCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
call SendOutMonText call SendOutMonText
call NewBattleMonStatus call NewBattleMonStatus
call BreakAttraction call BreakAttraction
@@ -2718,7 +2718,7 @@ JumpToPartyMenuAndPrintText:
farcall WritePartyMenuTilemap farcall WritePartyMenuTilemap
farcall PlacePartyMenuText farcall PlacePartyMenuText
call WaitBGMap call WaitBGMap
call SetPalettes call SetDefaultBGPAndOBP
call DelayFrame call DelayFrame
ret ret
@@ -2817,7 +2817,7 @@ LostBattle:
; Grayscale ; Grayscale
ld b, CGB_BATTLE_GRAYSCALE ld b, CGB_BATTLE_GRAYSCALE
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
jr .end jr .end
.LostLinkBattle: .LostLinkBattle:
@@ -4845,7 +4845,7 @@ BattleMenu_Pack:
and BATTLERESULT_BITMASK and BATTLERESULT_BITMASK
ld [wBattleResult], a ; WIN ld [wBattleResult], a ; WIN
call ClearMenuAndWindowData call ClearMenuAndWindowData
call SetPalettes call SetDefaultBGPAndOBP
scf scf
ret ret
@@ -4891,7 +4891,7 @@ BattleMenuPKMN_Loop:
call CloseWindow call CloseWindow
call LoadTilemapToTempTilemap call LoadTilemapToTempTilemap
call GetMemCGBLayout call GetMemCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
jp BattleMenu jp BattleMenu
.GetMenu: .GetMenu:
@@ -4971,7 +4971,7 @@ TryPlayerSwitch:
call _LoadHPBar call _LoadHPBar
call CloseWindow call CloseWindow
call GetMemCGBLayout call GetMemCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
ld a, [wCurPartyMon] ld a, [wCurPartyMon]
ld [wCurBattleMon], a ld [wCurBattleMon], a
PlayerSwitch: PlayerSwitch:
@@ -6797,7 +6797,7 @@ FinishBattleAnim:
push hl push hl
ld b, CGB_BATTLE_COLORS ld b, CGB_BATTLE_COLORS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
call DelayFrame call DelayFrame
pop hl pop hl
pop de pop de
@@ -8238,7 +8238,7 @@ _DisplayLinkRecord:
call WaitBGMap2 call WaitBGMap2
ld b, CGB_DIPLOMA ld b, CGB_DIPLOMA
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
ld c, 8 ld c, 8
call DelayFrames call DelayFrames
call WaitPressAorB_BlinkCursor call WaitPressAorB_BlinkCursor
@@ -8718,7 +8718,7 @@ InitBattleDisplay:
call HideSprites call HideSprites
ld b, CGB_BATTLE_COLORS ld b, CGB_BATTLE_COLORS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
ld a, $90 ld a, $90
ldh [hWY], a ldh [hWY], a
xor a xor a
@@ -8854,7 +8854,7 @@ BattleStartMessage:
farcall Battle_GetTrainerName farcall Battle_GetTrainerName
ld hl, WantsToBattleText ld hl, WantsToBattleText
jr .PlaceBattleStartText jr .PrintBattleStartText
.wild .wild
call BattleCheckEnemyShininess call BattleCheckEnemyShininess
@@ -8894,18 +8894,18 @@ BattleStartMessage:
jr nz, .NotFishing jr nz, .NotFishing
ld hl, HookedPokemonAttackedText ld hl, HookedPokemonAttackedText
jr .PlaceBattleStartText jr .PrintBattleStartText
.NotFishing: .NotFishing:
ld hl, PokemonFellFromTreeText ld hl, PokemonFellFromTreeText
cp BATTLETYPE_TREE cp BATTLETYPE_TREE
jr z, .PlaceBattleStartText jr z, .PrintBattleStartText
ld hl, WildCelebiAppearedText ld hl, WildCelebiAppearedText
cp BATTLETYPE_CELEBI cp BATTLETYPE_CELEBI
jr z, .PlaceBattleStartText jr z, .PrintBattleStartText
ld hl, WildPokemonAppearedText ld hl, WildPokemonAppearedText
.PlaceBattleStartText: .PrintBattleStartText:
push hl push hl
farcall BattleStart_TrainerHuds farcall BattleStart_TrainerHuds
pop hl pop hl

View File

@@ -29,7 +29,7 @@ BattleCommand_BatonPass:
call ClearBox call ClearBox
ld b, CGB_BATTLE_COLORS ld b, CGB_BATTLE_COLORS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
call BatonPass_LinkPlayerSwitch call BatonPass_LinkPlayerSwitch
ld hl, PassedBattleMonEntrance ld hl, PassedBattleMonEntrance

View File

@@ -16,4 +16,4 @@ _ReturnToBattle_UseBall:
call CloseWindow call CloseWindow
call LoadStandardMenuHeader call LoadStandardMenuHeader
call WaitBGMap call WaitBGMap
jp SetPalettes jp SetDefaultBGPAndOBP

View File

@@ -252,7 +252,7 @@ _ShowLinkBattleParticipants:
farcall LinkBattle_TrainerHuds ; no need to farcall farcall LinkBattle_TrainerHuds ; no need to farcall
ld b, CGB_DIPLOMA ld b, CGB_DIPLOMA
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
ld a, $e4 ld a, $e4
ldh [rOBP0], a ldh [rOBP0], a
ret ret

View File

@@ -271,7 +271,7 @@ DEF DIE_MAX_NUMBER EQU 6
set SECONDARYSPRITES_DIE_ROLL_F, [hl] set SECONDARYSPRITES_DIE_ROLL_F, [hl]
ld a, 1 ld a, 1
ld [wDieRoll], a ld [wDieRoll], a
call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu ; call HDMATransferTilemapAndAttrmap_Menu ;
call CloseText ; closetext call CloseText ; closetext
.rotate_die_loop .rotate_die_loop
@@ -454,7 +454,7 @@ BoardMenu_OpenSubmenu:
ld [wMenuReturn], a ld [wMenuReturn], a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call LoadStandardMenuHeader call LoadStandardMenuHeader
farcall FadeOutPalettesToWhite farcall FadeOutToWhite
call DisableOverworldHUD call DisableOverworldHUD
ld a, FALSE ld a, FALSE
ld [wText2bpp], a ld [wText2bpp], a
@@ -477,6 +477,6 @@ BoardMenu_CloseSubmenu:
ld b, CGB_MAPPALS ld b, CGB_MAPPALS
call GetCGBLayout call GetCGBLayout
call WaitBGMap2 call WaitBGMap2
farcall FadeInPalettesFromWhite farcall FadeInFromWhite
call EnableSpriteUpdates call EnableSpriteUpdates
ret ret

View File

@@ -1023,7 +1023,7 @@ TilesetColorPicker: ; unreferenced
ld [wDebugTilesetCurColor], a ld [wDebugTilesetCurColor], a
ldh [hMapAnims], a ldh [hMapAnims], a
call ClearSprites call ClearSprites
call LoadScreenTilemapAndAttrmapPals call LoadOverworldTilemapAndAttrmapPals
call WaitBGMap2 call WaitBGMap2
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a

View File

@@ -606,7 +606,7 @@ DebugRoom_EditPagedValues:
call WaitBGMap call WaitBGMap
ld b, CGB_DIPLOMA ld b, CGB_DIPLOMA
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
.resume .resume
call DelayFrame call DelayFrame
call JoyTextDelay call JoyTextDelay

View File

@@ -76,7 +76,7 @@ DisplayCaughtContestMonStats:
call WaitBGMap call WaitBGMap
ld b, CGB_DIPLOMA ld b, CGB_DIPLOMA
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
ret ret
.Health: .Health:

View File

@@ -31,7 +31,7 @@ PlaceDiplomaOnScreen:
call WaitBGMap call WaitBGMap
ld b, CGB_DIPLOMA ld b, CGB_DIPLOMA
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
call DelayFrame call DelayFrame
ret ret

View File

@@ -27,14 +27,14 @@ UseFlashAuto::
ret ret
BlindingFlash: BlindingFlash:
farcall FadeOutPalettesToWhite farcall FadeOutToWhite
ld hl, wStatusFlags ld hl, wStatusFlags
set STATUSFLAGS_FLASH_F, [hl] set STATUSFLAGS_FLASH_F, [hl]
farcall ReplaceTimeOfDayPals farcall ReplaceTimeOfDayPals
farcall UpdateTimeOfDayPal farcall UpdateTimeOfDayPal
ld b, CGB_MAPPALS ld b, CGB_MAPPALS
call GetCGBLayout call GetCGBLayout
farcall FadeInPalettesFromWhite farcall FadeInFromWhite
ret ret
ShakeHeadbuttTree: ShakeHeadbuttTree:
@@ -75,7 +75,7 @@ ShakeHeadbuttTree:
jr .loop jr .loop
.done .done
call LoadScreenTilemapAndAttrmapPals call LoadOverworldTilemapAndAttrmapPals
call WaitBGMap call WaitBGMap
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a

View File

@@ -39,7 +39,7 @@ RedCredits::
ld [wMusicFadeID + 1], a ld [wMusicFadeID + 1], a
ld a, 10 ld a, 10
ld [wMusicFade], a ld [wMusicFade], a
farcall FadeOutPalettesToWhite farcall FadeOutToWhite
xor a xor a
ld [wVramState], a ld [wVramState], a
ldh [hMapAnims], a ldh [hMapAnims], a
@@ -59,7 +59,7 @@ HallOfFame_FadeOutMusic:
ld [wMusicFadeID + 1], a ld [wMusicFadeID + 1], a
ld a, 10 ld a, 10
ld [wMusicFade], a ld [wMusicFade], a
farcall FadeOutPalettesToWhite farcall FadeOutToWhite
xor a xor a
ld [wVramState], a ld [wVramState], a
ldh [hMapAnims], a ldh [hMapAnims], a
@@ -252,7 +252,7 @@ AnimateHOFMonEntrance:
ldh [hBGMapMode], a ldh [hBGMapMode], a
ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
call HOF_SlideBackpic call HOF_SlideBackpic
xor a xor a
ld [wBoxAlignment], a ld [wBoxAlignment], a
@@ -385,7 +385,7 @@ _HallOfFamePC:
call WaitBGMap call WaitBGMap
ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
decoord 6, 5 decoord 6, 5
ld c, ANIM_MON_HOF ld c, ANIM_MON_HOF
predef HOF_AnimateFrontpic predef HOF_AnimateFrontpic
@@ -535,7 +535,7 @@ HOF_AnimatePlayerPic:
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
call HOF_SlideBackpic call HOF_SlideBackpic
xor a xor a
ld [wBoxAlignment], a ld [wBoxAlignment], a

View File

@@ -27,7 +27,7 @@ ItemFinder:
ret ret
.Script_FoundSomething: .Script_FoundSomething:
reloadmappart refreshmap
special UpdateTimePals special UpdateTimePals
callasm .ItemfinderSound callasm .ItemfinderSound
writetext .ItemfinderItemNearbyText writetext .ItemfinderItemNearbyText
@@ -35,7 +35,7 @@ ItemFinder:
end end
.Script_FoundNothing: .Script_FoundNothing:
reloadmappart refreshmap
special UpdateTimePals special UpdateTimePals
writetext .ItemfinderNopeText writetext .ItemfinderNopeText
closetext closetext

View File

@@ -200,13 +200,13 @@ CheckMapForSomethingToCut:
ret ret
Script_CutFromMenu: Script_CutFromMenu:
reloadmappart refreshmap
special UpdateTimePals special UpdateTimePals
Script_Cut: Script_Cut:
callasm GetPartyNickname callasm GetPartyNickname
writetext UseCutText writetext UseCutText
reloadmappart refreshmap
callasm CutDownTreeOrGrass callasm CutDownTreeOrGrass
closetext closetext
end end
@@ -220,7 +220,7 @@ CutDownTreeOrGrass:
ld [hl], a ld [hl], a
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call LoadScreenTilemapAndAttrmapPals call LoadOverworldTilemapAndAttrmapPals
call UpdateSprites call UpdateSprites
call DelayFrame call DelayFrame
ld a, [wCutWhirlpoolAnimationType] ld a, [wCutWhirlpoolAnimationType]
@@ -234,11 +234,11 @@ CutDownTreeOrGrass:
ret ret
Script_CutAuto:: Script_CutAuto::
refreshscreen reanchormap
callasm CutDownTreeObject callasm CutDownTreeObject
disappear LAST_TALKED disappear LAST_TALKED
special SetObjectToRemainHidden special SetObjectToRemainHidden
reloadmappart refreshmap
end end
CutDownTreeObject: CutDownTreeObject:
@@ -319,7 +319,7 @@ UseFlash:
jp QueueScript jp QueueScript
Script_UseFlash: Script_UseFlash:
reloadmappart refreshmap
special UpdateTimePals special UpdateTimePals
writetext UseFlashTextScript writetext UseFlashTextScript
callasm BlindingFlash callasm BlindingFlash
@@ -624,7 +624,7 @@ FlyFunction:
ret ret
.FlyScript: .FlyScript:
reloadmappart refreshmap
callasm HideSprites callasm HideSprites
special UpdateTimePals special UpdateTimePals
callasm FlyFromAnim callasm FlyFromAnim
@@ -696,7 +696,7 @@ Script_WaterfallAuto::
step_end step_end
Script_WaterfallFromMenu: Script_WaterfallFromMenu:
reloadmappart refreshmap
special UpdateTimePals special UpdateTimePals
Script_UsedWaterfall: Script_UsedWaterfall:
@@ -865,13 +865,13 @@ EscapeRopeOrDig:
text_end text_end
.UsedEscapeRopeScript: .UsedEscapeRopeScript:
reloadmappart refreshmap
special UpdateTimePals special UpdateTimePals
writetext .UseEscapeRopeText writetext .UseEscapeRopeText
sjump .UsedDigOrEscapeRopeScript sjump .UsedDigOrEscapeRopeScript
.UsedDigScript: .UsedDigScript:
reloadmappart refreshmap
special UpdateTimePals special UpdateTimePals
writetext .UseDigText writetext .UseDigText
@@ -957,11 +957,11 @@ TeleportFunction:
text_end text_end
.TeleportScript: .TeleportScript:
reloadmappart refreshmap
special UpdateTimePals special UpdateTimePals
writetext .TeleportReturnText writetext .TeleportReturnText
pause 60 pause 60
reloadmappart refreshmap
closetext closetext
playsound SFX_WARP_TO playsound SFX_WARP_TO
applymovement PLAYER, .TeleportFrom applymovement PLAYER, .TeleportFrom
@@ -1027,7 +1027,7 @@ SetStrengthFlag:
ret ret
Script_StrengthFromMenu: Script_StrengthFromMenu:
reloadmappart refreshmap
special UpdateTimePals special UpdateTimePals
Script_UsedStrength: Script_UsedStrength:
@@ -1186,13 +1186,13 @@ TryWhirlpoolMenu:
ret ret
Script_WhirlpoolFromMenu: Script_WhirlpoolFromMenu:
reloadmappart refreshmap
special UpdateTimePals special UpdateTimePals
Script_UsedWhirlpool: Script_UsedWhirlpool:
callasm GetPartyNickname callasm GetPartyNickname
writetext UseWhirlpoolText writetext UseWhirlpoolText
reloadmappart refreshmap
callasm DisappearWhirlpool callasm DisappearWhirlpool
closetext closetext
end end
@@ -1206,7 +1206,7 @@ DisappearWhirlpool:
ld [hl], a ld [hl], a
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call LoadScreenTilemapAndAttrmapPals call LoadOverworldTilemapAndAttrmapPals
ld a, [wCutWhirlpoolAnimationType] ld a, [wCutWhirlpoolAnimationType]
ld e, a ld e, a
farcall PlayWhirlpoolSound farcall PlayWhirlpoolSound
@@ -1285,14 +1285,14 @@ HeadbuttNothingText:
text_end text_end
HeadbuttFromMenuScript: HeadbuttFromMenuScript:
reloadmappart refreshmap
special UpdateTimePals special UpdateTimePals
HeadbuttScript: HeadbuttScript:
callasm GetPartyNickname callasm GetPartyNickname
writetext UseHeadbuttText writetext UseHeadbuttText
reloadmappart refreshmap
callasm ShakeHeadbuttTree callasm ShakeHeadbuttTree
callasm TreeMonEncounter callasm TreeMonEncounter
@@ -1382,7 +1382,7 @@ GetFacingObject:
ret ret
RockSmashFromMenuScript: RockSmashFromMenuScript:
reloadmappart refreshmap
special UpdateTimePals special UpdateTimePals
RockSmashScript: RockSmashScript:
@@ -1618,7 +1618,7 @@ Fishing_CheckFacingUp:
ret ret
Script_FishCastRod: Script_FishCastRod:
reloadmappart refreshmap
loadmem hBGMapMode, $0 loadmem hBGMapMode, $0
special UpdateTimePals special UpdateTimePals
loademote EMOTE_ROD loademote EMOTE_ROD
@@ -1735,7 +1735,7 @@ BikeFunction:
ret ret
Script_GetOnBike: Script_GetOnBike:
reloadmappart refreshmap
special UpdateTimePals special UpdateTimePals
loadvar VAR_MOVEMENT, PLAYER_BIKE loadvar VAR_MOVEMENT, PLAYER_BIKE
writetext GotOnBikeText writetext GotOnBikeText
@@ -1751,7 +1751,7 @@ Script_GetOnBike_Register:
end end
Script_GetOffBike: Script_GetOffBike:
reloadmappart refreshmap
special UpdateTimePals special UpdateTimePals
loadvar VAR_MOVEMENT, PLAYER_NORMAL loadvar VAR_MOVEMENT, PLAYER_NORMAL
writetext GotOffBikeText writetext GotOffBikeText

View File

@@ -212,7 +212,7 @@ _PlayersHousePC:
call _PlayersPC call _PlayersPC
and a and a
jr nz, .changed_deco_tiles jr nz, .changed_deco_tiles
call LoadScreenTilemapAndAttrmapPals call LoadOverworldTilemapAndAttrmapPals
call ApplyTilemap call ApplyTilemap
call UpdateSprites call UpdateSprites
call PC_PlayShutdownSound call PC_PlayShutdownSound

View File

@@ -35,7 +35,7 @@ ClosePokepic::
call GetMemCGBLayout call GetMemCGBLayout
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call LoadScreenTilemapAndAttrmapPals call LoadOverworldTilemapAndAttrmapPals
call ApplyTilemap call ApplyTilemap
call UpdateSprites call UpdateSprites
call LoadStandardFont call LoadStandardFont

Some files were not shown because too many files have changed in this diff Show More