Actions

SCHG How-to

Difference between revisions of "Port Sonic 1's Sound Driver to Sonic 2"

From Sonic Retro

m (tabbing fixed)
(Updated for Xenowhirl's disassembly)
Line 8: Line 8:
  
 
==Instructions==
 
==Instructions==
Okay, first we're going to get the actual driver to load. Go to loc_45E, which should be this:
+
Okay, first we're going to get the actual driver to load. Go to VintRet, which should be this:
<asm>loc_45E:; CODE XREF: ROM:000004C2�j
+
<asm>VintRet:
; ROM:00000562�j ...
+
addq.l #1,($FFFFFE0C).w
addq.l #1,($FFFFFE0C).w
+
movem.l (sp)+,d0-a6
movem.l (sp)+,d0-a6
+
rte</asm>
rte</asm>
 
  
 
And change it to this...
 
And change it to this...
<asm>loc_45E:; CODE XREF: ROM:000004C2�j
+
<asm>VintRet:
; ROM:00000562�j ...
+
jsr Init_Sonic1_Sound_Driver ; init Sonic 1 sound driver
jsr Init_Sonic1_Sound_Driver; Esrael L. G. Neto
 
 
addq.l #1,($FFFFFE0C).w
 
addq.l #1,($FFFFFE0C).w
 
movem.l (sp)+,d0-a6
 
movem.l (sp)+,d0-a6
 
rte</asm>
 
rte</asm>
  
Next, go to sub_130A, which should be this:
+
Next, go to JmpTo_SoundDriverLoad, which should be this:
<asm>sub_130A:; CODE XREF: ROM:00000386�p
+
<asm>JmpTo_SoundDriverLoad
nop
+
nop
jmp loc_EC000
+
jmp (SoundDriverLoad).l
; End of function sub_130A</asm>
+
; End of function JmpTo_SoundDriverLoad</asm>
  
 
And change it to this...
 
And change it to this...
<asm>sub_130A:; CODE XREF: ROM:00000386�p
+
<asm>JmpTo_SoundDriverLoad:
 
nop
 
nop
;jmp loc_EC000
+
; jmp (SoundDriverLoad).l
 
move.w  #$0100, ($00A11100); Esrael L. G. Neto Add Sonic 1 Sound Driver
 
move.w  #$0100, ($00A11100); Esrael L. G. Neto Add Sonic 1 Sound Driver
 
move.w  #$0100, ($00A11200); Esrael L. G. Neto Add Sonic 1 Sound Driver
 
move.w  #$0100, ($00A11200); Esrael L. G. Neto Add Sonic 1 Sound Driver
 
lea Kos_Z80, A0; Esrael L. G. Neto Add Sonic 1 Sound Driver
 
lea Kos_Z80, A0; Esrael L. G. Neto Add Sonic 1 Sound Driver
 
lea ($00A00000), A1; Esrael L. G. Neto Add Sonic 1 Sound Driver
 
lea ($00A00000), A1; Esrael L. G. Neto Add Sonic 1 Sound Driver
bsr KozDec_193A; Esrael L. G. Neto Add Sonic 1 Sound Driver
+
bsr KozDec; Esrael L. G. Neto Add Sonic 1 Sound Driver
 
move.b  #((SegaPCM>>$10)&$FF), ($00A00019); Esrael L. G. Neto Add Sonic 1 Sound Driver
 
move.b  #((SegaPCM>>$10)&$FF), ($00A00019); Esrael L. G. Neto Add Sonic 1 Sound Driver
 
move.w  #$0000, ($00A11200); Esrael L. G. Neto Add Sonic 1 Sound Driver
 
move.w  #$0000, ($00A11200); Esrael L. G. Neto Add Sonic 1 Sound Driver
Line 47: Line 45:
 
move.w  #$0000, ($00A11100); Esrael L. G. Neto Add Sonic 1 Sound Driver
 
move.w  #$0000, ($00A11100); Esrael L. G. Neto Add Sonic 1 Sound Driver
 
rts ; Esrael L. G. Neto Add Sonic 1 Sound Driver
 
rts ; Esrael L. G. Neto Add Sonic 1 Sound Driver
; End of function sub_130A</asm>
+
; End of function JmpTo_SoundDriverLoad</asm>
  
Next, find sub_135E, which should be this:
+
Next, find PlayMusic, which should be this:
<asm>sub_135E:; CODE XREF: ROM:000037BC�p
+
<asm>PlayMusic:
; ROM:0000399C�p ...
+
tst.b ($FFFFFFE0).w
tst.b ($FFFFFFE0).w
+
bne.s +
bne.s loc_136A
+
move.b d0,($FFFFFFE0).w
move.b d0,($FFFFFFE0).w
+
rts
rts
+
+
; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
+
move.b d0,($FFFFFFE4).w
 
+
rts
loc_136A:; CODE XREF: sub_135E+4�j
+
; End of function PlayMusic</asm>
move.b d0,($FFFFFFE4).w
 
rts
 
; End of function sub_135E</asm>
 
  
 
And change it to this...
 
And change it to this...
<asm>sub_135E:; CODE XREF: ROM:000037BC�p
+
<asm>PlayMusic:
; ROM:0000399C�p ...
+
; tst.b ($FFFFFFE0).w
;tst.b ($FFFFFFE0).w
+
; bne.s +
;bne.s loc_136A
+
; move.b d0,($FFFFFFE0).w
;move.b d0,($FFFFFFE0).w
+
move.b d0,($FFFFF00A).w
move.b D0, ($FFFFF00A).w; Esrael L. G. Neto Change Sonic 1 Sound Driver
+
rts
rts
+
+
; ==============================================================================================
+
move.b d0,($FFFFF00A).w
 +
rts
 +
; End of function PlayMusic</asm>
  
loc_136A:; CODE XREF: sub_135E+4�j
+
Next find PlaySound, and find this:
;move.b d0,($FFFFFFE4).w
+
<asm>PlaySound:
move.b D0, ($FFFFF00A).w; Esrael L. G. Neto Change Sonic 1 Sound Driver
+
move.b d0,($FFFFFFE1).w
rts
+
rts
; End of function sub_135E</asm>
+
; End of function PlaySound</asm>
 
 
Next find sub_1370, and find this:
 
<asm>sub_1370:; CODE XREF: ROM:0000392C�p
 
; ROM:00003CB4�p ...
 
move.b d0,($FFFFFFE1).w
 
rts
 
; End of function sub_1370</asm>
 
  
 
And replace it with this...
 
And replace it with this...
<asm>sub_1370:; CODE XREF: ROM:0000392C�p
+
<asm>PlaySound:
; ROM:00003CB4�p ...
+
move.b d0,($FFFFF00B).w
;move.b d0,($FFFFFFE1).w
+
rts
        move.b D0, ($FFFFF00B).w; Esrael L. G. Neto Change Sonic 1 Sound Driver
+
; End of function PlaySound</asm>
rts
 
; End of function sub_1370</asm>
 
  
Now, we're going to fix the broken sound effects, such as rings. Look for sub_1376. It should be this:
+
Now, we're going to fix the broken sound effects, such as rings. Look for PlaySoundStereo. It should be this:
<asm>sub_1376: ; CODE XREF: sub_11FC2+54�j
+
<asm>PlaySoundStereo:
; sub_11FC2+B0�j ...
+
move.b d0,($FFFFFFE2).w
move.b d0,($FFFFFFE2).w
+
rts
rts
+
; End of function PlaySoundStereo</asm>
; End of function sub_1376</asm>
 
  
 
Replace it with this:
 
Replace it with this:
<asm>sub_1376: ; CODE XREF: sub_11FC2+54�j
+
<asm>PlaySoundStereo:
; sub_11FC2+B0�j ...
+
bra.s PlayMusic ; skip over routine (For S1 driver)
bra.s sub_135E; branch to normal sfx playing routine
 
 
move.b d0,($FFFFFFE2).w
 
move.b d0,($FFFFFFE2).w
 
rts
 
rts
; End of function sub_1376</asm>
+
; End of function PlaySoundStereo</asm>
 
 
Now, look for sub_137C. It should be this:
 
<asm>sub_137C:; CODE XREF: sub_FE70+24�p h+B576�p ...
 
tst.b 1(a0)
 
bpl.s locret_1386
 
move.b d0,($FFFFFFE1).w
 
  
locret_1386:; CODE XREF: sub_137C+4�j
+
Now, look for PlaySoundLocal. It should be this:
rts
+
<asm>PlaySoundLocal:
; End of function sub_137C</asm>
+
tst.b 1(a0)
 +
bpl.s +
 +
move.b d0,($FFFFFFE1).w
 +
+
 +
rts
 +
; End of function PlaySoundLocal</asm>
  
 
Replace it with this:
 
Replace it with this:
<asm>sub_137C:; CODE XREF: sub_FE70+24�p h+B576�p ...
+
<asm>PlaySoundLocal:
 
tst.b 1(a0)
 
tst.b 1(a0)
bpl.s locret_1386
+
bpl.s +
;move.b d0,($FFFFFFE1).w
+
move.b d0,($FFFFF00B).w
move.b D0, ($FFFFF00B).w; Esrael L. G. Neto Change Sonic 1 Sound Driver
+
+
 +
rts</asm>
  
locret_1386:; CODE XREF: sub_137C+4�j
+
Next, we're going to fix the music so it stops correctly when you pause. Find the "+" after PauseGame, which should be this:
rts
+
<asm>+
; End of function sub_137C</asm>
+
move.w #1,($FFFFF63A).w ; freeze time
 
+
move.b #-2,($FFFFFFE0).w ; pause music</asm>
Next, we're going to fix the music so it stops correctly when you pause. Find loc_13A6, which should be this:
 
<asm>loc_13A6:; CODE XREF: sub_1388+E�j
 
move.w #1,($FFFFF63A).w
 
move.b #-2,($FFFFFFE0).w</asm>
 
  
 
And replace it with this...
 
And replace it with this...
<asm>loc_13A6:; CODE XREF: sub_1388+E�j
+
<asm>+
move.w #1,($FFFFF63A).w
+
move.w #1,($FFFFF63A).w ; freeze time
;move.b #-2,($FFFFFFE0).w
+
move.b #1,($FFFFF003).w ; pause music</asm>
move.b #$01,($FFFFF003).w; Esrael L. G. Neto Change Sonic 1 Sound Driver - Pause</asm>
 
  
 
Next, go to loc_13F2, which should be this:
 
Next, go to loc_13F2, which should be this:
<asm>loc_13F2:; CODE XREF: sub_1388+4A�j
+
<asm>loc_13F2:
move.b #-1,($FFFFFFE0).w</asm>
+
move.b #-1,($FFFFFFE0).w</asm>
  
 
And replace it with this...
 
And replace it with this...
<asm>loc_13F2:; CODE XREF: sub_1388+4A�j
+
<asm>loc_13F2:
;move.b #-1,($FFFFFFE0).w
+
move.b #$80,($FFFFF003).w</asm>
move.b #$80,($FFFFF003).w; Esrael L. G. Neto Change Sonic 1 Sound Driver - Pause</asm>
 
  
Now, find loc_1400, which should be this:
+
Now, find Pause_SlowMo, which should be this:
<asm>loc_1400:; CODE XREF: sub_1388+52�j sub_1388+5A�j
+
<asm>Pause_SlowMo:
move.w #1,($FFFFF63A).w
+
move.w #1,($FFFFF63A).w
move.b #-1,($FFFFFFE0).w
+
move.b #-1,($FFFFFFE0).w
rts</asm>
+
rts</asm>
  
 
And replace it with this...
 
And replace it with this...
<asm>loc_1400:; CODE XREF: sub_1388+52�j sub_1388+5A�j
+
<asm>Pause_SlowMo:
 
move.w #1,($FFFFF63A).w
 
move.w #1,($FFFFF63A).w
;move.b #-1,($FFFFFFE0).w
+
move.b #1,($FFFFF003).w
move.b #$01,($FFFFF003).w; Esrael L. G. Neto Change Sonic 1 Sound Driver - Pause
 
 
rts</asm>
 
rts</asm>
  
 
Next, find loc_541A, which should be this:
 
Next, find loc_541A, which should be this:
<asm>loc_541A:; CODE XREF: ROM:00005212�j
+
<asm>loc_541A:
; ROM:0000525A�j
+
move.b #-1,($FFFFFFE0).w
move.b #-1,($FFFFFFE0).w
+
move.b #8,($FFFFF62A).w
move.b #8,($FFFFF62A).w
+
bra.w DelayProgram</asm>
bra.w sub_3384</asm>
 
  
 
And replace it with this...
 
And replace it with this...
<asm>loc_541A:; CODE XREF: ROM:00005212�j
+
<asm>loc_541A:
; ROM:0000525A�j
+
move.b #1,($FFFFF003).w
;move.b #-1,($FFFFFFE0).w
 
move.b #$01,($FFFFF003).w; Esrael L. G. Neto Change Sonic 1 Sound Driver - Pause
 
 
move.b #8,($FFFFF62A).w
 
move.b #8,($FFFFF62A).w
bra.w sub_3384</asm>
+
bra.w DelayProgram</asm>
  
 
Now, we're going to fix the underwater palettes, since the sound driver uses some space in RAM that, in S2, is used for underwater palettes. Do a search and replace (ctrl+h) and replace all instances of "$FFFFF08" with "$FFFFFA8" - what this will do is make the game read from the Sonic 1 location for underwater palettes, which is unused in S2, and unaffected by the sound driver.
 
Now, we're going to fix the underwater palettes, since the sound driver uses some space in RAM that, in S2, is used for underwater palettes. Do a search and replace (ctrl+h) and replace all instances of "$FFFFF08" with "$FFFFFA8" - what this will do is make the game read from the Sonic 1 location for underwater palettes, which is unused in S2, and unaffected by the sound driver.
  
Next, go to sub_2764. This is the Sonic 2 equivalent of "PalLoad4_Water" in Sonic 1, and what we're going to do is change a line in it to match the Sonic 1 routine, so the underwater palettes load to the correct address. The routine should look like this:
+
Next, go to PalLoad4_Water. This is the Sonic 2 equivalent of "PalLoad4_Water" in Sonic 1, and what we're going to do is change a line in it to match the Sonic 1 routine, so the underwater palettes load to the correct address. The routine should look like this:
<asm>sub_2764:; CODE XREF: ROM:000042E4�p
+
<asm>PalLoad4_Water:
lea (PalPoint).l,a1
+
lea (PalPointers).l,a1
lsl.w #3,d0
+
lsl.w #3,d0
adda.w d0,a1
+
adda.w d0,a1
movea.l (a1)+,a2
+
movea.l (a1)+,a2
movea.w (a1)+,a3
+
movea.w (a1)+,a3
suba.l #$B00,a3
+
suba.l #$B00,a3
move.w (a1)+,d7
+
move.w (a1)+,d7
  
loc_277A:; CODE XREF: sub_2764+18�j
+
- move.l (a2)+,(a3)+
move.l (a2)+,(a3)+
+
dbf d7,-
dbf d7,loc_277A
+
rts
rts
+
; End of function PalLoad4_Water</asm>
; End of function sub_2764</asm>
 
  
 
Change it to this:
 
Change it to this:
<asm>sub_2764:; CODE XREF: ROM:000042E4�p
+
<asm>PalLoad4_Water:
lea (PalPoint).l,a1
+
lea (PalPointers).l,a1
 
lsl.w #3,d0
 
lsl.w #3,d0
 
adda.w d0,a1
 
adda.w d0,a1
Line 206: Line 181:
 
move.w (a1)+,d7
 
move.w (a1)+,d7
  
loc_277A:; CODE XREF: sub_2764+18�j
+
- move.l (a2)+,(a3)+
move.l (a2)+,(a3)+
+
dbf d7,-
dbf d7,loc_277A
+
rts
rts
+
; End of function PalLoad4_Water</asm>
; End of function sub_2764</asm>
 
  
 
What this does is change how much the game subtracts from $FB00, in order to calculate the location to move underwater palettes to.
 
What this does is change how much the game subtracts from $FB00, in order to calculate the location to move underwater palettes to.
 
The last thing we have to do in order to fix underwater palettes for good is to change a VDP instruction, which is what changes the palette fully to the underwater pallete once you're deep enough underwater, and the raster effects are no longer in effect. Do a search and replace for "-$69076AC0" and replace all instances of it with "$96FD9540" - this will make sure that when you're deep enough underwater, the correct palette is loaded.
 
  
 
The final step is to grab a slightly modified version of the Sonic 1 sound driver from Hivebrain's 2005 Sonic 1 disassembly (link below), and insert it into the Sonic 2 disassembly - the location does not matter, though I personally recommend the end of the ROM. You can also delete the Sonic 2 sound driver now, if you wish, though it is not required to do so.
 
The final step is to grab a slightly modified version of the Sonic 1 sound driver from Hivebrain's 2005 Sonic 1 disassembly (link below), and insert it into the Sonic 2 disassembly - the location does not matter, though I personally recommend the end of the ROM. You can also delete the Sonic 2 sound driver now, if you wish, though it is not required to do so.

Revision as of 19:21, 8 March 2008

(Original guide by Tweaker)

Introduction

For anyone who's worked with Sonic 2 before, you'll notice that managing music can be a bit of a hassle. Music has to be in a specific location, has to stay within a certain sound bank... and there's a limited number of sounds you can have in the game. However, the sound driver in Sonic 1 is entirely written in 68k (except for the DAC driver), making it much easier to edit, and much easier to manage music with. You can place music data anywhere, as the pointers use relative addressing, and there are no limitations on where you can place music data.

So, when Puto comes to me with his own port of the Sonic 1 sound driver, and said he had problems, I showed him a personal port that Esrael made for Sonic 2 Megamix. Together, we were able to fully patch up all the issues that the driver has when ported to Sonic 2. Therefore, we decided we'd make a guide, that, when followed correctly, allows anybody to use the Sonic 1 sound driver in their hack! Included below is the Sonic 1 sound driver in its own separate ASM file, which you can edit freely, along with the original folder structure for the sound driver's music data, sound data, etc.

Anyway, on with the guide!

Instructions

Okay, first we're going to get the actual driver to load. Go to VintRet, which should be this: <asm>VintRet: addq.l #1,($FFFFFE0C).w movem.l (sp)+,d0-a6 rte</asm>

And change it to this... <asm>VintRet: jsr Init_Sonic1_Sound_Driver ; init Sonic 1 sound driver addq.l #1,($FFFFFE0C).w movem.l (sp)+,d0-a6 rte</asm>

Next, go to JmpTo_SoundDriverLoad, which should be this: <asm>JmpTo_SoundDriverLoad nop jmp (SoundDriverLoad).l

End of function JmpTo_SoundDriverLoad</asm>

And change it to this... <asm>JmpTo_SoundDriverLoad: nop

jmp (SoundDriverLoad).l

move.w #$0100, ($00A11100); Esrael L. G. Neto Add Sonic 1 Sound Driver move.w #$0100, ($00A11200); Esrael L. G. Neto Add Sonic 1 Sound Driver lea Kos_Z80, A0; Esrael L. G. Neto Add Sonic 1 Sound Driver lea ($00A00000), A1; Esrael L. G. Neto Add Sonic 1 Sound Driver bsr KozDec; Esrael L. G. Neto Add Sonic 1 Sound Driver move.b #((SegaPCM>>$10)&$FF), ($00A00019); Esrael L. G. Neto Add Sonic 1 Sound Driver move.w #$0000, ($00A11200); Esrael L. G. Neto Add Sonic 1 Sound Driver nop ; Esrael L. G. Neto Add Sonic 1 Sound Driver nop ; Esrael L. G. Neto Add Sonic 1 Sound Driver nop ; Esrael L. G. Neto Add Sonic 1 Sound Driver nop ; Esrael L. G. Neto Add Sonic 1 Sound Driver move.w #$0100, ($00A11200); Esrael L. G. Neto Add Sonic 1 Sound Driver move.w #$0000, ($00A11100); Esrael L. G. Neto Add Sonic 1 Sound Driver rts ; Esrael L. G. Neto Add Sonic 1 Sound Driver

End of function JmpTo_SoundDriverLoad</asm>

Next, find PlayMusic, which should be this: <asm>PlayMusic: tst.b ($FFFFFFE0).w bne.s + move.b d0,($FFFFFFE0).w rts + move.b d0,($FFFFFFE4).w rts

End of function PlayMusic</asm>

And change it to this... <asm>PlayMusic:

tst.b ($FFFFFFE0).w
bne.s +
move.b d0,($FFFFFFE0).w

move.b d0,($FFFFF00A).w rts + move.b d0,($FFFFF00A).w rts

End of function PlayMusic</asm>

Next find PlaySound, and find this: <asm>PlaySound: move.b d0,($FFFFFFE1).w rts

End of function PlaySound</asm>

And replace it with this... <asm>PlaySound: move.b d0,($FFFFF00B).w rts

End of function PlaySound</asm>

Now, we're going to fix the broken sound effects, such as rings. Look for PlaySoundStereo. It should be this: <asm>PlaySoundStereo: move.b d0,($FFFFFFE2).w rts

End of function PlaySoundStereo</asm>

Replace it with this: <asm>PlaySoundStereo: bra.s PlayMusic ; skip over routine (For S1 driver) move.b d0,($FFFFFFE2).w rts

End of function PlaySoundStereo</asm>

Now, look for PlaySoundLocal. It should be this: <asm>PlaySoundLocal: tst.b 1(a0) bpl.s + move.b d0,($FFFFFFE1).w + rts

End of function PlaySoundLocal</asm>

Replace it with this: <asm>PlaySoundLocal: tst.b 1(a0) bpl.s + move.b d0,($FFFFF00B).w + rts</asm>

Next, we're going to fix the music so it stops correctly when you pause. Find the "+" after PauseGame, which should be this: <asm>+ move.w #1,($FFFFF63A).w ; freeze time move.b #-2,($FFFFFFE0).w ; pause music</asm>

And replace it with this... <asm>+ move.w #1,($FFFFF63A).w ; freeze time move.b #1,($FFFFF003).w ; pause music</asm>

Next, go to loc_13F2, which should be this: <asm>loc_13F2: move.b #-1,($FFFFFFE0).w</asm>

And replace it with this... <asm>loc_13F2: move.b #$80,($FFFFF003).w</asm>

Now, find Pause_SlowMo, which should be this: <asm>Pause_SlowMo: move.w #1,($FFFFF63A).w move.b #-1,($FFFFFFE0).w rts</asm>

And replace it with this... <asm>Pause_SlowMo: move.w #1,($FFFFF63A).w move.b #1,($FFFFF003).w rts</asm>

Next, find loc_541A, which should be this: <asm>loc_541A: move.b #-1,($FFFFFFE0).w move.b #8,($FFFFF62A).w bra.w DelayProgram</asm>

And replace it with this... <asm>loc_541A: move.b #1,($FFFFF003).w move.b #8,($FFFFF62A).w bra.w DelayProgram</asm>

Now, we're going to fix the underwater palettes, since the sound driver uses some space in RAM that, in S2, is used for underwater palettes. Do a search and replace (ctrl+h) and replace all instances of "$FFFFF08" with "$FFFFFA8" - what this will do is make the game read from the Sonic 1 location for underwater palettes, which is unused in S2, and unaffected by the sound driver.

Next, go to PalLoad4_Water. This is the Sonic 2 equivalent of "PalLoad4_Water" in Sonic 1, and what we're going to do is change a line in it to match the Sonic 1 routine, so the underwater palettes load to the correct address. The routine should look like this: <asm>PalLoad4_Water: lea (PalPointers).l,a1 lsl.w #3,d0 adda.w d0,a1 movea.l (a1)+,a2 movea.w (a1)+,a3 suba.l #$B00,a3 move.w (a1)+,d7

- move.l (a2)+,(a3)+ dbf d7,- rts

End of function PalLoad4_Water</asm>

Change it to this: <asm>PalLoad4_Water: lea (PalPointers).l,a1 lsl.w #3,d0 adda.w d0,a1 movea.l (a1)+,a2 movea.w (a1)+,a3 suba.l #$80,a3 move.w (a1)+,d7

- move.l (a2)+,(a3)+ dbf d7,- rts

End of function PalLoad4_Water</asm>

What this does is change how much the game subtracts from $FB00, in order to calculate the location to move underwater palettes to.

The final step is to grab a slightly modified version of the Sonic 1 sound driver from Hivebrain's 2005 Sonic 1 disassembly (link below), and insert it into the Sonic 2 disassembly - the location does not matter, though I personally recommend the end of the ROM. You can also delete the Sonic 2 sound driver now, if you wish, though it is not required to do so.

You can either use the include directive to insert S1 Sound Driver.asm, or you can simply copy/paste what's in there. Either will be sufficient.

Note

Certain sound effects and music from Sonic 2 WILL be missing, and you WILL need to add these yourself if you wish to still have them in game. To add a sound effect/music, simply tack it at the end of SoundIndex or MusicIndex. You can also get rid of SoundD0Index (and related setup) if you wish, as Sonic 2 does not have any sound effects that require it. Kega may also mess up a tad bit, not sure why - if anyone can figure it out, let us know.

Also, Sega sound is garbled. If you want to use it, either use a custom song, or figure out how to get it working. If anyone figures out how to do the latter, it would be appreciated if you shared your methods.

Sound Driver Files

Download.svg Download the Sonic 1 sound driver files
File: S1SoundDriverFiles.zip (66 kB) (info)

Credits

  • Varion Icaria - Puto's sound driver port.
  • Esrael - My driver port, plus fixes for things broken in Puto's port, such as hanging on the title card. Extra thanks for fixing the Sega sound.
  • Puto - Fixes for underwater palette stuff, as well as special stage ring stuff, and various other fixes.
  • StephenUK - Hints on how to fix the underwater stuff.
  • drx - Hacking CulT's VDP calculator.
  • Myself - I helped Puto fix the underwater stuff, and I wrote the guide. =P

And that's it! Enjoy! Let me or Puto know if there's any issues left, and we'll try and patch them up.