;This is an xkas code file written by Kejardon, and heavily commented so other people might be able ;to make sense of it. ;It adds a new song to the game, and loads the song when you go 2 rooms left of Samus's ship. lorom ;header ;Uncomment this command if your rom has a header. Ick. ;Main theme: Channel 3 and 4: main() { ; !C2 = $B0 ; !B2 = $AF ; !Bb2 = $AE ; !A2 = $AD ; !Ab2 = $AC ; !G2 = $AB ; !Gb2 = $AA ; !F1 = $A9 ; !E1 = $A8 ; !Eb1 = $A7 ; !D1 = $A6 ; !Db1 = $A5 ; !C1 = $A4 ; !B1 = $A3 ; !Bb1 = $A2 ; !A1 = $A1 ; !Ab1 = $A0 ; !G1 = $9F ; !Gb1 = $9E ; !F0 = $9D ; !E0 = $9C ; !Eb0 = $9B ; !D0 = $9A ; !Db0 = $99 ; !C0 = $98 ; !B0 = $97 ; !Bb0 = $96 ; !A0 = $95 ; !Ab0 = $94 ; !G0 = $93 ;=================== !C2 = $A4 !B1 = $A3 !Bb1 = $A2 !A1 = $A1 !Ab1 = $A0 !G1 = $9F !Gb1 = $9E !F1 = $9D !E1 = $9C !Eb1 = $9B !D1 = $9A !Db1 = $99 !C1 = $98 ;(Center) !B0 = $97 !Bb0 = $96 !A0 = $95 !Ab0 = $94 !G0 = $93 !Gb0 = $92 !F0 = $91 !E0 = $90 !Eb0 = $8F !D0 = $8E !Db0 = $8D !C0 = $8C org $8FE7E4 ;D1B61A DL NewSongMusic ;Adds a new pointer to end of original song data pointer table ;New pointer index is 4B. ;The start of the debug room is overwritten by this org $838968 ;Custom code to run for Crateria Mainstreet to Energy Tank Slope door. ;You can use the last two bytes of any door definition in SMILE DW RoomTransitionCode ;Call the code to load new music org $DED1C0 ;Free space at end of the rom, with the rest of music data. NewSongMusic: ;B516 ; B516 - B756 = 1 Wooden ticcing sound 40 ; B756 - BC54 = 2 Wooden thud 4FE ; BC93 - C44F = 3 Xylophone 7BC ; C44F - CDFA = 4 Drum 9AB ; CDFA - D2F8 = 5 Sort of like a deep string instrument, I guess 4FE ; D2F8 - DE9B = 6 tribal drum BA3 ; DE9B - DF22 = 7 o_O Not a clue 87 ; DFA9 - E04B = 8 Loud buzzing. A2 ; E04B - E066 = 9 Not sure how to describe it. Between a crash and a tic 1B ; E04B - E066 = 10 Growing vocalish sound 1B ; E04B - E066 = 11 Insant vocalish sound 1B ; F3C5 - F857 = 12 Insant vocalish sound, no decay 492 ; F3C5 - F857 = 13 Louder, flat vocalish sound. No decay 492 ; F3C5 - F857 = 14 Flat vocal sound, decay 492 ; ;up to $FF80 ; DW TableEnd-TableStart, $6D60 ;defines the sample length ; TableStart: ; DW SampleStart,I2_START ; DW I2_START,I4_START ; DW I4_START,I5_START ; DW I5_START,I6_START ; DW I6_START,I7_START ; DW I7_START,I8_START ; DW I8_START,I9_START ; DW I9_START,I10_START ; DW I10_START,I11_START ; DW I10_START,I11_START ; DW I10_START,I11_START ; DW I11_START,SampleEnd ; DW I11_START,SampleEnd ; DW I11_START,SampleEnd ; DW $FFFF,$FFFF ; DW $FFFF,$FFFF ; TableEnd: ; DW SampleEnd-SampleStart, $B516 ; base $00B516 ; SampleStart: ; Incbin I1.bin ; I2_START: ; Incbin I2.bin ; I4_START: ; Incbin I4.bin ; I5_START: ; Incbin I5.bin ; I6_START: ; Incbin I6.bin ; I7_START: ; Incbin I7.bin ; I8_START: ; Incbin I8.bin ; I9_START: ; Incbin I9.bin ; I10_START: ; Incbin I10.bin ; I11_START: ; Incbin I11.bin ; SampleEnd: ; DW InstEnd-InstStart, $6C90 base $006C90 ; InstStart: ; DB $18, $FF, $E0, $B8, $02, $50 ;instruments ; DB $19, $FF, $F4, $B8, $06, $F0 ; DB $1A, $FF, $E0, $B8, $03, $C0 ; DB $1B, $FF, $E0, $B8, $04, $70 ; DB $1C, $FF, $E0, $B8, $01, $B0 ; DB $1D, $FF, $E0, $B8, $02, $F0 ; DB $1E, $8F, $ED, $B8, $0E, $F0 ; DB $1F, $FF, $E0, $B8, $02, $20 ; DB $20, $83, $F2, $B8, $05, $D0 ; DB $21, $FF, $F2, $B8, $01, $D0 ; DB $22, $FF, $E0, $B8, $01, $D0 ; DB $23, $FF, $E0, $B8, $02, $20 ; DB $24, $FF, $F2, $B8, $02, $20 ; DB $25, $FF, $E0, $B8, $02, $20 ; InstEnd: ; DW EchoDataEnd-EchoDataStart, $5800 ; base $005800 ; EchoDataStart: ; DB $32, $65, $7F, $98, $B2, $CB ; DB $E5, $FC, $19, $32, $4C, $65 ; DB $72, $7F, $8C, $98, $A5, $B2 ; DB $BF, $CB, $D8, $E5, $F2, $FC ; EchoDataEnd: DW DataEnd-DataStart,$5828 ;Block transfer data. 5828 is the first track pointer used for ;music data (track 05), and the music data just follows it. base $005828 ;This is a useful xkas command so that all my pointers will be right ;when the music is moved from ROM into the SPC DataStart: DW THEME1 ;First is the track pointer for the song. So when track 05 is called, the ;conductor goes to Kraid1. Note that there is no track 06, trying to call ;track 06 will probably just make the game lock up. Don't call track 06. THEME1: DW THEME1PATTERN,$00FF,THEME1 ;The conductor's instructions. ;There's not much to the conductor. It loads the start positions at Kraid1Pattern, then loops ;endlessly (00FF) to Kraid1, which makes it load the start position at Kraid1Pattern. That's it. ; 36: 18 19 18 1D ; !song = #$FF0F !Chan1inst = $18 !Chan1transpose = $12 !vol1 = $80 !Chan2inst = $18 !Chan2transpose = $0C !vol2 = $F0 !Chan3inst = $18 !Chan3transpose = $00 !vol3 = $80 !Chan4inst = $1D !Chan4transpose = $F3 !vol4 = $80 !Chan5inst = $1D !Chan5transpose = $F3 !vol5 = $80 THEME1PATTERN: DW THEME1CHAN1,THEME1CHAN2,THEME1CHAN3,THEME1CHAN4,THEME1CHAN5,$0000,$0000,$0000 THEME1CHAN1: DB $E5,$FF ;Song volume: FF DB $F6 ;Disable echo. ; DB $F7,$20,$4E,$20 DB $E7,$30 DB $E0,!Chan1inst DB $E1,$0A ;Panning: Somewhat right DB $ED,!vol1 ;Slightly lower channel volume DB $EA,!Chan1transpose ;Transpose channel up: 12 steps (1 octave) DB $10,$7F ;Note length 24, sound length 8/8, volume percent 8/8 DB $EF : DW CHANNEL1 : DB $01 DB $00 THEME1CHAN2: DB $E0,!Chan2inst DB $E1,$0A ;Panning: Somewhat right DB $ED,!vol2 ;Slightly lower channel volume DB $EA, !Chan2transpose ;Transpose channel up: 12 steps (1 octave) DB $10,$7F ;Note length 24, sound length 8/8, volume percent 8/8 DB $EF : DW CHANNEL1 : DB $01 DB $00 CHANNEL1: REP 12 : DB $C9 ;Wait REP 12 : DB $C9 REP 12 : DB $C9 DB $EF : DW T1C1Loop1 : DB $01 DB !C0,$C8 ;6 DB !F0,$C8 DB !A0,$C8 DB !C0,$C8,$C8,$C8,$C8,$C8 ;7 DB !B0,$C8,$C8,$C8,$C8,$C8 ;8 DB $EF : DW T1C1Loop1 : DB $01 DB !A1,$C8 DB !B1,$C8 DB !C1,$C8 DB !C1,$C8,$C8,$C8,$C8,$C8 DB !B1,$C8,$C8,$C8,$C8,$C8 { DB $EF : DW T1C1Loop2 : DB $01 DB !E0,$C8 DB !C0,$C8 DB $EF : DW T1C1Loop2 : DB $01 DB !E0,$C8 DB !C0,$C8 DB $EF : DW T1C1Loop2 : DB $01 DB !E0,$C8 DB !F0,$C8 DB !G1 DB !G1,$C8 DB !G1 DB !G1,$C8 DB !G1,$C8 DB !F0,$C8 DB !E0,$C8 } { DB $EF : DW T1C1Loop2 : DB $01 DB !E0,$C8 DB !C0,$C8 DB $EF : DW T1C1Loop2 : DB $01 DB !E0,$C8 DB !C0,$C8 DB $EF : DW T1C1Loop2 : DB $01 DB !E0,$C8 DB !F0,$C8 DB !G1 DB !G1,$C8 DB !G1 DB !G1,$C8 DB !G1,$C8 DB !F0,$C8 DB !E0,$C8 DB $00 } { T1C1Loop1: DB !A1,$C8,$C8,$C8,$C8,$C8 ;1 DB !G1,$C8 ;2 DB !C2,$C8 DB !E0,$C8 DB !F0,$C8,$C8,$C8,$C8,$C8 ;3. DB !E0,$C8 ;4. DB !A1,$C8 DB !Db0,$C8 DB !D0,$C8,$C8,$C8,$C8,$C8 ;5 DB $00 { T1C1Loop2: DB !D0 DB !D0,$C8 DB !D0 DB !D0,$C8 DB !D0,$C8 DB $00 } } THEME1CHAN3: DB $E0,!Chan3inst DB $E1,$0C ;Panning: Somewhat left DB $ED,!vol3 ;Lower channel volume DB $EA,!Chan3transpose ;Transpose channel up: 12 steps (1 octave) ; DB $E7,$40 DB $10,$7F DB $F6 DB $EF : DW T1C3Loop1 : DB $03 DB $EF : DW T1C3Loop1 : DB $08 DB $EF : DW T1C3Loop2 : DB $08 DB $00 THEME1CHAN4: DB $E0,!Chan4inst DB $E1,$0C ;Panning: Somewhat left DB $ED,!vol4 ;Lower channel volume DB $EA,!Chan4transpose ;Transpose channel up: 12 steps (1 octave) ; DB $E7,$40 DB $10,$7F DB $F6 REP 12 : DB $C9 DB $EF : DW T1C3Loop1 : DB $02 DB $EF : DW T1C3Loop1 : DB $08 DB $EF : DW T1C3Loop2 : DB $08 DB $00 T1C3Loop1: DB !G1 DB !A1,$C8,$C8,$C8,$C8,$C8,$C8 DB !B1,$C8 DB !G1,$C8 DB $00 T1C3Loop2: DB !A1,$C8,$C8,$C8,$C8,$C8,$C8 DB !B1,$C8,$C8,$C8,$C8,$C8 DB !G0 DB $00 THEME1CHAN5: DB $E0,!Chan5inst DB $E1,$0C ;Panning: Somewhat left DB $ED,!vol5 ;Lower channel volume DB $EA,!Chan5transpose ;Transpose channel up: 12 steps (1 octave) ; DB $E7,$40 DB $10,$7F DB $F6 REP 24 : DB $C9 DB $EF : DW T1C3Loop1 : DB $01 DB $EF : DW T1C3Loop1 : DB $08 DB $EF : DW T1C3Loop2 : DB $08 DataEnd: DW $0000 ;No more data to transfer. Stick in a 0000 to signify that. org $8FE900 ;Free space for the custom room transition code RoomTransitionCode: LDA $7FFA02 CMP #$2222 BNE $01 RTS LDA #$2222 STA $7FFA02 ; LDA #$FF0F ;Load 4B song data ; JSL $808FC1 LDA #$FF03 ;Load 4B song data JSL $808FC1 LDA #$0005 ;Load song track 5 (First track from song data) JSL $808FC1 RTS } ; 22D78384 ; 02027BB6 ; 22D78384 ; 02037FB6 ; 22D78384 ; 020A9BB6