sine_wave macro parameterizes table size, not frequency ("amplitude" was an incorrect comment)
This commit is contained in:
@@ -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)
|
||||
|
@@ -4157,5 +4157,5 @@ BattleAnim_AbsCosinePrecise: ; ce778
|
||||
|
||||
; ce77f
|
||||
BattleAnimSineWave: ; ce77f
|
||||
sine_wave $100
|
||||
sine_wave 32
|
||||
; ce7bf
|
||||
|
@@ -281,7 +281,7 @@ CelebiEvent_Cosine: ; 49b3b (12:5b3b)
|
||||
; 49b6e (12:5b6e)
|
||||
|
||||
.sinewave ; 49b6e
|
||||
sine_wave $100
|
||||
sine_wave 32
|
||||
; 49bae
|
||||
|
||||
GetCelebiSpriteTile: ; 49bae
|
||||
|
@@ -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
|
||||
|
@@ -620,7 +620,7 @@ Sprites_Sine: ; 8e72c
|
||||
; 8e75d
|
||||
|
||||
.sinewave ; 8e75d
|
||||
sine_wave $100
|
||||
sine_wave 32
|
||||
|
||||
|
||||
AnimateEndOfExpBar: ; 8e79d
|
||||
|
@@ -112,12 +112,10 @@ ENDM
|
||||
|
||||
|
||||
sine_wave: MACRO
|
||||
; \1: amplitude
|
||||
x = 0
|
||||
rept $20
|
||||
; Round up.
|
||||
dw (sin(x) + (sin(x) & $ff)) >> 8
|
||||
x = x + (\1) * $40000
|
||||
rept \1
|
||||
dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up
|
||||
x = x + (32768.0 / \1) ; a circle has 65536.0 "degrees"
|
||||
endr
|
||||
ENDM
|
||||
|
||||
|
Reference in New Issue
Block a user