Difference between revisions of "SCHG How-to:Port Flamewing's Sonic 3 & Knuckles Sound Driver"
From Sonic Retro
Line 892: | Line 892: | ||
{{S1Howtos}} | {{S1Howtos}} | ||
− | | | + | |{{PAGENAME}}]] |
Revision as of 16:56, 12 May 2020
(Original guide by KZG4)
Many people have been using the older Sonic 3 and Knuckles sound driver port made by Kram1024 many years ago. I decided to try and port over Flamewing's improved Sonic 3 and Knuckles sound driver so people that intend to port over a Z80 based sound driver will be able to use a newer one.
Contents
Note
This guide is meant for a fresh install. I have not made this in order for the user to copy this over a disasm with Port Sonic 3 Sound Driver Part 1 applied onto it. I have not tested it so I have no idea if adding this guide over it will work.
Step 1: Resources
First you need the following:
- An ASM68K version of Hivebrain's disasm of Sonic 1. You can use the original version: Sonic 1 (Split and Text by Hivebrain) (ASM68K) (info) (1,016 kB) or you can use a modified version, such as Project Sonic 1: Two-Eight by MarkeyJester
- This File (info) (3 MB), which contains the S3K driver and required files.
Step 2: Setup
Make a new .asm files called 'Macros.asm' and include it in your disasm's "_inc" folder. Put this code in the file:
SonicControl equ $FFFFF602
Joypad equ $FFFFF604
Held equ 0
Press equ 1
iStart equ 7
iA equ 6
iC equ 5
iB equ 4
iRight equ 3
iLeft equ 2
iDown equ 1
iUp equ 0
MaskStart equ 1<<7
MaskA equ 1<<6
MaskC equ 1<<5
MaskB equ 1<<4
MaskRight equ 1<<3
MaskLeft equ 1<<2
MaskDown equ 1<<1
MaskUp equ 1
; =============================================================
; Macro to check button presses
; Arguments: 1 - buttons to check
; 2 - bitfield to check
; -------------------------------------------------------------
tpress macro
move.b (\2+1),d0
andi.b #\1,d0
endm
; =============================================================
; Macro to check if buttons are held
; Arguments: 1 - buttons to check
; 2 - bitfield to check
; -------------------------------------------------------------
theld macro
move.b \2,d0
andi.b #\1,d0
endm
; ---------------------------------------------------------------------------
; Align and pad
; input: length to align to, value to use as padding (default is 0)
; ---------------------------------------------------------------------------
align: macro
if (narg=1)
dcb.b \1-(*%\1),0
else
dcb.b \1-(*%\1),\2
endc
endm
; ---------------------------------------------------------------------------
; Set a VRAM address via the VDP control port.
; input: 16-bit VRAM address, control port (default is ($C00004).l)
; ---------------------------------------------------------------------------
locVRAM: macro loc,controlport
if (narg=1)
move.l #($40000000+((loc&$3FFF)<<16)+((loc&$C000)>>14)),($C00004).l
else
move.l #($40000000+((loc&$3FFF)<<16)+((loc&$C000)>>14)),controlport
endc
endm
; ---------------------------------------------------------------------------
; DMA copy data from 68K (ROM/RAM) to the VRAM
; input: source, length, destination
; ---------------------------------------------------------------------------
writeVRAM: macro
lea (vdp_control_port).l,a5
move.l #$94000000+(((\2>>1)&$FF00)<<8)+$9300+((\2>>1)&$FF),(a5)
move.l #$96000000+(((\1>>1)&$FF00)<<8)+$9500+((\1>>1)&$FF),(a5)
move.w #$9700+((((\1>>1)&$FF0000)>>16)&$7F),(a5)
move.w #$4000+(\3&$3FFF),(a5)
move.w #$80+((\3&$C000)>>14),(v_vdp_buffer2).w
move.w (v_vdp_buffer2).w,(a5)
endm
; ---------------------------------------------------------------------------
; DMA copy data from 68K (ROM/RAM) to the CRAM
; input: source, length, destination
; ---------------------------------------------------------------------------
writeCRAM: macro
lea (vdp_control_port).l,a5
move.l #$94000000+(((\2>>1)&$FF00)<<8)+$9300+((\2>>1)&$FF),(a5)
move.l #$96000000+(((\1>>1)&$FF00)<<8)+$9500+((\1>>1)&$FF),(a5)
move.w #$9700+((((\1>>1)&$FF0000)>>16)&$7F),(a5)
move.w #$C000+(\3&$3FFF),(a5)
move.w #$80+((\3&$C000)>>14),(v_vdp_buffer2).w
move.w (v_vdp_buffer2).w,(a5)
endm
; ---------------------------------------------------------------------------
; stop the Z80
; ---------------------------------------------------------------------------
stopZ80: macro
move.w #$100,($A11100).l
@wait: btst #0,($A11100).l
bne.s @wait
endm
; ---------------------------------------------------------------------------
; wait for Z80 to stop
; ---------------------------------------------------------------------------
waitZ80: macro
@wait: btst #0,($A11100).l
bne.s @wait
endm
stopZ80a: macro
move.w #$100,($A11100).l
endm
; ---------------------------------------------------------------------------
; reset the Z80
; ---------------------------------------------------------------------------
resetZ80: macro
move.w #$100,($A11200).l
endm
resetZ80a: macro
move.w #0,($A11200).l
endm
; ---------------------------------------------------------------------------
; start the Z80
; ---------------------------------------------------------------------------
startZ80: macro
move.w #0,($A11100).l
endm
; ---------------------------------------------------------------------------
; disable interrupts
; ---------------------------------------------------------------------------
disable_ints: macro
move #$2700,sr
endm
; ---------------------------------------------------------------------------
; enable interrupts
; ---------------------------------------------------------------------------
enable_ints: macro
move #$2300,sr
endm
; ---------------------------------------------------------------------------
; play a sound effect or music
; input: track, terminate routine (leave blank to not terminate)
; ---------------------------------------------------------------------------
music: macro track,terminate
move.w #track,d0
if (narg=1)
jsr (PlaySound).l
else
jmp (PlaySound).l
endc
endm
sfx: macro track,terminate
move.w #track,d0
if (narg=1)
jsr (PlaySound_Special).l
else
jmp (PlaySound_Special).l
endc
endm
This code adds some macros that the S3K driver uses, along with controller input macros that you may find helpful.
Now, at the top of your disasm (before StartOfROM:) add this:
include 'Macros.asm'
This will include the code into the assembly process.
Step 3: Removing the Sonic 1 Sound Driver
First, We need to locate the label "Go_SoundTypes:" in Sonic1.asm Delete all the code from Go_SoundTypes: until EndOfRom:
Then, Empty out the "sound" folder in your disasm. Replace it's contents with the contents of the "Sound4Guide.zip" File I linked above.
Step 4: Inserting the Sonic 3K Sound Driver
After you have removed the Sonic 1 Sound Driver, Locate the SoundDriverLoad Routine. The routine will look like this:
SoundDriverLoad: ; XREF: GameClrRAM; TitleScreen
nop
move.w #$100,($A11100).l ; stop the Z80
move.w #$100,($A11200).l ; reset the Z80
lea (Kos_Z80).l,a0 ; load sound driver
lea ($A00000).l,a1
bsr.w KosDec ; decompress
move.w #0,($A11200).l
nop
nop
nop
nop
move.w #$100,($A11200).l ; reset the Z80
move.w #0,($A11100).l ; start the Z80
rts
; End of function SoundDriverLoad
Now, replace this routine with this:
SoundDriverLoad: ; XREF: GameClrRAM; TitleScreen
LoadZ80drv:
nop
stopZ80a
resetZ80
lea (RomEndLoc).l,a0
move.l (a0),d0
addq.l #1,d0
movea.l d0,a0
lea ($A00000).l,a1
jsr KosDec
; lea (DriverResetData).l,a0
; lea ($A01C8A).l,a1 ; z80 ram start of variables (A01C00 in older version)
; move.w #DriverResetDataEnd-DriverResetData,d0
;DriverResetDataLoadLoop:
; move.b (a0)+,(a1)+
; dbf d0,DriverResetDataLoadLoop
btst #0,($C00005).l ; check video mode
sne ($A01C02).l ; set PAL mode flag
resetZ80a
nop
nop
nop
nop
resetZ80
startZ80
rts
; End of function SoundDriverLoad
DriverResetData:
dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DriverResetDataEnd:
Locate "Playsound:". It and the routines surrounding it should look like this:
; ---------------------------------------------------------------------------
; Subroutine to play a sound or music track
; ---------------------------------------------------------------------------
; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
PlaySound:
move.b d0,($FFFFF00A).w
rts
; End of function PlaySound
; ---------------------------------------------------------------------------
; Subroutine to play a special sound/music (E0-E4)
;
; E0 - Fade out
; E1 - Sega
; E2 - Speed up
; E3 - Normal speed
; E4 - Stop
; ---------------------------------------------------------------------------
; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
PlaySound_Special:
move.b d0,($FFFFF00B).w
rts
; End of function PlaySound_Special
; ===========================================================================
; ---------------------------------------------------------------------------
; Unused sound/music subroutine
; ---------------------------------------------------------------------------
PlaySound_Unk:
move.b d0,($FFFFF00C).w
rts
Replace all of those routines with these:
; ---------------------------------------------------------------------------
; Z80 Driver PlaySound
; ---------------------------------------------------------------------------
PlaySound:
cmpi.w #$FB,d0
blt.s PlayNotSpecialFlag
bhi.s TestForNormalSpeed
move.w #8,d0
jmp SetTempo
TestForNormalSpeed:
cmpi.w #$FC,d0
bne.s PlayNotSpecialFlag
clr.w d0
jmp SetTempo
PlayNotSpecialFlag:
stopZ80a
waitz80
move.b d0,($A01C0A).l
startZ80
rts
; End of function PlaySound
; ---------------------------------------------------------------------------
; Unused sound/music subroutine
; ---------------------------------------------------------------------------
PlaySound_Unk:
nop
; ---------------------------------------------------------------------------
; Subroutine to play a special sound/music (FB-FF)
; ---------------------------------------------------------------------------
PlaySound_Special:
stopZ80a
waitz80
cmp.b ($A01C0B).l,d0
beq.s PlaySound_Special1
tst.b ($A01C0B).l
bne.s PlaySound_Special0
move.b d0,($A01C0B).l
startZ80
rts
PlaySound_Special0:
move.b d0,($A01C0C).l
PlaySound_Special1:
startZ80
SkipPlaySound_Special:
rts
; End of function PlaySound_Special
; ---------------------------------------------------------------------------
; Subroutine to change the music tempo
; ---------------------------------------------------------------------------
SetTempo:
stopZ80a
waitz80
move.b D0,($A01C08).l
startZ80
rts
Step 5: Modifying Build.bat
Now, we need to modify build.bat
It will normally look like this:
@echo off
rem include.exe sonic1.asm s1comb.asm
REM ::: automatic recompression of data - disabled by default because it's slow
REM ::: remove "REM" from the lines below to re-enable it
REM derecmp.exe nc artnem_u artnem
REM derecmp.exe kc artkos_u artkos
REM derecmp.exe ec mapeni_u mapeni
REM derecmp.exe ec map16_u map16
REM derecmp.exe kc map256_u map256
REM derecmp.exe ec sslay_u sslayout
rem snasm68k.exe -emax 0 -p -o ae- s1comb.asm, s1built.bin
asm68k /o op+ /o os+ /o ow+ /o oz+ /o oaq+ /o osq+ /o omq+ /p /o ae- sonic1.asm, s1built.bin
rompad.exe s1built.bin 255 0
fixheadr.exe s1built.bin
pause
Replace the contents with this:
@echo off
asm68k /k /o op+ /o os+ /o ow+ /o oz+ /o oaq+ /o osq+ /o omq+ /p /o ae- sonic1.asm, s1built.bin >errors.txt, sonic1.lst
cd Sound
build.bat
cd ..
rem rompad.exe s1built.bin 255 0
rem fixheadr.exe s1built.bin
pause
Now the rom will build correctly.
Step 6: Changing SFX
SFX and music Will not play correctly due to the sounds not being at the same values as Sonic 1. This is easy to fix. Go into "Z80 Sound Driver.asm" In your "sound" folder. Locate this:
SndBank: startBank
SEGA_PCM: binclude "Sound/Sega PCM.bin"
SEGA_PCM_End
even
Sound_33: include "SK/SFX/33.asm"
Sound_34: include "SK/SFX/34.asm"
Sound_35: include "SK/SFX/35.asm"
Sound_36: include "SK/SFX/36.asm"
Sound_37: include "SK/SFX/37.asm"
Sound_38: include "SK/SFX/38.asm"
Sound_39: include "SK/SFX/39.asm"
Sound_3A: include "SK/SFX/3A.asm"
Sound_3B: include "SK/SFX/3B.asm"
Sound_3C: include "SK/SFX/3C.asm"
Sound_3D: include "SK/SFX/3D.asm"
Sound_3E: include "SK/SFX/3E.asm"
Sound_3F: include "SK/SFX/3F.asm"
Sound_40: include "SK/SFX/40.asm"
Sound_41: include "SK/SFX/41.asm"
Sound_42: include "SK/SFX/42.asm"
Sound_43: include "SK/SFX/43.asm"
Sound_44: include "SK/SFX/44.asm"
Sound_45: include "SK/SFX/45.asm"
Sound_46: include "SK/SFX/46.asm"
Sound_47: include "SK/SFX/47.asm"
Sound_48: include "SK/SFX/48.asm"
Sound_49: include "SK/SFX/49.asm"
Sound_4A: include "SK/SFX/4A.asm"
Sound_4B: include "SK/SFX/4B.asm"
Sound_4C: include "SK/SFX/4C.asm"
Sound_4D: include "SK/SFX/4D.asm"
Sound_4E: include "SK/SFX/4E.asm"
Sound_4F: include "SK/SFX/4F.asm"
Sound_50: include "SK/SFX/50.asm"
Sound_51: include "SK/SFX/51.asm"
Sound_52: include "SK/SFX/52.asm"
Sound_53: include "SK/SFX/53.asm"
Sound_54: include "SK/SFX/54.asm"
Sound_55: include "SK/SFX/55.asm"
Sound_56: include "SK/SFX/56.asm"
Sound_57: include "SK/SFX/57.asm"
Sound_58: include "SK/SFX/58.asm"
Sound_59: include "SK/SFX/59.asm"
Sound_5A: include "SK/SFX/5A.asm"
Sound_5B: include "SK/SFX/5B.asm"
Sound_5C: include "SK/SFX/5C.asm"
Sound_5D: include "SK/SFX/5D.asm"
Sound_5E: include "SK/SFX/5E.asm"
Sound_5F: include "SK/SFX/5F.asm"
Sound_60: include "SK/SFX/60.asm"
Sound_61: include "SK/SFX/61.asm"
Sound_62: include "SK/SFX/62.asm"
Sound_63: include "SK/SFX/63.asm"
Sound_64: include "SK/SFX/64.asm"
Sound_65: include "SK/SFX/65.asm"
Sound_66: include "SK/SFX/66.asm"
Sound_67: include "SK/SFX/67.asm"
Sound_68: include "SK/SFX/68.asm"
Sound_69: include "SK/SFX/69.asm"
Sound_6A: include "SK/SFX/6A.asm"
Sound_6B: include "SK/SFX/6B.asm"
Sound_6C: include "SK/SFX/6C.asm"
Sound_6D: include "SK/SFX/6D.asm"
Sound_6E: include "SK/SFX/6E.asm"
Sound_6F: include "SK/SFX/6F.asm"
Sound_70: include "SK/SFX/70.asm"
Sound_71: include "SK/SFX/71.asm"
Sound_72: include "SK/SFX/72.asm"
Sound_73: include "SK/SFX/73.asm"
Sound_74: include "SK/SFX/74.asm"
Sound_75: include "SK/SFX/75.asm"
Sound_76: include "SK/SFX/76.asm"
Sound_77: include "SK/SFX/77.asm"
Sound_78: include "SK/SFX/78.asm"
Sound_79: include "SK/SFX/79.asm"
Sound_7A: include "SK/SFX/7A.asm"
Sound_7B: include "SK/SFX/7B.asm"
Sound_7C: include "SK/SFX/7C.asm"
Sound_7D: include "SK/SFX/7D.asm"
Sound_7E: include "SK/SFX/7E.asm"
Sound_7F: include "SK/SFX/7F.asm"
Sound_80: include "SK/SFX/80.asm"
Sound_81: include "SK/SFX/81.asm"
Sound_82: include "SK/SFX/82.asm"
Sound_83: include "SK/SFX/83.asm"
Sound_84: include "SK/SFX/84.asm"
Sound_85: include "SK/SFX/85.asm"
Sound_86: include "SK/SFX/86.asm"
Sound_87: include "SK/SFX/87.asm"
Sound_88: include "SK/SFX/88.asm"
Sound_89: include "SK/SFX/89.asm"
Sound_8A: include "SK/SFX/8A.asm"
Sound_8B: include "SK/SFX/8B.asm"
Sound_8C: include "SK/SFX/8C.asm"
Sound_8D: include "SK/SFX/8D.asm"
Sound_8E: include "SK/SFX/8E.asm"
Sound_8F: include "SK/SFX/8F.asm"
Sound_90: include "SK/SFX/90.asm"
Sound_91: include "SK/SFX/91.asm"
Sound_92: include "SK/SFX/92.asm"
Sound_93: include "SK/SFX/93.asm"
Sound_94: include "SK/SFX/94.asm"
Sound_95: include "SK/SFX/95.asm"
Sound_96: include "SK/SFX/96.asm"
Sound_97: include "SK/SFX/97.asm"
Sound_98: include "SK/SFX/98.asm"
Sound_99: include "SK/SFX/99.asm"
Sound_9A: include "SK/SFX/9A.asm"
Sound_9B: include "SK/SFX/9B.asm"
Sound_9C: include "SK/SFX/9C.asm"
Sound_9D: include "SK/SFX/9D.asm"
Sound_9E: include "SK/SFX/9E.asm"
Sound_9F: include "SK/SFX/9F.asm"
Sound_A0: include "SK/SFX/A0.asm"
Sound_A1: include "SK/SFX/A1.asm"
Sound_A2: include "SK/SFX/A2.asm"
Sound_A3: include "SK/SFX/A3.asm"
Sound_A4: include "SK/SFX/A4.asm"
Sound_A5: include "SK/SFX/A5.asm"
Sound_A6: include "SK/SFX/A6.asm"
Sound_A7: include "SK/SFX/A7.asm"
Sound_A8: include "SK/SFX/A8.asm"
Sound_A9: include "SK/SFX/A9.asm"
Sound_AA: include "SK/SFX/AA.asm"
Sound_AB: include "SK/SFX/AB.asm"
Sound_AC: include "SK/SFX/AC.asm"
Sound_AD: include "SK/SFX/AD.asm"
Sound_AE: include "SK/SFX/AE.asm"
Sound_AF: include "SK/SFX/AF.asm"
Sound_B0: include "SK/SFX/B0.asm"
Sound_B1: include "SK/SFX/B1.asm"
Sound_B2: include "SK/SFX/B2.asm"
Sound_B3: include "SK/SFX/B3.asm"
Sound_B4: include "SK/SFX/B4.asm"
Sound_B5: include "SK/SFX/B5.asm"
Sound_B6: include "SK/SFX/B6.asm"
Sound_B7: include "SK/SFX/B7.asm"
Sound_B8: include "SK/SFX/B8.asm"
Sound_B9: include "SK/SFX/B9.asm"
Sound_BA: include "SK/SFX/BA.asm"
Sound_BB: include "SK/SFX/BB.asm"
Sound_BC: include "SK/SFX/BC.asm"
Sound_BD: include "SK/SFX/BD.asm"
Sound_BE: include "SK/SFX/BE.asm"
Sound_BF: include "SK/SFX/BF.asm"
Sound_C0: include "SK/SFX/C0.asm"
Sound_C1: include "SK/SFX/C1.asm"
Sound_C2: include "SK/SFX/C2.asm"
Sound_C3: include "SK/SFX/C3.asm"
Sound_C4: include "SK/SFX/C4.asm"
Sound_C5: include "SK/SFX/C5.asm"
Sound_C6: include "SK/SFX/C6.asm"
Sound_C7: include "SK/SFX/C7.asm"
Sound_C8: include "SK/SFX/C8.asm"
Sound_C9: include "SK/SFX/C9.asm"
Sound_CA: include "SK/SFX/CA.asm"
Sound_CB: include "SK/SFX/CB.asm"
Sound_CC: include "SK/SFX/CC.asm"
Sound_CD: include "SK/SFX/CD.asm"
Sound_CE: include "SK/SFX/CE.asm"
Sound_CF: include "SK/SFX/CF.asm"
Sound_D0: include "SK/SFX/D0.asm"
Sound_D1: include "SK/SFX/D1.asm"
Sound_D2: include "SK/SFX/D2.asm"
Sound_D3: include "SK/SFX/D3.asm"
Sound_D4: include "SK/SFX/D4.asm"
Sound_D5: include "SK/SFX/D5.asm"
Sound_D6: include "SK/SFX/D6.asm"
Sound_D7: include "SK/SFX/D7.asm"
Sound_D8: include "SK/SFX/D8.asm"
Sound_D9: include "SK/SFX/D9.asm"
Sound_DA: include "SK/SFX/DA.asm"
Sound_DB: include "SK/SFX/DB.asm"
finishBank
Replace It with this:
SndBank: startBank
SEGA_PCM: binclude "Sound/Sega PCM.bin"
SEGA_PCM_End
even
Sound_33: include "SK/SFX/33.asm"
Sound_34: include "SK/SFX/34.asm"
Sound_35: include "SK/SFX/35.asm"
Sound_36: include "SK/SFX/36.asm"
Sound_37: include "SK/SFX/37.asm"
Sound_38: include "SK/SFX/38.asm"
Sound_39: include "SK/SFX/39.asm"
Sound_3A: include "SK/SFX/3A.asm"
Sound_3B: include "SK/SFX/3B.asm"
Sound_3C: include "SK/SFX/3C.asm"
Sound_3D: include "SK/SFX/3D.asm"
Sound_3E: include "SK/SFX/3E.asm"
Sound_3F: include "SK/SFX/3F.asm"
Sound_40: include "SK/SFX/40.asm"
Sound_41: include "SK/SFX/41.asm"
Sound_42: include "SK/SFX/42.asm"
Sound_43: include "SK/SFX/43.asm"
Sound_44: include "SK/SFX/44.asm"
Sound_45: include "SK/SFX/45.asm"
Sound_46: include "SK/SFX/46.asm"
Sound_47: include "SK/SFX/47.asm"
Sound_48: include "SK/SFX/48.asm"
Sound_49: include "SK/SFX/49.asm"
Sound_4A: include "SK/SFX/4A.asm"
Sound_4B: include "SK/SFX/4B.asm"
Sound_4C: include "SK/SFX/4C.asm"
Sound_4D: include "SK/SFX/4D.asm"
Sound_4E: include "SK/SFX/4E.asm"
Sound_4F: include "SK/SFX/4F.asm"
Sound_50: include "SK/SFX/50.asm"
Sound_51: include "SK/SFX/51.asm"
Sound_52: include "SK/SFX/52.asm"
Sound_53: include "SK/SFX/53.asm"
Sound_54: include "SK/SFX/54.asm"
Sound_55: include "SK/SFX/55.asm"
Sound_56: include "SK/SFX/56.asm"
Sound_57: include "SK/SFX/57.asm"
Sound_58: include "SK/SFX/58.asm"
Sound_59: include "SK/SFX/59.asm"
Sound_5A: include "SK/SFX/5A.asm"
Sound_5B: include "SK/SFX/5B.asm"
Sound_5C: include "SK/SFX/5C.asm"
Sound_5D: include "SK/SFX/5D.asm"
Sound_5E: include "SK/SFX/5E.asm"
Sound_5F: include "SK/SFX/5F.asm"
Sound_60: include "SK/SFX/60.asm"
Sound_61: include "SK/SFX/61.asm"
Sound_62: include "SK/SFX/62.asm"
Sound_63: include "SK/SFX/63.asm"
Sound_64: include "SK/SFX/64.asm"
Sound_65: include "SK/SFX/65.asm"
Sound_66: include "SK/SFX/66.asm"
Sound_67: include "SK/SFX/67.asm"
Sound_68: include "SK/SFX/68.asm"
Sound_69: include "SK/SFX/69.asm"
Sound_6A: include "SK/SFX/6A.asm"
Sound_6B: include "SK/SFX/6B.asm"
Sound_6C: include "SK/SFX/6C.asm"
Sound_6D: include "SK/SFX/6D.asm"
Sound_6E: include "SK/SFX/6E.asm"
Sound_6F: include "S1/SFX/sndAB.asm"
Sound_70: include "SK/SFX/70.asm"
Sound_71: include "SK/SFX/71.asm"
Sound_72: include "SK/SFX/72.asm"
Sound_73: include "SK/SFX/73.asm"
Sound_74: include "SK/SFX/74.asm"
Sound_75: include "SK/SFX/75.asm"
Sound_76: include "SK/SFX/76.asm"
Sound_77: include "SK/SFX/77.asm"
Sound_78: include "SK/SFX/78.asm"
Sound_79: include "SK/SFX/79.asm"
Sound_7A: include "SK/SFX/7A.asm"
Sound_7B: include "SK/SFX/7B.asm"
Sound_7C: include "SK/SFX/7C.asm"
Sound_7D: include "SK/SFX/7D.asm"
Sound_7E: include "SK/SFX/7E.asm"
Sound_7F: include "SK/SFX/7F.asm"
Sound_80: include "SK/SFX/80.asm"
Sound_81: include "SK/SFX/81.asm"
Sound_82: include "SK/SFX/82.asm"
Sound_83: include "SK/SFX/83.asm"
Sound_84: include "SK/SFX/84.asm"
Sound_85: include "SK/SFX/85.asm"
Sound_86: include "SK/SFX/86.asm"
Sound_87: include "SK/SFX/87.asm"
Sound_88: include "SK/SFX/88.asm"
Sound_89: include "SK/SFX/89.asm"
Sound_8A: include "SK/SFX/8A.asm"
Sound_8B: include "SK/SFX/8B.asm"
Sound_8C: include "SK/SFX/8C.asm"
Sound_8D: include "SK/SFX/8D.asm"
Sound_8E: include "SK/SFX/8E.asm"
Sound_8F: include "SK/SFX/8F.asm"
Sound_90: include "SK/SFX/90.asm"
Sound_91: include "SK/SFX/91.asm"
Sound_92: include "SK/SFX/92.asm"
Sound_93: include "SK/SFX/93.asm"
Sound_94: include "SK/SFX/94.asm"
Sound_95: include "SK/SFX/95.asm"
Sound_96: include "SK/SFX/96.asm"
Sound_97: include "SK/SFX/97.asm"
Sound_98: include "SK/SFX/98.asm"
Sound_99: include "SK/SFX/99.asm"
Sound_9A: include "SK/SFX/9A.asm"
Sound_9B: include "SK/SFX/9B.asm"
Sound_9C: include "SK/SFX/9C.asm"
Sound_9D: include "SK/SFX/9D.asm"
Sound_9E: include "SK/SFX/9E.asm"
Sound_9F: include "SK/SFX/9F.asm"
Sound_A0: include "S1/SFX/SndA0 - Jump.asm"
even
Sound_A1: include "S1/SFX/SndA1 - Lamppost.asm"
even
Sound_A2: include "S1/SFX/SndA2.asm"
even
Sound_A3: include "S1/SFX/SndA3 - Death.asm"
even
Sound_A4: include "S1/SFX/SndA4 - Skid.asm"
even
Sound_A5: include "S1/SFX/SndA5.asm"
even
Sound_A6: include "S1/SFX/SndA6 - Hit Spikes.asm"
even
Sound_A7: include "S1/SFX/SndA7 - Push Block.asm"
even
Sound_A8: include "S1/SFX/SndA8 - SS Goal.asm"
even
Sound_A9: include "S1/SFX/SndA9 - SS Item.asm"
even
Sound_AA: include "S1/SFX/SndAA - Splash.asm"
even
Sound_AB: include "SK/SFX/AB.asm"
even
Sound_AC: include "S1/SFX/SndAC - Hit Boss.asm"
even
Sound_AD: include "S1/SFX/SndAD - Get Bubble.asm"
even
Sound_AE: include "S1/SFX/SndAE - Fireball.asm"
even
Sound_AF: include "S1/SFX/SndAF - Shield.asm"
even
Sound_B0: include "S1/SFX/SndB0 - Saw.asm"
even
Sound_B1: include "S1/SFX/SndB1 - Electric.asm"
even
Sound_B2: include "S1/SFX/SndB2 - Drown Death.asm"
even
Sound_B3: include "S1/SFX/SndB3 - Flamethrower.asm"
even
Sound_B4: include "S1/SFX/SndB4 - Bumper.asm"
even
Sound_B5: include "S1/SFX/SndB5 - Ring.asm"
even
Sound_B6: include "S1/SFX/SndB6 - Spikes Move.asm"
even
Sound_B7: include "S1/SFX/SndB7 - Rumbling.asm"
even
Sound_B8: include "S1/SFX/SndB8.asm"
even
Sound_B9: include "S1/SFX/SndB9 - Collapse.asm"
even
Sound_BA: include "S1/SFX/SndBA - SS Glass.asm"
even
Sound_BB: include "S1/SFX/SndBB - Door.asm"
even
Sound_BC: include "S1/SFX/SndBC - Teleport.asm"
even
Sound_BD: include "S1/SFX/SndBD - ChainStomp.asm"
even
Sound_BE: include "S1/SFX/SndBE - Roll.asm"
even
Sound_BF: include "S1/SFX/SndBF - Get Continue.asm"
even
Sound_C0: include "S1/SFX/SndC0 - Basaran Flap.asm"
even
Sound_C1: include "S1/SFX/SndC1 - Break Item.asm"
even
Sound_C2: include "S1/SFX/SndC2 - Drown Warning.asm"
even
Sound_C3: include "S1/SFX/SndC3 - Giant Ring.asm"
even
Sound_C4: include "S1/SFX/SndC4 - Bomb.asm"
even
Sound_C5: include "S1/SFX/SndC5 - Cash Register.asm"
even
Sound_C6: include "S1/SFX/SndC6 - Ring Loss.asm"
even
Sound_C7: include "S1/SFX/SndC7 - Chain Rising.asm"
even
Sound_C8: include "S1/SFX/SndC8 - Burning.asm"
even
Sound_C9: include "S1/SFX/SndC9 - Hidden Bonus.asm"
even
Sound_CA: include "S1/SFX/SndCA - Enter SS.asm"
even
Sound_CB: include "S1/SFX/SndCB - Wall Smash.asm"
even
Sound_CC: include "S1/SFX/SndCC - Spring.asm"
even
Sound_CD: include "S1/SFX/SndCD - Switch.asm"
even
Sound_CE: include "S1/SFX/SndCE - Ring Left Speaker.asm"
even
Sound_CF: include "S1/SFX/SndCF - Signpost.asm"
even
Sound_D0: include "SK/SFX/D0.asm"
Sound_D1: include "SK/SFX/D1.asm"
Sound_D2: include "SK/SFX/D2.asm"
Sound_D3: include "SK/SFX/D3.asm"
Sound_D4: include "SK/SFX/D4.asm"
Sound_D5: include "SK/SFX/D5.asm"
Sound_D6: include "SK/SFX/D6.asm"
Sound_D7: include "SK/SFX/D7.asm"
Sound_D8: include "SK/SFX/D8.asm"
Sound_D9: include "SK/SFX/D9.asm"
Sound_DA: include "SK/SFX/DA.asm"
Sound_DB: include "SK/SFX/DB.asm"
finishBank
Step 7: Fixing Music
Find "MusicList:" in sonic1.asm. It should look like this:
MusicList: incbin misc\muslist1.bin
even
Replace it with this:
MusicList: dc.b $01, $02, $03, $04, $05, $06, $07, 0
even
To fix the speed shoes, go to "Obj2E_ChkShoes:" Once there, replace these lines of code:
move.w #$E2,d0
jmp (PlaySound).l ; Speed up the music
With these lines of code:
moveq #8,d0
jmp (SetTempo).l
Now go to "Obj01_ChkShoes:" Replace these lines of code:
move.w #$E3,d0
jmp (PlaySound).l ; run music at normal speed
With these:
moveq #0,d0
jmp (SetTempo).l
Known Issues
Some of the Known Issues with this guide are:
- Pushing SFX is broken
- Point SFX is broken
- Pausing during gameplay does not stop music
Conclusion
Congrats! Now you have ported the Flamewing S3K driver to your Sonic 1 hack!
Credits
- Kurk (me): Main Guide, Code.
- Flamewing: Making his S3K driver and smps2asm.
- Crash: Porting the Flamewing S3K driver to S1 with a similar method, which helped me while writing this
- Alriightyman: Made a guide to do this but for Sonic 2, which helped me while writing this
- Clownancy: Fixed S1 SFX from Clone Driver v2
- Valley Bell: Isolating the Sonic 1 sound driver, which helped me locate what parts of the S1 sound driver to remove
- Kram1024: Making the original Sonic 3 sound driver in Sonic 1 guide.
|Port Flamewing's Sonic 3 & Knuckles Sound Driver]]