diff options
author | yenatch <yenatch@gmail.com> | 2013-09-03 18:40:12 -0400 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2013-09-03 18:40:12 -0400 |
commit | 23bb05851b0f71ca7cf9277d46f09e799986350d (patch) | |
tree | 745dfd252ba6000be7d9990d59c5ba4503761aee | |
parent | 12e6ff3fc6e6dcef94e87a8d500ab0e2fc5b9e5c (diff) |
split Sine/Cosine into engine/sine.asm
-rw-r--r-- | engine/sine.asm | 22 | ||||
-rw-r--r-- | main.asm | 25 |
2 files changed, 23 insertions, 24 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 + @@ -29,30 +29,7 @@ INCLUDE "engine/copy.asm" INCLUDE "engine/text.asm" INCLUDE "engine/video.asm" INCLUDE "engine/map_objects.asm" - - -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 - +INCLUDE "engine/sine.asm" Function1b1e: ; 1b1e ld [$d003], a |