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.asm16
-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, 17 insertions, 16 deletions
diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm
index 50f412ce2..132dd24a5 100644
--- a/engine/battle_anims/anim_commands.asm
+++ b/engine/battle_anims/anim_commands.asm
@@ -257,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
@@ -1076,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
@@ -1084,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)
@@ -1206,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
@@ -1243,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 bb8feb1f9..f63257df7 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 ea9fb70b3..4b77cd77c 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