diff options
-rw-r--r-- | engine/battle/battle_transition.asm | 5 | ||||
-rw-r--r-- | engine/battle_anims/functions.asm | 2 | ||||
-rw-r--r-- | engine/gfx/sprites.asm | 5 | ||||
-rw-r--r-- | engine/math/sine.asm | 7 | ||||
-rw-r--r-- | macros/data.asm | 6 |
5 files changed, 8 insertions, 17 deletions
diff --git a/engine/battle/battle_transition.asm b/engine/battle/battle_transition.asm index ad4b359c..21d332fe 100644 --- a/engine/battle/battle_transition.asm +++ b/engine/battle/battle_transition.asm @@ -669,10 +669,7 @@ WipeLYOverrides: ret StartTrainerBattle_DrawSineWave: - calc_sine_wave .SineWave - -.SineWave: - sine_table 256 + calc_sine_wave StartTrainerBattle_ZoomToBlack: farcall Function55a1 diff --git a/engine/battle_anims/functions.asm b/engine/battle_anims/functions.asm index e7bd9beb..94c90749 100644 --- a/engine/battle_anims/functions.asm +++ b/engine/battle_anims/functions.asm @@ -4151,4 +4151,4 @@ BattleAnim_AbsCosinePrecise: ret BattleAnimSineWave: - sine_table 256 + sine_table 32 diff --git a/engine/gfx/sprites.asm b/engine/gfx/sprites.asm index 824ceac4..2e671002 100644 --- a/engine/gfx/sprites.asm +++ b/engine/gfx/sprites.asm @@ -545,10 +545,7 @@ Sprites_Cosine: ; fallthrough Sprites_Sine: ; a = d * sin(a * pi/32) - calc_sine_wave .SineWave - -.SineWave: - sine_table 256 + calc_sine_wave AnimateEndOfExpBar: ldh a, [hSGB] diff --git a/engine/math/sine.asm b/engine/math/sine.asm index 5db3bd60..c7422aaf 100644 --- a/engine/math/sine.asm +++ b/engine/math/sine.asm @@ -1,7 +1,4 @@ _Sine:: -; a = d * sin(e * pi/256) +; a = d * sin(e * pi/32) ld a, e - calc_sine_wave .SineWave - -.SineWave: - sine_table $100 + calc_sine_wave 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 |