S3 Sound Driver In Sonic 2 Beta

Discussion in 'Engineering & Reverse Engineering' started by Esrael, Aug 31, 2008.

Thread Status:
Not open for further replies.
  1. Esrael

    Esrael

    Tech Member
    227
    80
    28
    Brazil, São Paulo, Guarulhos
    Neto Assembler Editor / Sonic 2 Delta / Neto MD-DOS
    This is a port o Sonic 3 Sound Driver into Sonic 2 Beta (Should work in Sonic 2 Too)

    This drivers has some modifications to allow you placing DAC Samples, Musics, Sfx, SEGAAA..... in any location.


    Sonic 3 Sound Driver Source
    To hear the sounds press down in Title Screen until Sound Test appear.

    To use this driver you will need to make the following Changes:
    SoundDriverLoad:
    Code (Text):
    1. SoundDriverLoad:; Offset_0x0014B8:
    2.                 nop  
    3.                 jmp  Sound_Driver
    Play_Music routine
    From
    Code (Text):
    1. Play_Music:
    2.                 move.b  D0, ($FFFFFFE0).w
    To
    Code (Text):
    1. Play_Music:
    2.                 jmp  Play_Music_New
    Play_Music routine
    From
    Code (Text):
    1. Play_Sfx:
    2.                 move.b  D0, ($FFFFFFE0).w
    To
    Code (Text):
    1. Play_Sfx:
    2.                 jmp  Play_Sfx_New
     
  2. ............Can I say holy fuck? I love you Esrael. I LOVE YOU =D.



    Edit: In before everyone else =P
     
  3. Spanner

    Spanner

    The Tool Member
    3,261
    62
    28
    United Kingdom
    Sonic Hacking Contest
    Esrael you're fucking awesome.
     
  4. Hitaxas

    Hitaxas

    Retro 80's themed Paladins Twich streamer Member
    <3

    You win the internets.
     
  5. Eduardo Knuckles

    Eduardo Knuckles

    Not a loved one, but the most hated person. Member
    413
    9
    18
    Someplace somewhere
    Project S.A.M.G.
    Just AWESOME. :argh:
    But, you plan a proccedure to port the S3 driver to s1 too?
     
  6. GasparXR

    GasparXR

    I'm back! Member
    Next thing you know, someone will post a port of Sonic CD to the Sega Dreamcast. Wow.
     
  7. Krigo

    Krigo

    Robotics;Notes shill Member
    If it's ported to Sonic 1, it'll be awesome.
     
  8. Hitaxas

    Hitaxas

    Retro 80's themed Paladins Twich streamer Member
    Now we need a detailed guide on how to port music to it. >.>
     
  9. Master3k

    Master3k

    Member
    278
    0
    0
    :U

    Great work, Esrael. Thanks for sharing that. Maybe I should try porting this to S2 sometime.

    EDIT:To port music to S3, just do the opposite process from porting S3-S1.
     
  10. Tweaker

    Tweaker

    Misfit
    12,389
    1
    0
    Wow, lots of words so far.

    This is pretty neat—and a nice technical achievement! But I prefer using 68k simply due to its vast potential for expansivity. Still, if you're looking for an established sound driver that gives you some extra cycles on the 68k, this should do the job nicely! :argh:

    I do hope that everybody doesn't start using this driver because it's from Sonic 3, though! Consider what's involved in using this—changing all the sound effect calls in the game, manually managing the music pointers and where they compile in the ROM, keeping all your music within a $8000 byte boundary... there's a reason I prefer the 68k management system.

    Working with Sonic 3's driver was an annoying pain for me; then again, I did it before we had stuff like the music pointer fixer, so who knows at this point? Maybe it's a good idea after all.
     
  11. Well I personally don't plan on using it, just seeing how it works. I've always wanted the s3 driver, and I guess now I have it =P
     
  12. Hitaxas

    Hitaxas

    Retro 80's themed Paladins Twich streamer Member
    I fixed up the driver to work with S2 final, but all I am getting is the sound effects. Any ideas?
     
  13. RattleMan

    RattleMan

    Oldbie
    154
    0
    0
    Sonic 2 Delta 0.23, eh?

    I like the boss hit counter.
     
  14. Ayla

    Ayla

    I shat on your desk ^^ Oldbie
    1,760
    0
    0
    West Linn, OR
    Hacking Contest, StH Overlooked, Personal Indie game
    I always liked the s3 sound driver the best out of all of them. This is exciting news =)
     
  15. Esrael

    Esrael

    Tech Member
    227
    80
    28
    Brazil, São Paulo, Guarulhos
    Neto Assembler Editor / Sonic 2 Delta / Neto MD-DOS
    The Sonic 2 add $80 to Sounds in Sound Test. Remove the part of code that add $80 and expand Sound test to allow you selecting from $00 to $FF


    Edit

    Sonic 2 Nemesis Disassembly Labels

    Play_Music_New => sub_135E
    Play_Sfx_New => sub_1370
    Play_Unknow_New => sub_1376
    Play_Sfx_Ex_New => sub_137C
    DelayProgram => sub_3384
    Sound_Driver => loc_EC000

    To get all Sounds in Options Menu Make the Following Changes

    Code (Text):
    1. loc_910C: ; Left Press Test
    2.              ...
    3.                 subq.b  #1,d2
    4.                 andi.l  #$FF, D0      ; Add This Line
    5.              ; bcc.s   loc_9128   ; Comment This Line
    6.              ; move.b  d3,d2         ; Comment This Line       
    7.  
    8. loc_9128:; Right Press Test CODE XREF: sub_90E0+40j sub_90E0+44j
    9.                 btst    #3,d0
    10.                 beq.s   loc_9136
    11.                 addq.b  #1,d2
    12.                 andi.l  #$FF, D0      ; Add This Line
    13.              ; cmpi.w   #$80,d0       ; Comment This Line
    14.              ; cmp.b    d3,d2        ; Comment This Line
    15.          ; bls.s    loc_9136      ; Comment This Line
    16.          ; moveq    #0,d2        ; Comment This Line
    17.  
    18. loc_9136:; "A" Press Test   ; CODE XREF: sub_90E0+4Cj sub_90E0+52j
    19.                 btst    #6,d0
    20.                 beq.s   loc_9146
    21.                 addi.b  #$10,d2
    22.                 andi.l  #$FF, D0      ; Add This Line
    23.              ; cmpi.w  #$80,d0        ; Comment This Line
    24.              ; cmp.b   d3,d2         ; Comment This Line
    25.              ; bls.s   loc_9146   ; Comment This Line
    26.              ; moveq   #0,d2         ; Comment This Line
    27.  
    28. loc_9146:
    And
    Code (Text):
    1. loc_9146:;
    2.  
    3.              ...
    4.                 move.w  ($FFFFFF84).w,d0
    5.              ; addi.w  #$80,d0; '€'; Comment This Line
    6.                 bsr.w   loc_9C6A
    7.              ...
     
  16. Hitaxas

    Hitaxas

    Retro 80's themed Paladins Twich streamer Member
    Thanks, that worked. :(

    Although, I experience some lag now... :(







    Anyway, with all that said:
    Here's the 2007 compatible version -> yay, a link to google!<-

    Edit: there is some sort of slowdown in the game, caused by the driver, Esrael, do you think you could find the problem? =X
     
  17. Alriightyman

    Alriightyman

    !!!!!!!!!!!!!!!!&#33 Tech Member
    353
    2
    18
    Largo, Fl
    0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
    Hmmmm.... I get a "File not available" message.
     
  18. Hitaxas, like I said, it's somewhat related to the DAC, when a sample plays it lags.


    Alriightyman, as soon as Hitaxas gets on I'll mirror it at Sonic Sanctuary.
     
  19. Hitaxas

    Hitaxas

    Retro 80's themed Paladins Twich streamer Member
    Link should work now, I just checked it.

    As for what Irixion said, It seems like that would be the case... But I can't find what it is exactly.


    EDIT: No, It doesn't work. D=

    EDIT2: Mirror'd link
     
Thread Status:
Not open for further replies.