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

View File

@ -64,7 +64,7 @@ _UnownPrinter:
ld b, CGB_TRAINER_OR_MON_FRONTPIC_PALS ld b, CGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
.joy_loop .joy_loop
call JoyTextDelay call JoyTextDelay

View File

@ -47,14 +47,14 @@ CheckAnyFaintedMon:
SacredAshScript: SacredAshScript:
special HealParty special HealParty
reloadmappart refreshmap
playsound SFX_WARP_TO playsound SFX_WARP_TO
special FadeOutPalettesToWhite special FadeOutToWhite
special FadeInPalettesFromWhite special FadeInFromWhite
special FadeOutPalettesToWhite special FadeOutToWhite
special FadeInPalettesFromWhite special FadeInFromWhite
special FadeOutPalettesToWhite special FadeOutToWhite
special FadeInPalettesFromWhite special FadeInFromWhite
waitsfx waitsfx
writetext .UseSacredAshText writetext .UseSacredAshText
playsound SFX_CAUGHT_MON playsound SFX_CAUGHT_MON

View File

@ -6,7 +6,7 @@ SweetScentFromMenu:
ret ret
.SweetScent: .SweetScent:
reloadmappart refreshmap
special UpdateTimePals special UpdateTimePals
callasm GetPartyNickname callasm GetPartyNickname
writetext UseSweetScentText writetext UseSweetScentText
@ -30,7 +30,7 @@ SweetScentNothing:
end end
SweetScentEncounter: SweetScentEncounter:
farcall CanEncounterWildMonInThisTile farcall CanEncounterWildMon
jr nc, .no_battle jr nc, .no_battle
ld hl, wStatusFlags2 ld hl, wStatusFlags2
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl] bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]

View File

@ -3,13 +3,13 @@ Script_BattleWhiteout::
sjump Script_Whiteout sjump Script_Whiteout
OverworldWhiteoutScript:: OverworldWhiteoutScript::
refreshscreen reanchormap
callasm OverworldBGMap callasm OverworldBGMap
Script_Whiteout: Script_Whiteout:
writetext .WhitedOutText writetext .WhitedOutText
waitbutton waitbutton
special FadeOutPalettesToWhite special FadeOutToWhite
pause 40 pause 40
special HealParty special HealParty
checkflag ENGINE_BUG_CONTEST_TIMER checkflag ENGINE_BUG_CONTEST_TIMER
@ -45,7 +45,7 @@ OverworldBGMap:
BattleBGMap: BattleBGMap:
ld b, CGB_BATTLE_GRAYSCALE ld b, CGB_BATTLE_GRAYSCALE
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
ret ret
HalveCoins: HalveCoins:

View File

@ -26,7 +26,7 @@ HDMATransferAttrmapToWRAMBank3:
call HDMATransferToWRAMBank3 call HDMATransferToWRAMBank3
ret ret
HDMATransferTilemapAndAttrmap_OverworldEffect:: HDMATransferTilemapAndAttrmap_Overworld::
ld hl, .Function ld hl, .Function
jp CallInSafeGFXMode jp CallInSafeGFXMode
@ -60,18 +60,18 @@ HDMATransferTilemapAndAttrmap_OverworldEffect::
ld a, $1 ld a, $1
ldh [rVBK], a ldh [rVBK], a
ld hl, wScratchAttrmap ld hl, wScratchAttrmap
call HDMATransfer_EndBeforeScanline128_toBGMap call HDMATransfer_WaitForScanline128_toBGMap
ld a, $0 ld a, $0
ldh [rVBK], a ldh [rVBK], a
ld hl, wScratchTilemap ld hl, wScratchTilemap
call HDMATransfer_EndBeforeScanline128_toBGMap call HDMATransfer_WaitForScanline128_toBGMap
pop af pop af
ldh [rVBK], a ldh [rVBK], a
ei ei
ret ret
_HDMATransferTilemapAndAttrmap_OpenAndCloseMenu:: _HDMATransferTilemapAndAttrmap_Menu::
ld hl, .Function ld hl, .Function
jp CallInSafeGFXMode jp CallInSafeGFXMode
@ -105,11 +105,11 @@ _HDMATransferTilemapAndAttrmap_OpenAndCloseMenu::
ld a, $1 ld a, $1
ldh [rVBK], a ldh [rVBK], a
ld hl, wScratchAttrmap ld hl, wScratchAttrmap
call HDMATransfer_EndBeforeScanline124_toBGMap call HDMATransfer_WaitForScanline124_toBGMap
ld a, $0 ld a, $0
ldh [rVBK], a ldh [rVBK], a
ld hl, wScratchTilemap ld hl, wScratchTilemap
call HDMATransfer_EndBeforeScanline124_toBGMap call HDMATransfer_WaitForScanline124_toBGMap
pop af pop af
ldh [rVBK], a ldh [rVBK], a
ei ei
@ -158,7 +158,7 @@ WaitDMATransfer:
jr nz, .loop jr nz, .loop
ret ret
HDMATransfer_EndBeforeScanline128_toBGMap: HDMATransfer_WaitForScanline128_toBGMap:
; HDMA transfer from hl to [hBGMapAddress] ; HDMA transfer from hl to [hBGMapAddress]
; hBGMapAddress -> de ; hBGMapAddress -> de
; 2 * SCREEN_HEIGHT -> c ; 2 * SCREEN_HEIGHT -> c
@ -167,9 +167,9 @@ HDMATransfer_EndBeforeScanline128_toBGMap:
ldh a, [hBGMapAddress] ldh a, [hBGMapAddress]
ld e, a ld e, a
ld c, 2 * SCREEN_HEIGHT ld c, 2 * SCREEN_HEIGHT
jr HDMATransfer_EndBeforeScanline128 jr HDMATransfer_WaitForScanline128
HDMATransfer_EndBeforeScanline124_toBGMap: HDMATransfer_WaitForScanline124_toBGMap:
; HDMA transfer from hl to [hBGMapAddress] ; HDMA transfer from hl to [hBGMapAddress]
; hBGMapAddress -> de ; hBGMapAddress -> de
; 2 * SCREEN_HEIGHT -> c ; 2 * SCREEN_HEIGHT -> c
@ -179,7 +179,7 @@ HDMATransfer_EndBeforeScanline124_toBGMap:
ldh a, [hBGMapAddress] ldh a, [hBGMapAddress]
ld e, a ld e, a
ld c, 2 * SCREEN_HEIGHT ld c, 2 * SCREEN_HEIGHT
jr HDMATransfer_EndBeforeScanline124 jr HDMATransfer_WaitForScanline124
HDMATransfer_NoDI: HDMATransfer_NoDI:
; HDMA transfer from hl to [hBGMapAddress] ; HDMA transfer from hl to [hBGMapAddress]
@ -240,11 +240,11 @@ HDMATransfer_NoDI:
res 7, [hl] res 7, [hl]
ret ret
HDMATransfer_EndBeforeScanline124: HDMATransfer_WaitForScanline124:
ld b, 124 - 1 ld b, 124 - 1
jr _continue_HDMATransfer jr _continue_HDMATransfer
HDMATransfer_EndBeforeScanline128: HDMATransfer_WaitForScanline128:
ld b, 128 - 1 ld b, 128 - 1
_continue_HDMATransfer: _continue_HDMATransfer:
; a lot of waiting around for hardware registers ; a lot of waiting around for hardware registers
@ -411,7 +411,7 @@ HDMATransfer2bpp::
ld d, h ld d, h
ld e, l ld e, l
ld hl, wScratchTilemap ld hl, wScratchTilemap
call HDMATransfer_EndBeforeScanline128 call HDMATransfer_WaitForScanline128
; restore the previous bank ; restore the previous bank
pop af pop af
@ -476,7 +476,7 @@ HDMATransfer1bpp::
ld d, h ld d, h
ld e, l ld e, l
ld hl, wScratchTilemap ld hl, wScratchTilemap
call HDMATransfer_EndBeforeScanline128 call HDMATransfer_WaitForScanline128
pop af pop af
ldh [rSVBK], a ldh [rSVBK], a
@ -498,13 +498,13 @@ HDMATransfer_OnlyTopFourRows:
ld c, $8 ld c, $8
ld hl, wScratchTilemap + $80 ld hl, wScratchTilemap + $80
debgcoord 0, 0, vBGMap1 debgcoord 0, 0, vBGMap1
call HDMATransfer_EndBeforeScanline128 call HDMATransfer_WaitForScanline128
ld a, $0 ld a, $0
ldh [rVBK], a ldh [rVBK], a
ld c, $8 ld c, $8
ld hl, wScratchTilemap ld hl, wScratchTilemap
debgcoord 0, 0, vBGMap1 debgcoord 0, 0, vBGMap1
call HDMATransfer_EndBeforeScanline128 call HDMATransfer_WaitForScanline128
ret ret
.Copy: .Copy:

