From 999c804f6f8de0be13d312af9165c99e005a25d1 Mon Sep 17 00:00:00 2001 From: pfero Date: Fri, 3 Nov 2017 01:09:27 +0100 Subject: [PATCH] Label some functions in gfx/load_pics.asm A few projects I looked around in used these same labels for these functions, and it looks like they describe these functions properly. Also fixed usage of BANK() in a few places. --- engine/stats_screen.asm | 2 +- gfx/load_pics.asm | 22 +++++++++++----------- gfx/pics/animation.asm | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/engine/stats_screen.asm b/engine/stats_screen.asm index 2412c0e13..6a59019f0 100755 --- a/engine/stats_screen.asm +++ b/engine/stats_screen.asm @@ -869,7 +869,7 @@ StatsScreen_PlaceFrontpic: ; 4e226 (13:6226) predef FrontpicPredef hlcoord 0, 0 ld d, $0 - ld e, $2 + ld e, ANIM_MON_MENU predef LoadMonAnimation ld hl, wcf64 set 6, [hl] diff --git a/gfx/load_pics.asm b/gfx/load_pics.asm index b66117de9..78e65dc81 100755 --- a/gfx/load_pics.asm +++ b/gfx/load_pics.asm @@ -70,7 +70,7 @@ FrontpicPredef: ; 5108b xor a ld [hBGMapMode], a call _GetFrontpic - call Function51103 + call GetAnimatedFrontpic pop af ld [rSVBK], a ret @@ -83,7 +83,7 @@ _GetFrontpic: ; 510a5 ld b, a push bc call GetFrontpicPointer - ld a, $6 + ld a, BANK(wDecompressScratch) ld [rSVBK], a ld a, b ld de, wDecompressScratch + $800 @@ -91,7 +91,7 @@ _GetFrontpic: ; 510a5 pop bc ld hl, wDecompressScratch ld de, wDecompressScratch + $800 - call Function512ab + call PadFrontpic pop hl push hl ld de, wDecompressScratch @@ -131,8 +131,8 @@ GLOBAL PicPointers, UnownPicPointers pop bc ret -Function51103: ; 51103 - ld a, $1 +GetAnimatedFrontpic: ; 51103 + ld a, BANK(VTiles3) ld [rVBK], a push hl ld de, wDecompressScratch @@ -144,7 +144,7 @@ Function51103: ; 51103 ld de, 7 * 7 tiles add hl, de push hl - ld a, $1 + ld a, BANK(BasePicSize) ld hl, BasePicSize call GetFarWRAMByte pop hl @@ -163,7 +163,7 @@ Function51103: ; 51103 push hl push bc - call Function5114f + call LoadFrontpicTiles pop bc pop hl ld de, wDecompressScratch @@ -174,7 +174,7 @@ Function51103: ; 51103 ld [rVBK], a ret -Function5114f: ; 5114f +LoadFrontpicTiles: ; 5114f ld hl, wDecompressScratch swap c ld a, c @@ -186,13 +186,13 @@ Function5114f: ; 5114f push bc call LoadFrontpic pop bc -.asm_51161 +.loop push bc ld c, $0 call LoadFrontpic pop bc dec b - jr nz, .asm_51161 + jr nz, .loop ret GetBackpic: ; 5116c @@ -413,7 +413,7 @@ FixBackpicAlignment: ; 5127c pop de ret -Function512ab: ; 512ab +PadFrontpic: ; 512ab ld a, b cp 6 jr z, .six diff --git a/gfx/pics/animation.asm b/gfx/pics/animation.asm index e26592fd7..aa32fbe94 100644 --- a/gfx/pics/animation.asm +++ b/gfx/pics/animation.asm @@ -123,7 +123,7 @@ LoadMonAnimation: ; d00a3 SetUpPokeAnim: ; d00b4 ld a, [rSVBK] push af - ld a, $2 + ld a, BANK(wPokeAnimSceneIndex) ld [rSVBK], a ld a, [wPokeAnimSceneIndex] ld c, a @@ -313,7 +313,7 @@ AnimateMon_CheckIfPokemon: ; d01c6 PokeAnim_InitPicAttributes: ; d01d6 ld a, [rSVBK] push af - ld a, $2 + ld a, BANK(wPokeAnimSceneIndex) ld [rSVBK], a push bc @@ -366,7 +366,7 @@ PokeAnim_InitPicAttributes: ; d01d6 PokeAnim_InitAnim: ; d0228 ld a, [rSVBK] push af - ld a, $2 + ld a, BANK(wPokeAnimExtraFlag) ld [rSVBK], a push bc ld hl, wPokeAnimExtraFlag @@ -1007,7 +1007,7 @@ GetMonAnimPointer: ; d055c PokeAnim_GetFrontpicDims: ; d05b4 ld a, [rSVBK] push af - ld a, $1 + ld a, BANK(CurPartySpecies) ld [rSVBK], a ld a, [CurPartySpecies] ld [CurSpecies], a