;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; @@ @@addmusicM ; ; ; ; @@Sound Source engine mods ; ; ; ; ; ; The bin can be integrated SPCAS ; ; (More.bin) ; ; ; ; ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Notepad ; ; ; ; $0000-$03FF RAM ; ; $0400-$04FF Free ; ; $0500-$133D Program ; ; $1360-$15FE Resident sequence sequence table ; ; $1600-$165F Free ; ; $1660-$20FF Various sound effects, sound sequence table ; ; $2100-$23FF Free ; ; $2400-$531F Resident wave ; ; $5320-$53FF Free ; ; $5400-$7FFF Custom Sequence ; ; $8000-$FFFF Custom waveforms ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; ① Command Table (0F90-0FDA frees) ; ; Head table move command ; ; ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw $0002 ;Setting a new command table dw $0D45 dw $034C dw $0002 ;Long tables set the new command dw $10CC dw $0372 base $0400-$04 dw A_end-A_start,$0400 A_start: ;Command code jump table 0DDC +2 n ⇒ 024C +2 n024C+2n dw $0D47 ;DA dw $0D8E ;DB dw $0DA5 ;DC dw $0000 ;DD (Command empty) dw $0DC1 ;DE dw $0DD5 ;DF dw $0DF0 ;E0 dw $0DFC ;E1 dw $0E11 ;E2 dw $0E1D ;E3 dw $0E35 ;E4 dw $0E3B ;E5 dw s_loop ;E6 dw $0E73 ;E7 dw $0E82 ;E8 dw $0EA5 ;E9 dw $0DDA ;EA dw $0E4F ;EB dw $0E53 ;EC dw ED_com ;ED (custom) dw $0E9E ;EE dw $0EC9 ;EF dw $0F1D ;F0 dw $0F33 ;F1 dw $0EF9 ;F2 dw srcn ;F3 (custom) dw F4_com ;F4 (custom) dw F5_com ;F5 (custom) dw F6_com ;F6 (custom) dw F7_com ;F7 (custom) dw Noiz ;F8 (custom) dw F9_com ;F9 (custom) dw FA_com ;FA (custom) dw $0000 ;FB (custom) dw $0000 ;FC (custom) dw $0000 ;FD (custom) dw $0000 ;FE (custom) dw $0000 ;FF (custom) ;Command length table 0EE8 + n 0372 ⇒ + n db $02 ;DA db $02 ;DB db $03 ;DC db $04 ;DD db $04 ;DE db $01 ;DF db $02 ;E0 db $03 ;E1 db $02 ;E2 db $03 ;E3 db $02 ;E4 db $04 ;E5 db $02 ;E6 db $02 ;E7 db $03 ;E8 db $04 ;E9 db $02 ;EA db $04 ;EB db $04 ;EC db $03 ;ED db $02 ;EE db $04 ;EF db $01 ;F0 db $04 ;F1 db $04 ;F2 db $03 ;F3 db $02 ;F4 db $09 ;F5 db $03 ;F6 db $04 ;F7 db $03 ;F8 db $03 ;F9 db $02 ;FA db $01 ;FB db $01 ;FC db $01 ;FD db $01 ;FE db $01 ;FF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; ② Additional commands in MORE.bin SDX ; ; $F3 command (SRCN) ; ; $ED command (ADSR) ; ; $E6 command (Second loop) ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; s_routineA: mov $e3,#$20 ; tone table has been changed by the movement of value here mov x,$46 mov a,$c1+x bmi label11 mov y,#$05 dec a mov $e2,#$46 bra label12 label11: mov $e2,#$a5 mov y,#$06 setc sbc a,#$d0 label12: mul ya addw ya,$e2 movw $e2,ya ret s_routineB: mov y,#$05 label14: mov a,($e2)+y mov ($14)+y,a dec y bpl label14 ret s_routineC: mov $14,#$30 mov $15,#$01 mov y,#$06 mov a,x lsr a mul ya addw ya,$14 movw $14,ya ret srcn: call $125c and a,#$7f mov $e0,a mov a,#$04 push a mov a,#$00 push a bra label1A ED_com: call $125c eor a,#$80 mov $e0,a bmi label18 mov a,#$03 push a bra label19 label18: mov a,#$02 push a label19: mov a,#$01 push a label1A: call $125e mov $e1,a call s_routineC pop y mov a,$e0 mov ($14)+y,a pop y mov a,$e1 mov ($14)+y,a jmp $0d5b return: call s_routineC ;Return mods jmp $0d5b pacas: mov x,$46 ;Percussion remodeling (or percussion picture?) call s_routineA call s_routineC call s_routineB jmp $0d61 ;--------------------------------;Now 04FE A_end: ;fillbyte $ff : fill $30 base $1600-$04 dw B_end-B_start,$1600 B_start: ;-------------------------------- pacas_2: push a ;Percussion 2 mods cmp a,#$d0 bcs label21 mov a,$48 jmp $0cab label21: pop a jmp $0cb0 at_hack: call $125c ;@ mods bmi label20 inc a label20: mov $c1+x,a call s_routineA call s_routineC call s_routineB jmp $0d5b s_loop: call $125c ;Command E6 bne label2 mov a,$30+x mov $01e0+x,a mov a,$31+x mov $01e1+x,a mov a,#$ff mov $01f0+x,a ret label2: push a mov a,$01f0+x cmp a,#$01 bne label3 pop a ret label3: cmp a,#$ff beq label4 pop a mov a,$01f0+x dec a mov $01f0+x,a bra label5 label4: pop a mov $01f0+x,a label5: mov a,$01e0+x mov $30+x,a mov a,$01e1+x mov $31+x,a ret B_end: ;165D so far ;-----------------------------------------------; ;fillbyte $ff : fill $30 dw $0003 ;Akira Osamu Percussion (???) dw $0CA8 jmp pacas_2 dw $000E ;Origin of percussion dw $05D0 call pacas fillbyte $00 : fill 11 dw $0003 ;@ origin dw $0D47 jmp at_hack dw $0002 ;Sound effects, altered the return to a routine fly (or alter the return to a routine fly sound effect?) dw $0B1A dw return dw $0002 dw $0A65 dw return dw $0002 dw $0873 dw return dw $0002 dw $074A dw return ;fillbyte $ff : fill $30 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; ③ $F4 $XX Sub-group command ; ; ; ; 00 Controlled by Yoshi # 5 on / off ; ; 01 CH true portamento on / off ; ; 02 CH light portamento on / off ; ; 03 CH Echo on / off ; ; 04 Special square-wave phase resetting ; ; 05 Synchronization value increment on / off ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; base $2100-$04 dw C_end-C_start,$2100 C_start: F4_com: call $125c asl a mov x,a jmp (SubC_table+x) SubC_table: dw SubC_0 dw SubC_1 dw SubC_2 dw SubC_3 dw SubC_4 dw SubC_5 SubC_0: mov a,#$01 SubC_00: eor a,$0160 ;yoshi control enable flag flip mov $0160,a ret SubC_1: mov a,$0161 ;Portamento enable flag flip ch eor a,$48 ;N-channel standing only if the bitN mov $0161,a mov a,$48 eor a,#$FF and a,$0162 mov $0162,a ;Clear key flag ret SubC_2: mov a,$10A8 eor a,#$03 mov $10A8,a ;KEY OFF before the next note to the limit whether to wait ret SubC_3: mov a,$0389 ;Echo ch eor a,$48 ;ch of the corresponding inverted mov $0389,a mov y,#$4D jmp $0697 ;A to DSPY SubC_4: mov a,#$00 mov x,#$07 SubC_4l: mov $245A+x,a mov $2463+x,a dec x bpl SubC_4l ret SubC_5: mov a,#$02 jmp SubC_00 ;Reuse ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Portamento keyoff: and a,$0161 and a,$0162 bne skip_keyoff mov a,$48 call $068F skip_keyoff: ret keyon: eor a,#$FF and a,$47 mov $12,a mov a,$0162 push a or a,$12 mov $0162,a pop a and a,$0161 eor a,#$FF and a,$12 ret restoff: cmp a,#$C6 beq restret bcs if_rest jmp $05E3 if_rest: mov a,$48 and a,$1D bne restret mov a,$48 mov y,#$5C call $0697 ;A to DSPY eor a,#$FF and a,$0162 mov $0162,a restret: ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Synchronization ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Special square wave Sq_data: db $70,$77,$07,$00 Sq_ret: mov a,$51 pop y jmp $0576 Square: mov a,$0165 ;Frequency beq Sq_ret pop y push y mul ya ;Timer elapsed times clrc adc a,$0163 ;Phase Low Byte mov $0163,a bcc Sq_ret ;Repeatedly raised only when playing with a square wave mov a,$0164 ;Phase High Byte push a and a,#$1F lsr a cmp a,#$08 bcc Sq_skip1 inc a Sq_skip1: mov x,a mov y,#$00 pop a and a,#$3F cmp a,#$20 bcc Sq_skip2 inc y inc y Sq_skip2: and a,#$01 beq Sq_skip3 inc y Sq_skip3: mov a,Sq_data+y mov $245A+x,a inc $0164 bra Sq_ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; ④ $F5 $XX $XX $XX $XX $XX $XX $XX $XX ; ; ; ; Given direct FIR echo by gocha ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; F5_com: mov y,#$0f F5_loop: push y call $125c pop y call $0697 mov a,y clrc adc a,#$10 mov y,a bpl F5_loop ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; ⑤ $F6 $XX $YY ; ; ; ; (Senior) DSP direct input (YY⇒dspXX) ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; F6_com: call $125c push a call $125c pop y jmp $0697 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; ⑥ $F7 $XX $YY $YY ; ; ; ; (Super Senior) direct input memory (XX⇒メモリYYYY (⇒ YYYY memory XX??)) ; ; (something about big endian) ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; F7_com: call $125c push a call $125c mov $21,a call $125c mov $20,a pop a mov y,#$00 mov ($20)+y,a ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; ⑦ $F8 $XX ; ; ; ; Noise Command ch by 757 ; ; Released by @. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; dw $0002 ; dw $0EE2 ; mov a,$2D Noiz: mov a,$48 and a,#$bf eor a,$2f mov $2f,a ;Current noiz ch 2f ... mov y,#$3d call $0697 ;Noiz on call $125c and a,#$1f mov $2d,a ;2d ... here noiz clock (2e ... the sound effects noiz clock)clock) mov y,#$6c ;Noiz clock call $0697 mov y,#$00 ret Noiz_ret: mov a,$2d ;$0D6C(@) $0920() $0863() mov y,#$6c call $0697 mov a,#$bf bra Noiz_ret3 Noiz_ret2: mov a,$48 ;Only 2f ch bit removed from the eor a,#$ff Noiz_ret3: and a,$2f mov $2f,a ret Noi_set: mov a,#$40 ;$0957 or a,$2f mov $2f,a ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; ⑧ $F9 $XX $YY ; ; ; ; Linear synchronous output given the current values (Big Endian) ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; F9_com: call $125c mov $0167,a call $125c mov $0166,a ret Douki: cmp x,#$01 beq D_ret cmp x,#$02 beq D_ret cmp x,#$03 beq D_label mov a,$0166 bra D_ret D_label: mov a,$0167 D_ret: mov $00F4+x,a ret D_inc: mov a,$0160 and a,#$02 beq Di_ret mov a,$0166 inc a cmp a,#$C0 bcc D_notcarry inc $0167 mov a,#$00 D_notcarry: mov $0166,a Di_ret: jmp $0BC0 ;本来の処理へ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; ⑨ $FA $XX ; ; ; ; Square-wave frequency given special (SRCN0A) ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FA_com: mov $00f4, #$01 ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; ⑩ $ DD + $ EE Tuning Slide allows both ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DDEE_Fix: mov a,$90+x beq IF_NDD mov a,$02B0+x ret IF_NDD: mov a,$02D1+x mov $02B0+x,a ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; ⑪Initialize to initialize the flag during the transfer ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Format_RAM: mov a,#$00 mov x,#$07 Format_loop: mov $0160+x,a mov $245A+x,a mov $2463+x,a dec x bpl Format_loop mov a,#$02 mov $10A8,a ;Rega (legacy?) less clear mov $0C,#$02 mov a,$06 ret fadeout: mov $06,#$80 jmp $0F76 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; ⑫Echo address autoconfiguration ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ESA_SET: call $0697 ;EDL parameter 1 to AtoDSPY ... (An argument to the DL ADSPY ...?) mov y,#$6D ;ESA and a,#$0F asl a asl a asl a ;8 times eor a,#$FF ;Subtracted from FF call $0697 ;ESA set ret ESA_SAFETY: call $0697 mov a,#$00 mov y,#$7D call $0697 ;EDL mov a,#$B9 mov y,#$6D call $0697 ;ESA ret C_end: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; Something about ③ on/in/at/about ⑪?? ; ; Various treatment settings ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;③ dw $0002 dw $0C58 dw $125C ;X in the command to allow tampering (important) base $0BC4-$04 dw $0008 dw $0BC4 mov a,$0160 nop ;Yoshi control and a,#$01 db $F0,$10 ;beq dw $0008 dw $097F mov a,$0160 ;Yosshiyosshi control nop and a,#$01 db $F0,$0A ;beq $0991 base $0573-$04 dw $0003 dw $0573 jmp Square ;Special square wave dw $0003 dw $10D5 call keyoff ;Portamento key off for intervention dw $0004 dw $0D2E call keyon ;Interventions for key-portamento nop dw $0004 dw $05C9 jmp restoff ;For intervention rests portamento nop ;④ ;⑤ ;⑥ ;⑦ dw $0004 dw $0D6C call Noiz_ret2 nop dw $0004 dw $0920 call Noiz_ret nop dw $0004 dw $0863 call Noiz_ret nop dw $0004 dw $0957 call Noi_set nop dw $0002 dw $0EE2 mov a,$2D ;⑧ dw $0003 dw $05A9 call Douki ;Synchronization dw $0003 dw $0583 call D_inc ;Sync increment ;⑨ ;⑩ dw $0003 dw $09DA call DDEE_Fix dw $0003 dw $062F call DDEE_Fix dw $0003 dw $112E call DDEE_Fix dw $0003 dw $11CC call DDEE_Fix ;⑪ dw $0003 dw $0B5C call Format_RAM ;⑫ dw $0003 dw $0F38 call ESA_SET dw $0003 dw $09C9 call ESA_SAFETY ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; Other ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw $0003 dw $09B9 mov $0168,a dw $0003 dw $0B57 mov $0168,y ;Out of reset when you change the tempo of the song transfer offset (offset out of reset when changing tempo song transfer??) dw $0003 dw $0BB9 call fadeout ;fillbyte $ff : fill $30