View File

@ -1724,7 +1724,7 @@ ChooseMonToUseItemOn:
farcall WritePartyMenuTilemap farcall WritePartyMenuTilemap
farcall PlacePartyMenuText farcall PlacePartyMenuText
call WaitBGMap call WaitBGMap
call SetPalettes call SetDefaultBGPAndOBP
call DelayFrame call DelayFrame
farcall PartyMenuSelect farcall PartyMenuSelect
ret ret
@ -1741,7 +1741,7 @@ ItemActionText:
farcall WritePartyMenuTilemap farcall WritePartyMenuTilemap
farcall PrintPartyMenuActionText farcall PrintPartyMenuActionText
call WaitBGMap call WaitBGMap
call SetPalettes call SetDefaultBGPAndOBP
call DelayFrame call DelayFrame
pop bc pop bc
pop de pop de

View File

@ -574,7 +574,7 @@ GiveItem:
farcall WritePartyMenuTilemap farcall WritePartyMenuTilemap
farcall PlacePartyMenuText farcall PlacePartyMenuText
call WaitBGMap call WaitBGMap
call SetPalettes call SetDefaultBGPAndOBP
call DelayFrame call DelayFrame
farcall PartyMenuSelect farcall PartyMenuSelect
jr c, .finish jr c, .finish
@ -1437,7 +1437,7 @@ Pack_InitColors:
call WaitBGMap call WaitBGMap
ld b, CGB_PACKPALS ld b, CGB_PACKPALS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
call DelayFrame call DelayFrame
ret ret

View File

@ -82,7 +82,7 @@ ChooseMonToLearnTMHM_NoRefresh:
farcall WritePartyMenuTilemap farcall WritePartyMenuTilemap
farcall PlacePartyMenuText farcall PlacePartyMenuText
call WaitBGMap call WaitBGMap
call SetPalettes call SetDefaultBGPAndOBP
call DelayFrame call DelayFrame
farcall PartyMenuSelect farcall PartyMenuSelect
push af push af

View File

@ -522,7 +522,7 @@ LinkTimeout:
pop de pop de
pop hl pop hl
bccoord 1, 14 bccoord 1, 14
call PrintHLTextAtBC call PrintTextboxTextAt
call RotateThreePalettesRight call RotateThreePalettesRight
call ClearScreen call ClearScreen
ld b, CGB_DIPLOMA ld b, CGB_DIPLOMA
@ -1443,7 +1443,7 @@ LinkTrade_TradeStatsMenu:
dec a dec a
ld [wCurTradePartyMon], a ld [wCurTradePartyMon], a
ld [wPlayerLinkAction], a ld [wPlayerLinkAction], a
farcall PrintWaitingTextAndSyncAndExchangeNybble farcall PlaceWaitingTextAndSyncAndExchangeNybble
ld a, [wOtherPlayerLinkMode] ld a, [wOtherPlayerLinkMode]
cp $f cp $f
jp z, InitTradeMenuDisplay jp z, InitTradeMenuDisplay
@ -1465,7 +1465,7 @@ LinkTrade_TradeStatsMenu:
farcall Link_WaitBGMap farcall Link_WaitBGMap
ld hl, .LinkTradeCantBattleText ld hl, .LinkTradeCantBattleText
bccoord 1, 14 bccoord 1, 14
call PrintHLTextAtBC call PrintTextboxTextAt
jr .cancel_trade jr .cancel_trade
.abnormal .abnormal
@ -1487,7 +1487,7 @@ LinkTrade_TradeStatsMenu:
farcall Link_WaitBGMap farcall Link_WaitBGMap
ld hl, .LinkAbnormalMonText ld hl, .LinkAbnormalMonText
bccoord 1, 14 bccoord 1, 14
call PrintHLTextAtBC call PrintTextboxTextAt
.cancel_trade .cancel_trade
hlcoord 0, 12 hlcoord 0, 12
@ -1499,7 +1499,7 @@ LinkTrade_TradeStatsMenu:
call PlaceString call PlaceString
ld a, $1 ld a, $1
ld [wPlayerLinkAction], a ld [wPlayerLinkAction], a
farcall PrintWaitingTextAndSyncAndExchangeNybble farcall PlaceWaitingTextAndSyncAndExchangeNybble
ld c, 100 ld c, 100
call DelayFrames call DelayFrames
jp InitTradeMenuDisplay jp InitTradeMenuDisplay
@ -1561,7 +1561,7 @@ LinkTradePartymonMenuCheckCancel:
ldcoord_a 9, 17 ldcoord_a 9, 17
ld a, $f ld a, $f
ld [wPlayerLinkAction], a ld [wPlayerLinkAction], a
farcall PrintWaitingTextAndSyncAndExchangeNybble farcall PlaceWaitingTextAndSyncAndExchangeNybble
ld a, [wOtherPlayerLinkMode] ld a, [wOtherPlayerLinkMode]
cp $f cp $f
jr nz, .loop1 jr nz, .loop1
@ -1658,7 +1658,7 @@ LinkTrade:
call GetPokemonName call GetPokemonName
ld hl, LinkAskTradeForText ld hl, LinkAskTradeForText
bccoord 1, 14 bccoord 1, 14
call PrintHLTextAtBC call PrintTextboxTextAt
call LoadStandardMenuHeader call LoadStandardMenuHeader
hlcoord 10, 7 hlcoord 10, 7
ld b, 3 ld b, 3
@ -1707,13 +1707,13 @@ LinkTrade:
hlcoord 1, 14 hlcoord 1, 14
ld de, String_TooBadTheTradeWasCanceled ld de, String_TooBadTheTradeWasCanceled
call PlaceString call PlaceString
farcall PrintWaitingTextAndSyncAndExchangeNybble farcall PlaceWaitingTextAndSyncAndExchangeNybble
jp InitTradeMenuDisplay_Delay jp InitTradeMenuDisplay_Delay
.try_trade .try_trade
ld a, $2 ld a, $2
ld [wPlayerLinkAction], a ld [wPlayerLinkAction], a
farcall PrintWaitingTextAndSyncAndExchangeNybble farcall PlaceWaitingTextAndSyncAndExchangeNybble
ld a, [wOtherPlayerLinkMode] ld a, [wOtherPlayerLinkMode]
dec a dec a
jr nz, .do_trade jr nz, .do_trade
@ -1956,7 +1956,7 @@ LinkTrade:
ld a, b ld a, b
ld [wPlayerLinkAction], a ld [wPlayerLinkAction], a
push bc push bc
call Serial_PrintWaitingTextAndSyncAndExchangeNybble call Serial_PlaceWaitingTextAndSyncAndExchangeNybble
pop bc pop bc
ld a, [wLinkMode] ld a, [wLinkMode]
cp LINK_TIMECAPSULE cp LINK_TIMECAPSULE
@ -2020,7 +2020,7 @@ LoadTradeScreenBorderGFX:
SetTradeRoomBGPals: SetTradeRoomBGPals:
farcall LoadTradeRoomBGPals ; just a nested farcall; so wasteful farcall LoadTradeRoomBGPals ; just a nested farcall; so wasteful
call SetPalettes call SetDefaultBGPAndOBP
ret ret
PlaceTradeScreenTextbox: ; unreferenced PlaceTradeScreenTextbox: ; unreferenced

