Getting started with battle anims; sine and cosine

This commit is contained in:
PikalaxALT
2015-12-04 14:33:29 -05:00
parent 5b94d54a6c
commit 81ea723b04
8 changed files with 1048 additions and 847 deletions

View File

@@ -2230,24 +2230,24 @@ _Sine:: ; 84d9
cp %100000
jr nc, .negative
call Function84ef
call .ApplySineWave
ld a, h
ret
.negative
and %011111
call Function84ef
call .ApplySineWave
ld a, h
xor -1
inc a
ret
; 84ef
Function84ef: ; 84ef
.ApplySineWave: ; 84ef
ld e, a
ld a, d
ld d, 0
ld hl, SineWave
ld hl, .sinewave
rept 2
add hl, de
endr
@@ -2269,7 +2269,7 @@ endr
ret
; 850b
SineWave: ; 850b
.sinewave: ; 850b
; A $20-word table representing a sine wave.
; 90 degrees is index $10 at a base amplitude of $100.
sine_wave $100