Sonic 1 with Redbook Audio

Discussion in 'Engineering & Reverse Engineering' started by theocas, Dec 4, 2011.

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

    theocas

    Tech Member
    346
    0
    16
    So, the story goes a little like this: LOL CD AUDIO IN SONIC 1. And after lots of voodoo magic and other... things, and thus, Team Evanesco presents this magical concoction:

    Sonic 1 utilizing the Sega CD in Mode 1, meaning it runs from a regular cartridge, but uses the Sega CD hardware. Note that this doesn't really work on any emulators except the latest version of Kega. On Kega, load the ROM first, make sure you have Sega CD BIOS files, then load the CD audio image of your choice and enjoy. You need to set the option called "CartBootEnabled" to 1 in Kega's ini file for it to work this way. Likewise, for doing this on the real hardware, simply burn the bin/cue file of your choice to a regular CD-R, shove the ROM on a flash cart and load the cart up.

    Features of this hack include:
    • It's Floppy Friendly™ allowing you to store more porn along with this. (Yep, just for you djohe!)
    • Magical CD-DA audio.
    • 100% Fat Free.

    So yeah, there you have it. To make your own set of CD songs, follow this track layout:
    Code (Text):
    1.  
    2. Track 1 = Title Screen
    3. Track 2 = GHZ
    4. Track 3 = MZ
    5. Track 4 = SYZ
    6. Track 5 = LZ
    7. Track 6 = SLZ
    8. Track 7 = SBZ
    9. Track 8 = Boss
    10. Track 9 = FZ
    11. Track 10 = Act Clear
    12. Track 11 = Speed Up
    13. Track 12 = Invincibility
    14. Track 13 = Game Over
    15. Track 14 = Special Stage
    16. Track 15 = Ending
    17. Track 16 = Credits
    18. Track 17 = Drowning
    19. Track 18 = Continue
    20.  
    Downloads


    Edit: We've done a few little bug fixes here and there, re-download if you want. Doesn't really add anything.
    Edit2: Iron Sonic and I fixed a crapton of bugs in our code, as well as finally allowing it to run on real hardware. Thanks to Flygon for being our beta tester on European HW! Just re-download the ROM.
     
  2. LazloPsylus

    LazloPsylus

    Buried under SSRG Somewhere Tech Member
    154
    0
    0
    Academy City
    SSRG, world domination, a billion and one research projects...
    Alright, so there's a simple edit that needs to be made to Kega's INI file to support this thing. Just set CartBootEnabled to 1. It should be located around the bottom of the INI. Afterword, the instructions provided by theocas should work.

    This hack uses the Mode 1 for the Sega CD that was mentioned a few days ago in a couple of posts that both theocas and I made. It's surprising how little this mode is used, though to be fair, it took quite a lot of sleepless nights and research to figure out. This ROM does work without use of the Sega CD, though that just reverts the audio back to the SMPS engine.

    Also, you can thank Maxd for the BIN/CUE released on #retro. And don't worry, this BIN/CUE is not the one released on #retro, and demonstrates what we did far better.

    Anyway, enjoy this release from Team Evanesco. Maybe theocas and I do something else in the future...
     
  3. Maxd

    Maxd

    Member
    661
    0
    0
    Alabama
    Mixin'
    Dibs on writing better music :p
     
  4. Flygon

    Flygon

    Member
    You can guess what my Sega CD and I are doing tomorrow. :)

    Per act based music'd be great though, ignoring the CD size restrictions. :v:
     
  5. amphobius

    amphobius

    doing more important things with my life Member
    2,120
    0
    16
    life
    http://www.youtube.com/watch?v=irhVoX1N7w4

    There you go guys, some publicity! :P

    Really impressed with this, looking forward to seeing this used in bigger projects.
     
  6. Spanner

    Spanner

    The Tool Member
    3,312
    115
    43
    United Kingdom
    Sonic Hacking Contest
    Or you could use Masato Nakamura's demo tracks from the Sonic 1&2 Soundtrack. =P
     
  7. Covarr

    Covarr

    Sentient Cash Register Member
    4,233
    3
    18
    Trapped in my own thoughts.
    Two stageplays, a screenplay, and an album
    And here I thought this'd be Sonic 4 music or something. Well played.

    I'm already coming up with potential uses for this... Potential and evil uses.
     
  8. ashthedragon

    ashthedragon

    Dragon Team Researcher
    1,374
    13
    18
    Spain
    Sonic Paradise & Sonic Ages
    this is very interesting, although I feel that is a bit burdensome, expecially to run it on a real mega CD, needing a md flashcart to shove the rom in. But is a nice start to port MD games into MCD and use redbook audio with them.
     
  9. LazloPsylus

    LazloPsylus

    Buried under SSRG Somewhere Tech Member
    154
    0
    0
    Academy City
    SSRG, world domination, a billion and one research projects...
    Updated the ROM with an indicator for whether the SegaCD is detected. Text will be different on the "Presents" screen before the title.
     
  10. Billy

    Billy

    RIP Oderus Urungus Member
    1,981
    66
    28
    Colorado, USA
    Indie games
    I've done something to that effect, mostly.
    Here.
    It's a cue/mp3, it contains mostly the demo tracks from Sonic 1 with a few exceptions: Invincibility is the Super Sonic music from Sonic 2 (demo version), game over and credits are the originals, and drowning is form Sonic Colors. Tracks seem to delay before they play, and I'm not sure why (probably something to do with using mp3s). Should be easy enough to substitute your own mp3s. Would've made a bin/cue, but the only way to do that, that I know of, would be to burn an audio CD and re-rip it.
     
  11. Especially if you are sourcing your music from MP3, do not convert your images to bin/cue. By doing so, you are inflating the file size, giving a false impression of lossless audio, and inhibiting downloaders from previewing the songs themselves without considerable effort. :eng101:
     
  12. Tanks

    Tanks

    Member
    1,044
    66
    28
    Wow this is impressive... I had no idea the Genesis had the same connectivity with Sega CD as, say, the 32x did. I can only think of how much potential there is for rom hacks now. Not just music I mean, but the sharing of data between the CD and the cart.
     
  13. Flygon

    Flygon

    Member
    It's much simpler than that. Simply make a virtual CD ROM drive, burn to that, and rip from that. With absolutely no physical CD's used.
     
  14. LazloPsylus

    LazloPsylus

    Buried under SSRG Somewhere Tech Member
    154
    0
    0
    Academy City
    SSRG, world domination, a billion and one research projects...
    Alright, before any of the roaming hardware testers comment on this, we know it's currently breaking on real hardware on at least European systems. We are working to debug this and will update when this has been patched.

    Also, thanks to Flygon for pointing this out to us by testing it while on Skype.
     
  15. Blastfrog

    Blastfrog

    See ya starside. Member
    On the subject of porting things to the Sega CD, how easy would it be to port a simple hack of Sonic 2 to the Sega CD? Also, why is it apparently so difficult to port things to the Sega CD when all it comes down to is a matter of breaking the game down into 256kb standalone chunks and loading them? I can understand that managing to load them might be a pain in the ass with all the pointers, but wouldn't it be more of a pain in the ass than truly difficult? I ask because from what it sounds like, it's not terribly complicated, just a pain to work around at times.
     
  16. FraGag

    FraGag

    Tech Member
    Stealth ported some levels of Sonic 1 and Sonic 2 to Mega CD, so it's definitely not impossible. However, it requires that you understand what parts of the code and what data you must keep and what you can remove for a single-level program. Sure, you can take it easy and stop once your program is small enough; or you can build it from scratch and add the necessary pieces as you encounter them.
     
  17. LazloPsylus

    LazloPsylus

    Buried under SSRG Somewhere Tech Member
    154
    0
    0
    Academy City
    SSRG, world domination, a billion and one research projects...
    Easy? Not really. For starters, you're going to have to modify the initialization routines, since you have a BIOS to account for (in three major regions, which makes things even more fun due to slight variances between some), as well as an entire 68k Sub CPU. If you manage to pull off working initialization routines, then there' the division of the code into the 256KB chunks. Each of these chunks has to be, in essence, its own individual game, each possessing its own Sonic engine, initialization, objects, art, and sound code. In addition, these chunks must be able to pass the game from chunk to chunk, so you'll need to add pointers that load given specific circumstances (such as completing the level). As for the audio, you're going to have to completely rewrite the sound code. You can cheat and just have the sound engine run from the main 68k, but that defeats most of the point of even porting, since you'd want to use CD audio. Therefore, you're going to have to make a modified sound engine that uses the PCM channels for your sound effects while routing music calls to load a track using the ToC of the disc, which in itself requires messing with command IDs and other fun BIOS calls.

    That's just a brief summarization of some of what you'd need to do. There's plenty more details for what you'd need to do besides that, but I'm not here to write an instruction manual for porting. Porting Sonic 2 to CD is not impossible, but there's good reason why people don't do it. Stealth has done it with his Sonic on MegaCD, which more than proves that it exists. But it's a task that, while simple in theory, is quite a mess in practice.
     
  18. Hm.... Wondering what it would take to have tracks for speed-up versions of each level.
     
  19. Flygon

    Flygon

    Member
    Audio going through the Sega CD's PCM chip, or separate audio tracks on the CD.

    Generally, not worth the effort.
     
  20. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    For more info on this, see Stealth's blog post on it.
     
Thread Status:
Not open for further replies.