View File

@ -27,7 +27,7 @@ TestMobileTradeBorderTilemap: ; unreferenced
farcall LoadMobileTradeBorderTilemap ; useless to farcall farcall LoadMobileTradeBorderTilemap ; useless to farcall
ld b, CGB_DIPLOMA ld b, CGB_DIPLOMA
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
call WaitBGMap call WaitBGMap
call JoyWaitAorB call JoyWaitAorB
call Call_ExitMenu call Call_ExitMenu
@ -156,15 +156,15 @@ LinkTextbox:
call _LinkTextbox call _LinkTextbox
ret ret
PrintWaitingTextAndSyncAndExchangeNybble: PlaceWaitingTextAndSyncAndExchangeNybble:
call LoadStandardMenuHeader call LoadStandardMenuHeader
call .PrintWaitingText call .PlaceWaitingText
farcall WaitLinkTransfer farcall WaitLinkTransfer
call Call_ExitMenu call Call_ExitMenu
call WaitBGMap2 call WaitBGMap2
ret ret
.PrintWaitingText: .PlaceWaitingText:
hlcoord 4, 10 hlcoord 4, 10
ld b, 1 ld b, 1
ld c, 10 ld c, 10

View File

@ -12,14 +12,14 @@ ClearedLevelScreen:
call ClearMenuAndWindowData call ClearMenuAndWindowData
ld b, CGB_DIPLOMA ld b, CGB_DIPLOMA
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
call EnableLCD call EnableLCD
ld hl, .LevelCleared1Text ld hl, .LevelCleared1Text
bccoord 3, 1 bccoord 3, 1
call PrintHLTextAtBC call PrintTextboxTextAt
ld hl, .LevelCleared2Text ld hl, .LevelCleared2Text
bccoord 3, 3 bccoord 3, 3
call PrintHLTextAtBC call PrintTextboxTextAt
.loop .loop
call DelayFrame call DelayFrame
call GetJoypad call GetJoypad

View File

@ -23,7 +23,7 @@ GameMenu_KeepMusic:
call ClearMenuAndWindowData call ClearMenuAndWindowData
ld b, CGB_DIPLOMA ld b, CGB_DIPLOMA
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
xor a xor a
ld [wWhichIndexSet], a ld [wWhichIndexSet], a
ld hl, .MenuHeader ld hl, .MenuHeader

View File

@ -3,7 +3,7 @@ InitGender:
call LoadGenderScreenPal call LoadGenderScreenPal
call LoadGenderScreenLightBlueTile call LoadGenderScreenLightBlueTile
call WaitBGMap2 call WaitBGMap2
call SetPalettes call SetDefaultBGPAndOBP
ld hl, AreYouABoyOrAreYouAGirlText ld hl, AreYouABoyOrAreYouAGirlText
call PrintText1bpp call PrintText1bpp
ld hl, .MenuHeader ld hl, .MenuHeader

View File

@ -58,7 +58,7 @@ LevelSelectionMenu::
call LevelSelectionMenu_DrawTimeOfDaySymbol call LevelSelectionMenu_DrawTimeOfDaySymbol
ld b, CGB_LEVEL_SELECTION_MENU ld b, CGB_LEVEL_SELECTION_MENU
call GetCGBLayout ; apply and commit pals call GetCGBLayout ; apply and commit pals
call SetPalettes call SetDefaultBGPAndOBP
ld c, 20 ; ld c, 20 ;
call DelayFrames ; page shown --> page and textbox shown call DelayFrames ; page shown --> page and textbox shown
@ -105,7 +105,7 @@ LevelSelectionMenu::
call LevelSelectionMenu_DrawTimeOfDaySymbol call LevelSelectionMenu_DrawTimeOfDaySymbol
ld b, CGB_LEVEL_SELECTION_MENU ld b, CGB_LEVEL_SELECTION_MENU
call GetCGBLayout ; apply and commit pals call GetCGBLayout ; apply and commit pals
call SetPalettes call SetDefaultBGPAndOBP
ld de, MUSIC_GAME_CORNER ld de, MUSIC_GAME_CORNER
call PlayMusic call PlayMusic

View File

@ -20,7 +20,7 @@ MainMenu:
call ClearMenuAndWindowData call ClearMenuAndWindowData
ld b, CGB_DIPLOMA ld b, CGB_DIPLOMA
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
call MainMenu_GetWhichMenu call MainMenu_GetWhichMenu
ld [wWhichIndexSet], a ld [wWhichIndexSet], a
call MainMenu_PrintCurrentTimeAndDay call MainMenu_PrintCurrentTimeAndDay

View File

@ -624,7 +624,7 @@ RestoreOverworldMapTiles: ; unreferenced
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
call LoadScreenTilemapAndAttrmapPals call LoadOverworldTilemapAndAttrmapPals
xor a ; sScratch xor a ; sScratch
call OpenSRAM call OpenSRAM
ld hl, sScratch ld hl, sScratch

View File

