Use pokecrystal's sine_table macro

This commit is contained in:
Rangi
2021-04-18 15:51:07 -04:00
parent 7d66719468
commit 3a97ec326c
4 changed files with 7 additions and 7 deletions

View File

@@ -2740,7 +2740,7 @@ SurfingPikachu_Sine: ; sine
ret
.SineWave:
sine_wave $100
sine_table 32
SurfingPikachuSpawnStateDataPointer:
db $00, $00, $00 ; 0

View File

@@ -1077,7 +1077,7 @@ Func_fa08e:
ret
Unkn_fa0aa:
sine_wave $100
sine_table 32
INCLUDE "data/sprite_anims/intro_frames.asm"
INCLUDE "data/sprite_anims/intro_oam.asm"

View File

@@ -1045,4 +1045,4 @@ GetSine:
ret
SineWave_3f:
sine_wave $100
sine_table 32

View File

@@ -69,11 +69,11 @@ dbbw: MACRO
dw \3
ENDM
sine_wave: MACRO
; \1: amplitude
sine_table: MACRO
; \1 samples of sin(x) from x=0 to x<32768 (pi radians)
x = 0
REPT $20
REPT \1
dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up
x = x + (\1) * $40000
x = x + DIV(32768, \1) ; a circle has 65536 "degrees"
ENDR
ENDM