diff --git a/battle/anim_commands.asm b/battle/anim_commands.asm index 561d509d7..510f44d2b 100644 --- a/battle/anim_commands.asm +++ b/battle/anim_commands.asm @@ -932,7 +932,7 @@ BattleAnimCmd_Transform: ; cc5dc (33:45dc) ld hl, BattleMonDVs ; BattleMonDVs predef GetUnownLetter ld de, VTiles0 tile $00 - predef GetFrontpic + predef GetMonFrontpic jr .done .player @@ -941,7 +941,7 @@ BattleAnimCmd_Transform: ; cc5dc (33:45dc) ld hl, EnemyMonDVs ; EnemyMonDVs predef GetUnownLetter ld de, VTiles0 tile $00 - predef GetBackpic + predef GetMonBackpic .done pop af @@ -1159,14 +1159,14 @@ BattleAnimCmd_BeatUp: ; cc776 (33:4776) ld hl, BattleMonDVs predef GetUnownLetter ld de, VTiles2 tile $00 - predef GetFrontpic + predef GetMonFrontpic jr .done .player ld hl, EnemyMonDVs predef GetUnownLetter ld de, VTiles2 tile $31 - predef GetBackpic + predef GetMonBackpic .done pop af diff --git a/battle/core.asm b/battle/core.asm index 593caf649..7a12538dc 100644 --- a/battle/core.asm +++ b/battle/core.asm @@ -3689,7 +3689,7 @@ Function_SetEnemyPkmnAndSendOutAnimation: ; 3d7c7 ld a, OTPARTYMON ld [MonType], a predef CopyPkmnToTempMon - call GetMonFrontpic + call GetEnemyMonFrontpic xor a ld [wNumHits], a @@ -4176,7 +4176,7 @@ SendOutPlayerMon: ; 3db5f call WaitBGMap xor a ld [hBGMapMode], a - call GetMonBackpic + call GetBattleMonBackpic xor a ld [hGraphicStartTile], a ld [wBattleMenuCursorBuffer], a @@ -5185,8 +5185,8 @@ BattleMenu_Pack: ; 3e1c7 call ClearPalettes call DelayFrame call _LoadBattleFontsHPBar - call GetMonBackpic - call GetMonFrontpic + call GetBattleMonBackpic + call GetEnemyMonFrontpic call ExitMenu call WaitBGMap call FinishBattleAnim @@ -5218,10 +5218,10 @@ BattleMenu_Pack: ; 3e1c7 ld a, [BattleType] cp BATTLETYPE_TUTORIAL jr z, .tutorial2 - call GetMonBackpic + call GetBattleMonBackpic .tutorial2 - call GetMonFrontpic + call GetEnemyMonFrontpic ld a, $1 ld [wMenuCursorY], a call ExitMenu @@ -8269,17 +8269,17 @@ PlaceExpBar: ; 3f41c ret ; 3f43d -GetMonBackpic: ; 3f43d +GetBattleMonBackpic: ; 3f43d ld a, [PlayerSubStatus4] bit SUBSTATUS_SUBSTITUTE, a ld hl, BattleAnimCmd_RaiseSub - jr nz, GetBackpic_DoAnim ; substitute + jr nz, GetBattleMonBackpic_DoAnim ; substitute DropPlayerSub: ; 3f447 ld a, [wPlayerMinimized] and a ld hl, BattleAnimCmd_MinimizeOpp - jr nz, GetBackpic_DoAnim + jr nz, GetBattleMonBackpic_DoAnim ld a, [CurPartySpecies] push af ld a, [BattleMonSpecies] @@ -8287,13 +8287,13 @@ DropPlayerSub: ; 3f447 ld hl, BattleMonDVs predef GetUnownLetter ld de, VTiles2 tile $31 - predef GetBackpic + predef GetMonBackpic pop af ld [CurPartySpecies], a ret ; 3f46f -GetBackpic_DoAnim: ; 3f46f +GetBattleMonBackpic_DoAnim: ; 3f46f ld a, [hBattleTurn] push af xor a @@ -8305,17 +8305,17 @@ GetBackpic_DoAnim: ; 3f46f ret ; 3f47c -GetMonFrontpic: ; 3f47c +GetEnemyMonFrontpic: ; 3f47c ld a, [EnemySubStatus4] bit SUBSTATUS_SUBSTITUTE, a ld hl, BattleAnimCmd_RaiseSub - jr nz, GetFrontpic_DoAnim + jr nz, GetEnemyMonFrontpic_DoAnim DropEnemySub: ; 3f486 ld a, [wEnemyMinimized] and a ld hl, BattleAnimCmd_MinimizeOpp - jr nz, GetFrontpic_DoAnim + jr nz, GetEnemyMonFrontpic_DoAnim ld a, [CurPartySpecies] push af @@ -8326,13 +8326,13 @@ DropEnemySub: ; 3f486 ld hl, EnemyMonDVs predef GetUnownLetter ld de, VTiles2 - predef FrontpicPredef + predef GetAnimatedFrontpicPredef pop af ld [CurPartySpecies], a ret ; 3f4b4 -GetFrontpic_DoAnim: ; 3f4b4 +GetEnemyMonFrontpic_DoAnim: ; 3f4b4 ld a, [hBattleTurn] push af call SetEnemyTurn @@ -8532,7 +8532,7 @@ InitEnemyWildmon: ; 3f607 ld [wFirstUnownSeen], a .skip_unown ld de, VTiles2 - predef FrontpicPredef + predef GetAnimatedFrontpicPredef xor a ld [TrainerClass], a ld [hGraphicStartTile], a diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm index d04da6b52..8f148c883 100644 --- a/battle/effect_commands.asm +++ b/battle/effect_commands.asm @@ -6299,11 +6299,11 @@ BattleCommand_Curl: ; 365a7 BattleCommand_RaiseSubNoAnim: ; 365af - ld hl, GetMonBackpic + ld hl, GetBattleMonBackpic ld a, [hBattleTurn] and a jr z, .PlayerTurn - ld hl, GetMonFrontpic + ld hl, GetEnemyMonFrontpic .PlayerTurn: xor a ld [hBGMapMode], a diff --git a/engine/billspc.asm b/engine/billspc.asm index 0bdacf436..2dd9a512f 100755 --- a/engine/billspc.asm +++ b/engine/billspc.asm @@ -1108,7 +1108,7 @@ PCMonInfo: ; e2ac6 (38:6ac6) predef GetUnownLetter call GetBaseData ld de, VTiles2 tile $00 - predef GetFrontpic + predef GetMonFrontpic xor a ld [wBillsPC_MonHasMail], a ld a, [CurPartySpecies] diff --git a/engine/breeding.asm b/engine/breeding.asm index 517908902..967694612 100755 --- a/engine/breeding.asm +++ b/engine/breeding.asm @@ -649,7 +649,7 @@ GetEggFrontpic: ; 17224 (5:7224) ld hl, BattleMonDVs predef GetUnownLetter pop de - predef_jump GetFrontpic + predef_jump GetMonFrontpic GetHatchlingFrontpic: ; 1723c (5:723c) push de @@ -659,7 +659,7 @@ GetHatchlingFrontpic: ; 1723c (5:723c) ld hl, BattleMonDVs predef GetUnownLetter pop de - predef_jump FrontpicPredef + predef_jump GetAnimatedFrontpicPredef Hatch_UpdateFrontpicBGMapCenter: ; 17254 (5:7254) push af diff --git a/engine/debug.asm b/engine/debug.asm index 65f2cfb36..588de7a64 100755 --- a/engine/debug.asm +++ b/engine/debug.asm @@ -315,7 +315,7 @@ Function81adb: ; 81adb hlcoord 12, 3 call _PrepMonFrontpic ld de, VTiles2 tile $31 - predef GetBackpic + predef GetMonBackpic ld a, $31 ld [hGraphicStartTile], a hlcoord 2, 4 diff --git a/engine/dma_transfer.asm b/engine/dma_transfer.asm index a0dad0dde..9d95c87b1 100755 --- a/engine/dma_transfer.asm +++ b/engine/dma_transfer.asm @@ -5,10 +5,10 @@ HDMATransferAttrMapAndTileMapToWRAMBank3:: ; 104000 .Function: decoord 0, 0, AttrMap ld hl, wScratchAttrMap - call CutAndPasteAttrMap + call PadAttrMapForHDMATransfer decoord 0, 0 ld hl, wScratchTileMap - call CutAndPasteTilemap + call PadTilemapForHDMATransfer ld a, $0 ld [rVBK], a ld hl, wScratchTileMap @@ -27,7 +27,7 @@ HDMATransferTileMapToWRAMBank3:: ; 10402d .Function: decoord 0, 0 ld hl, wScratchTileMap - call CutAndPasteTilemap + call PadTilemapForHDMATransfer ld a, $0 ld [rVBK], a ld hl, wScratchTileMap @@ -42,7 +42,7 @@ HDMATransferAttrMapToWRAMBank3: ; 104047 .Function: decoord 0, 0, AttrMap ld hl, wScratchAttrMap - call CutAndPasteAttrMap + call PadAttrMapForHDMATransfer ld a, $1 ld [rVBK], a ld hl, wScratchAttrMap @@ -57,10 +57,10 @@ ReloadMapPart:: ; 104061 .Function: decoord 0, 0, AttrMap ld hl, wScratchAttrMap - call CutAndPasteAttrMap + call PadAttrMapForHDMATransfer decoord 0, 0 ld hl, wScratchTileMap - call CutAndPasteTilemap + call PadTilemapForHDMATransfer call DelayFrame di @@ -88,10 +88,10 @@ Mobile_ReloadMapPart: ; 104099 .Function: decoord 0, 0, AttrMap ld hl, wScratchAttrMap - call CutAndPasteAttrMap + call PadAttrMapForHDMATransfer decoord 0, 0 ld hl, wScratchTileMap - call CutAndPasteTilemap + call PadTilemapForHDMATransfer call DelayFrame di @@ -161,10 +161,10 @@ OpenAndCloseMenu_HDMATransferTileMapAndAttrMap:: ; 104110 ; Fill vBGTiles with " " decoord 0, 0, AttrMap ld hl, wScratchAttrMap - call CutAndPasteAttrMap + call PadAttrMapForHDMATransfer decoord 0, 0 ld hl, wScratchTileMap - call CutAndPasteTilemap + call PadTilemapForHDMATransfer call DelayFrame di @@ -194,11 +194,11 @@ Mobile_OpenAndCloseMenu_HDMATransferTileMapAndAttrMap: ; 104148 (41:4148) ; Fill vBGTiles with $ff decoord 0, 0, AttrMap ld hl, wScratchAttrMap - call CutAndPasteAttrMap + call PadAttrMapForHDMATransfer ld c, $ff decoord 0, 0 ld hl, wScratchTileMap - call CutAndPasteMap + call PadMapForHDMATransfer ld a, $1 ld [rVBK], a @@ -422,15 +422,16 @@ _LoadHDMAParameters: ; 10424e (41:424e) ld [rHDMA4], a ret -CutAndPasteTilemap: ; 10425f (41:425f) +PadTilemapForHDMATransfer: ; 10425f (41:425f) ld c, " " - jr CutAndPasteMap + jr PadMapForHDMATransfer -CutAndPasteAttrMap: ; 104263 (41:4263) +PadAttrMapForHDMATransfer: ; 104263 (41:4263) ld c, $0 -CutAndPasteMap: ; 104265 (41:4265) -; back up the value of c to hMapObjectIndexBuffer +PadMapForHDMATransfer: ; 104265 (41:4265) +; pad a 20x18 map to 32x18 for HDMA transfer +; back up the padding value in c to hMapObjectIndexBuffer ld a, [hMapObjectIndexBuffer] push af ld a, c @@ -449,7 +450,7 @@ CutAndPasteMap: ; 104265 (41:4265) dec b jr nz, .loop2 -; load the original value of c into hl 12 times +; load the original padding value of c into hl for 32 - 20 = 12 rows ld a, [hMapObjectIndexBuffer] ld b, BG_MAP_WIDTH - SCREEN_WIDTH .loop3 diff --git a/engine/evolution_animation.asm b/engine/evolution_animation.asm index e2713fceb..dd09f9eda 100755 --- a/engine/evolution_animation.asm +++ b/engine/evolution_animation.asm @@ -168,7 +168,7 @@ EvolutionAnimation: ; 4e5e1 ld a, $1 ld [wBoxAlignment], a ld de, VTiles2 - predef FrontpicPredef + predef GetAnimatedFrontpicPredef xor a ld [wBoxAlignment], a ret diff --git a/engine/pokedex.asm b/engine/pokedex.asm index eef9c707a..12b5b2cd6 100644 --- a/engine/pokedex.asm +++ b/engine/pokedex.asm @@ -2403,7 +2403,7 @@ Pokedex_LoadSelectedMonTiles: ; 4143b ld [CurPartySpecies], a call GetBaseData ld de, VTiles2 - predef GetFrontpic + predef GetMonFrontpic ret .QuestionMark: @@ -2556,7 +2556,7 @@ Pokedex_LoadUnownFrontpicTiles: ; 41a58 (10:5a58) ld [CurPartySpecies], a call GetBaseData ld de, VTiles2 tile $00 - predef GetFrontpic + predef GetMonFrontpic pop af ld [UnownLetter], a ret @@ -2586,7 +2586,7 @@ _NewPokedexEntry: ; 41a7f call WaitBGMap call GetBaseData ld de, VTiles2 - predef GetFrontpic + predef GetMonFrontpic ld a, SCGB_POKEDEX call Pokedex_GetSGBLayout ld a, [CurPartySpecies] diff --git a/engine/pokepic.asm b/engine/pokepic.asm index 2530ae4c9..ea5b3c300 100755 --- a/engine/pokepic.asm +++ b/engine/pokepic.asm @@ -12,7 +12,7 @@ Pokepic:: ; 244e3 ld [CurSpecies], a call GetBaseData ld de, VTiles1 - predef GetFrontpic + predef GetMonFrontpic ld a, [wMenuBorderTopCoord] inc a ld b, a diff --git a/engine/predef.asm b/engine/predef.asm index 73bc937a3..837f7b96b 100644 --- a/engine/predef.asm +++ b/engine/predef.asm @@ -54,8 +54,8 @@ PredefPointers:: ; 856b add_predef UpdateEnemyHUD add_predef StartBattle add_predef FillInExpBar - add_predef GetMonBackpic ; $18 - add_predef GetMonFrontpic + add_predef GetBattleMonBackpic ; $18 + add_predef GetEnemyMonFrontpic add_predef LearnLevelMoves add_predef FillMoves add_predef EvolveAfterBattle @@ -90,9 +90,9 @@ PredefPointers:: ; 856b add_predef Predef39 add_predef Predef3A add_predef PartyMonItemName - add_predef GetFrontpic - add_predef GetBackpic - add_predef FrontpicPredef + add_predef GetMonFrontpic + add_predef GetMonBackpic + add_predef GetAnimatedFrontpicPredef add_predef GetTrainerPic add_predef DecompressPredef ; $40 add_predef CheckTypeMatchup diff --git a/engine/stats_screen.asm b/engine/stats_screen.asm index 842e5ea2c..5f35d4d8b 100755 --- a/engine/stats_screen.asm +++ b/engine/stats_screen.asm @@ -866,7 +866,7 @@ StatsScreen_PlaceFrontpic: ; 4e226 (13:6226) ret c call StatsScreen_LoadTextBoxSpaceGFX ld de, VTiles2 tile $00 - predef FrontpicPredef + predef GetAnimatedFrontpicPredef hlcoord 0, 0 ld d, $0 ld e, ANIM_MON_MENU @@ -1071,7 +1071,7 @@ StatsScreen_AnimateEgg: ; 4e497 (13:6497) ld [wBoxAlignment], a call StatsScreen_LoadTextBoxSpaceGFX ld de, VTiles2 tile $00 - predef FrontpicPredef + predef GetAnimatedFrontpicPredef pop de hlcoord 0, 0 ld d, $0 diff --git a/engine/trade_animation.asm b/engine/trade_animation.asm index 2fc8df854..711ba4d19 100755 --- a/engine/trade_animation.asm +++ b/engine/trade_animation.asm @@ -877,7 +877,7 @@ TradeAnim_GetFrontpic: ; 29491 ld [CurSpecies], a call GetBaseData pop de - predef GetFrontpic + predef GetMonFrontpic ret ; 294a9 diff --git a/engine/trademon_frontpic.asm b/engine/trademon_frontpic.asm index bf1c2965c..3a38688d7 100644 --- a/engine/trademon_frontpic.asm +++ b/engine/trademon_frontpic.asm @@ -10,7 +10,7 @@ GetTrademonFrontpic: ; 4d7fd ld [CurSpecies], a call GetBaseData pop de - predef FrontpicPredef + predef GetAnimatedFrontpicPredef ret AnimateTrademonFrontpic: ; 4d81e diff --git a/event/halloffame.asm b/event/halloffame.asm index 986c49096..3fadb233a 100755 --- a/event/halloffame.asm +++ b/event/halloffame.asm @@ -250,7 +250,7 @@ AnimateHOFMonEntrance: ; 865b5 ld a, " " call ByteFill ld de, VTiles2 tile $31 - predef GetBackpic + predef GetMonBackpic ld a, $31 ld [hGraphicStartTile], a hlcoord 6, 6 diff --git a/event/print_unown.asm b/event/print_unown.asm index 5d3966585..7841a688b 100644 --- a/event/print_unown.asm +++ b/event/print_unown.asm @@ -140,7 +140,7 @@ UnownPrinter: ; 16be4 xor a ld [wBoxAlignment], a ld de, VTiles2 - predef GetFrontpic + predef GetMonFrontpic call .Load2bppToSRAM hlcoord 1, 6 xor a diff --git a/gfx/load_pics.asm b/gfx/load_pics.asm index 040a1d644..838fc5656 100755 --- a/gfx/load_pics.asm +++ b/gfx/load_pics.asm @@ -48,7 +48,7 @@ GetUnownLetter: ; 51040 ld [UnownLetter], a ret -GetFrontpic: ; 51077 +GetMonFrontpic: ; 51077 ld a, [CurPartySpecies] ld [CurSpecies], a call IsAPokemon @@ -60,7 +60,7 @@ GetFrontpic: ; 51077 ld [rSVBK], a ret -FrontpicPredef: ; 5108b +GetAnimatedFrontpicPredef: ; 5108b ld a, [CurPartySpecies] ld [CurSpecies], a call IsAPokemon @@ -195,7 +195,7 @@ LoadFrontpicTiles: ; 5114f jr nz, .loop ret -GetBackpic: ; 5116c +GetMonBackpic: ; 5116c ld a, [CurPartySpecies] call IsAPokemon ret c diff --git a/gfx/pics/animation.asm b/gfx/pics/animation.asm index eeaaa49ad..2b93ef749 100644 --- a/gfx/pics/animation.asm +++ b/gfx/pics/animation.asm @@ -1121,7 +1121,7 @@ HOF_AnimateFrontpic: ; d066e Predef 49 push bc push hl ld de, VTiles2 - predef FrontpicPredef + predef GetAnimatedFrontpicPredef pop hl pop bc ld d, 0 diff --git a/home.asm b/home.asm index 18c1ce300..b5ac0db58 100644 --- a/home.asm +++ b/home.asm @@ -1075,7 +1075,7 @@ _PrepMonFrontpic:: ; 378b push hl ld de, VTiles2 - predef GetFrontpic + predef GetMonFrontpic pop hl xor a ld [hGraphicStartTile], a diff --git a/main.asm b/main.asm index dbb838066..cbeebac07 100644 --- a/main.asm +++ b/main.asm @@ -197,13 +197,13 @@ _ReturnToBattle_UseBall: ; 2715c ld a, [BattleType] cp BATTLETYPE_TUTORIAL jr z, .gettutorialbackpic - farcall GetMonBackpic + farcall GetBattleMonBackpic jr .continue .gettutorialbackpic farcall GetTrainerBackpic .continue - farcall GetMonFrontpic + farcall GetEnemyMonFrontpic farcall _LoadBattleFontsHPBar call GetMemSGBLayout call CloseWindow diff --git a/mobile/mobile_42.asm b/mobile/mobile_42.asm index 6b9db7741..e551b5245 100644 --- a/mobile/mobile_42.asm +++ b/mobile/mobile_42.asm @@ -296,7 +296,7 @@ MobileTradeAnim_GetFrontpic: ; 1081e9 ld [CurSpecies], a call GetBaseData pop de - predef GetFrontpic + predef GetMonFrontpic ret ; 108201 @@ -309,7 +309,7 @@ Function108201: ; 108201 ld [CurSpecies], a call GetBaseData pop de - predef FrontpicPredef + predef GetAnimatedFrontpicPredef ret ; 108219