@ -55,7 +55,7 @@ NamingScreen:
call .GetNamingScreenSetup call .GetNamingScreenSetup
call WaitBGMap call WaitBGMap
call WaitTop call WaitTop
call SetPalettes call SetDefaultBGPAndOBP
call NamingScreen_InitNameEntry call NamingScreen_InitNameEntry
ret ret

View File

@ -48,7 +48,7 @@ _Option:
call WaitBGMap call WaitBGMap
ld b, CGB_DIPLOMA ld b, CGB_DIPLOMA
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
.joypad_loop .joypad_loop
call JoyTextDelay call JoyTextDelay

View File

@ -36,7 +36,7 @@ StartMenu::
call DrawVariableLengthMenuBox call DrawVariableLengthMenuBox
call .DrawBugContestStatusBox call .DrawBugContestStatusBox
call SafeUpdateSprites call SafeUpdateSprites
call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu call HDMATransferTilemapAndAttrmap_Menu
farcall LoadFont_NoOAMUpdate farcall LoadFont_NoOAMUpdate
call .DrawBugContestStatus call .DrawBugContestStatus
call UpdateTimePals call UpdateTimePals

View File

@ -67,7 +67,7 @@ TrainerCard:
call WaitBGMap call WaitBGMap
ld b, CGB_TRAINER_CARD ld b, CGB_TRAINER_CARD
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
call WaitBGMap call WaitBGMap
ld hl, wJumptableIndex ld hl, wJumptableIndex
xor a ; TRAINERCARDSTATE_PAGE1_LOADGFX xor a ; TRAINERCARDSTATE_PAGE1_LOADGFX

View File

@ -72,7 +72,7 @@ Credits::
ldh [hLCDCPointer], a ldh [hLCDCPointer], a
call GetCreditsPalette call GetCreditsPalette
call SetPalettes call SetDefaultBGPAndOBP
ldh a, [hVBlank] ldh a, [hVBlank]
push af push af
@ -325,7 +325,7 @@ ParseCredits:
xor a xor a
ld [wCreditsBorderFrame], a ; frame ld [wCreditsBorderFrame], a ; frame
call GetCreditsPalette call GetCreditsPalette
call SetPalettes ; update hw pal registers call SetDefaultBGPAndOBP ; update hw pal registers
jr .loop jr .loop
.clear .clear

View File

@ -17,7 +17,7 @@ InitDisplayForHallOfFame:
ld hl, .SavingRecordText ld hl, .SavingRecordText
call PrintText1bpp call PrintText1bpp
call WaitBGMap2 call WaitBGMap2
call SetPalettes call SetDefaultBGPAndOBP
ret ret
.SavingRecordText: .SavingRecordText:
@ -50,7 +50,7 @@ InitDisplayForRedCredits:
ldh [hSCX], a ldh [hSCX], a
call EnableLCD call EnableLCD
call WaitBGMap2 call WaitBGMap2
call SetPalettes call SetDefaultBGPAndOBP
ret ret
ResetDisplayBetweenHallOfFameMons: ResetDisplayBetweenHallOfFameMons:

View File

@ -19,7 +19,7 @@ SplashScreen:
call WaitBGMap call WaitBGMap
ld b, CGB_GAMEFREAK_LOGO ld b, CGB_GAMEFREAK_LOGO
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
ld c, 10 ld c, 10
call DelayFrames call DelayFrames

View File

@ -27,111 +27,111 @@ OverworldLoop::
DisableEvents: DisableEvents:
xor a xor a
ld [wScriptFlags2], a ld [wEnabledPlayerEvents], a
ret ret
EnableEvents:: EnableEvents::
ld a, $ff ld a, $ff
ld [wScriptFlags2], a ld [wEnabledPlayerEvents], a
ret ret
DisableTileEvents: DisableTileEvents:
; DisableWarpsConnxns + DisableCoordEvents + DisableStepCount + DisableWildEncounters ; DisableWarpsConnections + DisableCoordEvents + DisableStepCount + DisableWildEncounters
push af push af
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
ld a, [hl] ld a, [hl]
and ~((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3)) and ~((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3))
ld [hl], a ld [hl], a
pop af pop af
ret ret
DisableWarpsConnxns: ; unreferenced DisableWarpsConnections: ; unreferenced
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
res 2, [hl] res 2, [hl]
ret ret
DisableCoordEvents: ; unreferenced DisableCoordEvents: ; unreferenced
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
res 1, [hl] res 1, [hl]
ret ret
DisableStepCount: ; unreferenced DisableStepCount: ; unreferenced
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
res 0, [hl] res 0, [hl]
ret ret
DisableWildEncounters: ; unreferenced DisableWildEncounters: ; unreferenced
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
res 3, [hl] res 3, [hl]
ret ret
DisableSpaceEffects: DisableSpaceEffects:
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
res 4, [hl] res 4, [hl]
ret ret
DisableTrainerAndTalkerEvents: ; unreferenced DisableTrainerAndTalkerEvents: ; unreferenced
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
res 5, [hl] res 5, [hl]
ret ret
EnableWarpsConnxns: ; unreferenced EnableWarpsConnections: ; unreferenced
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
set 2, [hl] set 2, [hl]
ret ret
EnableCoordEvents: ; unreferenced EnableCoordEvents: ; unreferenced
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
set 1, [hl] set 1, [hl]
ret ret
EnableStepCount: ; unreferenced EnableStepCount: ; unreferenced
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
set 0, [hl] set 0, [hl]
ret ret
EnableWildEncounters: EnableWildEncounters:
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
set 3, [hl] set 3, [hl]
ret ret
EnableSpaceEffects: ; unreferenced EnableSpaceEffects: ; unreferenced
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
set 4, [hl] set 4, [hl]
ret ret
EnableTrainerAndTalkerEvents: ; unreferenced EnableTrainerAndTalkerEvents: ; unreferenced
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
set 5, [hl] set 5, [hl]
ret ret
CheckWarpConnxnScriptFlag: CheckWarpConnectionsEnabled:
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
bit 2, [hl] bit 2, [hl]
ret ret
CheckCoordEventScriptFlag: CheckCoordEventsEnabled:
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
bit 1, [hl] bit 1, [hl]
ret ret
CheckStepCountScriptFlag: CheckStepCountEnabled:
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
bit 0, [hl] bit 0, [hl]
ret ret
CheckWildEncountersScriptFlag: CheckWildEncountersEnabled:
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
bit 3, [hl] bit 3, [hl]
ret ret
CheckSpaceEffectsScriptFlag: CheckSpaceEffectsScriptFlag:
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
bit 4, [hl] bit 4, [hl]
ret ret
CheckTrainerAndTalkerEvents: CheckTrainerAndTalkerEvents:
ld hl, wScriptFlags2 ld hl, wEnabledPlayerEvents
bit 5, [hl] bit 5, [hl]
ret ret
@ -550,7 +550,7 @@ CheckTrainerOrTalkerEvent:
CheckTileEvent: CheckTileEvent:
; Check for warps, coord events, or wild battles. ; Check for warps, coord events, or wild battles.
call CheckWarpConnxnScriptFlag call CheckWarpConnectionsEnabled
jr z, .connections_disabled jr z, .connections_disabled
farcall CheckMovingOffEdgeOfMap farcall CheckMovingOffEdgeOfMap
@ -568,21 +568,21 @@ CheckTileEvent:
cp BOARDEVENT_VIEW_MAP_MODE cp BOARDEVENT_VIEW_MAP_MODE
ret z ; nc ret z ; nc
call CheckCoordEventScriptFlag call CheckCoordEventsEnabled
jr z, .coord_events_disabled jr z, .coord_events_disabled
call CheckCurrentMapCoordEvents call CheckCurrentMapCoordEvents
jr c, .coord_event jr c, .coord_event
.coord_events_disabled .coord_events_disabled
call CheckStepCountScriptFlag call CheckStepCountEnabled
jr z, .step_count_disabled jr z, .step_count_disabled
call CountStep call CountStep
ret c ret c
.step_count_disabled .step_count_disabled
call CheckWildEncountersScriptFlag call CheckWildEncountersEnabled
jr z, .ok jr z, .ok
call RandomEncounter call RandomEncounter
@ -1536,7 +1536,7 @@ RandomEncounter::
call CheckWildEncounterCooldown call CheckWildEncounterCooldown
jr c, .nope jr c, .nope
call CanEncounterWildMonInThisTile call CanEncounterWildMon
jr nc, .nope jr nc, .nope
ld hl, wStatusFlags2 ld hl, wStatusFlags2
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl] bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
@ -1576,7 +1576,7 @@ WildBattleScript:
reloadmapafterbattle reloadmapafterbattle
end end
CanEncounterWildMonInThisTile:: CanEncounterWildMon::
ld hl, wStatusFlags ld hl, wStatusFlags
bit STATUSFLAGS_NO_WILD_ENCOUNTERS_F, [hl] bit STATUSFLAGS_NO_WILD_ENCOUNTERS_F, [hl]
jr nz, .no jr nz, .no

