diff options
Diffstat (limited to 'engine/sine.asm')
-rw-r--r-- | engine/sine.asm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/engine/sine.asm b/engine/sine.asm new file mode 100644 index 000000000..09d06ca89 --- /dev/null +++ b/engine/sine.asm @@ -0,0 +1,22 @@ +Cosine: ; 1b0f +; Return d * cos(a) in hl + add $10 ; 90 degrees + +Sine: ; 1b11 +; Return d * sin(a) in hl +; a is a signed 6-bit value. + + ld e, a + + ld a, [hROMBank] + push af + ld a, BANK(_Sine) + rst Bankswitch + + call _Sine + + pop af + rst Bankswitch + ret +; 1b1e + |