diff --git a/data/events/special_pointers.asm b/data/events/special_pointers.asm index c8dfce0d0..9c6c0df88 100644 --- a/data/events/special_pointers.asm +++ b/data/events/special_pointers.asm @@ -53,10 +53,10 @@ SpecialsPointers:: add_special CardFlip add_special UnusedMemoryGame ; unused add_special ClearBGPalettesBufferScreen ; unused - add_special FadeOutPalettesToWhite - add_special FadeOutPalettesToBlack - add_special FadeInPalettesFromWhite - add_special FadeInPalettesFromBlack + add_special FadeOutToWhite + add_special FadeOutToBlack + add_special FadeInFromWhite + add_special FadeInFromBlack add_special ReloadSpritesNoPalettes ; bank 0 add_special ClearBGPalettes ; bank 0 add_special UpdateTimePals ; bank 0 diff --git a/data/maps/setup_script_pointers.asm b/data/maps/setup_script_pointers.asm index 66c6a5cb4..22b5897d5 100644 --- a/data/maps/setup_script_pointers.asm +++ b/data/maps/setup_script_pointers.asm @@ -33,8 +33,8 @@ MapSetupCommands: add_mapsetup LoadMapAttributes ; 1a add_mapsetup LoadMapAttributes_SkipObjects ; 1b add_mapsetup ClearBGPalettes ; 1c - add_mapsetup FadeOutPalettesToWhite ; 1d - add_mapsetup FadeInPalettesFromWhite ; 1e + add_mapsetup FadeOutToWhite ; 1d + add_mapsetup FadeInFromWhite ; 1e add_mapsetup GetMapScreenCoords ; 1f add_mapsetup GetWarpDestCoords ; 20 add_mapsetup SpawnInFacingDown ; 21 diff --git a/data/maps/setup_scripts.asm b/data/maps/setup_scripts.asm index d53de86ac..d83cfe719 100644 --- a/data/maps/setup_scripts.asm +++ b/data/maps/setup_scripts.asm @@ -44,7 +44,7 @@ MapSetupScript_EnterLevel: mapsetup RefreshMapSprites mapsetup PlayMapMusicBike mapsetup FadeInToMusic - mapsetup FadeInPalettesFromWhite + mapsetup FadeInFromWhite mapsetup ConstructAndEnableOverworldHUD mapsetup ActivateMapAnims mapsetup LoadWildMonData @@ -54,7 +54,7 @@ MapSetupScript_EnterLevel: MapSetupScript_Teleport: mapsetup ResetPlayerObjectAction MapSetupScript_Fly: - mapsetup FadeOutPalettesToWhite + mapsetup FadeOutToWhite mapsetup JumpRoamMons MapSetupScript_Warp: mapsetup DisableLCD @@ -78,7 +78,7 @@ MapSetupScript_Warp: mapsetup RefreshMapSprites mapsetup PlayMapMusicBike mapsetup FadeInToMusic - mapsetup FadeInPalettesFromWhite + mapsetup FadeInFromWhite mapsetup ActivateMapAnims mapsetup LoadWildMonData mapsetup AnchorPointAfterWarp @@ -106,7 +106,7 @@ MapSetupScript_BadWarp: mapsetup SpawnInFacingDown mapsetup RefreshMapSprites mapsetup FadeToMapMusic - mapsetup FadeInPalettesFromWhite + mapsetup FadeInFromWhite mapsetup ActivateMapAnims mapsetup LoadWildMonData mapsetup AnchorPointAfterWarp @@ -138,7 +138,7 @@ MapSetupScript_Connection: MapSetupScript_Fall: mapsetup ResetPlayerObjectAction MapSetupScript_Door: - mapsetup FadeOutPalettesToWhite + mapsetup FadeOutToWhite MapSetupScript_Train: mapsetup BackupMapObjects mapsetup EnterMapWarp @@ -158,7 +158,7 @@ MapSetupScript_Train: mapsetup LoadMapPalettes mapsetup RefreshMapSprites mapsetup FadeToMapMusic - mapsetup FadeInPalettesFromWhite + mapsetup FadeInFromWhite mapsetup ActivateMapAnims mapsetup LoadWildMonData mapsetup UpdateRoamMons @@ -180,7 +180,7 @@ MapSetupScript_ReloadMap: mapsetup LoadMapPalettes mapsetup RefreshMapSprites mapsetup ForceMapMusic - mapsetup FadeInPalettesFromWhite + mapsetup FadeInFromWhite mapsetup EnableOverworldHUD mapsetup ActivateMapAnims mapsetup LoadWildMonData @@ -205,7 +205,7 @@ MapSetupScript_ExitViewMap: mapsetup LoadMapPalettes mapsetup SpawnInCustomFacing ; restore player's facing if in branch space mapsetup RefreshMapSprites - mapsetup FadeInPalettesFromWhite + mapsetup FadeInFromWhite mapsetup EnableOverworldHUD mapsetup ActivateMapAnims mapsetup LoadWildMonData @@ -226,7 +226,7 @@ MapSetupScript_LinkReturn: mapsetup LoadMapPalettes mapsetup RefreshMapSprites mapsetup PlayMapMusicBike - mapsetup FadeInPalettesFromWhite + mapsetup FadeInFromWhite mapsetup ActivateMapAnims mapsetup LoadWildMonData mapsetup EnableTextAcceleration @@ -249,7 +249,7 @@ MapSetupScript_Continue: mapsetup LoadMapPalettes mapsetup RefreshMapSprites mapsetup PlayMapMusicBike - mapsetup FadeInPalettesFromWhite + mapsetup FadeInFromWhite mapsetup ConstructAndEnableOverworldHUD mapsetup ActivateMapAnims mapsetup LoadWildMonData diff --git a/docs/develop/index.md b/docs/develop/index.md index 5d0d41379..56cb0e45a 100755 --- a/docs/develop/index.md +++ b/docs/develop/index.md @@ -35,14 +35,14 @@ #### 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. -- **LoadScreenAttrmapPals**: Load wAttrmap palette numbers based on the tileset palettes of the current map. Called only by LoadScreenTilemapAndAttrmapPals. -- **LoadScreenTilemapAndAttrmapPals**: LoadScreenTilemap + LoadScreenAttrmapPals. Often used to reload screen after closing a text box. +- **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. +- **LoadOverworldAttrmapPals**: Load wAttrmap palette numbers based on the tileset palettes of the current map. Called only by LoadOverworldTilemapAndAttrmapPals. +- **LoadOverworldTilemapAndAttrmapPals**: LoadOverworldTilemap + LoadOverworldAttrmapPals. Often used to reload screen after closing a text box. #### 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. -- **OpenText1bpp**, **OpenText2bpp**: ClearMenuAndWindowData + ReanchorBGMap_NoOAMUpdate + SpeechTextbox1bpp + HDMATransferTilemapAndAttrmap_OpenAndCloseMenu + hide Window +- **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_Menu + hide Window - **OpenText1bpp**: Loads 1bpp font (LoadFont_NoOAMUpdate) - **OpenText2bpp**: Doesn't load 2bpp font - **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 - **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 -- **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 @@ -69,8 +69,8 @@ ## Scripts -- **refreshscreen**: 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. +- **reanchormap**: RefreshScreen +- **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 @@ -130,19 +130,19 @@ ### Overworld workflow 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``. 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**. -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). -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. +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 ``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. 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``. -10) In the next ``HandleMap`` iteration, ``CheckBoardEvent.board`` is called with ``wScriptFlags2[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 player is not above a tile (``wPlayerTile``) with a space collision: ``wScriptFlags2[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**. +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 ``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. ``wEnabledPlayerEvents[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. ``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. - 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**. diff --git a/docs/event_commands.md b/docs/event_commands.md index aa9a710f3..7cf71177b 100644 --- a/docs/event_commands.md +++ b/docs/event_commands.md @@ -257,7 +257,7 @@ If item_id = `USE_SCRIPT_VAR`, then it uses `[hScriptVar]` i ## `$47`: `opentext` -## `$48`: refreshscreen [dummy=0] +## `$48`: reanchormap [dummy=0] ## `$49`: `closetext` @@ -419,7 +419,7 @@ If item_id = `USE_SCRIPT_VAR`, then it uses `[hScriptVar]` i ## `$7B`: `reloadmap` -## `$7C`: `reloadmappart` +## `$7C`: `refreshmap` ## `$7D`: writecmdqueue queue_pointer diff --git a/engine/battle/core.asm b/engine/battle/core.asm index b29b6e169..3bb616fa1 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -2655,7 +2655,7 @@ ForcePlayerMonChoice: call LoadTilemapToTempTilemap call WaitBGMap call GetMemCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP xor a ld c, a ret @@ -2674,7 +2674,7 @@ ForcePlayerMonChoice: call _LoadHPBar call CloseWindow call GetMemCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP call SendOutMonText call NewBattleMonStatus call BreakAttraction @@ -2718,7 +2718,7 @@ JumpToPartyMenuAndPrintText: farcall WritePartyMenuTilemap farcall PlacePartyMenuText call WaitBGMap - call SetPalettes + call SetDefaultBGPAndOBP call DelayFrame ret @@ -2817,7 +2817,7 @@ LostBattle: ; Grayscale ld b, CGB_BATTLE_GRAYSCALE call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP jr .end .LostLinkBattle: @@ -4845,7 +4845,7 @@ BattleMenu_Pack: and BATTLERESULT_BITMASK ld [wBattleResult], a ; WIN call ClearMenuAndWindowData - call SetPalettes + call SetDefaultBGPAndOBP scf ret @@ -4891,7 +4891,7 @@ BattleMenuPKMN_Loop: call CloseWindow call LoadTilemapToTempTilemap call GetMemCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP jp BattleMenu .GetMenu: @@ -4971,7 +4971,7 @@ TryPlayerSwitch: call _LoadHPBar call CloseWindow call GetMemCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP ld a, [wCurPartyMon] ld [wCurBattleMon], a PlayerSwitch: @@ -6797,7 +6797,7 @@ FinishBattleAnim: push hl ld b, CGB_BATTLE_COLORS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP call DelayFrame pop hl pop de @@ -8238,7 +8238,7 @@ _DisplayLinkRecord: call WaitBGMap2 ld b, CGB_DIPLOMA call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP ld c, 8 call DelayFrames call WaitPressAorB_BlinkCursor @@ -8718,7 +8718,7 @@ InitBattleDisplay: call HideSprites ld b, CGB_BATTLE_COLORS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP ld a, $90 ldh [hWY], a xor a @@ -8854,7 +8854,7 @@ BattleStartMessage: farcall Battle_GetTrainerName ld hl, WantsToBattleText - jr .PlaceBattleStartText + jr .PrintBattleStartText .wild call BattleCheckEnemyShininess @@ -8894,18 +8894,18 @@ BattleStartMessage: jr nz, .NotFishing ld hl, HookedPokemonAttackedText - jr .PlaceBattleStartText + jr .PrintBattleStartText .NotFishing: ld hl, PokemonFellFromTreeText cp BATTLETYPE_TREE - jr z, .PlaceBattleStartText + jr z, .PrintBattleStartText ld hl, WildCelebiAppearedText cp BATTLETYPE_CELEBI - jr z, .PlaceBattleStartText + jr z, .PrintBattleStartText ld hl, WildPokemonAppearedText -.PlaceBattleStartText: +.PrintBattleStartText: push hl farcall BattleStart_TrainerHuds pop hl diff --git a/engine/battle/move_effects/baton_pass.asm b/engine/battle/move_effects/baton_pass.asm index 44368130e..51b79de42 100644 --- a/engine/battle/move_effects/baton_pass.asm +++ b/engine/battle/move_effects/baton_pass.asm @@ -29,7 +29,7 @@ BattleCommand_BatonPass: call ClearBox ld b, CGB_BATTLE_COLORS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP call BatonPass_LinkPlayerSwitch ld hl, PassedBattleMonEntrance diff --git a/engine/battle/returntobattle_useball.asm b/engine/battle/returntobattle_useball.asm index e2fdc87e9..502afe286 100644 --- a/engine/battle/returntobattle_useball.asm +++ b/engine/battle/returntobattle_useball.asm @@ -16,4 +16,4 @@ _ReturnToBattle_UseBall: call CloseWindow call LoadStandardMenuHeader call WaitBGMap - jp SetPalettes + jp SetDefaultBGPAndOBP diff --git a/engine/battle/trainer_huds.asm b/engine/battle/trainer_huds.asm index 7c533bd18..5724cca15 100644 --- a/engine/battle/trainer_huds.asm +++ b/engine/battle/trainer_huds.asm @@ -252,7 +252,7 @@ _ShowLinkBattleParticipants: farcall LinkBattle_TrainerHuds ; no need to farcall ld b, CGB_DIPLOMA call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP ld a, $e4 ldh [rOBP0], a ret diff --git a/engine/board/menu.asm b/engine/board/menu.asm index a233c188e..00c7331ff 100755 --- a/engine/board/menu.asm +++ b/engine/board/menu.asm @@ -271,7 +271,7 @@ DEF DIE_MAX_NUMBER EQU 6 set SECONDARYSPRITES_DIE_ROLL_F, [hl] ld a, 1 ld [wDieRoll], a - call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu ; + call HDMATransferTilemapAndAttrmap_Menu ; call CloseText ; closetext .rotate_die_loop @@ -454,7 +454,7 @@ BoardMenu_OpenSubmenu: ld [wMenuReturn], a ldh [hBGMapMode], a call LoadStandardMenuHeader - farcall FadeOutPalettesToWhite + farcall FadeOutToWhite call DisableOverworldHUD ld a, FALSE ld [wText2bpp], a @@ -477,6 +477,6 @@ BoardMenu_CloseSubmenu: ld b, CGB_MAPPALS call GetCGBLayout call WaitBGMap2 - farcall FadeInPalettesFromWhite + farcall FadeInFromWhite call EnableSpriteUpdates ret diff --git a/engine/debug/color_picker.asm b/engine/debug/color_picker.asm index 38d4530c8..e8d137718 100644 --- a/engine/debug/color_picker.asm +++ b/engine/debug/color_picker.asm @@ -1023,7 +1023,7 @@ TilesetColorPicker: ; unreferenced ld [wDebugTilesetCurColor], a ldh [hMapAnims], a call ClearSprites - call LoadScreenTilemapAndAttrmapPals + call LoadOverworldTilemapAndAttrmapPals call WaitBGMap2 xor a ldh [hBGMapMode], a diff --git a/engine/debug/debug_room.asm b/engine/debug/debug_room.asm index 93aaa4871..86587f91a 100644 --- a/engine/debug/debug_room.asm +++ b/engine/debug/debug_room.asm @@ -606,7 +606,7 @@ DebugRoom_EditPagedValues: call WaitBGMap ld b, CGB_DIPLOMA call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP .resume call DelayFrame call JoyTextDelay diff --git a/engine/events/bug_contest/display_stats.asm b/engine/events/bug_contest/display_stats.asm index dcc95e8e9..0040af2b7 100644 --- a/engine/events/bug_contest/display_stats.asm +++ b/engine/events/bug_contest/display_stats.asm @@ -76,7 +76,7 @@ DisplayCaughtContestMonStats: call WaitBGMap ld b, CGB_DIPLOMA call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP ret .Health: diff --git a/engine/events/diploma.asm b/engine/events/diploma.asm index b485cfba2..7d916ab84 100644 --- a/engine/events/diploma.asm +++ b/engine/events/diploma.asm @@ -31,7 +31,7 @@ PlaceDiplomaOnScreen: call WaitBGMap ld b, CGB_DIPLOMA call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP call DelayFrame ret diff --git a/engine/events/field_moves.asm b/engine/events/field_moves.asm index 155fede0e..1a556d4b1 100644 --- a/engine/events/field_moves.asm +++ b/engine/events/field_moves.asm @@ -27,14 +27,14 @@ UseFlashAuto:: ret BlindingFlash: - farcall FadeOutPalettesToWhite + farcall FadeOutToWhite ld hl, wStatusFlags set STATUSFLAGS_FLASH_F, [hl] farcall ReplaceTimeOfDayPals farcall UpdateTimeOfDayPal ld b, CGB_MAPPALS call GetCGBLayout - farcall FadeInPalettesFromWhite + farcall FadeInFromWhite ret ShakeHeadbuttTree: @@ -75,7 +75,7 @@ ShakeHeadbuttTree: jr .loop .done - call LoadScreenTilemapAndAttrmapPals + call LoadOverworldTilemapAndAttrmapPals call WaitBGMap xor a ldh [hBGMapMode], a diff --git a/engine/events/halloffame.asm b/engine/events/halloffame.asm index e2ec625bf..9885ae731 100644 --- a/engine/events/halloffame.asm +++ b/engine/events/halloffame.asm @@ -39,7 +39,7 @@ RedCredits:: ld [wMusicFadeID + 1], a ld a, 10 ld [wMusicFade], a - farcall FadeOutPalettesToWhite + farcall FadeOutToWhite xor a ld [wVramState], a ldh [hMapAnims], a @@ -59,7 +59,7 @@ HallOfFame_FadeOutMusic: ld [wMusicFadeID + 1], a ld a, 10 ld [wMusicFade], a - farcall FadeOutPalettesToWhite + farcall FadeOutToWhite xor a ld [wVramState], a ldh [hMapAnims], a @@ -252,7 +252,7 @@ AnimateHOFMonEntrance: ldh [hBGMapMode], a ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP call HOF_SlideBackpic xor a ld [wBoxAlignment], a @@ -385,7 +385,7 @@ _HallOfFamePC: call WaitBGMap ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP decoord 6, 5 ld c, ANIM_MON_HOF predef HOF_AnimateFrontpic @@ -535,7 +535,7 @@ HOF_AnimatePlayerPic: ld [wCurPartySpecies], a ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP call HOF_SlideBackpic xor a ld [wBoxAlignment], a diff --git a/engine/events/itemfinder.asm b/engine/events/itemfinder.asm index 3665187c8..f2bea5f9a 100644 --- a/engine/events/itemfinder.asm +++ b/engine/events/itemfinder.asm @@ -27,7 +27,7 @@ ItemFinder: ret .Script_FoundSomething: - reloadmappart + refreshmap special UpdateTimePals callasm .ItemfinderSound writetext .ItemfinderItemNearbyText @@ -35,7 +35,7 @@ ItemFinder: end .Script_FoundNothing: - reloadmappart + refreshmap special UpdateTimePals writetext .ItemfinderNopeText closetext diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm index c0915f5d6..5df6788b0 100644 --- a/engine/events/overworld.asm +++ b/engine/events/overworld.asm @@ -200,13 +200,13 @@ CheckMapForSomethingToCut: ret Script_CutFromMenu: - reloadmappart + refreshmap special UpdateTimePals Script_Cut: callasm GetPartyNickname writetext UseCutText - reloadmappart + refreshmap callasm CutDownTreeOrGrass closetext end @@ -220,7 +220,7 @@ CutDownTreeOrGrass: ld [hl], a xor a ldh [hBGMapMode], a - call LoadScreenTilemapAndAttrmapPals + call LoadOverworldTilemapAndAttrmapPals call UpdateSprites call DelayFrame ld a, [wCutWhirlpoolAnimationType] @@ -234,11 +234,11 @@ CutDownTreeOrGrass: ret Script_CutAuto:: - refreshscreen + reanchormap callasm CutDownTreeObject disappear LAST_TALKED special SetObjectToRemainHidden - reloadmappart + refreshmap end CutDownTreeObject: @@ -319,7 +319,7 @@ UseFlash: jp QueueScript Script_UseFlash: - reloadmappart + refreshmap special UpdateTimePals writetext UseFlashTextScript callasm BlindingFlash @@ -624,7 +624,7 @@ FlyFunction: ret .FlyScript: - reloadmappart + refreshmap callasm HideSprites special UpdateTimePals callasm FlyFromAnim @@ -696,7 +696,7 @@ Script_WaterfallAuto:: step_end Script_WaterfallFromMenu: - reloadmappart + refreshmap special UpdateTimePals Script_UsedWaterfall: @@ -865,13 +865,13 @@ EscapeRopeOrDig: text_end .UsedEscapeRopeScript: - reloadmappart + refreshmap special UpdateTimePals writetext .UseEscapeRopeText sjump .UsedDigOrEscapeRopeScript .UsedDigScript: - reloadmappart + refreshmap special UpdateTimePals writetext .UseDigText @@ -957,11 +957,11 @@ TeleportFunction: text_end .TeleportScript: - reloadmappart + refreshmap special UpdateTimePals writetext .TeleportReturnText pause 60 - reloadmappart + refreshmap closetext playsound SFX_WARP_TO applymovement PLAYER, .TeleportFrom @@ -1027,7 +1027,7 @@ SetStrengthFlag: ret Script_StrengthFromMenu: - reloadmappart + refreshmap special UpdateTimePals Script_UsedStrength: @@ -1186,13 +1186,13 @@ TryWhirlpoolMenu: ret Script_WhirlpoolFromMenu: - reloadmappart + refreshmap special UpdateTimePals Script_UsedWhirlpool: callasm GetPartyNickname writetext UseWhirlpoolText - reloadmappart + refreshmap callasm DisappearWhirlpool closetext end @@ -1206,7 +1206,7 @@ DisappearWhirlpool: ld [hl], a xor a ldh [hBGMapMode], a - call LoadScreenTilemapAndAttrmapPals + call LoadOverworldTilemapAndAttrmapPals ld a, [wCutWhirlpoolAnimationType] ld e, a farcall PlayWhirlpoolSound @@ -1285,14 +1285,14 @@ HeadbuttNothingText: text_end HeadbuttFromMenuScript: - reloadmappart + refreshmap special UpdateTimePals HeadbuttScript: callasm GetPartyNickname writetext UseHeadbuttText - reloadmappart + refreshmap callasm ShakeHeadbuttTree callasm TreeMonEncounter @@ -1382,7 +1382,7 @@ GetFacingObject: ret RockSmashFromMenuScript: - reloadmappart + refreshmap special UpdateTimePals RockSmashScript: @@ -1618,7 +1618,7 @@ Fishing_CheckFacingUp: ret Script_FishCastRod: - reloadmappart + refreshmap loadmem hBGMapMode, $0 special UpdateTimePals loademote EMOTE_ROD @@ -1735,7 +1735,7 @@ BikeFunction: ret Script_GetOnBike: - reloadmappart + refreshmap special UpdateTimePals loadvar VAR_MOVEMENT, PLAYER_BIKE writetext GotOnBikeText @@ -1751,7 +1751,7 @@ Script_GetOnBike_Register: end Script_GetOffBike: - reloadmappart + refreshmap special UpdateTimePals loadvar VAR_MOVEMENT, PLAYER_NORMAL writetext GotOffBikeText diff --git a/engine/events/pokecenter_pc.asm b/engine/events/pokecenter_pc.asm index fcbeca0fa..ce47400a6 100644 --- a/engine/events/pokecenter_pc.asm +++ b/engine/events/pokecenter_pc.asm @@ -212,7 +212,7 @@ _PlayersHousePC: call _PlayersPC and a jr nz, .changed_deco_tiles - call LoadScreenTilemapAndAttrmapPals + call LoadOverworldTilemapAndAttrmapPals call ApplyTilemap call UpdateSprites call PC_PlayShutdownSound diff --git a/engine/events/pokepic.asm b/engine/events/pokepic.asm index 34019a08a..cf568e379 100644 --- a/engine/events/pokepic.asm +++ b/engine/events/pokepic.asm @@ -35,7 +35,7 @@ ClosePokepic:: call GetMemCGBLayout xor a ldh [hBGMapMode], a - call LoadScreenTilemapAndAttrmapPals + call LoadOverworldTilemapAndAttrmapPals call ApplyTilemap call UpdateSprites call LoadStandardFont diff --git a/engine/events/print_unown.asm b/engine/events/print_unown.asm index a71fd15bb..2eec7502f 100644 --- a/engine/events/print_unown.asm +++ b/engine/events/print_unown.asm @@ -64,7 +64,7 @@ _UnownPrinter: ld b, CGB_TRAINER_OR_MON_FRONTPIC_PALS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP .joy_loop call JoyTextDelay diff --git a/engine/events/sacred_ash.asm b/engine/events/sacred_ash.asm index 26df78cc8..c9f62a9a1 100644 --- a/engine/events/sacred_ash.asm +++ b/engine/events/sacred_ash.asm @@ -47,14 +47,14 @@ CheckAnyFaintedMon: SacredAshScript: special HealParty - reloadmappart + refreshmap playsound SFX_WARP_TO - special FadeOutPalettesToWhite - special FadeInPalettesFromWhite - special FadeOutPalettesToWhite - special FadeInPalettesFromWhite - special FadeOutPalettesToWhite - special FadeInPalettesFromWhite + special FadeOutToWhite + special FadeInFromWhite + special FadeOutToWhite + special FadeInFromWhite + special FadeOutToWhite + special FadeInFromWhite waitsfx writetext .UseSacredAshText playsound SFX_CAUGHT_MON diff --git a/engine/events/sweet_scent.asm b/engine/events/sweet_scent.asm index 00db91440..0c97e6ff1 100644 --- a/engine/events/sweet_scent.asm +++ b/engine/events/sweet_scent.asm @@ -6,7 +6,7 @@ SweetScentFromMenu: ret .SweetScent: - reloadmappart + refreshmap special UpdateTimePals callasm GetPartyNickname writetext UseSweetScentText @@ -30,7 +30,7 @@ SweetScentNothing: end SweetScentEncounter: - farcall CanEncounterWildMonInThisTile + farcall CanEncounterWildMon jr nc, .no_battle ld hl, wStatusFlags2 bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl] diff --git a/engine/events/whiteout.asm b/engine/events/whiteout.asm index 8293d42c5..3e09896e0 100644 --- a/engine/events/whiteout.asm +++ b/engine/events/whiteout.asm @@ -3,13 +3,13 @@ Script_BattleWhiteout:: sjump Script_Whiteout OverworldWhiteoutScript:: - refreshscreen + reanchormap callasm OverworldBGMap Script_Whiteout: writetext .WhitedOutText waitbutton - special FadeOutPalettesToWhite + special FadeOutToWhite pause 40 special HealParty checkflag ENGINE_BUG_CONTEST_TIMER @@ -45,7 +45,7 @@ OverworldBGMap: BattleBGMap: ld b, CGB_BATTLE_GRAYSCALE call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP ret HalveCoins: diff --git a/engine/gfx/dma_transfer.asm b/engine/gfx/dma_transfer.asm index fb6814508..65c51c393 100644 --- a/engine/gfx/dma_transfer.asm +++ b/engine/gfx/dma_transfer.asm @@ -26,7 +26,7 @@ HDMATransferAttrmapToWRAMBank3: call HDMATransferToWRAMBank3 ret -HDMATransferTilemapAndAttrmap_OverworldEffect:: +HDMATransferTilemapAndAttrmap_Overworld:: ld hl, .Function jp CallInSafeGFXMode @@ -60,18 +60,18 @@ HDMATransferTilemapAndAttrmap_OverworldEffect:: ld a, $1 ldh [rVBK], a ld hl, wScratchAttrmap - call HDMATransfer_EndBeforeScanline128_toBGMap + call HDMATransfer_WaitForScanline128_toBGMap ld a, $0 ldh [rVBK], a ld hl, wScratchTilemap - call HDMATransfer_EndBeforeScanline128_toBGMap + call HDMATransfer_WaitForScanline128_toBGMap pop af ldh [rVBK], a ei ret -_HDMATransferTilemapAndAttrmap_OpenAndCloseMenu:: +_HDMATransferTilemapAndAttrmap_Menu:: ld hl, .Function jp CallInSafeGFXMode @@ -105,11 +105,11 @@ _HDMATransferTilemapAndAttrmap_OpenAndCloseMenu:: ld a, $1 ldh [rVBK], a ld hl, wScratchAttrmap - call HDMATransfer_EndBeforeScanline124_toBGMap + call HDMATransfer_WaitForScanline124_toBGMap ld a, $0 ldh [rVBK], a ld hl, wScratchTilemap - call HDMATransfer_EndBeforeScanline124_toBGMap + call HDMATransfer_WaitForScanline124_toBGMap pop af ldh [rVBK], a ei @@ -158,7 +158,7 @@ WaitDMATransfer: jr nz, .loop ret -HDMATransfer_EndBeforeScanline128_toBGMap: +HDMATransfer_WaitForScanline128_toBGMap: ; HDMA transfer from hl to [hBGMapAddress] ; hBGMapAddress -> de ; 2 * SCREEN_HEIGHT -> c @@ -167,9 +167,9 @@ HDMATransfer_EndBeforeScanline128_toBGMap: ldh a, [hBGMapAddress] ld e, a ld c, 2 * SCREEN_HEIGHT - jr HDMATransfer_EndBeforeScanline128 + jr HDMATransfer_WaitForScanline128 -HDMATransfer_EndBeforeScanline124_toBGMap: +HDMATransfer_WaitForScanline124_toBGMap: ; HDMA transfer from hl to [hBGMapAddress] ; hBGMapAddress -> de ; 2 * SCREEN_HEIGHT -> c @@ -179,7 +179,7 @@ HDMATransfer_EndBeforeScanline124_toBGMap: ldh a, [hBGMapAddress] ld e, a ld c, 2 * SCREEN_HEIGHT - jr HDMATransfer_EndBeforeScanline124 + jr HDMATransfer_WaitForScanline124 HDMATransfer_NoDI: ; HDMA transfer from hl to [hBGMapAddress] @@ -240,11 +240,11 @@ HDMATransfer_NoDI: res 7, [hl] ret -HDMATransfer_EndBeforeScanline124: +HDMATransfer_WaitForScanline124: ld b, 124 - 1 jr _continue_HDMATransfer -HDMATransfer_EndBeforeScanline128: +HDMATransfer_WaitForScanline128: ld b, 128 - 1 _continue_HDMATransfer: ; a lot of waiting around for hardware registers @@ -411,7 +411,7 @@ HDMATransfer2bpp:: ld d, h ld e, l ld hl, wScratchTilemap - call HDMATransfer_EndBeforeScanline128 + call HDMATransfer_WaitForScanline128 ; restore the previous bank pop af @@ -476,7 +476,7 @@ HDMATransfer1bpp:: ld d, h ld e, l ld hl, wScratchTilemap - call HDMATransfer_EndBeforeScanline128 + call HDMATransfer_WaitForScanline128 pop af ldh [rSVBK], a @@ -498,13 +498,13 @@ HDMATransfer_OnlyTopFourRows: ld c, $8 ld hl, wScratchTilemap + $80 debgcoord 0, 0, vBGMap1 - call HDMATransfer_EndBeforeScanline128 + call HDMATransfer_WaitForScanline128 ld a, $0 ldh [rVBK], a ld c, $8 ld hl, wScratchTilemap debgcoord 0, 0, vBGMap1 - call HDMATransfer_EndBeforeScanline128 + call HDMATransfer_WaitForScanline128 ret .Copy: diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index e1379919d..fee0d8b2b 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -1724,7 +1724,7 @@ ChooseMonToUseItemOn: farcall WritePartyMenuTilemap farcall PlacePartyMenuText call WaitBGMap - call SetPalettes + call SetDefaultBGPAndOBP call DelayFrame farcall PartyMenuSelect ret @@ -1741,7 +1741,7 @@ ItemActionText: farcall WritePartyMenuTilemap farcall PrintPartyMenuActionText call WaitBGMap - call SetPalettes + call SetDefaultBGPAndOBP call DelayFrame pop bc pop de diff --git a/engine/items/pack.asm b/engine/items/pack.asm index 3aa576535..579803543 100644 --- a/engine/items/pack.asm +++ b/engine/items/pack.asm @@ -574,7 +574,7 @@ GiveItem: farcall WritePartyMenuTilemap farcall PlacePartyMenuText call WaitBGMap - call SetPalettes + call SetDefaultBGPAndOBP call DelayFrame farcall PartyMenuSelect jr c, .finish @@ -1437,7 +1437,7 @@ Pack_InitColors: call WaitBGMap ld b, CGB_PACKPALS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP call DelayFrame ret diff --git a/engine/items/tmhm.asm b/engine/items/tmhm.asm index bb6f2a867..61b5d90aa 100644 --- a/engine/items/tmhm.asm +++ b/engine/items/tmhm.asm @@ -82,7 +82,7 @@ ChooseMonToLearnTMHM_NoRefresh: farcall WritePartyMenuTilemap farcall PlacePartyMenuText call WaitBGMap - call SetPalettes + call SetDefaultBGPAndOBP call DelayFrame farcall PartyMenuSelect push af diff --git a/engine/link/link.asm b/engine/link/link.asm index 1d8d9d1b7..c015fcaf9 100644 --- a/engine/link/link.asm +++ b/engine/link/link.asm @@ -522,7 +522,7 @@ LinkTimeout: pop de pop hl bccoord 1, 14 - call PrintHLTextAtBC + call PrintTextboxTextAt call RotateThreePalettesRight call ClearScreen ld b, CGB_DIPLOMA @@ -1443,7 +1443,7 @@ LinkTrade_TradeStatsMenu: dec a ld [wCurTradePartyMon], a ld [wPlayerLinkAction], a - farcall PrintWaitingTextAndSyncAndExchangeNybble + farcall PlaceWaitingTextAndSyncAndExchangeNybble ld a, [wOtherPlayerLinkMode] cp $f jp z, InitTradeMenuDisplay @@ -1465,7 +1465,7 @@ LinkTrade_TradeStatsMenu: farcall Link_WaitBGMap ld hl, .LinkTradeCantBattleText bccoord 1, 14 - call PrintHLTextAtBC + call PrintTextboxTextAt jr .cancel_trade .abnormal @@ -1487,7 +1487,7 @@ LinkTrade_TradeStatsMenu: farcall Link_WaitBGMap ld hl, .LinkAbnormalMonText bccoord 1, 14 - call PrintHLTextAtBC + call PrintTextboxTextAt .cancel_trade hlcoord 0, 12 @@ -1499,7 +1499,7 @@ LinkTrade_TradeStatsMenu: call PlaceString ld a, $1 ld [wPlayerLinkAction], a - farcall PrintWaitingTextAndSyncAndExchangeNybble + farcall PlaceWaitingTextAndSyncAndExchangeNybble ld c, 100 call DelayFrames jp InitTradeMenuDisplay @@ -1561,7 +1561,7 @@ LinkTradePartymonMenuCheckCancel: ldcoord_a 9, 17 ld a, $f ld [wPlayerLinkAction], a - farcall PrintWaitingTextAndSyncAndExchangeNybble + farcall PlaceWaitingTextAndSyncAndExchangeNybble ld a, [wOtherPlayerLinkMode] cp $f jr nz, .loop1 @@ -1658,7 +1658,7 @@ LinkTrade: call GetPokemonName ld hl, LinkAskTradeForText bccoord 1, 14 - call PrintHLTextAtBC + call PrintTextboxTextAt call LoadStandardMenuHeader hlcoord 10, 7 ld b, 3 @@ -1707,13 +1707,13 @@ LinkTrade: hlcoord 1, 14 ld de, String_TooBadTheTradeWasCanceled call PlaceString - farcall PrintWaitingTextAndSyncAndExchangeNybble + farcall PlaceWaitingTextAndSyncAndExchangeNybble jp InitTradeMenuDisplay_Delay .try_trade ld a, $2 ld [wPlayerLinkAction], a - farcall PrintWaitingTextAndSyncAndExchangeNybble + farcall PlaceWaitingTextAndSyncAndExchangeNybble ld a, [wOtherPlayerLinkMode] dec a jr nz, .do_trade @@ -1956,7 +1956,7 @@ LinkTrade: ld a, b ld [wPlayerLinkAction], a push bc - call Serial_PrintWaitingTextAndSyncAndExchangeNybble + call Serial_PlaceWaitingTextAndSyncAndExchangeNybble pop bc ld a, [wLinkMode] cp LINK_TIMECAPSULE @@ -2020,7 +2020,7 @@ LoadTradeScreenBorderGFX: SetTradeRoomBGPals: farcall LoadTradeRoomBGPals ; just a nested farcall; so wasteful - call SetPalettes + call SetDefaultBGPAndOBP ret PlaceTradeScreenTextbox: ; unreferenced diff --git a/engine/link/link_trade.asm b/engine/link/link_trade.asm index 0152351e7..dac00f731 100644 --- a/engine/link/link_trade.asm +++ b/engine/link/link_trade.asm @@ -27,7 +27,7 @@ TestMobileTradeBorderTilemap: ; unreferenced farcall LoadMobileTradeBorderTilemap ; useless to farcall ld b, CGB_DIPLOMA call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP call WaitBGMap call JoyWaitAorB call Call_ExitMenu @@ -156,15 +156,15 @@ LinkTextbox: call _LinkTextbox ret -PrintWaitingTextAndSyncAndExchangeNybble: +PlaceWaitingTextAndSyncAndExchangeNybble: call LoadStandardMenuHeader - call .PrintWaitingText + call .PlaceWaitingText farcall WaitLinkTransfer call Call_ExitMenu call WaitBGMap2 ret -.PrintWaitingText: +.PlaceWaitingText: hlcoord 4, 10 ld b, 1 ld c, 10 diff --git a/engine/menus/cleared_level_screen.asm b/engine/menus/cleared_level_screen.asm index a8c210986..18cb5db8a 100755 --- a/engine/menus/cleared_level_screen.asm +++ b/engine/menus/cleared_level_screen.asm @@ -12,14 +12,14 @@ ClearedLevelScreen: call ClearMenuAndWindowData ld b, CGB_DIPLOMA call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP call EnableLCD ld hl, .LevelCleared1Text bccoord 3, 1 - call PrintHLTextAtBC + call PrintTextboxTextAt ld hl, .LevelCleared2Text bccoord 3, 3 - call PrintHLTextAtBC + call PrintTextboxTextAt .loop call DelayFrame call GetJoypad diff --git a/engine/menus/game_menu.asm b/engine/menus/game_menu.asm index 45cf1d872..6363b53a6 100755 --- a/engine/menus/game_menu.asm +++ b/engine/menus/game_menu.asm @@ -23,7 +23,7 @@ GameMenu_KeepMusic: call ClearMenuAndWindowData ld b, CGB_DIPLOMA call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP xor a ld [wWhichIndexSet], a ld hl, .MenuHeader diff --git a/engine/menus/init_gender.asm b/engine/menus/init_gender.asm index 26238fece..7ccbf9448 100644 --- a/engine/menus/init_gender.asm +++ b/engine/menus/init_gender.asm @@ -3,7 +3,7 @@ InitGender: call LoadGenderScreenPal call LoadGenderScreenLightBlueTile call WaitBGMap2 - call SetPalettes + call SetDefaultBGPAndOBP ld hl, AreYouABoyOrAreYouAGirlText call PrintText1bpp ld hl, .MenuHeader diff --git a/engine/menus/level_selection_menu.asm b/engine/menus/level_selection_menu.asm index 28da68a74..c3c67ffe4 100755 --- a/engine/menus/level_selection_menu.asm +++ b/engine/menus/level_selection_menu.asm @@ -58,7 +58,7 @@ LevelSelectionMenu:: call LevelSelectionMenu_DrawTimeOfDaySymbol ld b, CGB_LEVEL_SELECTION_MENU call GetCGBLayout ; apply and commit pals - call SetPalettes + call SetDefaultBGPAndOBP ld c, 20 ; call DelayFrames ; page shown --> page and textbox shown @@ -105,7 +105,7 @@ LevelSelectionMenu:: call LevelSelectionMenu_DrawTimeOfDaySymbol ld b, CGB_LEVEL_SELECTION_MENU call GetCGBLayout ; apply and commit pals - call SetPalettes + call SetDefaultBGPAndOBP ld de, MUSIC_GAME_CORNER call PlayMusic diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm index 61f23137a..45985c802 100644 --- a/engine/menus/main_menu.asm +++ b/engine/menus/main_menu.asm @@ -20,7 +20,7 @@ MainMenu: call ClearMenuAndWindowData ld b, CGB_DIPLOMA call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP call MainMenu_GetWhichMenu ld [wWhichIndexSet], a call MainMenu_PrintCurrentTimeAndDay diff --git a/engine/menus/menu.asm b/engine/menus/menu.asm index 3b0bb251a..ab7241d7e 100644 --- a/engine/menus/menu.asm +++ b/engine/menus/menu.asm @@ -624,7 +624,7 @@ RestoreOverworldMapTiles: ; unreferenced ld bc, SCREEN_WIDTH * SCREEN_HEIGHT call CopyBytes call CloseSRAM - call LoadScreenTilemapAndAttrmapPals + call LoadOverworldTilemapAndAttrmapPals xor a ; sScratch call OpenSRAM ld hl, sScratch diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index 960a2d16b..4ef2655ce 100644 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -55,7 +55,7 @@ NamingScreen: call .GetNamingScreenSetup call WaitBGMap call WaitTop - call SetPalettes + call SetDefaultBGPAndOBP call NamingScreen_InitNameEntry ret diff --git a/engine/menus/options_menu.asm b/engine/menus/options_menu.asm index 297459169..195bd49c0 100644 --- a/engine/menus/options_menu.asm +++ b/engine/menus/options_menu.asm @@ -48,7 +48,7 @@ _Option: call WaitBGMap ld b, CGB_DIPLOMA call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP .joypad_loop call JoyTextDelay diff --git a/engine/menus/start_menu.asm b/engine/menus/start_menu.asm index 2e9cbd572..d3f3bd645 100644 --- a/engine/menus/start_menu.asm +++ b/engine/menus/start_menu.asm @@ -36,7 +36,7 @@ StartMenu:: call DrawVariableLengthMenuBox call .DrawBugContestStatusBox call SafeUpdateSprites - call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu + call HDMATransferTilemapAndAttrmap_Menu farcall LoadFont_NoOAMUpdate call .DrawBugContestStatus call UpdateTimePals diff --git a/engine/menus/trainer_card.asm b/engine/menus/trainer_card.asm index f1c5accc9..be54576a2 100644 --- a/engine/menus/trainer_card.asm +++ b/engine/menus/trainer_card.asm @@ -67,7 +67,7 @@ TrainerCard: call WaitBGMap ld b, CGB_TRAINER_CARD call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP call WaitBGMap ld hl, wJumptableIndex xor a ; TRAINERCARDSTATE_PAGE1_LOADGFX diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm index 86aa79a9c..9cf3a8ab6 100644 --- a/engine/movie/credits.asm +++ b/engine/movie/credits.asm @@ -72,7 +72,7 @@ Credits:: ldh [hLCDCPointer], a call GetCreditsPalette - call SetPalettes + call SetDefaultBGPAndOBP ldh a, [hVBlank] push af @@ -325,7 +325,7 @@ ParseCredits: xor a ld [wCreditsBorderFrame], a ; frame call GetCreditsPalette - call SetPalettes ; update hw pal registers + call SetDefaultBGPAndOBP ; update hw pal registers jr .loop .clear diff --git a/engine/movie/init_hof_credits.asm b/engine/movie/init_hof_credits.asm index a0392fde2..25aaee092 100644 --- a/engine/movie/init_hof_credits.asm +++ b/engine/movie/init_hof_credits.asm @@ -17,7 +17,7 @@ InitDisplayForHallOfFame: ld hl, .SavingRecordText call PrintText1bpp call WaitBGMap2 - call SetPalettes + call SetDefaultBGPAndOBP ret .SavingRecordText: @@ -50,7 +50,7 @@ InitDisplayForRedCredits: ldh [hSCX], a call EnableLCD call WaitBGMap2 - call SetPalettes + call SetDefaultBGPAndOBP ret ResetDisplayBetweenHallOfFameMons: diff --git a/engine/movie/splash.asm b/engine/movie/splash.asm index 8a6ef0f5f..ede50f330 100644 --- a/engine/movie/splash.asm +++ b/engine/movie/splash.asm @@ -19,7 +19,7 @@ SplashScreen: call WaitBGMap ld b, CGB_GAMEFREAK_LOGO call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP ld c, 10 call DelayFrames diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index b00ef6b02..00212ee69 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -27,111 +27,111 @@ OverworldLoop:: DisableEvents: xor a - ld [wScriptFlags2], a + ld [wEnabledPlayerEvents], a ret EnableEvents:: ld a, $ff - ld [wScriptFlags2], a + ld [wEnabledPlayerEvents], a ret DisableTileEvents: -; DisableWarpsConnxns + DisableCoordEvents + DisableStepCount + DisableWildEncounters +; DisableWarpsConnections + DisableCoordEvents + DisableStepCount + DisableWildEncounters push af - ld hl, wScriptFlags2 + ld hl, wEnabledPlayerEvents ld a, [hl] and ~((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3)) ld [hl], a pop af ret -DisableWarpsConnxns: ; unreferenced - ld hl, wScriptFlags2 +DisableWarpsConnections: ; unreferenced + ld hl, wEnabledPlayerEvents res 2, [hl] ret DisableCoordEvents: ; unreferenced - ld hl, wScriptFlags2 + ld hl, wEnabledPlayerEvents res 1, [hl] ret DisableStepCount: ; unreferenced - ld hl, wScriptFlags2 + ld hl, wEnabledPlayerEvents res 0, [hl] ret DisableWildEncounters: ; unreferenced - ld hl, wScriptFlags2 + ld hl, wEnabledPlayerEvents res 3, [hl] ret DisableSpaceEffects: - ld hl, wScriptFlags2 + ld hl, wEnabledPlayerEvents res 4, [hl] ret DisableTrainerAndTalkerEvents: ; unreferenced - ld hl, wScriptFlags2 + ld hl, wEnabledPlayerEvents res 5, [hl] ret -EnableWarpsConnxns: ; unreferenced - ld hl, wScriptFlags2 +EnableWarpsConnections: ; unreferenced + ld hl, wEnabledPlayerEvents set 2, [hl] ret EnableCoordEvents: ; unreferenced - ld hl, wScriptFlags2 + ld hl, wEnabledPlayerEvents set 1, [hl] ret EnableStepCount: ; unreferenced - ld hl, wScriptFlags2 + ld hl, wEnabledPlayerEvents set 0, [hl] ret EnableWildEncounters: - ld hl, wScriptFlags2 + ld hl, wEnabledPlayerEvents set 3, [hl] ret EnableSpaceEffects: ; unreferenced - ld hl, wScriptFlags2 + ld hl, wEnabledPlayerEvents set 4, [hl] ret EnableTrainerAndTalkerEvents: ; unreferenced - ld hl, wScriptFlags2 + ld hl, wEnabledPlayerEvents set 5, [hl] ret -CheckWarpConnxnScriptFlag: - ld hl, wScriptFlags2 +CheckWarpConnectionsEnabled: + ld hl, wEnabledPlayerEvents bit 2, [hl] ret -CheckCoordEventScriptFlag: - ld hl, wScriptFlags2 +CheckCoordEventsEnabled: + ld hl, wEnabledPlayerEvents bit 1, [hl] ret -CheckStepCountScriptFlag: - ld hl, wScriptFlags2 +CheckStepCountEnabled: + ld hl, wEnabledPlayerEvents bit 0, [hl] ret -CheckWildEncountersScriptFlag: - ld hl, wScriptFlags2 +CheckWildEncountersEnabled: + ld hl, wEnabledPlayerEvents bit 3, [hl] ret CheckSpaceEffectsScriptFlag: - ld hl, wScriptFlags2 + ld hl, wEnabledPlayerEvents bit 4, [hl] ret CheckTrainerAndTalkerEvents: - ld hl, wScriptFlags2 + ld hl, wEnabledPlayerEvents bit 5, [hl] ret @@ -550,7 +550,7 @@ CheckTrainerOrTalkerEvent: CheckTileEvent: ; Check for warps, coord events, or wild battles. - call CheckWarpConnxnScriptFlag + call CheckWarpConnectionsEnabled jr z, .connections_disabled farcall CheckMovingOffEdgeOfMap @@ -568,21 +568,21 @@ CheckTileEvent: cp BOARDEVENT_VIEW_MAP_MODE ret z ; nc - call CheckCoordEventScriptFlag + call CheckCoordEventsEnabled jr z, .coord_events_disabled call CheckCurrentMapCoordEvents jr c, .coord_event .coord_events_disabled - call CheckStepCountScriptFlag + call CheckStepCountEnabled jr z, .step_count_disabled call CountStep ret c .step_count_disabled - call CheckWildEncountersScriptFlag + call CheckWildEncountersEnabled jr z, .ok call RandomEncounter @@ -1536,7 +1536,7 @@ RandomEncounter:: call CheckWildEncounterCooldown jr c, .nope - call CanEncounterWildMonInThisTile + call CanEncounterWildMon jr nc, .nope ld hl, wStatusFlags2 bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl] @@ -1576,7 +1576,7 @@ WildBattleScript: reloadmapafterbattle end -CanEncounterWildMonInThisTile:: +CanEncounterWildMon:: ld hl, wStatusFlags bit STATUSFLAGS_NO_WILD_ENCOUNTERS_F, [hl] jr nz, .no diff --git a/engine/overworld/init_map.asm b/engine/overworld/init_map.asm index 6a971b3c7..9383cbe0b 100644 --- a/engine/overworld/init_map.asm +++ b/engine/overworld/init_map.asm @@ -29,11 +29,11 @@ ReanchorBGMap_NoOAMUpdate:: ; draw screen at wTilemap and wAttrmap and then transfer it. ld a, $90 ldh [hWY], a - call LoadScreenTilemapAndAttrmapPals + call LoadOverworldTilemapAndAttrmapPals call LoadWindowHUD ld a, HIGH(vBGMap1) call .LoadBGMapAddrIntoHRAM - call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu + call HDMATransferTilemapAndAttrmap_Menu farcall ApplyPals ld a, TRUE ldh [hCGBPalUpdate], a diff --git a/engine/overworld/load_screen_tilemap.asm b/engine/overworld/load_overworld_tilemap.asm similarity index 94% rename from engine/overworld/load_screen_tilemap.asm rename to engine/overworld/load_overworld_tilemap.asm index 0f964b23b..c0531ecf2 100644 --- a/engine/overworld/load_screen_tilemap.asm +++ b/engine/overworld/load_overworld_tilemap.asm @@ -1,4 +1,4 @@ -_LoadScreenTilemap:: +_LoadOverworldTilemap:: ld hl, wSurroundingTiles ld a, [wPlayerMetatileY] and a diff --git a/engine/overworld/player_object.asm b/engine/overworld/player_object.asm index 44262b31c..aa69b4092 100644 --- a/engine/overworld/player_object.asm +++ b/engine/overworld/player_object.asm @@ -13,7 +13,7 @@ BlankScreen: ld a, $7 call ByteFill call WaitBGMap2 - call SetPalettes + call SetDefaultBGPAndOBP ret SpawnPlayer: diff --git a/engine/overworld/player_step.asm b/engine/overworld/player_step.asm index 8698a15b6..0c889f0c1 100644 --- a/engine/overworld/player_step.asm +++ b/engine/overworld/player_step.asm @@ -144,25 +144,25 @@ UpdateOverworldMap: .step_down call .ScrollOverworldMapDown - call LoadScreenTilemap + call LoadOverworldTilemap call ScrollMapDown ret .step_up call .ScrollOverworldMapUp - call LoadScreenTilemap + call LoadOverworldTilemap call ScrollMapUp ret .step_left call .ScrollOverworldMapLeft - call LoadScreenTilemap + call LoadOverworldTilemap call ScrollMapLeft ret .step_right call .ScrollOverworldMapRight - call LoadScreenTilemap + call LoadOverworldTilemap call ScrollMapRight ret diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm index b7ec0fb6e..ba086a2ae 100644 --- a/engine/overworld/scripting.asm +++ b/engine/overworld/scripting.asm @@ -136,7 +136,7 @@ ScriptCommandTable: dw Script_itemnotify ; 45 dw Script_pocketisfull ; 46 dw Script_opentext ; 47 - dw Script_refreshscreen ; 48 + dw Script_reanchormap ; 48 dw Script_closetext ; 49 dw Script_writeunusedbyte ; 4a dw Script_farwritetext ; 4b @@ -188,7 +188,7 @@ ScriptCommandTable: dw Script_changemapblocks ; 79 dw Script_changeblock ; 7a dw Script_reloadmap ; 7b - dw Script_reloadmappart ; 7c + dw Script_refreshmap ; 7c dw Script_writecmdqueue ; 7d dw Script_delcmdqueue ; 7e dw Script_playmusic ; 7f @@ -953,7 +953,7 @@ ApplyObjectFacing: ret .DisableTextTiles: - call LoadScreenTilemap + call LoadOverworldTilemap hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT .loop @@ -2287,12 +2287,12 @@ Script_changeblock: call BufferScreen ret -Script_reloadmappart:: +Script_refreshmap:: xor a ldh [hBGMapMode], a - call LoadScreenTilemapAndAttrmapPals + call LoadOverworldTilemapAndAttrmapPals call GetMovementPermissions - farcall HDMATransferTilemapAndAttrmap_OverworldEffect + farcall HDMATransferTilemapAndAttrmap_Overworld call UpdateSprites ret @@ -2322,7 +2322,7 @@ Script_opentext: call OpenText2bpp ret -Script_refreshscreen: +Script_reanchormap: call RefreshScreen call GetScriptByte ret @@ -2332,7 +2332,7 @@ Script_writeunusedbyte: ret Script_closetext: - call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu + call HDMATransferTilemapAndAttrmap_Menu call CloseText ret diff --git a/engine/overworld/warp_connection.asm b/engine/overworld/warp_connection.asm index 777103853..af40d1b31 100644 --- a/engine/overworld/warp_connection.asm +++ b/engine/overworld/warp_connection.asm @@ -219,7 +219,7 @@ LoadMapTimeOfDay: ld [wSpriteUpdatesEnabled], a farcall ReplaceTimeOfDayPals farcall UpdateTimeOfDayPal - call LoadScreenTilemapAndAttrmapPals + call LoadOverworldTilemapAndAttrmapPals call .ClearBGMap call .PushAttrmap ret diff --git a/engine/phone/phone.asm b/engine/phone/phone.asm index ba16139b9..5a588e34d 100644 --- a/engine/phone/phone.asm +++ b/engine/phone/phone.asm @@ -407,7 +407,7 @@ WrongNumber: text_end Script_ReceivePhoneCall: - refreshscreen + reanchormap callasm RingTwice_StartCall memcall wCallerContact + PHONE_CONTACT_SCRIPT2_BANK waitbutton diff --git a/engine/pokedex/new_pokedex_entry.asm b/engine/pokedex/new_pokedex_entry.asm index 1703350ef..e00df3787 100644 --- a/engine/pokedex/new_pokedex_entry.asm +++ b/engine/pokedex/new_pokedex_entry.asm @@ -46,5 +46,5 @@ NewPokedexEntry: ld [wTempMonDVs + 1], a ld b, CGB_TRAINER_OR_MON_FRONTPIC_PALS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP ret diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index 9aebe5c14..ca2407f12 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -102,7 +102,7 @@ PokeGear: call InitPokegearTilemap ld b, CGB_POKEGEAR_PALS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP ld a, %11100100 call DmgToCgbObjPal0 ret @@ -1621,7 +1621,7 @@ _TownMap: ld [wTownMapCursorObjectPointer + 1], a ld b, CGB_POKEGEAR_PALS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP ld a, %11100100 call DmgToCgbObjPal0 call DelayFrame @@ -1840,7 +1840,7 @@ _FlyMap: call Pokegear_DummyFunction ld b, CGB_POKEGEAR_PALS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP .loop call JoyTextDelay ld hl, hJoyPressed @@ -2110,7 +2110,7 @@ Pokedex_GetArea: call TownMapBGUpdate ld b, CGB_POKEGEAR_PALS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP xor a ldh [hBGMapMode], a xor a ; JOHTO_REGION @@ -2537,7 +2537,7 @@ EntireFlyMap: ; unreferenced ld [wTownMapCursorCoordinates + 1], a ld b, CGB_POKEGEAR_PALS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP .loop call JoyTextDelay ld hl, hJoyPressed diff --git a/engine/pokegear/radio.asm b/engine/pokegear/radio.asm index 7a8c71f4f..62b262f60 100644 --- a/engine/pokegear/radio.asm +++ b/engine/pokegear/radio.asm @@ -129,7 +129,7 @@ PrintRadioLine: cp 2 jr nz, .print bccoord 1, 16 - call PrintHLTextAtBC + call PrintTextboxTextAt jr .skip .print call PrintTextboxText diff --git a/engine/pokemon/bills_pc_top.asm b/engine/pokemon/bills_pc_top.asm index e34e8423d..5b01332d1 100644 --- a/engine/pokemon/bills_pc_top.asm +++ b/engine/pokemon/bills_pc_top.asm @@ -48,7 +48,7 @@ _BillsPC: ld a, $1 .loop ld [wMenuCursorPosition], a - call SetPalettes + call SetDefaultBGPAndOBP xor a ld [wWhichIndexSet], a ldh [hBGMapMode], a @@ -245,7 +245,7 @@ ClearPCItemScreen: lb bc, 4, 18 call Textbox1bpp call WaitBGMap2 - call SetPalettes ; load regular palettes? + call SetDefaultBGPAndOBP ret CopyBoxmonToTempMon: diff --git a/engine/pokemon/breeding.asm b/engine/pokemon/breeding.asm index 92aec0f8d..d5fc4ef8f 100644 --- a/engine/pokemon/breeding.asm +++ b/engine/pokemon/breeding.asm @@ -649,7 +649,7 @@ Hatch_UpdateFrontpicBGMapCenter: predef PlaceGraphic pop af call Hatch_LoadFrontpicPal - call SetPalettes + call SetDefaultBGPAndOBP jp WaitBGMap EggHatch_DoSpriteAnimFrame: diff --git a/engine/pokemon/mail.asm b/engine/pokemon/mail.asm index de78abe92..d778b95f5 100644 --- a/engine/pokemon/mail.asm +++ b/engine/pokemon/mail.asm @@ -490,7 +490,7 @@ MailboxPC: farcall WritePartyMenuTilemap farcall PlacePartyMenuText call WaitBGMap - call SetPalettes + call SetDefaultBGPAndOBP call DelayFrame farcall PartyMenuSelect jr c, .exit2 diff --git a/engine/pokemon/mail_2.asm b/engine/pokemon/mail_2.asm index 8e246aaac..7525111fe 100644 --- a/engine/pokemon/mail_2.asm +++ b/engine/pokemon/mail_2.asm @@ -40,7 +40,7 @@ ReadAnyMail: ld a, [wCurMailIndex] ld e, a farcall LoadMailPalettes - call SetPalettes + call SetDefaultBGPAndOBP xor a ldh [hJoyPressed], a call .loop diff --git a/engine/pokemon/mon_menu.asm b/engine/pokemon/mon_menu.asm index 398fe8400..3e1a4ea24 100644 --- a/engine/pokemon/mon_menu.asm +++ b/engine/pokemon/mon_menu.asm @@ -119,7 +119,7 @@ Party:: farcall WritePartyMenuTilemap farcall PlacePartyMenuText call WaitBGMap - call SetPalettes + call SetDefaultBGPAndOBP call DelayFrame farcall PartyMenuSelect ret c ; if cancelled or pressed B @@ -204,7 +204,7 @@ SwitchPartyMons: call AddNTimes ld [hl], "▷" call WaitBGMap - call SetPalettes + call SetDefaultBGPAndOBP call DelayFrame farcall PartyMenuSelect @@ -1181,7 +1181,7 @@ SetUpMoveList: hlcoord 10, 4 predef ListMovePP call WaitBGMap - call SetPalettes + call SetDefaultBGPAndOBP ld a, [wNumMoves] inc a ld [w2DMenuNumRows], a diff --git a/engine/pokemon/party_menu.asm b/engine/pokemon/party_menu.asm index 7c68a411c..26e341f29 100644 --- a/engine/pokemon/party_menu.asm +++ b/engine/pokemon/party_menu.asm @@ -5,7 +5,7 @@ SelectMonFromParty: call ClearBGPalettes call InitPartyMenuLayout call WaitBGMap - call SetPalettes + call SetDefaultBGPAndOBP call DelayFrame call PartyMenuSelect call ReturnToMapWithSpeechTextbox @@ -20,7 +20,7 @@ SelectTradeOrDayCareMon: call WaitBGMap ld b, CGB_PARTY_MENU call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP call DelayFrame call PartyMenuSelect call ReturnToMapWithSpeechTextbox diff --git a/engine/pokemon/stats_screen.asm b/engine/pokemon/stats_screen.asm index 7eece47b0..32e952459 100644 --- a/engine/pokemon/stats_screen.asm +++ b/engine/pokemon/stats_screen.asm @@ -494,7 +494,7 @@ StatsScreen_LoadGFX: ld hl, wStatsScreenFlags bit 4, [hl] jr nz, .place_frontpic - call SetPalettes + call SetDefaultBGPAndOBP ret .place_frontpic @@ -795,16 +795,16 @@ StatsScreen_PlaceFrontpic: .egg call .AnimateEgg - call SetPalettes + call SetDefaultBGPAndOBP ret .no_cry call .AnimateMon - call SetPalettes + call SetDefaultBGPAndOBP ret .cry - call SetPalettes + call SetDefaultBGPAndOBP call .AnimateMon ld a, [wCurPartySpecies] call PlayMonCry2 @@ -995,7 +995,7 @@ endc call PlaceString ld hl, wStatsScreenFlags set 5, [hl] - call SetPalettes ; pals + call SetDefaultBGPAndOBP call DelayFrame hlcoord 0, 0 call PrepMonFrontpic diff --git a/engine/printer/print_party.asm b/engine/printer/print_party.asm index 9d7e6e5da..a12ab52fe 100644 --- a/engine/printer/print_party.asm +++ b/engine/printer/print_party.asm @@ -225,7 +225,7 @@ PrintPartyMonPage1: call WaitBGMap ld b, CGB_STATS_SCREEN_HP_PALS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP ret PrintPartyMonPage2: @@ -276,7 +276,7 @@ PrintPartyMonPage2: call WaitBGMap ld b, CGB_STATS_SCREEN_HP_PALS call GetCGBLayout - call SetPalettes + call SetDefaultBGPAndOBP ret .PrintTempMonStats: diff --git a/engine/tilesets/map_palettes.asm b/engine/tilesets/map_palettes.asm index 8f9087ee6..19009f558 100644 --- a/engine/tilesets/map_palettes.asm +++ b/engine/tilesets/map_palettes.asm @@ -1,4 +1,4 @@ -_LoadScreenAttrmapPals:: +_LoadOverworldAttrmapPals:: hlcoord 0, 0 decoord 0, 0, wAttrmap ld b, SCREEN_HEIGHT diff --git a/engine/tilesets/timeofday_pals.asm b/engine/tilesets/timeofday_pals.asm index 816f9b219..514fbd97a 100644 --- a/engine/tilesets/timeofday_pals.asm +++ b/engine/tilesets/timeofday_pals.asm @@ -111,7 +111,7 @@ _UpdateTimePals:: call DmgToCgbTimePals ret -FadeInPalettesFromWhite:: +FadeInFromWhite:: ; fades from white to normal palettes in four steps ; all palettes use white color of Pal0 before step 3 call BackupWhiteColorFromBGPals1 @@ -127,7 +127,7 @@ FadeInPalettesFromWhite:: call ConvertTimePalsDecHL ret -FadeOutPalettesToWhite:: +FadeOutToWhite:: ; fades from normal palettes to white in four steps ; all palettes use white color of Pal0 after step 2 ld c, $9 @@ -141,14 +141,14 @@ FadeOutPalettesToWhite:: call ConvertTimePalsIncHL ret -FadeInPalettesFromBlack: +FadeInFromBlack: ld c, $0 call GetTimePalFade ld b, $4 call ConvertTimePalsIncHL ret -FadeOutPalettesToBlack: +FadeOutToBlack: ld c, $9 call GetTimePalFade ld b, $4 diff --git a/home/map.asm b/home/map.asm index c8fa358b2..6bbbfc8a7 100644 --- a/home/map.asm +++ b/home/map.asm @@ -84,12 +84,12 @@ GetMapSceneID:: pop bc ret -LoadScreenTilemapAndAttrmapPals:: - call LoadScreenTilemap - call LoadScreenAttrmapPals +LoadOverworldTilemapAndAttrmapPals:: + call LoadOverworldTilemap + call LoadOverworldAttrmapPals ret -LoadScreenTilemap:: +LoadOverworldTilemap:: ldh a, [hROMBank] push af @@ -102,9 +102,9 @@ LoadScreenTilemap:: ld bc, SCREEN_WIDTH * SCREEN_HEIGHT call ByteFill - ld a, BANK(_LoadScreenTilemap) + ld a, BANK(_LoadOverworldTilemap) rst Bankswitch - call _LoadScreenTilemap + call _LoadOverworldTilemap pop af rst Bankswitch @@ -2170,7 +2170,7 @@ FadeToMenu:: xor a ldh [hBGMapMode], a call LoadStandardMenuHeader - farcall FadeOutPalettesToWhite + farcall FadeOutToWhite call ClearSprites call DisableSpriteUpdates ret @@ -2191,7 +2191,7 @@ FinishExitMenu:: ld b, CGB_MAPPALS call GetCGBLayout call WaitBGMap2 - farcall FadeInPalettesFromWhite + farcall FadeInFromWhite call EnableSpriteUpdates ret @@ -2237,7 +2237,7 @@ ReloadTilesetAndPalettes:: ld c, a call SwitchToAnyMapAttributesBank farcall UpdateTimeOfDayPal - call LoadScreenTilemapAndAttrmapPals + call LoadOverworldTilemapAndAttrmapPals call LoadTilesetGFX ld a, 9 call SkipMusic diff --git a/home/palettes.asm b/home/palettes.asm index 87c56d655..61a8a3fd4 100644 --- a/home/palettes.asm +++ b/home/palettes.asm @@ -288,8 +288,8 @@ ReloadSpritesNoPalettes:: call DelayFrame ret -LoadScreenAttrmapPals:: - homecall _LoadScreenAttrmapPals +LoadOverworldAttrmapPals:: + homecall _LoadOverworldAttrmapPals ret ScrollBGMapPalettes:: diff --git a/home/scrolling_menu.asm b/home/scrolling_menu.asm index de1c8cdb1..64bb52598 100644 --- a/home/scrolling_menu.asm +++ b/home/scrolling_menu.asm @@ -20,7 +20,7 @@ ScrollingMenu:: ld hl, wVramState bit 0, [hl] jp nz, UpdateTimePals - jp SetPalettes + jp SetDefaultBGPAndOBP InitScrollingMenu:: ld a, [wMenuBorderTopCoord] diff --git a/home/serial.asm b/home/serial.asm index 7459a8b18..b4070fc3c 100644 --- a/home/serial.asm +++ b/home/serial.asm @@ -270,7 +270,7 @@ Serial_ExchangeSyncBytes:: jr nz, .exchange ret -Serial_PrintWaitingTextAndSyncAndExchangeNybble:: +Serial_PlaceWaitingTextAndSyncAndExchangeNybble:: call LoadTilemapToTempTilemap callfar PlaceWaitingText call WaitLinkTransfer diff --git a/home/text.asm b/home/text.asm index 82eb7914b..f959d0ce6 100644 --- a/home/text.asm +++ b/home/text.asm @@ -208,7 +208,7 @@ BuenaPrintText:: PrintTextboxText:: bccoord TEXTBOX_INNERX, TEXTBOX_INNERY - call PrintHLTextAtBC + call PrintTextboxTextAt ret PlaceString:: @@ -624,7 +624,7 @@ PokeFluteTerminator:: .stop: text_end -PrintHLTextAtBC:: +PrintTextboxTextAt:: ld a, [wTextboxFlags] push af set TEXT_DELAY_F, a diff --git a/home/tilemap.asm b/home/tilemap.asm index b3a345de6..d520ac151 100644 --- a/home/tilemap.asm +++ b/home/tilemap.asm @@ -129,12 +129,12 @@ endr ld sp, hl ret -SetPalettes:: +SetDefaultBGPAndOBP:: ; Inits the Palettes ; depending on the system the monochromes palettes or color palettes ldh a, [hCGB] and a - jr nz, .SetPalettesForGameBoyColor + jr nz, .SetDefaultBGPAndOBPForGameBoyColor ld a, %11100100 ldh [rBGP], a ld a, %11010000 @@ -142,7 +142,7 @@ SetPalettes:: ldh [rOBP1], a ret -.SetPalettesForGameBoyColor: +.SetDefaultBGPAndOBPForGameBoyColor: push de ld a, %11100100 call DmgToCgbBGPals diff --git a/home/window.asm b/home/window.asm index 464862a6b..043d16c38 100644 --- a/home/window.asm +++ b/home/window.asm @@ -6,7 +6,7 @@ RefreshScreen:: rst Bankswitch call ReanchorBGMap_NoOAMUpdate - call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu + call HDMATransferTilemapAndAttrmap_Menu call HideWindow_EnableLCDInt pop af @@ -22,8 +22,8 @@ CloseText:: call ClearMenuAndWindowData xor a ldh [hBGMapMode], a - call LoadScreenTilemapAndAttrmapPals - call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu + call LoadOverworldTilemapAndAttrmapPals + call HDMATransferTilemapAndAttrmap_Menu xor a ldh [hBGMapMode], a call SafeUpdateSprites @@ -52,7 +52,7 @@ OpenText2bpp:: ; assumes that the overworld 2bpp font and frame are loaded when calling this call ReanchorBGMap_NoOAMUpdate ; anchor bgmap call SpeechTextbox2bpp - call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu ; transfer bgmap + call HDMATransferTilemapAndAttrmap_Menu ; transfer bgmap call HideWindow_EnableLCDInt pop af @@ -73,7 +73,7 @@ OpenText1bpp:: call ReanchorBGMap_NoOAMUpdate ; anchor bgmap call SpeechTextbox1bpp - call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu ; transfer bgmap + call HDMATransferTilemapAndAttrmap_Menu ; transfer bgmap call LoadFont_NoOAMUpdate ; load 1bpp font and frame, hide window pop af @@ -81,13 +81,13 @@ OpenText1bpp:: ret -HDMATransferTilemapAndAttrmap_OpenAndCloseMenu:: +HDMATransferTilemapAndAttrmap_Menu:: ldh a, [hOAMUpdate] push af ld a, $1 ldh [hOAMUpdate], a - farcall _HDMATransferTilemapAndAttrmap_OpenAndCloseMenu + farcall _HDMATransferTilemapAndAttrmap_Menu pop af ldh [hOAMUpdate], a diff --git a/macros/scripts/events.asm b/macros/scripts/events.asm index 891b148fa..342f8205f 100644 --- a/macros/scripts/events.asm +++ b/macros/scripts/events.asm @@ -476,12 +476,12 @@ MACRO opentext db opentext_command ENDM - const refreshscreen_command ; $48 -MACRO refreshscreen + const reanchormap_command ; $48 +MACRO reanchormap if _NARG == 0 - refreshscreen 0 + reanchormap 0 else - db refreshscreen_command + db reanchormap_command db \1 ; dummy endc ENDM @@ -789,9 +789,9 @@ MACRO reloadmap db reloadmap_command ENDM - const reloadmappart_command ; $7c -MACRO reloadmappart - db reloadmappart_command + const refreshmap_command ; $7c +MACRO refreshmap + db refreshmap_command ENDM const writecmdqueue_command ; $7d diff --git a/main.asm b/main.asm index 8e9a2c899..0ad704df0 100644 --- a/main.asm +++ b/main.asm @@ -191,7 +191,7 @@ INCLUDE "data/collision/collision_permissions.asm" INCLUDE "engine/menus/empty_sram.asm" INCLUDE "engine/events/checksave.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" diff --git a/ram/wram.asm b/ram/wram.asm index 967d2de7a..0b3a40786 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -2250,7 +2250,7 @@ wMapEventStatus:: db wScriptFlags:: ; bit 3: run deferred script db -wScriptFlags2:: +wEnabledPlayerEvents:: ; bit 0: count steps ; bit 1: coord events ; bit 2: warps and connections @@ -2773,7 +2773,7 @@ wMagnetTrainHoldPosition:: db wMagnetTrainFinalPosition:: db wMagnetTrainPlayerSpriteInitX:: db - ; Used by FadeInPalettesFromWhite + ; Used by FadeInFromWhite wBGPalsRegularWhiteColors:: ds 8 * PAL_COLOR_SIZE ds 91