summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/battle/battle_transition.asm2
-rwxr-xr-xengine/battle_anims/functions.asm2
-rwxr-xr-xengine/events/celebi.asm2
-rwxr-xr-xengine/routines/sine.asm2
-rwxr-xr-xengine/sprites.asm2
-rw-r--r--macros/data.asm34
6 files changed, 21 insertions, 23 deletions
diff --git a/engine/battle/battle_transition.asm b/engine/battle/battle_transition.asm
index 452339e81..0c2f7e8cc 100644
--- a/engine/battle/battle_transition.asm
+++ b/engine/battle/battle_transition.asm
@@ -789,7 +789,7 @@ StartTrainerBattle_DrawSineWave: ; 8c6f7 (23:46f7)
; 8c728 (23:4728)
.sinewave ; 8c728
- sine_wave $100
+ sine_wave 32
; 8c768
StartTrainerBattle_ZoomToBlack: ; 8c768 (23:4768)
diff --git a/engine/battle_anims/functions.asm b/engine/battle_anims/functions.asm
index 817df4967..25d1a50c4 100755
--- a/engine/battle_anims/functions.asm
+++ b/engine/battle_anims/functions.asm
@@ -4157,5 +4157,5 @@ BattleAnim_AbsCosinePrecise: ; ce778
; ce77f
BattleAnimSineWave: ; ce77f
- sine_wave $100
+ sine_wave 32
; ce7bf
diff --git a/engine/events/celebi.asm b/engine/events/celebi.asm
index 4d60a7d99..f6cedd074 100755
--- a/engine/events/celebi.asm
+++ b/engine/events/celebi.asm
@@ -281,7 +281,7 @@ CelebiEvent_Cosine: ; 49b3b (12:5b3b)
; 49b6e (12:5b6e)
.sinewave ; 49b6e
- sine_wave $100
+ sine_wave 32
; 49bae
GetCelebiSpriteTile: ; 49bae
diff --git a/engine/routines/sine.asm b/engine/routines/sine.asm
index 5f56a10a8..8c5ec6347 100755
--- a/engine/routines/sine.asm
+++ b/engine/routines/sine.asm
@@ -45,4 +45,4 @@ _Sine:: ; 84d9
.sinewave ; 850b
; A $20-word table representing a sine wave.
; 90 degrees is index $10 at a base amplitude of $100.
- sine_wave $100
+ sine_wave 32
diff --git a/engine/sprites.asm b/engine/sprites.asm
index 09f6ae89a..60efe1b13 100755
--- a/engine/sprites.asm
+++ b/engine/sprites.asm
@@ -620,7 +620,7 @@ Sprites_Sine: ; 8e72c
; 8e75d
.sinewave ; 8e75d
- sine_wave $100
+ sine_wave 32
AnimateEndOfExpBar: ; 8e79d
diff --git a/macros/data.asm b/macros/data.asm
index d0e93d73f..1806f5f59 100644
--- a/macros/data.asm
+++ b/macros/data.asm
@@ -31,29 +31,29 @@ dbwww: MACRO
ENDM
dn: MACRO ; nybbles
- rept _NARG / 2
+rept _NARG / 2
db ((\1) << 4) | (\2)
shift
shift
- endr
+endr
ENDM
dc: MACRO ; "crumbs"
- rept _NARG / 4
+rept _NARG / 4
db ((\1) << 6) | ((\2) << 4) | ((\3) << 2) | (\4)
shift
shift
shift
shift
- endr
+endr
ENDM
dx: MACRO
x = 8 * ((\1) - 1)
- rept \1
+rept \1
db ((\2) >> x) & $ff
x = x + -8
- endr
+endr
ENDM
dt: MACRO ; three-byte (big-endian)
@@ -69,17 +69,17 @@ bigdw: MACRO ; big-endian word
ENDM
dba: MACRO ; dbw bank, address
- rept _NARG
+rept _NARG
dbw BANK(\1), \1
shift
- endr
+endr
ENDM
dab: MACRO ; dwb address, bank
- rept _NARG
+rept _NARG
dwb \1, BANK(\1)
shift
- endr
+endr
ENDM
dba_pic: MACRO ; dbw bank, address
@@ -112,19 +112,17 @@ ENDM
sine_wave: MACRO
-; \1: amplitude
x = 0
- rept $20
- ; Round up.
- dw (sin(x) + (sin(x) & $ff)) >> 8
-x = x + (\1) * $40000
- endr
+rept \1
+ dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up
+x = x + (32768.0 / \1) ; a circle has 65536.0 "degrees"
+endr
ENDM
bcd: MACRO
- rept _NARG
+rept _NARG
dn ((\1) % 100) / 10, (\1) % 10
shift
- endr
+endr
ENDM