mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-09-09 09:51:34 -07:00
Use a macro for sine waves.
So far they're identical, but amplitude could change.
This commit is contained in:
parent
2a2b5d7f23
commit
ddc88bed4b
11
macros.asm
11
macros.asm
@ -191,3 +191,14 @@ ENDC
|
|||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
|
sine_wave: MACRO
|
||||||
|
; \1: amplitude
|
||||||
|
|
||||||
|
x = 0
|
||||||
|
rept $20
|
||||||
|
; Round up.
|
||||||
|
dw (sin(x) + (sin(x) & $ff)) >> 8
|
||||||
|
x = x + \1 * $40000
|
||||||
|
endr
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
27
main.asm
27
main.asm
@ -7722,11 +7722,7 @@ Function84ef: ; 84ef
|
|||||||
SineWave: ; 850b
|
SineWave: ; 850b
|
||||||
; A $20-word table representing a sine wave.
|
; A $20-word table representing a sine wave.
|
||||||
; 90 degrees is index $10 at a base amplitude of $100.
|
; 90 degrees is index $10 at a base amplitude of $100.
|
||||||
x set 0
|
sine_wave $100
|
||||||
rept $20
|
|
||||||
dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up
|
|
||||||
x set x + $100 * $40000
|
|
||||||
endr
|
|
||||||
; 854b
|
; 854b
|
||||||
|
|
||||||
|
|
||||||
@ -52516,12 +52512,7 @@ Function49b52: ; 49b52 (12:5b52)
|
|||||||
; 49b6e (12:5b6e)
|
; 49b6e (12:5b6e)
|
||||||
|
|
||||||
Unknown_49b6e: ; 49b6e
|
Unknown_49b6e: ; 49b6e
|
||||||
; Yet another sine wave.
|
sine_wave $100
|
||||||
x set 0
|
|
||||||
rept $20
|
|
||||||
dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up
|
|
||||||
x set x + $100 * $40000
|
|
||||||
endr
|
|
||||||
; 49bae
|
; 49bae
|
||||||
|
|
||||||
Function49bae: ; 49bae
|
Function49bae: ; 49bae
|
||||||
@ -75538,12 +75529,7 @@ Function8c70c: ; 8c70c (23:470c)
|
|||||||
; 8c728 (23:4728)
|
; 8c728 (23:4728)
|
||||||
|
|
||||||
Unknown_8c728: ; 8c728
|
Unknown_8c728: ; 8c728
|
||||||
; Another sine wave?
|
sine_wave $100
|
||||||
x set 0
|
|
||||||
rept $20
|
|
||||||
dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up
|
|
||||||
x set x + $100 * $40000
|
|
||||||
endr
|
|
||||||
; 8c768
|
; 8c768
|
||||||
|
|
||||||
; no known jump sources
|
; no known jump sources
|
||||||
@ -79367,12 +79353,7 @@ Function8e741: ; 8e741
|
|||||||
; 8e75d
|
; 8e75d
|
||||||
|
|
||||||
Unknown_8e75d: ; 8e75d
|
Unknown_8e75d: ; 8e75d
|
||||||
; A sine wave.
|
sine_wave $100
|
||||||
x set 0
|
|
||||||
rept $20
|
|
||||||
dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up
|
|
||||||
x set x + $100 * $40000
|
|
||||||
endr
|
|
||||||
|
|
||||||
|
|
||||||
Function8e79d: ; 8e79d
|
Function8e79d: ; 8e79d
|
||||||
|
Loading…
Reference in New Issue
Block a user