summaryrefslogtreecommitdiff
path: root/engine/math/sine.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/math/sine.asm')
-rw-r--r--engine/math/sine.asm39
1 files changed, 3 insertions, 36 deletions
diff --git a/engine/math/sine.asm b/engine/math/sine.asm
index e22d785a..5db3bd60 100644
--- a/engine/math/sine.asm
+++ b/engine/math/sine.asm
@@ -1,40 +1,7 @@
-_Sine:: ; 8ac9 (2:4ac9)
+_Sine::
+; a = d * sin(e * pi/256)
ld a, e
- and $3f
- cp $20
- jr nc, .negative
- call .GetSine
- ld a, h
- ret
-.negative
- and $1f
- call .GetSine
- ld a, h
- xor $ff
- inc a
- ret
-
-.GetSine: ; 8adf (2:4adf)
- 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
-.loop
- srl a
- jr nc, .no_add
- add hl, de
-.no_add
- sla e
- rl d
- and a
- jr nz, .loop
- ret
+ calc_sine_wave .SineWave
.SineWave:
sine_table $100