summaryrefslogtreecommitdiff
path: root/engine/battle/battle_transition.asm
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-02-03 21:11:55 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2018-02-03 21:11:55 -0500
commit73ea7c6326f16f84de1cf74193705328d1664645 (patch)
tree31c6e407dd73df136f34c7945c8198afb2746f0a /engine/battle/battle_transition.asm
parent271aa20b73f699819351e787c58d0d14694eb135 (diff)
Macro factors out sine code, just like sine data, since it's used 5 times
Diffstat (limited to 'engine/battle/battle_transition.asm')
-rw-r--r--engine/battle/battle_transition.asm42
1 files changed, 1 insertions, 41 deletions
diff --git a/engine/battle/battle_transition.asm b/engine/battle/battle_transition.asm
index e331cf3ee..1de84421d 100644
--- a/engine/battle/battle_transition.asm
+++ b/engine/battle/battle_transition.asm
@@ -749,47 +749,7 @@ WipeLYOverrides: ; 8c6d8
StartTrainerBattle_DrawSineWave: ; 8c6f7 (23:46f7)
-; a = d * sin(a * pi/32)
- and %111111
- cp %100000
- jr nc, .negative
- call .ApplySineWave
- ld a, h
- ret
-
-.negative
- and %011111
- call .ApplySineWave
- ld a, h
- xor $ff
- inc a
- ret
-
-.ApplySineWave: ; 8c70c (23:470c)
- ld e, a
- ld a, d
- ld d, 0
- ld hl, .sinewave
- add hl, de
- add hl, de
- ld e, [hl]
- inc hl
- ld d, [hl]
- ld hl, 0
-.multiply
- srl a
- jr nc, .even
- add hl, de
-.even
- sla e
- rl d
- and a
- jr nz, .multiply
- ret
-; 8c728 (23:4728)
-
-.sinewave ; 8c728
- sine_wave 32
+ calc_sine_wave
; 8c768
StartTrainerBattle_ZoomToBlack: ; 8c768 (23:4768)