summaryrefslogtreecommitdiff
path: root/engine/battle_anims
diff options
context:
space:
mode:
Diffstat (limited to 'engine/battle_anims')
-rw-r--r--engine/battle_anims/anim_commands.asm39
-rw-r--r--engine/battle_anims/bg_effects.asm4
-rwxr-xr-xengine/battle_anims/core.asm (renamed from engine/battle_anims/engine.asm)0
-rwxr-xr-xengine/battle_anims/functions.asm13
4 files changed, 28 insertions, 28 deletions
diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm
index 16c101301..ee13fbd96 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
@@ -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)
@@ -258,15 +257,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
@@ -929,18 +928,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
@@ -1077,7 +1076,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 +1084,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)
@@ -1156,16 +1155,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
@@ -1207,7 +1206,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 +1243,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
diff --git a/engine/battle_anims/bg_effects.asm b/engine/battle_anims/bg_effects.asm
index 3dd6e7785..a7c2012e5 100644
--- a/engine/battle_anims/bg_effects.asm
+++ b/engine/battle_anims/bg_effects.asm
@@ -506,13 +506,13 @@ BattleBGEffect_HeadFollow: ; c8281 (32:4281)
push bc
call BGEffect_CheckBattleTurn
jr nz, .player_turn
- ld a, ANIM_OBJ_BA
+ ld a, ANIM_OBJ_PLAYERHEADFOLLOW
ld [wBattleAnimTemp0], a
ld a, 16 * 8 + 4
jr .okay
.player_turn
- ld a, ANIM_OBJ_BB
+ ld a, ANIM_OBJ_ENEMYHEADFOLLOW
ld [wBattleAnimTemp0], a
ld a, 6 * 8
.okay
diff --git a/engine/battle_anims/engine.asm b/engine/battle_anims/core.asm
index 55adeae8c..55adeae8c 100755
--- a/engine/battle_anims/engine.asm
+++ b/engine/battle_anims/core.asm
diff --git a/engine/battle_anims/functions.asm b/engine/battle_anims/functions.asm
index 1a66ed51d..5e85ffdb0 100755
--- a/engine/battle_anims/functions.asm
+++ b/engine/battle_anims/functions.asm
@@ -4083,18 +4083,19 @@ BattleAnim_IncAnonJumptableIndex: ; ce72c (33:672c)
ret
BattleAnim_Cosine: ; ce732 (33:6732)
- add $10
+; a = d * cos(a * pi/32)
+ add %010000
BattleAnim_Sine: ; ce734 (33:6734)
-; a = d sin a
- and $3f
- cp $20
+; a = d * sin(a * pi/32)
+ and %111111
+ cp %100000
jr nc, .negative
call .ApplySineWave
ld a, h
ret
.negative
- and $1f
+ and %011111
call .ApplySineWave
ld a, h
xor $ff
@@ -4111,7 +4112,7 @@ BattleAnim_Sine: ; ce734 (33:6734)
ld e, [hl]
inc hl
ld d, [hl]
- ld hl, $0
+ ld hl, 0
.multiply
srl a
jr nc, .even