summaryrefslogtreecommitdiff
path: root/engine/events
diff options
context:
space:
mode:
authorRemy Oukaour <remy.oukaour@gmail.com>2018-01-09 16:39:36 -0500
committerRemy Oukaour <remy.oukaour@gmail.com>2018-01-09 16:39:36 -0500
commit11556196ba546f5c45b97fffc2c263a79eb639b9 (patch)
treebff73d91ac9caba31703b4671db1f0d59524fa3f /engine/events
parenta849c3557b8ee3dd2b464ccdc646aebd33d7b2a7 (diff)
Consistent sine wave code formatting
Diffstat (limited to 'engine/events')
-rwxr-xr-xengine/events/celebi.asm19
1 files changed, 9 insertions, 10 deletions
diff --git a/engine/events/celebi.asm b/engine/events/celebi.asm
index 1139ad3d5..22f8f00a4 100755
--- a/engine/events/celebi.asm
+++ b/engine/events/celebi.asm
@@ -238,27 +238,27 @@ UpdateCelebiPosition: ; 49aa2 (12:5aa2)
CelebiEvent_Cosine: ; 49b3b (12:5b3b)
- add $10
- and $3f
- cp $20
+; a = d * cos(a * pi/32)
+ add %010000
+ and %111111
+ cp %100000
jr nc, .negative
- call .SineFunction
+ call .ApplySineWave
ld a, h
ret
.negative
- and $1f
- call .SineFunction
+ and %011111
+ call .ApplySineWave
ld a, h
xor $ff
inc a
ret
-
-.SineFunction: ; 49b52 (12:5b52)
+.ApplySineWave: ; 49b52 (12:5b52)
ld e, a
ld a, d
- ld d, $0
+ ld d, 0
ld hl, .sinewave
add hl, de
add hl, de
@@ -276,7 +276,6 @@ CelebiEvent_Cosine: ; 49b3b (12:5b3b)
and a
jr nz, .multiply
ret
-
; 49b6e (12:5b6e)
.sinewave ; 49b6e