mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
split Sine/Cosine into engine/sine.asm
This commit is contained in:
parent
12e6ff3fc6
commit
23bb05851b
22
engine/sine.asm
Normal file
22
engine/sine.asm
Normal file
@ -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
|
||||
|
25
main.asm
25
main.asm
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user