Actions

SCHG How-to

Extend Music Slots in Sonic 1

From Sonic Retro

Revision as of 19:25, 6 October 2008 by Mikel (talk | contribs) (New page: {{GuideBy|Mikel}} You may notice that in the Sound Test stops on $CF, and can't go any further than $CF. So here are instructions on how to extend the Music Slots to $FF in Sonic 1. To s...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

(Original guide by Mikel)

You may notice that in the Sound Test stops on $CF, and can't go any further than $CF. So here are instructions on how to extend the Music Slots to $FF in Sonic 1.

To start go to Sound_ChkValue, if you see this line:

<asm> cmpi.b #$E4,d7 bls.s Sound_E0toE4</asm> Add this under Sound_E0toE4:

<asm> cmpi.b #$FF,d7 bls.w Sound_E5toFF</asm> Then, go to Sound_81to9F, and add this above Sound_81to9F:

<asm>Sound_E5toFF: jsr sub_725CA(pc) movea.l (off_719A0).l,a4 subi.b #$E5,d7 move.b (a4,d7.w),$29(a6) movea.l (Go_MusicIndex_E5toFF).l,a4

                 jmp Music_Continue</asm>

Then go to loc_7202C, and change it to:

<asm> loc_7202C: jsr sub_725CA(pc) movea.l (off_719A0).l,a4 subi.b #$81,d7 move.b (a4,d7.w),$29(a6) movea.l (Go_MusicIndex).l,a4 Music_Continue: lsl.w #2,d7 movea.l (a4,d7.w),a4 moveq #0,d0 move.w (a4),d0 add.l a4,d0 move.l d0,$18(a6) move.b 5(a4),d0 move.b d0,$28(a6) tst.b $2A(a6) beq.s loc_72068 move.b $29(a6),d0</asm> Then, change:

<asm> Go_SoundTypes: dc.l SoundTypes ; XREF: Sound_Play Go_SoundD0: dc.l SoundD0Index ; XREF: Sound_D0toDF Go_MusicIndex: dc.l MusicIndex ; XREF: Sound_81to9F Go_SoundIndex: dc.l SoundIndex ; XREF: Sound_A0toCF off_719A0: dc.l byte_71A94 ; XREF: Sound_81to9F Go_PSGIndex: dc.l PSG_Index ; XREF: sub_72926</asm> To:

<asm> align $10 Go_SoundTypes: dc.l SoundTypes ; XREF: Sound_Play Go_SoundD0: dc.l SoundD0Index ; XREF: Sound_D0toDF Go_MusicIndex: dc.l MusicIndex ; XREF: Sound_81to9F Go_MusicIndex_E5toFF: dc.l MusicIndex_E5plus ; XREF: Sound_81to9F Go_SoundIndex: dc.l SoundIndex ; XREF: Sound_A0toCF off_719A0: dc.l byte_71A94 ; XREF: Sound_81to9F Go_PSGIndex: dc.l PSG_Index ; XREF: sub_72926</asm> Then, go to:

<asm>Music9F: incbin sound\music9F.bin even</asm> And add the following lines under the line I posted above:

<asm>MusicIndex_E5plus:

                               dc.l MusicE5, MusicE6

dc.l MusicE7, MusicE8 dc.l MusicE9, MusicEA dc.l MusicEB, MusicEC dc.l MusicED, MusicEE dc.l MusicEF, MusicF0 dc.l MusicF1, MusicF2 dc.l MusicF3, MusicF4

                               dc.l MusicF5, MusicF6

dc.l MusicF7, MusicF8 dc.l MusicF9, MusicFA dc.l MusicFB, MusicFC dc.l MusicFD, MusicFE dc.l MusicFF</asm>

Then, under MusicIndex_E5toFF, add these lines:

<asm>MusicE5: incbin sound\musicE5.bin even MusicE6: incbin sound\musicE6.bin even MusicE7: incbin sound\musicE7.bin even MusicE8: incbin sound\musicE8.bin even MusicE9: incbin sound\musicE9.bin even MusicEA: incbin sound\musicEA.bin even MusicEB: incbin sound\musicEB.bin even MusicEC: incbin sound\musicEC.bin even MusicED: incbin sound\musicED.bin even MusicEE: incbin sound\musicEE.bin even MusicEF: incbin sound\musicEF.bin even MusicF0: incbin sound\musicF0.bin even MusicF1: incbin sound\musicF1.bin even MusicF2: incbin sound\musicF2.bin even MusicF3: incbin sound\musicF3.bin even MusicF4: incbin sound\musicF4.bin even MusicF5: incbin sound\musicF5.bin even MusicF6: incbin sound\musicF6.bin even MusicF7: incbin sound\musicF7.bin even MusicF8: incbin sound\musicF8.bin even MusicF9: incbin sound\musicF9.bin even MusicFA: incbin sound\musicFA.bin even MusicFB: incbin sound\musicFB.bin even MusicFC: incbin sound\musicFC.bin even MusicFD: incbin sound\musicFD.bin even MusicFE: incbin sound\musicFE.bin even MusicFF: incbin sound\musicFF.bin even</asm> Next, we are going to extend the slots in the Sound Test, first go to LevSel_SndTest, and change:

<asm> moveq #$4F,d0 ; if sound test moves below 0, set to $4F</asm> To:

<asm> moveq #$7F,d0 ; if sound test moves below 0, set to $7F</asm> Then, go to LevSel_Right, and change:

<asm> cmpi.w #$50,d0</asm> To:

<asm> cmpi.w #$80,d0</asm> Last but not least, we are going to allow the Sound Test to read slots $E5 to $FF, so go to LevSel_NoCheat, and change:

<asm> cmpi.w #$9F,d0 ; is sound $80-$9F being played? ble.s LevSel_PlaySnd ; if yes, branch</asm> To:

<asm> cmpi.w #$FF,d0 ; is sound $E5-$FF being played? ble.s LevSel_PlaySnd ; if yes, branch</asm> Then, build the rom and check out your newly added tunes.