sound.asm
list p=18f452
#include p18f452.inc
#define TMR0_RELOAD 0xEA
#define TMR1_RELOAD_H 0xD9
#define TMR1_RELOAD_L 0x04
#define F60HZ Flags, 0
var_g1 UDATA_ACS 0x0
temp0 res 1
temp1 res 1
galTemp res 1
Flags res 1 hCount res 1
gType res 1
gVol res 1
GLOBAL temp0, temp1, gType, gVol, hCount, Flags
var_g2 UDATA_ACS 0x8
v0_hFreq_L res 1 v0_hAcc_L res 1
v0_hFreq_M res 1
v0_hAcc_M res 1
v0_hFreq_H res 1
v0_hAcc_H res 1
v0_hWaveSel res 1
v0_hVol res 1
v1_hFreq_L res 1 v1_hAcc_L res 1
v1_hFreq_M res 1
v1_hAcc_M res 1
v1_hFreq_H res 1
v1_hAcc_H res 1
v1_hWaveSel res 1
v1_hVol res 1
v2_hFreq_L res 1 v2_hAcc_L res 1
v2_hFreq_M res 1
v2_hAcc_M res 1
v2_hFreq_H res 1
v2_hAcc_H res 1
v2_hWaveSel res 1
v2_hVol res 1
GLOBAL v0_hFreq_L, v0_hFreq_M, v0_hFreq_H, v0_hWaveSel, v0_hVol
GLOBAL v1_hFreq_L, v1_hFreq_M, v1_hFreq_H, v1_hWaveSel, v1_hVol
GLOBAL v2_hFreq_L, v2_hFreq_M, v2_hFreq_H, v2_hWaveSel, v2_hVol
var_4 UDATA 0x400
table res 0xff
extern pacman_refresh, pacman_wavetable
extern galaga_refresh, galaga_wavetable, galaga_sound
ORG 0x0000
nop
goto main
ORG 0x0008
goto int_handler
ORG 0x0100
int_code CODE
int_handler
btfss PIR1, TMR1IF
bra int_test_0
call int_timer1
bcf PIR1, TMR1IF
int_test_0
btfss INTCON, TMR0IF
bra int_test_2
call int_timer0
bcf INTCON, TMR0IF
int_test_2
retfie FAST
int_timer0
movlw TMR0_RELOAD movwf TMR0L
movf POSTINC0, w addwf POSTINC0, f movf POSTINC0, w addwfc POSTINC0, f movf POSTINC0, w addwfc INDF0, f
movf POSTINC0, w andlw 0xF8 iorwf POSTINC0, w movwf FSR2L movf INDF2, w iorwf POSTINC0, w movwf LATD
btfss FSR0L, 5 return
lfsr FSR0, v0_hFreq_L return
int_timer1
movlw TMR1_RELOAD_H
movwf TMR1H
movlw TMR1_RELOAD_L
movwf TMR1L
incf hCount, f bsf F60HZ
return
main_code CODE
main
clrf TRISD
clrf LATD
movlw b'11001000' movwf T0CON
movlw b'10110001' movwf T1CON
movlw TMR1_RELOAD_H
movwf TMR1H
movlw TMR1_RELOAD_L
movwf TMR1L
clrf INTCON
bsf INTCON, TMR0IE bsf INTCON, IPEN bsf PIE1, TMR1IE
lfsr FSR1, 0x000
movlw .128
ram0 clrf POSTINC0
decfsz WREG
bra ram0
lfsr FSR1, 0x100
call clear_bank
lfsr FSR1, 0x200
call clear_bank
lfsr FSR1, 0x300
call clear_bank
lfsr FSR1, 0x500
call clear_bank
lfsr FSR0, v0_hFreq_L call galaga_wavetable
bsf INTCON, GIE
call debug_setup
main_loop
btfsc F60HZ call timer_60hz
nop
goto main_loop
timer_60hz
call galaga_refresh
btfsc PORTC,6
call debug_setup
bcf F60HZ
return
clear_bank
clrf temp0
cb_1 clrf POSTINC1
decfsz temp0
bra cb_1
return
fix_voices
GLOBAL fix_voices
tstfsz v0_hVol
bra fv1
clrf v0_hFreq_L
clrf v0_hFreq_M
clrf v0_hFreq_H
clrf v0_hAcc_L
clrf v0_hAcc_M
clrf v0_hAcc_H
fv1 tstfsz v1_hVol
bra fv2
clrf v1_hFreq_L
clrf v1_hFreq_M
clrf v1_hFreq_H
clrf v1_hAcc_L
clrf v1_hAcc_M
clrf v1_hAcc_H
fv2 tstfsz v2_hVol
return
clrf v2_hFreq_L
clrf v2_hFreq_M
clrf v2_hFreq_H
clrf v2_hAcc_L
clrf v2_hAcc_M
clrf v2_hAcc_H
return
extern Effect, Wave
debug_setup
#if 0
btfss PORTC, 7
bra set_wave
set_effect
movf PORTC, w
andlw 0x1F
movwf temp1
movlb .1
movlw .3
cpfslt temp1 movlb .2
movf temp1, w
movwf Effect
bra set_done
set_wave
movf PORTC, w
andlw 0x1F
incf WREG, w
rlncf WREG, w
movlb .1
decf WREG, w
movwf Wave
movlb .2
incf WREG, w
movwf Wave
#else
movf PORTC, w
andlw 0x1F
call galaga_sound
#endif
set_done
return
END
list p=18f452
#include p18f452.inc
var_5 UDATA 0x500
sound_number res 1
voice_number res 1
num_voices res 1
chunk_done res 1
data_byte res 1
data_next res 1
bfreq res 2
vol res 3 freq res 6 wavesels res 3 offset res 1
data0 res 1
data1 res 1
wavesel res 1
sound05_count res 1
sound05_vol res 1
sound06_count res 1
sound06_wavesel res 1
states res 43 do_sound res 23 in_sound res 23 positions res 43 acc16 res 2
data16 res 2
extern temp0, temp1, gType, gVol, hCount, Flags
extern v0_hFreq_L, v0_hFreq_M, v0_hFreq_H, v0_hWaveSel, v0_hVol
extern v1_hFreq_L, v1_hFreq_M, v1_hFreq_H, v1_hWaveSel, v1_hVol
extern v2_hFreq_L, v2_hFreq_M, v2_hFreq_H, v2_hWaveSel, v2_hVol
extern fix_voices
galaga_code CODE
galaga_sound
GLOBAL galaga_sound
movlb .5
lfsr FSR1, in_sound
addwf FSR1L, f
tstfsz INDF1
return
lfsr FSR1, do_sound
addwf FSR1L, f
tstfsz INDF1
return
incf INDF1, f
return
galaga_wavetable
GLOBAL galaga_wavetable
clrf TBLPTRU
movlw high(galaga_wavetable_data)
movwf TBLPTRH
movlw low(galaga_wavetable_data)
movwf TBLPTRL
lfsr FSR1, 0x400 clrf temp0
cwt tblrd*+
movf TABLAT, w
movwf POSTINC1
decfsz temp0
bra cwt
lfsr FSR2, 0x400 return
galaga_refresh
GLOBAL galaga_refresh
movlb .5
check_00
check_13
movlw 0x13
movwf sound_number
tstfsz do_sound+0x13
bra $+4
bra check_cont_13
clrf do_sound+0x13
call start_sound
bra check_0F
check_cont_13
tstfsz in_sound+0x13
call continue_sound
check_0F
movlw 0x0F
movwf sound_number
tstfsz do_sound+0x0F
bra $+4
bra check_cont_0F
clrf do_sound+0xF
call start_sound
bra check_03
check_cont_0F
tstfsz in_sound+0x0F
call continue_sound
check_03
movlw 0x03
movwf sound_number
tstfsz do_sound+0x3
bra $+4
bra check_cont_03
clrf do_sound+0x3
call start_sound
bra check_02
check_cont_03
tstfsz in_sound+0x3
call continue_sound
check_02
movlw 0x02
movwf sound_number
tstfsz do_sound+0x2
bra $+4
bra check_cont_02
clrf do_sound+0x2
call start_sound
bra check_04
check_cont_02
tstfsz in_sound+0x2
call continue_sound
check_04
movlw 0x04
movwf sound_number
tstfsz do_sound+0x4
bra $+4
bra check_cont_04
clrf do_sound+0x4
call start_sound
bra check_01
check_cont_04
tstfsz in_sound+0x4
call continue_sound
check_01
movlw 0x01
movwf sound_number
tstfsz do_sound+0x1
bra $+4
bra check_cont_01
clrf do_sound+0x1
call start_sound
bra check_12
check_cont_01
tstfsz in_sound+0x1
call continue_sound
check_12
movlw 0x12
movwf sound_number
tstfsz do_sound+0x12
bra $+4
bra check_cont_12
clrf do_sound+0x12
call start_sound
bra check_05
check_cont_12
tstfsz in_sound+0x12
call continue_sound
check_05
tstfsz do_sound+0x5
bra $+4
bra not_05
movlw 0x5
movwf sound_number
call play_sound_bis
incf sound05_count, f
movlw .7
cpfslt sound05_count
bra set_vol_05 clrf sound05_count movlw .4
cpfslt sound05_vol bra xx_05
movlw 0xC
movwf sound05_vol bra set_vol_05
xx_05 decf sound05_vol, f set_vol_05
movf sound05_vol, w
movwf vol+2 bra check_06
not_05
clrf in_sound+0x5
check_06
tstfsz do_sound+0x6
bra $+4
bra not_06
movlw 0x6
movwf sound_number
call play_sound_bis
incf sound06_count, f
movlw 0x1C
cpfseq sound06_count
bra set_wav_06 clrf sound06_count incf sound06_wavesel, f set_wav_06
movf sound06_wavesel
movwf wavesels+2 bra check_09
not_06
clrf in_sound+0x6
check_09
tstfsz do_sound+0x9
bra $+4
bra not_09
movlw 0x9
movwf sound_number
call play_sound_bis
bra check_07
not_09
clrf in_sound+0x9
check_07
tstfsz do_sound+0x7
bra $+4
bra check_11
movlw 0x7
movwf sound_number
call play_sound
check_11
tstfsz do_sound+0x11
bra $+4
bra not_11
movlw 0x11
movwf sound_number
call play_sound_bis
bra check_0D
not_11
clrf in_sound+0x11
check_0D
tstfsz do_sound+0xd
bra $+4
bra check_0E
movlw 0xd
movwf sound_number
call play_sound
check_0E
tstfsz do_sound+0xe
bra $+4
bra check_0E_part2
movlw 0xe
movwf sound_number
call play_sound
check_0E_part2
tstfsz do_sound+0xe
bra $+4
bra check_14
movlw .9
movwf vol+2
movlw .6
movwf vol+3
check_14
tstfsz do_sound+0x14
bra $+4
bra check_15
movlw 0x14
movwf sound_number
call play_sound
check_15
tstfsz do_sound+0x15
bra $+4
bra check_0A
movlw 0x15
movwf sound_number
call play_sound
check_0A
tstfsz do_sound+0x0A
bra $+4
bra check_0B
movlw 0x0A
movwf sound_number
call play_sound
check_0B
tstfsz do_sound+0x0B
bra $+4
bra check_10
movlw 0x0B
movwf sound_number
call play_sound
check_10
tstfsz do_sound+0x10
bra $+4
bra not_10
movlw 0x10
movwf sound_number
call play_sound_bis
bra check_0C
not_10
clrf do_sound+0x10
check_0C
tstfsz do_sound+0xC
bra $+4
bra check_16
movlw 0xC
movwf sound_number
call play_sound
check_16
tstfsz do_sound+0x16
bra $+4
bra check_08
movlw 0x16
movwf sound_number
call play_sound
check_08
tstfsz do_sound+0x8
bra $+4
bra check_done
movlw 0x8
movwf sound_number
call play_sound
check_done
call copy_to_hw
return
copy_to_hw
#if 1
clrf v0_hFreq_L
movf freq, w
movwf v0_hFreq_M
movf freq+1, w
movwf v0_hFreq_H
movf vol, w
andlw 0xf
movwf v0_hVol
movf wavesels, w
andlw 0x7
movwf v0_hWaveSel
#endif
#if 1
clrf v1_hFreq_L
movf freq+2, w
movwf v1_hFreq_M
movf freq+3, w
movwf v1_hFreq_H
movf vol+1, w
andlw 0xf
movwf v1_hVol
movf wavesels+1, w
andlw 0x7
movwf v1_hWaveSel
#endif
#if 1
clrf v2_hFreq_L
movf freq+4, w
movwf v2_hFreq_M
movf freq+5, w
movwf v2_hFreq_H
movf vol+2, w
andlw 0xf
movwf v2_hVol
movf wavesels+2, w
andlw 0x7
movwf v2_hWaveSel
#endif
call fix_voices
return
play_sound
call get_data
call check_in_sound
ps_1 call process_chunk
decfsz num_voices
bra ps_end
tstfsz chunk_done bra ps_2
return ps_2 clrf chunk_done lfsr FSR1, in_sound
movf sound_number, w
addwf FSR1L, f
clrf INDF1
lfsr FSR1, do_sound
movf sound_number, w
addwf FSR1L, f
movlw .8
cpfseq sound_number bra ps_3 decf INDF1, f return
ps_3
movlw 0xC
cpfseq sound_number bra ps_5 decf INDF1, f btfsc STATUS, Z bra ps_4 btfsc INDF1, 0 return ps_4 movlw .1
movwf do_sound+0x16 return
ps_5
movlw 0x14 cpfseq sound_number bra ps_6
clrf INDF1 movlw .1
movwf do_sound+0x13 return
ps_6
clrf INDF1 return
ps_end incf offset, f
incf voice_number, f
bra ps_1
start_sound
lfsr FSR1, in_sound
movf sound_number, w
addwf FSR1L, f
incf INDF1, f
call get_data
call init_sound
bra continue_sound_2
continue_sound
call get_data
continue_sound_2
call process_chunk
decfsz num_voices
bra cs_2
tstfsz chunk_done
bra cs_1
return
cs_1 clrf chunk_done
lfsr FSR1, in_sound
movf sound_number, w
addwf FSR1L, f
clrf INDF1 return
cs_2 incf offset, f
incf voice_number, f
bra continue_sound_2
play_sound_bis
call get_data
call check_in_sound
bra continue_sound_2
check_in_sound
lfsr FSR1, in_sound
movf sound_number, w
addwf FSR1L, f
tstfsz INDF1 return
incf INDF1, f init_sound
lfsr FSR1, states
movf offset, w
addwf FSR1L, f
movf num_voices, w
cis_1 clrf POSTINC1 decfsz WREG
bra cis_1
lfsr FSR1, positions movf offset, w
addwf FSR1L, f
movf num_voices, w
cis_2 clrf POSTINC1
decfsz WREG
bra cis_2
return
get_data
movlw high(table3)
movwf TBLPTRH
movlw low(table3)
movwf TBLPTRL
movf sound_number, w
addwf WREG, w
addwf sound_number, w addwf TBLPTRL, f
btfsc STATUS, C
incf TBLPTRH, f tblrd*+
movf TABLAT, w
movwf offset
tblrd*+
movf TABLAT, w
movwf num_voices
tblrd*+
movf TABLAT, w
movwf voice_number
movlw 0xE
cpfseq sound_number return
movlw .0
cpfseq positions+0x1C bra gd_1
movlw .1 movwf num_voices return
gd_1 movlw .1
cpfseq positions+0x1C bra gd_3
gd_2 movlw .2 movwf num_voices return
gd_3 tstfsz positions+0x1D return
bra gd_2
process_chunk
lfsr FSR1, states
movf offset, w
addwf FSR1L, f
incf INDF1, f
movlw high(table4)
movwf TBLPTRH
movlw low(table4)
movwf TBLPTRL rlncf offset, w addwf TBLPTRL, f
btfsc STATUS, C
incf TBLPTRH, f
tblrd*+
movf TABLAT, w
movwf temp1
tblrd*+
movf TABLAT, w
movwf temp0
movf temp0, w
movwf TBLPTRH
movf temp1, w
movwf TBLPTRL tblrd*+
movf TABLAT, w
movwf data0 tblrd*+
movf TABLAT, w
movwf data1 tblrd*+
movf TABLAT, w
movwf wavesel
lfsr FSR1, positions
movf offset, w
addwf FSR1L, f
movf INDF1, w addwf TBLPTRL, f
btfsc STATUS, C
incf TBLPTRH, f
tblrd*+
movf TABLAT, w movwf data_byte tblrd*+
movf TABLAT, w
movwf data_next
movf data_byte, w
incfsz WREG, w bra chunk_1
lfsr FSR1, vol
movf voice_number, w
addwf FSR1L, f
clrf INDF1 movlw .1
movwf chunk_done return
chunk_1
movlw high(table0)
movwf TBLPTRH
movlw low(table0)
movwf TBLPTRL
movf data_byte, w
andlw 0x0F
rlncf WREG, w
addwf TBLPTRL, f
btfsc STATUS, C
incf TBLPTRH, f tblrd*+
movf TABLAT, w
movwf bfreq
tblrd*+
movf TABLAT, w
movwf bfreq+1
swapf data_byte, w
andlw 0x0F btfsc STATUS, Z
bra chunk_3 movwf temp0
chunk_2 bcf STATUS, C
rrcf bfreq+1, f
rrcf bfreq, f
decfsz temp0
bra chunk_2
chunk_3
lfsr FSR1, freq
movf voice_number, w
rlncf WREG, w
addwf FSR1L, f
movf bfreq, w
movwf POSTINC1
movf bfreq+1, w
movwf POSTINC1
movlw 0x0C
subwf data_byte, w btfsc STATUS, Z
bra vol_zero
movf data0, w
andwf WREG, w
btfsc STATUS, Z
bra data0_zero decf WREG, w
btfsc STATUS, Z
bra data0_one data0_gt_one
lfsr FSR1, states
movf offset, w
addwf FSR1L, f movlw .6
cpfslt INDF1
bra data0_zero comf INDF1, w
bra store_vol
data0_one
lfsr FSR1, states
movf offset, w
addwf FSR1L, f movlw .6
cpfslt INDF1
bra data0_zero movf INDF1, w
addwf WREG, w
bra store_vol
data0_zero
movf data1, w
andwf WREG, w
btfsc STATUS, Z
bra data1_zero lfsr FSR1, states
movf offset, w
addwf FSR1L, f movlw 0xA
cpfsgt INDF1
bra data1_zero movlw 0x15
cpfslt INDF1
bra vol_zero movf INDF1, w
sublw .0
addlw 0x15
bra store_vol
data1_zero
movlw 0x0A
bra store_vol
vol_zero
movlw .0
bra store_vol
store_vol
movwf temp0 lfsr FSR1, vol
movf voice_number, w
addwf FSR1L, f movf temp0, w movwf INDF1
lfsr FSR1, wavesels
movf voice_number, w
addwf FSR1L, f movf wavesel, w
movwf INDF1
movlw high(table5)
movwf TBLPTRH
movlw low(table5)
movwf TBLPTRL
movf sound_number, w
addwf TBLPTRL, f
btfsc STATUS, C
incf TBLPTRH, f tblrd*
movf TABLAT, w
movwf temp1
movf data_next, w
movwf data16
clrf data16+1 clrf acc16
clrf acc16+1 movlw .8
movwf temp0
chunk_4
rrcf temp1, f btfss STATUS, C
bra chunk_5
movf data16, w addwf acc16, f
movf data16+1, w
addwfc acc16+1, f chunk_5
bcf STATUS, C
rlcf data16, f
rlcf data16+1, f decfsz temp0
bra chunk_4
lfsr FSR1, states
movf offset, w
addwf FSR1L, f movf INDF1, w
cpfseq acc16
return
clrf INDF1 lfsr FSR1, positions
movf offset, w
addwf FSR1L, f incf INDF1, f
incf INDF1, f return
galaga_data CODE_PACK
galaga_wavetable_data
db 0x70, 0x70, 0xe0, 0xb0, 0x70, 0x70, 0x70, 0xa0
db 0x90, 0x90, 0xe0, 0xd0, 0xa0, 0xe0, 0x80, 0xc0
db 0xa0, 0xa0, 0xe0, 0xe0, 0xc0, 0xc0, 0xa0, 0xc0
db 0xb0, 0xb0, 0xe0, 0xd0, 0xd0, 0x90, 0xc0, 0xa0
db 0xc0, 0x70, 0xe0, 0xc0, 0xe0, 0xc0, 0xe0, 0x70
db 0xd0, 0xd0, 0xe0, 0xa0, 0xd0, 0xe0, 0xd0, 0x70
db 0xd0, 0xd0, 0xe0, 0x80, 0xc0, 0xa0, 0xc0, 0x80
db 0xe0, 0x70, 0xe0, 0x80, 0xa0, 0x70, 0xc0, 0xb0
db 0xe0, 0xe0, 0xe0, 0x80, 0x70, 0xc0, 0xb0, 0xd0
db 0xe0, 0x70, 0xe0, 0xa0, 0x40, 0xf0, 0xa0, 0xe0
db 0xd0, 0xd0, 0xe0, 0xc0, 0x20, 0xd0, 0x80, 0xd0
db 0xd0, 0xd0, 0xe0, 0xd0, 0x10, 0x80, 0x70, 0xa0
db 0xc0, 0x70, 0xe0, 0xe0, 0x00, 0xa0, 0x50, 0x60
db 0xb0, 0xb0, 0xe0, 0xd0, 0x10, 0xb0, 0x60, 0x50
db 0xa0, 0xa0, 0xe0, 0xb0, 0x20, 0x70, 0x70, 0x50
db 0x90, 0x90, 0xe0, 0x80, 0x40, 0x20, 0x80, 0x70
db 0x70, 0x70, 0x00, 0x40, 0x70, 0x80, 0x80, 0x90
db 0x50, 0x50, 0x00, 0x20, 0xb0, 0xd0, 0x90, 0x90
db 0x40, 0x70, 0x00, 0x10, 0xd0, 0x90, 0xa0, 0x80
db 0x30, 0x30, 0x00, 0x20, 0xe0, 0x40, 0xb0, 0x40
db 0x20, 0x70, 0x00, 0x30, 0xd0, 0x50, 0x90, 0x10
db 0x10, 0x10, 0x00, 0x50, 0xb0, 0x70, 0x80, 0x00
db 0x10, 0x70, 0x00, 0x70, 0x70, 0x20, 0x60, 0x10
db 0x00, 0x00, 0x00, 0x70, 0x30, 0x00, 0x50, 0x30
db 0x00, 0x70, 0x00, 0x70, 0x10, 0x30, 0x40, 0x60
db 0x00, 0x00, 0x00, 0x50, 0x00, 0x80, 0x40, 0x70
db 0x10, 0x70, 0x00, 0x30, 0x10, 0x50, 0x30, 0x70
db 0x10, 0x10, 0x00, 0x20, 0x30, 0x10, 0x20, 0x40
db 0x20, 0x70, 0x00, 0x10, 0x70, 0x30, 0x40, 0x20
db 0x30, 0x30, 0x00, 0x20, 0xe0, 0x60, 0x60, 0x20
db 0x40, 0x70, 0x00, 0x40, 0x70, 0x30, 0x80, 0x40
db 0x50, 0x50, 0x00, 0x70, 0x00, 0x10, 0x90, 0x70
table0
dw 8150h
dw 8900h
dw 9126h
dw 99C8h
dw 0A2ECh
dw 0AC9Dh
dw 0B6E0h
dw 0C1C0h
dw 0CD45h
dw 0D97Ah
dw 0E669h
dw 0F41Ch
dw 0
table1
dw 130h
dw 168h
dw 136h
dw 1A8h
dw 168h
dw 200h
dw 1ACh
dw 208h
table2
dw 0FE00h
dw 0FE58h
dw 0FE08h
dw 0FE98h
dw 0FE58h
dw 0FED0h
dw 0FE98h
dw 0FED6h
dw 5B00h
dw 6C00h
dw 5B00h
dw 7E00h
dw 6C00h
dw 9700h
dw 8100h
dw 9900h
dw 0D900h
dw 0B600h
dw 0D900h
dw 9700h
dw 0B600h
dw 7E00h
dw 9900h
dw 8100h
table3
db 0, 1, 0 db 1, 1, 1 db 2, 1, 1 db 3, 1, 1 db 4, 1, 1 db 5, 1, 0 db 6, 1, 0 db 20h, 3, 0 db 0Ah, 3, 0 db 0Dh, 3, 0 db 7, 3, 0 db 13h, 3, 0 db 16h, 3, 0 db 19h, 3, 0 db 1Ch, 3, 0 db 1Fh, 1, 2 db 2Ch, 3, 0 db 10h, 3, 0 db 23h, 1, 0 db 24h, 1, 0 db 25h, 3, 0 db 28h, 1, 0 db 29h, 3, 0
table4
dw WAVE01
dw WAVE02
dw WAVE03
dw WAVE04
dw WAVE05
dw WAVE06
dw WAVE07
dw WAVE08
dw WAVE09
dw WAVE10
dw WAVE11
dw WAVE12
dw WAVE13
dw WAVE14
dw WAVE15
dw WAVE16
dw WAVE17
dw WAVE18
dw WAVE19
dw WAVE20
dw WAVE21
dw WAVE22
dw WAVE23
dw WAVE24
dw WAVE25
dw WAVE26
dw WAVE27
dw wAVE28
dw WAVE20
dw WAVE20
dw WAVE20
dw WAVE29
dw WAVE30
dw WAVE31
dw WAVE32
dw WAVE33
dw WAVE29
dw WAVE34
dw WAVE35
dw WAVE36
dw WAVE37
dw WAVE38
dw WAVE39
dw WAVE40
dw WAVE41
dw WAVE42
dw WAVE43
table5
db 4, 2, 2, 2, 2, 4, 4, 0Ah, 7, 0Ch, 0Bh, 4, 0Ah, 0Dh, 4, 1, 4
db 0Ch, 2, 6, 5, 2, 0Ah
WAVE01
db 0FFh
WAVE04
db 0, 0, 6, 71h, 1, 72h, 1, 73h, 1, 75h, 1, 74h, 1, 73h, 1, 72h
db 1, 71h, 1, 70h, 1, 8Bh, 1, 8Ah, 1, 0Ch, 4, 86h, 1, 87h, 1, 88h
db 1, 89h, 1, 8Ah, 1, 89h, 1, 88h, 1, 87h, 1, 86h, 1, 85h, 1, 84h
db 1, 83h, 1, 0FFh
WAVE03
db 0, 0, 4, 88h, 1, 8Ah, 1, 70h, 1, 71h, 1, 73h, 1, 75h, 1, 77h
db 1, 78h, 1, 0Ch, 6, 74h, 1, 73h, 1, 72h, 1, 71h, 1, 70h, 1, 8Bh
db 1, 0FFh
WAVE02
db 0, 0, 7, 89h, 1, 8Ah, 1, 8Bh, 1, 0Ch, 1, 70h, 1, 71h, 1, 72h
db 1, 0Ch, 1, 73h, 1, 74h, 1, 75h, 1, 0Ch, 3, 8Bh, 1, 70h, 1, 71h
db 1, 0Ch, 1, 72h, 1, 73h, 1, 74h, 1, 0Ch, 1, 75h, 1, 76h, 1, 77h
db 1, 0Ch, 3, 71h, 1, 72h, 1, 73h, 1, 0Ch, 1, 74h, 1, 75h, 1, 76h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 3, 97h, 2, 98h, 2, 9Ah, 2, 90h, 2, 9Ah, 2, 98h
db 1, 97h, 1, 95h, 1, 92h, 1, 93h, 1, 95h, 1, 0FFh
WAVE30
db 2, 4, 3, 7Ah, 1, 76h, 1, 78h, 1, 75h, 1, 76h, 1, 73h, 1, 75h
db 1, 72h, 1, 73h, 1, 8Ah, 1, 8Ah, 1, 88h, 1, 86h, 1, 85h, 1, 83h
db 1, 82h, 1, 83h, 1, 85h, 1, 86h, 1, 88h, 1, 86h, 1, 8Ah, 1, 70h
db 1, 72h, 1, 73h, 4, 0FFh
WAVE31
db 2, 4, 3, 76h, 1, 73h, 1, 75h, 1, 72h, 1, 73h, 1, 70h, 1, 72h
db 1, 8Ah, 1, 8Ah, 1, 86h, 1, 86h, 1, 85h, 1, 83h, 1, 82h, 1, 80h
db 1, 9Ah, 1, 9Ah, 1, 8Bh, 1, 80h, 1, 82h, 1, 83h, 1, 85h, 1, 86h
db 1, 88h, 1, 8Ah, 4, 0FFh
WAVE32
db 2, 10h, 3, 73h, 2, 75h, 2, 76h, 2, 75h, 2, 73h, 2, 72h, 2, 70h
db 2, 72h, 2, 73h, 2, 8Bh, 2, 8Ah, 2, 86h, 2, 83h, 4, 0FFh
WAVE33
db 0, 0, 4, 71h, 4, 73h, 4, 71h, 4, 73h, 4, 76h, 4, 78h, 4, 76h
db 4, 78h, 4, 0FFh
WAVE29
db 0, 0, 6, 56h, 1, 55h, 1, 54h, 1, 53h, 1, 52h, 1, 51h, 1, 50h
db 1, 6Bh, 1, 6Ah, 1, 69h, 1, 68h, 1, 67h, 1, 66h, 1, 65h, 1, 64h
db 1, 63h, 1, 62h, 1, 61h, 1, 60h, 1, 7Bh, 1, 7Ah, 1, 79h, 1, 78h
db 1, 77h, 1, 76h, 1, 75h, 1, 74h, 1, 73h, 1, 72h, 1, 71h, 1, 70h
db 1, 8Bh, 1, 8Ah, 1, 89h, 1, 88h, 1, 87h, 1, 86h, 1, 85h, 1, 84h
db 1, 83h, 1, 0FFh
WAVE23
db 2, 4, 5, 60h, 1, 78h, 1, 75h, 1, 71h, 1, 60h, 1, 78h, 1, 75h
db 1, 71h, 1, 60h, 1, 78h, 1, 75h, 1, 71h, 1, 60h, 1, 78h, 1, 75h
db 1, 71h, 1, 60h, 1, 78h, 1, 75h, 1, 71h, 1, 60h, 1, 78h, 1, 75h
db 1, 71h, 1, 60h, 1, 0Ch, 1, 78h, 1, 7Ah, 1, 75h, 1, 78h, 1, 73h
db 1, 75h, 1, 61h, 1, 7Ah, 1, 76h, 1, 73h, 1, 61h, 1, 7Ah, 1, 76h
db 1, 73h, 1, 61h, 1, 7Ah, 1, 76h, 1, 73h, 1, 61h, 1, 7Ah, 1, 76h
db 1, 73h, 1, 61h, 1, 79h, 1, 76h, 1, 73h, 1, 61h, 1, 79h, 1, 76h
db 1, 73h, 1, 61h, 1, 0Ch, 1, 79h, 1, 61h, 1, 78h, 1, 79h, 1, 75h
db 1, 78h, 1, 0FFh
WAVE38
db 2, 2, 5, 60h, 1, 60h, 1, 60h, 1, 0FFh
WAVE24
db 2, 4, 5, 61h, 2, 78h, 2, 78h, 2, 61h, 2, 78h, 2, 78h, 2, 61h
db 2, 78h, 2, 78h, 2, 61h, 2, 78h, 2, 78h, 2, 61h, 2, 78h, 2, 7Ah
db 2, 75h, 2, 63h, 2, 7Ah, 2, 7Ah, 2, 63h, 2, 7Ah, 2, 7Ah, 2, 63h
db 2, 7Ah, 2, 79h, 2, 63h, 2, 79h, 2, 79h, 2, 63h, 2, 79h, 2, 76h
db 2, 73h, 2, 0FFh
WAVE39
db 2, 2, 5, 78h, 1, 78h, 1, 78h, 1, 0FFh
WAVE25
db 2, 10h, 5, 85h, 6, 85h, 6, 85h, 6, 85h, 6, 85h, 4, 85h, 4, 86h
db 6, 86h, 6, 86h, 6, 86h, 6, 86h, 4, 86h, 4, 0FFh
WAVE40
db 2, 4, 5, 81h, 1, 81h, 1, 81h, 1, 0FFh
WAVE37
db 2, 0, 7, 65h, 1, 0Ch,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