From d7970f749ac23786728926109be430ab732f19e6 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Tue, 2 Jan 2018 18:49:25 +0100 Subject: Consistent predef function names --- engine/battle_anims/anim_commands.asm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'engine/battle_anims/anim_commands.asm') diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index 27d57e68f..29bb3c215 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -1,6 +1,6 @@ ; Battle animation command interpreter. -PlayBattleAnim: ; cc0d6 +Predef_PlayBattleAnim: ; cc0d6 ld a, [rSVBK] push af @@ -167,7 +167,7 @@ BattleAnimRestoreHuds: ; cc1bb ld [rSVBK], a ld hl, UpdateBattleHuds - ld a, BANK(UpdatePlayerHUD) + ld a, BANK(Predef_UpdatePlayerHUD) rst FarCall ; Why not "call UpdateBattleHuds"? pop af @@ -929,18 +929,18 @@ BattleAnimCmd_Transform: ; cc5dc (33:45dc) ld a, [TempBattleMonSpecies] ; TempBattleMonSpecies ld [CurPartySpecies], a ; CurPartySpecies ld hl, BattleMonDVs ; BattleMonDVs - predef GetUnownLetter + predef Predef_GetUnownLetter ld de, vTiles0 tile $00 - predef GetMonFrontpic + predef Predef_GetMonFrontpic jr .done .player ld a, [TempEnemyMonSpecies] ; TempEnemyMonSpecies ld [CurPartySpecies], a ; CurPartySpecies ld hl, EnemyMonDVs ; EnemyMonDVs - predef GetUnownLetter + predef Predef_GetUnownLetter ld de, vTiles0 tile $00 - predef GetMonBackpic + predef Predef_GetMonBackpic .done pop af @@ -1156,16 +1156,16 @@ BattleAnimCmd_BeatUp: ; cc776 (33:4776) jr z, .player ld hl, BattleMonDVs - predef GetUnownLetter + predef Predef_GetUnownLetter ld de, vTiles2 tile $00 - predef GetMonFrontpic + predef Predef_GetMonFrontpic jr .done .player ld hl, EnemyMonDVs - predef GetUnownLetter + predef Predef_GetUnownLetter ld de, vTiles2 tile $31 - predef GetMonBackpic + predef Predef_GetMonBackpic .done pop af -- cgit v1.2.3 From b4e087167f3263342bbe01b5256f42fcf2d726af Mon Sep 17 00:00:00 2001 From: xCrystal Date: Tue, 2 Jan 2018 19:38:56 +0100 Subject: More unreferenced labels and unused text --- engine/battle_anims/anim_commands.asm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engine/battle_anims/anim_commands.asm') diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index 29bb3c215..50f412ce2 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -232,8 +232,7 @@ ClearActorHud: ; cc207 ret ; cc220 -Functioncc220: ; cc220 -; Appears to be unused. +Unreferenced_Functioncc220: ; cc220 xor a ld [hBGMapMode], a ld a, LOW(vBGMap0 tile $28) -- cgit v1.2.3 From 9d0ba6bfd3b2f10fae9969a784aa7b2b573e8411 Mon Sep 17 00:00:00 2001 From: Adelaide Walter Date: Wed, 3 Jan 2018 19:12:45 -0500 Subject: Use BANK for hardcoded WRAM banks (except where bankswitches appear unnecessary). --- engine/battle_anims/anim_commands.asm | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'engine/battle_anims/anim_commands.asm') diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index 27d57e68f..b91aa8c6c 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -5,7 +5,7 @@ PlayBattleAnim: ; cc0d6 ld a, [rSVBK] push af - ld a, 5 + ld a, BANK(ActiveAnimObjects) ld [rSVBK], a call _PlayBattleAnim @@ -163,7 +163,7 @@ BattleAnimRestoreHuds: ; cc1bb ld a, [rSVBK] push af - ld a, $1 + ld a, BANK(CurBattleMon) ; alternatively: BANK(TempMon), BANK(PartyMon1), several others ld [rSVBK], a ld hl, UpdateBattleHuds @@ -917,7 +917,7 @@ BattleAnimCmd_E7: ; cc5db (33:45db) BattleAnimCmd_Transform: ; cc5dc (33:45dc) ld a, [rSVBK] push af - ld a, 1 + ld a, BANK(CurPartySpecies) ld [rSVBK], a ld a, [CurPartySpecies] ; CurPartySpecies push af @@ -973,7 +973,7 @@ BattleAnimCmd_RaiseSub: ; cc640 (33:4640) ld a, [rSVBK] push af - ld a, 1 + ld a, 1 ; unnecessary bankswitch? ld [rSVBK], a xor a call GetSRAMBank @@ -1047,7 +1047,7 @@ GetSubstitutePic: ; cc64c BattleAnimCmd_MinimizeOpp: ; cc6cf (33:46cf) ld a, [rSVBK] push af - ld a, $1 + ld a, 1 ; unnecessary bankswitch? ld [rSVBK], a xor a call GetSRAMBank @@ -1103,7 +1103,7 @@ INCBIN "gfx/battle/minimize.2bpp" BattleAnimCmd_Minimize: ; cc735 (33:4735) ld a, [rSVBK] push af - ld a, $1 + ld a, 1 ; unnecessary bankswitch? ld [rSVBK], a xor a call GetSRAMBank @@ -1118,7 +1118,7 @@ BattleAnimCmd_Minimize: ; cc735 (33:4735) BattleAnimCmd_DropSub: ; cc750 (33:4750) ld a, [rSVBK] push af - ld a, $1 + ld a, BANK(CurPartySpecies) ld [rSVBK], a ld a, [CurPartySpecies] ; CurPartySpecies @@ -1143,7 +1143,7 @@ BattleAnimCmd_DropSub: ; cc750 (33:4750) BattleAnimCmd_BeatUp: ; cc776 (33:4776) ld a, [rSVBK] push af - ld a, $1 + ld a, BANK(CurPartySpecies) ld [rSVBK], a ld a, [CurPartySpecies] ; CurPartySpecies push af @@ -1254,7 +1254,7 @@ endr ld a, [rSVBK] push af - ld a, 1 + ld a, BANK(EnemyMon) ; BattleMon is in WRAM0, but EnemyMon is in WRAMX ld [rSVBK], a ld a, [hBattleTurn] @@ -1262,14 +1262,14 @@ endr jr nz, .enemy ld a, $f0 - ld [CryTracks], a ; CryTracks - ld a, [BattleMonSpecies] ; BattleMonSpecies + ld [CryTracks], a + ld a, [BattleMonSpecies] jr .done_cry_tracks .enemy ld a, $0f - ld [CryTracks], a ; CryTracks - ld a, [EnemyMonSpecies] ; EnemyMon + ld [CryTracks], a + ld a, [EnemyMonSpecies] .done_cry_tracks push hl @@ -1431,7 +1431,7 @@ BattleAnim_SetBGPals: ; cc91a ret z ld a, [rSVBK] push af - ld a, $5 + ld a, BANK(wBGPals1) ld [rSVBK], a ld hl, wBGPals2 ld de, wBGPals1 @@ -1459,7 +1459,7 @@ BattleAnim_SetOBPals: ; cc94b ret z ld a, [rSVBK] push af - ld a, $5 + ld a, BANK(wOBPals1) ld [rSVBK], a ld hl, wOBPals2 palette PAL_BATTLE_OB_GRAY ld de, wOBPals1 palette PAL_BATTLE_OB_GRAY -- cgit v1.2.3 From ce985a09a7802d90519997de032720e6c5eca6d0 Mon Sep 17 00:00:00 2001 From: Adelaide Walter Date: Thu, 4 Jan 2018 16:51:50 -0500 Subject: Document switches to BANK(sScratch) via xor a --- engine/battle_anims/anim_commands.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engine/battle_anims/anim_commands.asm') diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index b91aa8c6c..f3b2ee46d 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -975,7 +975,7 @@ BattleAnimCmd_RaiseSub: ; cc640 (33:4640) push af ld a, 1 ; unnecessary bankswitch? ld [rSVBK], a - xor a + xor a ; effectively ld a, BANK(sScratch) call GetSRAMBank GetSubstitutePic: ; cc64c @@ -1049,7 +1049,7 @@ BattleAnimCmd_MinimizeOpp: ; cc6cf (33:46cf) push af ld a, 1 ; unnecessary bankswitch? ld [rSVBK], a - xor a + xor a ; effectively ld a, BANK(sScratch) call GetSRAMBank call GetMinimizePic call Request2bpp @@ -1105,7 +1105,7 @@ BattleAnimCmd_Minimize: ; cc735 (33:4735) push af ld a, 1 ; unnecessary bankswitch? ld [rSVBK], a - xor a + xor a ; effectively ld a, BANK(sScratch) call GetSRAMBank call GetMinimizePic ld hl, vTiles0 tile $00 -- cgit v1.2.3 From 6c5cd7a963fb2b5eed109aeef25f041eabba0004 Mon Sep 17 00:00:00 2001 From: Adelaide Walter Date: Mon, 8 Jan 2018 23:07:46 -0500 Subject: Simplify comments per Rangi's rec. --- engine/battle_anims/anim_commands.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engine/battle_anims/anim_commands.asm') diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index f3b2ee46d..16c101301 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -975,7 +975,7 @@ BattleAnimCmd_RaiseSub: ; cc640 (33:4640) push af ld a, 1 ; unnecessary bankswitch? ld [rSVBK], a - xor a ; effectively ld a, BANK(sScratch) + xor a ; sScratch call GetSRAMBank GetSubstitutePic: ; cc64c @@ -1049,7 +1049,7 @@ BattleAnimCmd_MinimizeOpp: ; cc6cf (33:46cf) push af ld a, 1 ; unnecessary bankswitch? ld [rSVBK], a - xor a ; effectively ld a, BANK(sScratch) + xor a ; sScratch call GetSRAMBank call GetMinimizePic call Request2bpp @@ -1105,7 +1105,7 @@ BattleAnimCmd_Minimize: ; cc735 (33:4735) push af ld a, 1 ; unnecessary bankswitch? ld [rSVBK], a - xor a ; effectively ld a, BANK(sScratch) + xor a ; sScratch call GetSRAMBank call GetMinimizePic ld hl, vTiles0 tile $00 -- cgit v1.2.3 From 417937cffc2a7c3cfac49f3b00caf1a856d0a925 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Wed, 10 Jan 2018 13:47:57 -0500 Subject: Resolve #461 --- engine/battle_anims/anim_commands.asm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engine/battle_anims/anim_commands.asm') diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index 27d57e68f..b81911a88 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -258,15 +258,15 @@ BattleAnim_ClearCGB_OAMFlags: ; cc23d bit 3, a jr z, .delete - ld hl, Sprites + 3 - ld c, (SpritesEnd - Sprites) / 4 + ld hl, Sprite01Attributes + ld c, NUM_SPRITE_OAM_STRUCTS .loop ld a, [hl] and $f0 ld [hli], a +rept SPRITEOAMSTRUCT_LENGTH +- 1 inc hl - inc hl - inc hl +endr dec c jr nz, .loop ret -- cgit v1.2.3 From 94d6a327218fc56753238b424df208245092d96c Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Thu, 11 Jan 2018 12:00:01 -0500 Subject: Use maskbits some more --- engine/battle_anims/anim_commands.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/battle_anims/anim_commands.asm') diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index b81911a88..2d5a53aa0 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -1207,7 +1207,7 @@ BattleAnimCmd_Sound: ; cc7cd (33:47cd) srl a ld [wSFXDuration], a call .GetCryTrack - and 3 + maskbits NUM_NOISE_CHANS +- 1 ld [CryTracks], a ; CryTracks ld e, a @@ -1244,7 +1244,7 @@ BattleAnimCmd_Sound: ; cc7cd (33:47cd) BattleAnimCmd_Cry: ; cc807 (33:4807) call GetBattleAnimByte - and 3 + maskbits NUM_NOISE_CHANS +- 1 ld e, a ld d, 0 ld hl, .CryData -- cgit v1.2.3 From 7a09fc9f750aec50dd568226083b279004ffe155 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Sun, 14 Jan 2018 19:43:35 -0500 Subject: GFX tile sizes in decimal --- engine/battle_anims/anim_commands.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/battle_anims/anim_commands.asm') diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index 2d5a53aa0..fde4d2969 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -1077,7 +1077,7 @@ GetMinimizePic: ; cc6e7 (33:46e7) call CopyMinimizePic ld hl, vTiles2 tile $00 ld de, sScratch - lb bc, BANK(GetMinimizePic), $31 + lb bc, BANK(GetMinimizePic), 7 * 7 ret .player @@ -1085,7 +1085,7 @@ GetMinimizePic: ; cc6e7 (33:46e7) call CopyMinimizePic ld hl, vTiles2 tile $31 ld de, sScratch - lb bc, BANK(GetMinimizePic), $24 + lb bc, BANK(GetMinimizePic), 6 * 6 ret CopyMinimizePic: ; cc719 (33:4719) -- cgit v1.2.3 From 80480821142d7a7b16dd2b1a98a213e7b389af0f Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Tue, 16 Jan 2018 14:30:10 -0500 Subject: Remove Predef_ prefix from routines listed in PredefPointers --- engine/battle_anims/anim_commands.asm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'engine/battle_anims/anim_commands.asm') diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index ee13fbd96..d19e7210a 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -1,6 +1,6 @@ ; Battle animation command interpreter. -Predef_PlayBattleAnim: ; cc0d6 +PlayBattleAnim: ; cc0d6 ld a, [rSVBK] push af @@ -167,7 +167,7 @@ BattleAnimRestoreHuds: ; cc1bb ld [rSVBK], a ld hl, UpdateBattleHuds - ld a, BANK(Predef_UpdatePlayerHUD) + ld a, BANK(UpdatePlayerHUD) rst FarCall ; Why not "call UpdateBattleHuds"? pop af @@ -928,18 +928,18 @@ BattleAnimCmd_Transform: ; cc5dc (33:45dc) ld a, [TempBattleMonSpecies] ; TempBattleMonSpecies ld [CurPartySpecies], a ; CurPartySpecies ld hl, BattleMonDVs ; BattleMonDVs - predef Predef_GetUnownLetter + predef GetUnownLetter ld de, vTiles0 tile $00 - predef Predef_GetMonFrontpic + predef GetMonFrontpic jr .done .player ld a, [TempEnemyMonSpecies] ; TempEnemyMonSpecies ld [CurPartySpecies], a ; CurPartySpecies ld hl, EnemyMonDVs ; EnemyMonDVs - predef Predef_GetUnownLetter + predef GetUnownLetter ld de, vTiles0 tile $00 - predef Predef_GetMonBackpic + predef GetMonBackpic .done pop af @@ -1155,16 +1155,16 @@ BattleAnimCmd_BeatUp: ; cc776 (33:4776) jr z, .player ld hl, BattleMonDVs - predef Predef_GetUnownLetter + predef GetUnownLetter ld de, vTiles2 tile $00 - predef Predef_GetMonFrontpic + predef GetMonFrontpic jr .done .player ld hl, EnemyMonDVs - predef Predef_GetUnownLetter + predef GetUnownLetter ld de, vTiles2 tile $31 - predef Predef_GetMonBackpic + predef GetMonBackpic .done pop af -- cgit v1.2.3 From 7b3de85a06e81d14ac0c73e8f9e1ab8e4a474beb Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Tue, 16 Jan 2018 17:27:50 -0500 Subject: Avoid "+- 1" at every maskbits --- engine/battle_anims/anim_commands.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/battle_anims/anim_commands.asm') diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index d19e7210a..07ab82d95 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -1206,7 +1206,7 @@ BattleAnimCmd_Sound: ; cc7cd (33:47cd) srl a ld [wSFXDuration], a call .GetCryTrack - maskbits NUM_NOISE_CHANS +- 1 + maskbits NUM_NOISE_CHANS ld [CryTracks], a ; CryTracks ld e, a @@ -1243,7 +1243,7 @@ BattleAnimCmd_Sound: ; cc7cd (33:47cd) BattleAnimCmd_Cry: ; cc807 (33:4807) call GetBattleAnimByte - maskbits NUM_NOISE_CHANS +- 1 + maskbits NUM_NOISE_CHANS ld e, a ld d, 0 ld hl, .CryData -- cgit v1.2.3 From 6d20cf3e80780af15ed15acea2f7feac1ffd9705 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Tue, 16 Jan 2018 23:47:45 -0500 Subject: =?UTF-8?q?"CryHeader"=20=E2=86=92=20"Cry";=20"Cry"=20=E2=86=92=20?= =?UTF-8?q?"MonCry"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- engine/battle_anims/anim_commands.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/battle_anims/anim_commands.asm') diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index 07ab82d95..0bbedf909 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -1272,7 +1272,7 @@ endr .done_cry_tracks push hl - call LoadCryHeader + call LoadCry pop hl jr c, .done @@ -1309,7 +1309,7 @@ endr ld a, 1 ld [wStereoPanningMask], a - callfar _PlayCryHeader + callfar _PlayCry .done pop af -- cgit v1.2.3