aboutsummaryrefslogtreecommitdiffstats
path: root/macros/data.asm
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2022-10-02 22:42:26 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2022-10-02 22:42:26 -0400
commit7dd9d7dc80dcd57ce079d0f365257035e9df4614 (patch)
tree3807ecb72443ecf12feb4faa0e4d811bad279458 /macros/data.asm
parentMerge remote-tracking branch 'remotes/pokered/master' (diff)
parentRequire rgbds 0.6.0 (diff)
downloadpokeyellow-7dd9d7dc80dcd57ce079d0f365257035e9df4614.tar.gz
pokeyellow-7dd9d7dc80dcd57ce079d0f365257035e9df4614.tar.xz
pokeyellow-7dd9d7dc80dcd57ce079d0f365257035e9df4614.zip
Merge remote-tracking branch 'remotes/pokered/master'
Diffstat (limited to 'macros/data.asm')
-rw-r--r--macros/data.asm10
1 files changed, 4 insertions, 6 deletions
diff --git a/macros/data.asm b/macros/data.asm
index b7a16190..775b6adc 100644
--- a/macros/data.asm
+++ b/macros/data.asm
@@ -71,10 +71,8 @@ MACRO dab ; dwb address, bank
ENDM
MACRO sine_table
-; \1 samples of sin(x) from x=0 to x<32768 (pi radians)
- DEF x = 0
- REPT \1
- dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up
- DEF x += DIV(32768, \1) ; a circle has 65536 "degrees"
- ENDR
+; \1 samples of sin(x) from x=0 to x<0.5 turns (pi radians)
+ for x, \1
+ dw sin(x * 0.5 / (\1))
+ endr
ENDM