mirror of
https://github.com/pret/pokegold.git
synced 2026-10-01 11:26:43 -05:00
Use pokecrystal's sine_table macro
A circle has 65536 "degrees", so 32768 "degrees" = pi radians = half a circle
This commit is contained in:
@@ -669,10 +669,7 @@ WipeLYOverrides:
|
||||
ret
|
||||
|
||||
StartTrainerBattle_DrawSineWave:
|
||||
calc_sine_wave .SineWave
|
||||
|
||||
.SineWave:
|
||||
sine_table 256
|
||||
calc_sine_wave
|
||||
|
||||
StartTrainerBattle_ZoomToBlack:
|
||||
farcall Function55a1
|
||||
|
||||
@@ -4151,4 +4151,4 @@ BattleAnim_AbsCosinePrecise:
|
||||
ret
|
||||
|
||||
BattleAnimSineWave:
|
||||
sine_table 256
|
||||
sine_table 32
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user