View File

@ -29,11 +29,11 @@ ReanchorBGMap_NoOAMUpdate::
; draw screen at wTilemap and wAttrmap and then transfer it. ; draw screen at wTilemap and wAttrmap and then transfer it.
ld a, $90 ld a, $90
ldh [hWY], a ldh [hWY], a
call LoadScreenTilemapAndAttrmapPals call LoadOverworldTilemapAndAttrmapPals
call LoadWindowHUD call LoadWindowHUD
ld a, HIGH(vBGMap1) ld a, HIGH(vBGMap1)
call .LoadBGMapAddrIntoHRAM call .LoadBGMapAddrIntoHRAM
call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu call HDMATransferTilemapAndAttrmap_Menu
farcall ApplyPals farcall ApplyPals
ld a, TRUE ld a, TRUE
ldh [hCGBPalUpdate], a ldh [hCGBPalUpdate], a

View File

@ -1,4 +1,4 @@
_LoadScreenTilemap:: _LoadOverworldTilemap::
ld hl, wSurroundingTiles ld hl, wSurroundingTiles
ld a, [wPlayerMetatileY] ld a, [wPlayerMetatileY]
and a and a

View File

@ -13,7 +13,7 @@ BlankScreen:
ld a, $7 ld a, $7
call ByteFill call ByteFill
call WaitBGMap2 call WaitBGMap2
call SetPalettes call SetDefaultBGPAndOBP
ret ret
SpawnPlayer: SpawnPlayer:

View File

@ -144,25 +144,25 @@ UpdateOverworldMap:
.step_down .step_down
call .ScrollOverworldMapDown call .ScrollOverworldMapDown
call LoadScreenTilemap call LoadOverworldTilemap
call ScrollMapDown call ScrollMapDown
ret ret
.step_up .step_up
call .ScrollOverworldMapUp call .ScrollOverworldMapUp
call LoadScreenTilemap call LoadOverworldTilemap
call ScrollMapUp call ScrollMapUp
ret ret
.step_left .step_left
call .ScrollOverworldMapLeft call .ScrollOverworldMapLeft
call LoadScreenTilemap call LoadOverworldTilemap
call ScrollMapLeft call ScrollMapLeft
ret ret
.step_right .step_right
call .ScrollOverworldMapRight call .ScrollOverworldMapRight
call LoadScreenTilemap call LoadOverworldTilemap
call ScrollMapRight call ScrollMapRight
ret ret

View File

@ -136,7 +136,7 @@ ScriptCommandTable:
dw Script_itemnotify ; 45 dw Script_itemnotify ; 45
dw Script_pocketisfull ; 46 dw Script_pocketisfull ; 46
dw Script_opentext ; 47 dw Script_opentext ; 47
dw Script_refreshscreen ; 48 dw Script_reanchormap ; 48
dw Script_closetext ; 49 dw Script_closetext ; 49
dw Script_writeunusedbyte ; 4a dw Script_writeunusedbyte ; 4a
dw Script_farwritetext ; 4b dw Script_farwritetext ; 4b
@ -188,7 +188,7 @@ ScriptCommandTable:
dw Script_changemapblocks ; 79 dw Script_changemapblocks ; 79
dw Script_changeblock ; 7a dw Script_changeblock ; 7a
dw Script_reloadmap ; 7b dw Script_reloadmap ; 7b
dw Script_reloadmappart ; 7c dw Script_refreshmap ; 7c
dw Script_writecmdqueue ; 7d dw Script_writecmdqueue ; 7d
dw Script_delcmdqueue ; 7e dw Script_delcmdqueue ; 7e
dw Script_playmusic ; 7f dw Script_playmusic ; 7f
@ -953,7 +953,7 @@ ApplyObjectFacing:
ret ret
.DisableTextTiles: .DisableTextTiles:
call LoadScreenTilemap call LoadOverworldTilemap
hlcoord 0, 0 hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
.loop .loop
@ -2287,12 +2287,12 @@ Script_changeblock:
call BufferScreen call BufferScreen
ret ret
Script_reloadmappart:: Script_refreshmap::
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call LoadScreenTilemapAndAttrmapPals call LoadOverworldTilemapAndAttrmapPals
call GetMovementPermissions call GetMovementPermissions
farcall HDMATransferTilemapAndAttrmap_OverworldEffect farcall HDMATransferTilemapAndAttrmap_Overworld
call UpdateSprites call UpdateSprites
ret ret
@ -2322,7 +2322,7 @@ Script_opentext:
call OpenText2bpp call OpenText2bpp
ret ret
Script_refreshscreen: Script_reanchormap:
call RefreshScreen call RefreshScreen
call GetScriptByte call GetScriptByte
ret ret
@ -2332,7 +2332,7 @@ Script_writeunusedbyte:
ret ret
Script_closetext: Script_closetext:
call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu call HDMATransferTilemapAndAttrmap_Menu
call CloseText call CloseText
ret ret

View File

