diff --git a/engine/battle_transition.asm b/engine/battle_transition.asm index 2af113ddd..bef74ad29 100644 --- a/engine/battle_transition.asm +++ b/engine/battle_transition.asm @@ -60,7 +60,7 @@ Predef_StartBattle: ; 8c20f call UpdateSprites call DelayFrame call .NonMobile_LoadPokeballTiles - call BattleStart_LoadEDTile + call BattleStart_CopyTilemapAtOnce jr .resume .mobile @@ -663,7 +663,7 @@ StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc) ld a, $1 ld [hCGBPalUpdate], a call DelayFrame - call BattleStart_LoadEDTile + call BattleStart_CopyTilemapAtOnce .nextscene ; 8c673 (23:4673) call StartTrainerBattle_NextScene diff --git a/engine/color.asm b/engine/color.asm index ce9e1dfaa..afa8fe2e7 100644 --- a/engine/color.asm +++ b/engine/color.asm @@ -307,7 +307,7 @@ Function8bec: ld a, [EnemySafeguardCount] ; value and $3 call FillBoxCGB - call LoadEDTile + call CopyTilemapAtOnce ret ApplyMonOrTrainerPals: diff --git a/engine/phone/phone.asm b/engine/phone/phone.asm index 9b451d04a..53bb519b3 100644 --- a/engine/phone/phone.asm +++ b/engine/phone/phone.asm @@ -599,7 +599,7 @@ Phone_StartRinging: ; 9033f call PlaySFX call Phone_CallerTextbox call UpdateSprites - farcall PhoneRing_LoadEDTile + farcall PhoneRing_CopyTilemapAtOnce ret ; 90355 @@ -609,7 +609,7 @@ HangUp_Wait20Frames: ; 90355 Phone_Wait20Frames ld c, 20 call DelayFrames - farcall PhoneRing_LoadEDTile + farcall PhoneRing_CopyTilemapAtOnce ret ; 90363 diff --git a/engine/save.asm b/engine/save.asm index 6ee92bcee..69bbaee82 100644 --- a/engine/save.asm +++ b/engine/save.asm @@ -3,7 +3,7 @@ SaveMenu: ; 14a1a farcall DisplaySaveInfoOnSave call SpeechTextBox call UpdateSprites - farcall SaveMenu_LoadEDTile + farcall SaveMenu_CopyTilemapAtOnce ld hl, Text_WouldYouLikeToSaveTheGame call SaveTheGame_yesorno jr nz, .refused @@ -19,7 +19,7 @@ SaveMenu: ; 14a1a .refused call ExitMenu call ret_d90 - farcall SaveMenu_LoadEDTile + farcall SaveMenu_CopyTilemapAtOnce scf ret diff --git a/event/mom.asm b/event/mom.asm index a23b55256..6e3c7b320 100644 --- a/event/mom.asm +++ b/event/mom.asm @@ -476,7 +476,7 @@ Mom_ContinueMenuSetup: ; 1651a lb bc, PRINTNUM_MONEY | PRINTNUM_LEADINGZEROS | 3, 6 call PrintNum call UpdateSprites - call CGBOnly_LoadEDTile + call CGBOnly_CopyTilemapAtOnce ret ; 1656b diff --git a/home.asm b/home.asm index b5ac0db58..9601a8c1a 100644 --- a/home.asm +++ b/home.asm @@ -532,7 +532,7 @@ ApplyTilemap:: ; 321c ld a, 1 ld [hBGMapMode], a - jr LoadEDTile + jr CopyTilemapAtOnce .dmg ; WaitBGMap @@ -543,13 +543,13 @@ ApplyTilemap:: ; 321c ret ; 3238 -CGBOnly_LoadEDTile:: ; 3238 +CGBOnly_CopyTilemapAtOnce:: ; 3238 ld a, [hCGB] and a jr z, WaitBGMap -LoadEDTile:: ; 323d - jr .LoadEDTile +CopyTilemapAtOnce:: ; 323d + jr .CopyTilemapAtOnce ; 323f ; XXX @@ -557,7 +557,7 @@ LoadEDTile:: ; 323d ret ; 3246 -.LoadEDTile: ; 3246 +.CopyTilemapAtOnce: ; 3246 ld a, [hBGMapMode] push af xor a @@ -574,11 +574,11 @@ LoadEDTile:: ; 323d jr c, .wait di - ld a, 1 ; BANK(VTiles3) + ld a, BANK(VTiles3) ld [rVBK], a hlcoord 0, 0, AttrMap call .StackPointerMagic - ld a, 0 ; BANK(VTiles0) + ld a, BANK(VTiles0) ld [rVBK], a hlcoord 0, 0 call .StackPointerMagic @@ -623,7 +623,7 @@ rept SCREEN_WIDTH / 2 inc l endr - ld de, $20 - SCREEN_WIDTH + ld de, BG_MAP_WIDTH - SCREEN_WIDTH add hl, de ld a, [hTilesPerCycle] dec a diff --git a/main.asm b/main.asm index cbeebac07..01f5699b7 100644 --- a/main.asm +++ b/main.asm @@ -309,12 +309,12 @@ endr INCLUDE "data/collision_permissions.asm" INCLUDE "engine/empty_sram.asm" -SaveMenu_LoadEDTile: ; 4cf45 (13:4f45) +SaveMenu_CopyTilemapAtOnce: ; 4cf45 (13:4f45) ld a, [hCGB] and a jp z, WaitBGMap -; The following is a modified version of LoadEDTile. +; The following is a modified version of CopyTilemapAtOnce. ld a, [hBGMapMode] push af xor a @@ -329,14 +329,14 @@ SaveMenu_LoadEDTile: ; 4cf45 (13:4f45) jr c, .WaitLY di - ld a, 1 ; BANK(VBGMap2) + ld a, BANK(VBGMap2) ld [rVBK], a hlcoord 0, 0, AttrMap - call .LoadEDTile - ld a, 0 ; BANK(VBGMap0) + call .CopyTilemapAtOnce + ld a, BANK(VBGMap0) ld [rVBK], a hlcoord 0, 0 - call .LoadEDTile + call .CopyTilemapAtOnce .WaitLY2: ld a, [rLY] cp $60 @@ -349,7 +349,7 @@ SaveMenu_LoadEDTile: ; 4cf45 (13:4f45) ld [hBGMapMode], a ret -.LoadEDTile: ; 4cf80 (13:4f80) +.CopyTilemapAtOnce: ; 4cf80 (13:4f80) ld [hSPBuffer], sp ; $ffd9 ld sp, hl ld a, [hBGMapAddress + 1] @@ -373,7 +373,7 @@ rept SCREEN_WIDTH / 2 inc l endr - ld de, $20 - SCREEN_WIDTH + ld de, BG_MAP_WIDTH - SCREEN_WIDTH add hl, de ld a, [hTilesPerCycle] dec a @@ -447,7 +447,7 @@ _LoadMapPart:: ; 4d15b jr nz, .loop ret -PhoneRing_LoadEDTile: ; 4d188 +PhoneRing_CopyTilemapAtOnce: ; 4d188 ld a, [hCGB] and a jp z, WaitBGMap @@ -455,7 +455,7 @@ PhoneRing_LoadEDTile: ; 4d188 cp $0 jp z, WaitBGMap -; What follows is a modified version of LoadEDTile. +; What follows is a modified version of CopyTilemapAtOnce. ld a, [hBGMapMode] push af xor a @@ -470,14 +470,14 @@ PhoneRing_LoadEDTile: ; 4d188 jr c, .wait di - ld a, 1 ; BANK(VBGMap2) + ld a, BANK(VBGMap2) ld [rVBK], a hlcoord 0, 0, AttrMap - call .LoadEDTile - ld a, 0 ; BANK(VBGMap0) + call .CopyTilemapAtOnce + ld a, BANK(VBGMap0) ld [rVBK], a hlcoord 0, 0 - call .LoadEDTile + call .CopyTilemapAtOnce .wait2 ld a, [rLY] cp $8f @@ -490,7 +490,7 @@ PhoneRing_LoadEDTile: ; 4d188 ld [hBGMapMode], a ret -.LoadEDTile: ; 4d1cb +.CopyTilemapAtOnce: ; 4d1cb ld [hSPBuffer], sp ld sp, hl ld a, [hBGMapAddress + 1] @@ -514,7 +514,7 @@ rept SCREEN_WIDTH / 2 inc l endr - ld de, $20 - SCREEN_WIDTH + ld de, BG_MAP_WIDTH - SCREEN_WIDTH add hl, de ld a, [hTilesPerCycle] dec a @@ -752,8 +752,8 @@ INCLUDE "engine/battle_transition.asm" INCLUDE "event/field_moves.asm" INCLUDE "event/magnet_train.asm" -BattleStart_LoadEDTile: ; 8cf4f - call CGBOnly_LoadEDTile +BattleStart_CopyTilemapAtOnce: ; 8cf4f + call CGBOnly_CopyTilemapAtOnce ret INCLUDE "engine/sprites.asm" diff --git a/mobile/mobile_22.asm b/mobile/mobile_22.asm index 416f62df8..fa58b7a05 100644 --- a/mobile/mobile_22.asm +++ b/mobile/mobile_22.asm @@ -2226,7 +2226,7 @@ Function89d85: ; 89d85 (22:5d85) push hl call Mobile22_SetBGMapMode0 call _hl_ - call CGBOnly_LoadEDTile + call CGBOnly_CopyTilemapAtOnce pop hl asm_89d90: ; 89d90 (22:5d90) @@ -2670,7 +2670,7 @@ Function8a055: ; 8a055 (22:6055) inc hl ld a, $6 call Function8a5a3 - call CGBOnly_LoadEDTile + call CGBOnly_CopyTilemapAtOnce pop bc ld a, c cp $b @@ -2685,7 +2685,7 @@ Function8a055: ; 8a055 (22:6055) ld a, $6 hlcoord 15, 4, AttrMap call Function8a5a3 - call CGBOnly_LoadEDTile + call CGBOnly_CopyTilemapAtOnce jp Function89e36 Function8a0a1: ; 8a0a1 (22:60a1) diff --git a/mobile/mobile_22_2.asm b/mobile/mobile_22_2.asm index dfba961e4..49780d4aa 100644 --- a/mobile/mobile_22_2.asm +++ b/mobile/mobile_22_2.asm @@ -411,7 +411,7 @@ Function8b539: ; 8b539 (22:7539) call Function8b4fd ld e, $0 call Function89c44 - call CGBOnly_LoadEDTile + call CGBOnly_CopyTilemapAtOnce ret Function8b555: ; 8b555 (22:7555) diff --git a/mobile/mobile_40.asm b/mobile/mobile_40.asm index a8a60343c..fc8ea13cf 100644 --- a/mobile/mobile_40.asm +++ b/mobile/mobile_40.asm @@ -3089,7 +3089,7 @@ Function1013d6: ; 1013d6 ; 1013dd Function1013dd: ; 1013dd - call CGBOnly_LoadEDTile + call CGBOnly_CopyTilemapAtOnce ret ; 1013e1