Sonic 1 Sound Driver in Sonic 3 and Knuckles

Discussion in 'Discussion and Q&A Archive' started by RocketRobz, Jun 4, 2013.

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

    RocketRobz Coolest of TWL, and Sonic fan Member

    Joined:
    Aug 20, 2009
    Messages:
    80
    We know that the Sonic 1 Sound Driver (SMPS 68k) works in Sonic 2 (Final tested, S.W. Beta tested).

    The Sonic 1 Sound Driver (SMPS 68k) can be used out of the 4MB ROM limit.

    The SMPS Z80 Driver used in Sonic 2-3&K cannot be used out of the 4MB ROM limit,

    or else, all music and sounds are muted, and the SEGA PCM plays screeching sound.

    I attempted to port the Sonic 1 Sound Driver with Mega PCM to Sonic 3 and Knuckles, and it worked!

    The other thing I need to fix it the sfx, or else the game crashes and restarts.

    Could someone please give me instructions to fix the sound driver to work with S3K,

    and the game's music and sfx?

    I'm using the HG disassembly.

    Musics: $01-32

    Sounds: $33-DF

    Thanks!

    EDIT: I am currently doing Addressed Music just like MarkeyJester did with Sonic 1.
     
    Last edited by a moderator: Jul 26, 2013
  2. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Wait, you ported WHAT to Sonic 3 & Knuckles? I had looked into the Sonic 1 sound driver in S3K but it didn't seem possible due to major RAM rearrangements. Nevertheless, I congratulate you, and to celebrate your accomplishment, I have converted and fully fixed three S3K songs for the S1 sound driver. Here they are.

    The songs are:

    Endless Mine

    Death Egg Zone, Act 2

    Flying Battery Zone, Act 1

    I'd give you Ice Cap Zone, Act 1 and Death Egg Zone, Act 1, but sadly, I already remixed Ice Cap Zone Act 1, and Death Egg Zone Act 1 isn't fully fixed yet. Nevertheless, I hope these help you.
     
  3. InfiniteWave

    InfiniteWave Veteran Of The Arte & Sword Member

    Joined:
    Apr 18, 2013
    Messages:
    77
    Location:
    Visiting the Hakurei Shrine
    Sonic 1's sound driver is soo inferior why replace 3K's with it?
     
  4. fdswerty

    fdswerty Well-Known Member Member

    Joined:
    Apr 10, 2013
    Messages:
    138
    I have to agree with InfiniteWave, S1 Snd Driver is way too inferior than the S3K one... But I can recommend you this. It features SFX, DAC's and Songs from Sonic1, Sonic2, Sonic3, Sonic & Knuckles and Sonic 3D Blast.
     
  5. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Actually, the Sonic & Knuckles sound driver is no better than the Sonic 1 sound driver. IIRC, one major issue with the S&K sound driver (the reason why I can't use it) is that it constantly switches between DAC and PSG, causing additional chopping in samples. Soft samples and character voices especially suffer from this.

    Electroball, that post you linked? That's still the S&K sound driver. So that won't work.

    Now, as far as I'm concerned, some sound effects, like collecting and losing rings and jumping, are the exact same as Sonic 1, so I could give those, but I can't convert any S3K-specific sound effects due to my lack of experience, so you'll have to call on someone else for that part of it.
     
  6. RocketRobz

    RocketRobz Coolest of TWL, and Sonic fan Member

    Joined:
    Aug 20, 2009
    Messages:
    80
    Like I said:

    Sonic 1 Sound Driver is much easier to work with.
     
    Last edited by a moderator: Jun 4, 2013
  7. RocketRobz

    RocketRobz Coolest of TWL, and Sonic fan Member

    Joined:
    Aug 20, 2009
    Messages:
    80
    Last edited by a moderator: Jun 4, 2013
  8. Varion Icaria

    Varion Icaria Well-Known Member Member

    Joined:
    Apr 26, 2012
    Messages:
    77
    Okay, While the S1 driver may seem better than S3K's driver, It really isn't capable of working in S3K Stock. Not to be a downer but it is a severe ram issue. Excerpt from my Disassembly showing the ram values used in S3K.


    FFFFFFFF Water_Pal_FadeTo: equ $FFFFF000
    FFFFFFFF Water_Pal_FadeTo_Line2: equ $FFFFF020
    FFFFFFFF Water_Pal_FadeTo_Line3: equ $FFFFF040
    FFFFFFFF Water_Pal_FadeTo_Line4: equ $FFFFF060
    FFFFFFFF Water_Pal:       equ $FFFFF080
    FFFFFFFF Water_Pal_Line2: equ $FFFFF0A0
    FFFFFFFF Water_Pal_Line3: equ $FFFFF0C0
    FFFFFFFF Water_Pal_Line4: equ $FFFFF0E0
    FFFFFFFF VRAM_Buffer:     equ $FFFFF580

    So as seen here. $FFFFF100 to $FFFFF57F is Unused [that I know of thus far] Sonic 1 requires $5FF bytes. Now there is a way to make it work, but it involves Re-arranging the ram so all of the free ram is in one spot. Effectively it could be done in a few simple ways if you were smart about it. The Underwater Palette could be moved to $FFFFFD00 cause there's $100 bytes of free ram. As for the VRAM_Buffer. I am not sure where there is another free $80 bytes in the RAM. One of the only other methods to get it to work, would be to make the S1 driver use less Variables. I hope this helps those who were attempting or lost in how to do this.
     
  9. RocketRobz

    RocketRobz Coolest of TWL, and Sonic fan Member

    Joined:
    Aug 20, 2009
    Messages:
    80
    I am currently doing Addressed Music just like MarkeyJester did with Sonic 1.
     
  10. Varion Icaria

    Varion Icaria Well-Known Member Member

    Joined:
    Apr 26, 2012
    Messages:
    77
    Addressed music isn't going to make a difference if there is no RAM for the Variables for the Sound Driver core itself. It's going to mess up on levels with water and not to mention anything that uses the VRAM buffer will either be messed up or the Driver itself will shit itself. If you don't free enough RAM or don't lower the amount of Variables the driver uses [Not sure how S1's driver works nor do I really care as I use Z80 drivers primarilly] The driver will never fully work in a stock S3K. Not to mention that the Driver could potentially slow down S3K due to it being run on the 68K rather than Z80. I would just use Flamewings SK driver or my customized binary insertion driver [For ASM68K and my Specific S3K Disassembly. since Flamewings is AS only.]
     
  11. ValleyBell

    ValleyBell Well-Known Member Member

    Joined:
    Dec 23, 2011
    Messages:
    166
    Lets me post the RAM layout of the S1 driver:


    F000    Global Variables
    F040    DAC Track [Music]
    F070    FM1 Track [Music]
    F0A0    FM2 Track [Music]
    F0D0    FM3 Track [Music]
    F100    FM4 Track [Music]
    F130    FM5 Track [Music]
    F160    FM6 Track [Music]
    F190    PSG1 Track [Music]
    F1C0    PSG2 Track [Music]
    F1F0    PSG3 Track [Music]
    F220    FM3 Track [SFX]
    F250    FM4 Track [SFX]
    F280    FM5 Track [SFX]
    F2B0    PSG1 Track [SFX]
    F2E0    PSG2 Track [SFX]
    F310    PSG3 Track [SFX]
    F340    FM4 Track [Extra SFX]
    F370    PSG3 Track [Extra SFX]
    F3A0    Music RAM copy for 1-up [$220 bytes]
    F5C0    End of RAM used by the sound driver
    For S3K, you could remove the "Extra SFX" channels, because S3K doesn't use these. (In Sonic 1, the D0 sound uses them.)

    If you do so and move the 1-up to F340, you free $60 bytes and the driver's RAM would end at F560.

    This can be pushed even further, btw. The S2 Clone Driver in S2 Recreation uses $520 bytes right now. (Well, plus another $1F0 bytes somewhere else to store a second copy of the music track RAM.)
     
  12. Varion Icaria

    Varion Icaria Well-Known Member Member

    Joined:
    Apr 26, 2012
    Messages:
    77
    Well said ValleyBell. I'm sure our combined info will probably help them fix it up.
     
  13. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    [​IMG]

    Right then chaps, here's the strategy for getting the music men onto mars:

    This...

    [​IMG]

    ...is the universe as we know it, the small round like object is planet earth, that of which we have too many people on, and this bigger round object is mars.

    Now, mars is quite cramped at the moment, not enough for people to complain, but it's still pretty squashed, now, we could move all of the chunk people from chunky island to earth, but earth doesn't have enough space for them, so we better leave them on mars.

    The layout mounts, the people there are ALWAYS moving in and out like a fucking battery ram, moving more people in and out there would only cause confusion and we'll probably end up causing the universe to suck itself in (we've already had that once, I don't think we want it again).

    Other crap pole? Bleh!! No thanks, we'll pass.

    Block land however is where it's at! Now, we all know that the block people are compact on earth, because we kept them locked inside the factory, we only really let them out to stretch their legs on block land, every level or so, however, there is enough space on earth so much so, that we can let them out the factory there! So they don't need to go to block land!

    For those of you who know best, the music men have paid in full for a spot on mars, so we can't keep them on earth, lord knows we don't wanna get sued... again...

    SO! We put the music men on block land perminantly, and let all of the block people out of the factory, uncompressed and stretch free on earth! We all know they don't take much space, unlick SOME people we know... Riiiiggghhht chunky people?

    Now the music men are quite small and are well organised, so I'm sure they won't mind letting out the 70% of their free space for other people later in time, you never know when more interesting people will arrive in our universe!!

    And that concludes our strategy for this evening, hop to it men!

    1

    2

    1

    2

    1

    2

    ...
     
    Last edited by a moderator: Jun 4, 2013
  14. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Are you pissed?
     
  15. Spanner

    Spanner The Tool Member

    Joined:
    Aug 9, 2007
    Messages:
    2,570
    He just wanted to do something different instead of the usual posts from people that consist of plugging their own hack to oblivion.
     
    Last edited by a moderator: Jun 4, 2013
  16. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Yes, it's certainly different.  Made me laugh =P
     
  17. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Alright, I've had my fun.

    BASICALLY!!

    What I am suggesting is that you decompress all of the 10x10 (i.e. 16x16) block data for each and every level, and change the engine to read them directly from the ROM, and use the block RAM space for the sound driver, now, those astute idividuals in the thread will automatically state the obvious notion of ROM space usage, i.e. using too much of it for uncompressed block data, now this is indeed a con to the method, but that's why I chose blocks as opposed to chunks, it isn't so much that it's going to be a bother, especially if this individual has already surpassed 4MB and is heading upto the 10MB mark.

    The pros behind this though, I feel majorly outbalance the con, for a start, you don't need to decompress and transfer the block data, this will increase the level loading speed (not that it's much speed, but fuck it, it's a pro), the second is that you now have not only enough space for the whole sound driver, but you have an approximate remaining space of about 60-70% to use for something else, should you want to add an interesting and unique feature later on (that of which, I wish most of you would do).

    I still feel that taking ValleyBell's advice on organising RAM sections, is still a good idea, if not for the sound driver, then certainly for something else, so keep that also in mind.
     
  18. RocketRobz

    RocketRobz Coolest of TWL, and Sonic fan Member

    Joined:
    Aug 20, 2009
    Messages:
    80
    How exactly do I do that?

    I'm not too smart at hacking sonic.

    EDIT: When playing the rolling sfx, tiles start to look incorrect.

    [​IMG]

    Let me guess, it is a RAM problem.
     
    Last edited by a moderator: Jun 4, 2013
  19. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    I don't think the sounds are part of RAM, so that's most likely not the issue. But what do I know on the subject? Not much, that's what =P

    Also, I personally see no difference in the screenshot you took.
     
  20. RocketRobz

    RocketRobz Coolest of TWL, and Sonic fan Member

    Joined:
    Aug 20, 2009
    Messages:
    80
    Look close at the waterfall. You will see Horizantal lines.

    Also, I need help using Non-Module Kos art as level art,

    so I can get rid of these to free RAM:

     
    Last edited by a moderator: Jun 5, 2013
Thread Status:
Not open for further replies.