@ -219,7 +219,7 @@ LoadMapTimeOfDay:
ld [wSpriteUpdatesEnabled], a ld [wSpriteUpdatesEnabled], a
farcall ReplaceTimeOfDayPals farcall ReplaceTimeOfDayPals
farcall UpdateTimeOfDayPal farcall UpdateTimeOfDayPal
call LoadScreenTilemapAndAttrmapPals call LoadOverworldTilemapAndAttrmapPals
call .ClearBGMap call .ClearBGMap
call .PushAttrmap call .PushAttrmap
ret ret

View File

@ -407,7 +407,7 @@ WrongNumber:
text_end text_end
Script_ReceivePhoneCall: Script_ReceivePhoneCall:
refreshscreen reanchormap
callasm RingTwice_StartCall callasm RingTwice_StartCall
memcall wCallerContact + PHONE_CONTACT_SCRIPT2_BANK memcall wCallerContact + PHONE_CONTACT_SCRIPT2_BANK
waitbutton waitbutton

View File

@ -46,5 +46,5 @@ NewPokedexEntry:
ld [wTempMonDVs + 1], a ld [wTempMonDVs + 1], a
ld b, CGB_TRAINER_OR_MON_FRONTPIC_PALS ld b, CGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
ret ret

View File

@ -102,7 +102,7 @@ PokeGear:
call InitPokegearTilemap call InitPokegearTilemap
ld b, CGB_POKEGEAR_PALS ld b, CGB_POKEGEAR_PALS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
ld a, %11100100 ld a, %11100100
call DmgToCgbObjPal0 call DmgToCgbObjPal0
ret ret
@ -1621,7 +1621,7 @@ _TownMap:
ld [wTownMapCursorObjectPointer + 1], a ld [wTownMapCursorObjectPointer + 1], a
ld b, CGB_POKEGEAR_PALS ld b, CGB_POKEGEAR_PALS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
ld a, %11100100 ld a, %11100100
call DmgToCgbObjPal0 call DmgToCgbObjPal0
call DelayFrame call DelayFrame
@ -1840,7 +1840,7 @@ _FlyMap:
call Pokegear_DummyFunction call Pokegear_DummyFunction
ld b, CGB_POKEGEAR_PALS ld b, CGB_POKEGEAR_PALS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
.loop .loop
call JoyTextDelay call JoyTextDelay
ld hl, hJoyPressed ld hl, hJoyPressed
@ -2110,7 +2110,7 @@ Pokedex_GetArea:
call TownMapBGUpdate call TownMapBGUpdate
ld b, CGB_POKEGEAR_PALS ld b, CGB_POKEGEAR_PALS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
xor a ; JOHTO_REGION xor a ; JOHTO_REGION
@ -2537,7 +2537,7 @@ EntireFlyMap: ; unreferenced
ld [wTownMapCursorCoordinates + 1], a ld [wTownMapCursorCoordinates + 1], a
ld b, CGB_POKEGEAR_PALS ld b, CGB_POKEGEAR_PALS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
.loop .loop
call JoyTextDelay call JoyTextDelay
ld hl, hJoyPressed ld hl, hJoyPressed

View File

@ -129,7 +129,7 @@ PrintRadioLine:
cp 2 cp 2
jr nz, .print jr nz, .print
bccoord 1, 16 bccoord 1, 16
call PrintHLTextAtBC call PrintTextboxTextAt
jr .skip jr .skip
.print .print
call PrintTextboxText call PrintTextboxText

View File

@ -48,7 +48,7 @@ _BillsPC:
ld a, $1 ld a, $1
.loop .loop
ld [wMenuCursorPosition], a ld [wMenuCursorPosition], a
call SetPalettes call SetDefaultBGPAndOBP
xor a xor a
ld [wWhichIndexSet], a ld [wWhichIndexSet], a
ldh [hBGMapMode], a ldh [hBGMapMode], a
@ -245,7 +245,7 @@ ClearPCItemScreen:
lb bc, 4, 18 lb bc, 4, 18
call Textbox1bpp call Textbox1bpp
call WaitBGMap2 call WaitBGMap2
call SetPalettes ; load regular palettes? call SetDefaultBGPAndOBP
ret ret
CopyBoxmonToTempMon: CopyBoxmonToTempMon:

View File

@ -649,7 +649,7 @@ Hatch_UpdateFrontpicBGMapCenter:
predef PlaceGraphic predef PlaceGraphic
pop af pop af
call Hatch_LoadFrontpicPal call Hatch_LoadFrontpicPal
call SetPalettes call SetDefaultBGPAndOBP
jp WaitBGMap jp WaitBGMap
EggHatch_DoSpriteAnimFrame: EggHatch_DoSpriteAnimFrame:

View File

@ -490,7 +490,7 @@ MailboxPC:
farcall WritePartyMenuTilemap farcall WritePartyMenuTilemap
farcall PlacePartyMenuText farcall PlacePartyMenuText
call WaitBGMap call WaitBGMap
call SetPalettes call SetDefaultBGPAndOBP
call DelayFrame call DelayFrame
farcall PartyMenuSelect farcall PartyMenuSelect
jr c, .exit2 jr c, .exit2

View File

@ -40,7 +40,7 @@ ReadAnyMail:
ld a, [wCurMailIndex] ld a, [wCurMailIndex]
ld e, a ld e, a
farcall LoadMailPalettes farcall LoadMailPalettes
call SetPalettes call SetDefaultBGPAndOBP
xor a xor a
ldh [hJoyPressed], a ldh [hJoyPressed], a
call .loop call .loop

View File

@ -119,7 +119,7 @@ Party::
farcall WritePartyMenuTilemap farcall WritePartyMenuTilemap
farcall PlacePartyMenuText farcall PlacePartyMenuText
call WaitBGMap call WaitBGMap
call SetPalettes call SetDefaultBGPAndOBP
call DelayFrame call DelayFrame
farcall PartyMenuSelect farcall PartyMenuSelect
ret c ; if cancelled or pressed B ret c ; if cancelled or pressed B
@ -204,7 +204,7 @@ SwitchPartyMons:
call AddNTimes call AddNTimes
ld [hl], "▷" ld [hl], "▷"
call WaitBGMap call WaitBGMap
call SetPalettes call SetDefaultBGPAndOBP
call DelayFrame call DelayFrame
farcall PartyMenuSelect farcall PartyMenuSelect
@ -1181,7 +1181,7 @@ SetUpMoveList:
hlcoord 10, 4 hlcoord 10, 4
predef ListMovePP predef ListMovePP
call WaitBGMap call WaitBGMap
call SetPalettes call SetDefaultBGPAndOBP
ld a, [wNumMoves] ld a, [wNumMoves]
inc a inc a
ld [w2DMenuNumRows], a ld [w2DMenuNumRows], a

View File

