ref: 23bb05851b0f71ca7cf9277d46f09e799986350d
parent: 12e6ff3fc6e6dcef94e87a8d500ab0e2fc5b9e5c
author: yenatch <[email protected]>
date: Tue Sep 3 14:40:12 EDT 2013
split Sine/Cosine into engine/sine.asm
--- /dev/null
+++ b/engine/sine.asm
@@ -1,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
+
--- a/main.asm
+++ b/main.asm
@@ -29,30 +29,7 @@
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