diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-06-15 12:12:05 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-06-15 12:12:05 -0400 |
commit | 6bc203541bbced1e237b5e27db7ab42739b65655 (patch) | |
tree | 1f0118e19711ebe3ce6e4f32c4a8a7bc8df5b27d /macros | |
parent | 9048adc08a9ba6ec2a3d2bfe14733749b5ee23f3 (diff) |
Use pokecrystal's sine_table macro
A circle has 65536 "degrees", so 32768 "degrees" = pi radians = half a circle
Diffstat (limited to 'macros')
-rw-r--r-- | macros/data.asm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/macros/data.asm b/macros/data.asm index 5b9614fe..36854d79 100644 --- a/macros/data.asm +++ b/macros/data.asm @@ -124,10 +124,10 @@ endr ENDM sine_table: MACRO -; \1: amplitude +; \1 samples of sin(x) from x=0 to x<32768 (pi radians) x = 0 -rept 32 +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 |