@ -5,7 +5,7 @@ SelectMonFromParty:
call ClearBGPalettes call ClearBGPalettes
call InitPartyMenuLayout call InitPartyMenuLayout
call WaitBGMap call WaitBGMap
call SetPalettes call SetDefaultBGPAndOBP
call DelayFrame call DelayFrame
call PartyMenuSelect call PartyMenuSelect
call ReturnToMapWithSpeechTextbox call ReturnToMapWithSpeechTextbox
@ -20,7 +20,7 @@ SelectTradeOrDayCareMon:
call WaitBGMap call WaitBGMap
ld b, CGB_PARTY_MENU ld b, CGB_PARTY_MENU
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
call DelayFrame call DelayFrame
call PartyMenuSelect call PartyMenuSelect
call ReturnToMapWithSpeechTextbox call ReturnToMapWithSpeechTextbox

View File

@ -494,7 +494,7 @@ StatsScreen_LoadGFX:
ld hl, wStatsScreenFlags ld hl, wStatsScreenFlags
bit 4, [hl] bit 4, [hl]
jr nz, .place_frontpic jr nz, .place_frontpic
call SetPalettes call SetDefaultBGPAndOBP
ret ret
.place_frontpic .place_frontpic
@ -795,16 +795,16 @@ StatsScreen_PlaceFrontpic:
.egg .egg
call .AnimateEgg call .AnimateEgg
call SetPalettes call SetDefaultBGPAndOBP
ret ret
.no_cry .no_cry
call .AnimateMon call .AnimateMon
call SetPalettes call SetDefaultBGPAndOBP
ret ret
.cry .cry
call SetPalettes call SetDefaultBGPAndOBP
call .AnimateMon call .AnimateMon
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
call PlayMonCry2 call PlayMonCry2
@ -995,7 +995,7 @@ endc
call PlaceString call PlaceString
ld hl, wStatsScreenFlags ld hl, wStatsScreenFlags
set 5, [hl] set 5, [hl]
call SetPalettes ; pals call SetDefaultBGPAndOBP
call DelayFrame call DelayFrame
hlcoord 0, 0 hlcoord 0, 0
call PrepMonFrontpic call PrepMonFrontpic

View File

@ -225,7 +225,7 @@ PrintPartyMonPage1:
call WaitBGMap call WaitBGMap
ld b, CGB_STATS_SCREEN_HP_PALS ld b, CGB_STATS_SCREEN_HP_PALS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
ret ret
PrintPartyMonPage2: PrintPartyMonPage2:
@ -276,7 +276,7 @@ PrintPartyMonPage2:
call WaitBGMap call WaitBGMap
ld b, CGB_STATS_SCREEN_HP_PALS ld b, CGB_STATS_SCREEN_HP_PALS
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetDefaultBGPAndOBP
ret ret
.PrintTempMonStats: .PrintTempMonStats:

View File

@ -1,4 +1,4 @@
_LoadScreenAttrmapPals:: _LoadOverworldAttrmapPals::
hlcoord 0, 0 hlcoord 0, 0
decoord 0, 0, wAttrmap decoord 0, 0, wAttrmap
ld b, SCREEN_HEIGHT ld b, SCREEN_HEIGHT

View File

@ -111,7 +111,7 @@ _UpdateTimePals::
call DmgToCgbTimePals call DmgToCgbTimePals
ret ret
FadeInPalettesFromWhite:: FadeInFromWhite::
; fades from white to normal palettes in four steps ; fades from white to normal palettes in four steps
; all palettes use white color of Pal0 before step 3 ; all palettes use white color of Pal0 before step 3
call BackupWhiteColorFromBGPals1 call BackupWhiteColorFromBGPals1
@ -127,7 +127,7 @@ FadeInPalettesFromWhite::
call ConvertTimePalsDecHL call ConvertTimePalsDecHL
ret ret
FadeOutPalettesToWhite:: FadeOutToWhite::
; fades from normal palettes to white in four steps ; fades from normal palettes to white in four steps
; all palettes use white color of Pal0 after step 2 ; all palettes use white color of Pal0 after step 2
ld c, $9 ld c, $9
@ -141,14 +141,14 @@ FadeOutPalettesToWhite::
call ConvertTimePalsIncHL call ConvertTimePalsIncHL
ret ret
FadeInPalettesFromBlack: FadeInFromBlack:
ld c, $0 ld c, $0
call GetTimePalFade call GetTimePalFade
ld b, $4 ld b, $4
call ConvertTimePalsIncHL call ConvertTimePalsIncHL
ret ret
FadeOutPalettesToBlack: FadeOutToBlack:
ld c, $9 ld c, $9
call GetTimePalFade call GetTimePalFade
ld b, $4 ld b, $4

View File

@ -84,12 +84,12 @@ GetMapSceneID::
pop bc pop bc
ret ret
LoadScreenTilemapAndAttrmapPals:: LoadOverworldTilemapAndAttrmapPals::
call LoadScreenTilemap call LoadOverworldTilemap
call LoadScreenAttrmapPals call LoadOverworldAttrmapPals
ret ret
LoadScreenTilemap:: LoadOverworldTilemap::
ldh a, [hROMBank] ldh a, [hROMBank]
push af push af
@ -102,9 +102,9 @@ LoadScreenTilemap::
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill call ByteFill
ld a, BANK(_LoadScreenTilemap) ld a, BANK(_LoadOverworldTilemap)
rst Bankswitch rst Bankswitch
call _LoadScreenTilemap call _LoadOverworldTilemap
pop af pop af
rst Bankswitch rst Bankswitch
@ -2170,7 +2170,7 @@ FadeToMenu::
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call LoadStandardMenuHeader call LoadStandardMenuHeader
farcall FadeOutPalettesToWhite farcall FadeOutToWhite
call ClearSprites call ClearSprites
call DisableSpriteUpdates call DisableSpriteUpdates
ret ret
@ -2191,7 +2191,7 @@ FinishExitMenu::
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
@ -2237,7 +2237,7 @@ ReloadTilesetAndPalettes::
ld c, a ld c, a
call SwitchToAnyMapAttributesBank call SwitchToAnyMapAttributesBank
farcall UpdateTimeOfDayPal farcall UpdateTimeOfDayPal
call LoadScreenTilemapAndAttrmapPals call LoadOverworldTilemapAndAttrmapPals
call LoadTilesetGFX call LoadTilesetGFX
ld a, 9 ld a, 9
call SkipMusic call SkipMusic

View File

@ -288,8 +288,8 @@ ReloadSpritesNoPalettes::
call DelayFrame call DelayFrame
ret ret
LoadScreenAttrmapPals:: LoadOverworldAttrmapPals::
homecall _LoadScreenAttrmapPals homecall _LoadOverworldAttrmapPals
ret ret
ScrollBGMapPalettes:: ScrollBGMapPalettes::

View File

@ -20,7 +20,7 @@ ScrollingMenu::
ld hl, wVramState ld hl, wVramState
bit 0, [hl] bit 0, [hl]
jp nz, UpdateTimePals jp nz, UpdateTimePals
jp SetPalettes jp SetDefaultBGPAndOBP
InitScrollingMenu:: InitScrollingMenu::
ld a, [wMenuBorderTopCoord] ld a, [wMenuBorderTopCoord]

View File

@ -270,7 +270,7 @@ Serial_ExchangeSyncBytes::
jr nz, .exchange jr nz, .exchange
ret ret
Serial_PrintWaitingTextAndSyncAndExchangeNybble:: Serial_PlaceWaitingTextAndSyncAndExchangeNybble::
call LoadTilemapToTempTilemap call LoadTilemapToTempTilemap
callfar PlaceWaitingText callfar PlaceWaitingText
call WaitLinkTransfer call WaitLinkTransfer

View File

@ -208,7 +208,7 @@ BuenaPrintText::
PrintTextboxText:: PrintTextboxText::
bccoord TEXTBOX_INNERX, TEXTBOX_INNERY bccoord TEXTBOX_INNERX, TEXTBOX_INNERY
call PrintHLTextAtBC call PrintTextboxTextAt
ret ret
PlaceString:: PlaceString::
@ -624,7 +624,7 @@ PokeFluteTerminator::
.stop: .stop:
text_end text_end
PrintHLTextAtBC:: PrintTextboxTextAt::
ld a, [wTextboxFlags] ld a, [wTextboxFlags]
push af push af
set TEXT_DELAY_F, a set TEXT_DELAY_F, a

View File

@ -129,12 +129,12 @@ endr
ld sp, hl ld sp, hl
ret ret
SetPalettes:: SetDefaultBGPAndOBP::
; Inits the Palettes ; Inits the Palettes
; depending on the system the monochromes palettes or color palettes ; depending on the system the monochromes palettes or color palettes
ldh a, [hCGB] ldh a, [hCGB]
and a and a
jr nz, .SetPalettesForGameBoyColor jr nz, .SetDefaultBGPAndOBPForGameBoyColor
ld a, %11100100 ld a, %11100100
ldh [rBGP], a ldh [rBGP], a
ld a, %11010000 ld a, %11010000
@ -142,7 +142,7 @@ SetPalettes::
ldh [rOBP1], a ldh [rOBP1], a
ret ret
.SetPalettesForGameBoyColor: .SetDefaultBGPAndOBPForGameBoyColor:
push de push de
ld a, %11100100 ld a, %11100100
call DmgToCgbBGPals call DmgToCgbBGPals

View File

@ -6,7 +6,7 @@ RefreshScreen::
rst Bankswitch rst Bankswitch
call ReanchorBGMap_NoOAMUpdate call ReanchorBGMap_NoOAMUpdate
call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu call HDMATransferTilemapAndAttrmap_Menu
call HideWindow_EnableLCDInt call HideWindow_EnableLCDInt
pop af pop af
@ -22,8 +22,8 @@ CloseText::
call ClearMenuAndWindowData call ClearMenuAndWindowData
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call LoadScreenTilemapAndAttrmapPals call LoadOverworldTilemapAndAttrmapPals
call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu call HDMATransferTilemapAndAttrmap_Menu
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call SafeUpdateSprites call SafeUpdateSprites
@ -52,7 +52,7 @@ OpenText2bpp::
; assumes that the overworld 2bpp font and frame are loaded when calling this ; assumes that the overworld 2bpp font and frame are loaded when calling this
call ReanchorBGMap_NoOAMUpdate ; anchor bgmap call ReanchorBGMap_NoOAMUpdate ; anchor bgmap
call SpeechTextbox2bpp call SpeechTextbox2bpp
call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu ; transfer bgmap call HDMATransferTilemapAndAttrmap_Menu ; transfer bgmap
call HideWindow_EnableLCDInt call HideWindow_EnableLCDInt
pop af pop af
@ -73,7 +73,7 @@ OpenText1bpp::
call ReanchorBGMap_NoOAMUpdate ; anchor bgmap call ReanchorBGMap_NoOAMUpdate ; anchor bgmap
call SpeechTextbox1bpp call SpeechTextbox1bpp
call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu ; transfer bgmap call HDMATransferTilemapAndAttrmap_Menu ; transfer bgmap
call LoadFont_NoOAMUpdate ; load 1bpp font and frame, hide window call LoadFont_NoOAMUpdate ; load 1bpp font and frame, hide window
pop af pop af
@ -81,13 +81,13 @@ OpenText1bpp::
ret ret
HDMATransferTilemapAndAttrmap_OpenAndCloseMenu:: HDMATransferTilemapAndAttrmap_Menu::
ldh a, [hOAMUpdate] ldh a, [hOAMUpdate]
push af push af
ld a, $1 ld a, $1
ldh [hOAMUpdate], a ldh [hOAMUpdate], a
farcall _HDMATransferTilemapAndAttrmap_OpenAndCloseMenu farcall _HDMATransferTilemapAndAttrmap_Menu
pop af pop af
ldh [hOAMUpdate], a ldh [hOAMUpdate], a

View File

@ -476,12 +476,12 @@ MACRO opentext
db opentext_command db opentext_command
ENDM ENDM
const refreshscreen_command ; $48 const reanchormap_command ; $48
MACRO refreshscreen MACRO reanchormap
if _NARG == 0 if _NARG == 0
refreshscreen 0 reanchormap 0
else else
db refreshscreen_command db reanchormap_command
db \1 ; dummy db \1 ; dummy
endc endc
ENDM ENDM
@ -789,9 +789,9 @@ MACRO reloadmap
db reloadmap_command db reloadmap_command
ENDM ENDM
const reloadmappart_command ; $7c const refreshmap_command ; $7c
MACRO reloadmappart MACRO refreshmap
db reloadmappart_command db refreshmap_command
ENDM ENDM
const writecmdqueue_command ; $7d const writecmdqueue_command ; $7d

View File

@ -191,7 +191,7 @@ INCLUDE "data/collision/collision_permissions.asm"
INCLUDE "engine/menus/empty_sram.asm" INCLUDE "engine/menus/empty_sram.asm"
INCLUDE "engine/events/checksave.asm" INCLUDE "engine/events/checksave.asm"
INCLUDE "data/maps/scenes.asm" INCLUDE "data/maps/scenes.asm"
INCLUDE "engine/overworld/load_screen_tilemap.asm" INCLUDE "engine/overworld/load_overworld_tilemap.asm"
INCLUDE "engine/gfx/hud.asm" INCLUDE "engine/gfx/hud.asm"

View File

@ -2250,7 +2250,7 @@ wMapEventStatus:: db
wScriptFlags:: wScriptFlags::
; bit 3: run deferred script ; bit 3: run deferred script
db db
wScriptFlags2:: wEnabledPlayerEvents::
; bit 0: count steps ; bit 0: count steps
; bit 1: coord events ; bit 1: coord events
; bit 2: warps and connections ; bit 2: warps and connections
@ -2773,7 +2773,7 @@ wMagnetTrainHoldPosition:: db
wMagnetTrainFinalPosition:: db wMagnetTrainFinalPosition:: db
wMagnetTrainPlayerSpriteInitX:: db wMagnetTrainPlayerSpriteInitX:: db
; Used by FadeInPalettesFromWhite ; Used by FadeInFromWhite
wBGPalsRegularWhiteColors:: ds 8 * PAL_COLOR_SIZE wBGPalsRegularWhiteColors:: ds 8 * PAL_COLOR_SIZE
ds 91 ds 91