Valley Bell's SMPS Research

Discussion in 'Technical Discussion' started by ValleyBell, Dec 31, 2013.

  1. ValleyBell

    ValleyBell

    Tech Members Tech Member
    236
    0
    0
    researching SMPS sound drivers
    I've been researching Master System SMPS a bit recently, so I have a small update to SMPSPlay: (It's now at v2.01.)

    • PSG noise drums are supported now and are defined with a new file called DefDrum_PSG.txt
      These are used in SMS/GG games in general and also in Space Harrier 2 on the MD.
    • in preparation for real preSMPS support, I added the preSMPS instrument format (register-data pairs) and 2x 2op FM drums
    You can download the Windows binary (32-bit and 64-bit) or the source code.

    The binary package includes rips from Sonic 2 SMS/GG and Sonic Triple Trouble.
    There are also two songs from Space Harrier 2, which I converted to normal SMPS by rewriting the song header.

    btw: Sonic 2 SMS/GG has a unique feature: a real ADSR envelope. The only song that uses it is Gimmick Mountain and the feature was removed from Triple Trouble. (I haven't looked at Sonic Chaos yet.)
     
  2. ICEknight

    ICEknight

    Researcher Researcher
    Awesome!


    In case it may be useful in some way, here's the link to the topic where the "SGC" format dumps were released: http://forums.nesdev.com/viewtopic.php?t=5887
     
  3. Xeta

    Xeta

    AkumaYin Member
    Now, here's a question. Is the SMPS engine exclusive to the MegaDrive (excluding the Master System, Game Gear, and Sega CD)?
     
  4. muteKi

    muteKi

    Fuck it Member
    7,543
    0
    16
    A similar engine seems to be in use for Sonic 2 GG/SMS. I don't know how much people have looked into the sound engines of the later games.
     
  5. amphobius

    amphobius

    where are the japanese shaman girls, lintahlo? Member
    Sonic CD uses SMPS - it's extremely obvious considering it's using standard Sonic sound effects and several of which have been ported over to the MD.

    Sonic CD's past music uses a variant of SMPS to account for the 8 channel PCM usage, and Sonic 2 GG/MS, as noted, also use SMPS. It's just a generic driver for developers to modify as needed.
     
  6. Xeta

    Xeta

    AkumaYin Member
    So, I've heard that the sound effects are the same format as in Sonic 1, so how would I find sound effect locations?
     
  7. Clownacy

    Clownacy

    Tech Members Tech Member
    775
    0
    16
    Are you sure about that? SCD Sound Effect Driver.asm's cfPtrTable begs to differ. That and the driver being a Z80 FM Type 1. I must be looking at the wrong driver.

    Speaking of which, I really need to find the past music's driver. I just hope it's 68k. Though, it probably does a Chaotix, and has the Z80 do the processing, while the other processor just relays the output to the hardware. I can still dream, dang it! Wait, can't the Megadrive's own 68k access the Mega CD's program RAM? If so then potentially, the main 68k processes the game, and the Mega CD 68k handles the sound. There's still hope, dagnabbit!
     
  8. ValleyBell

    ValleyBell

    Tech Members Tech Member
    236
    0
    0
    researching SMPS sound drivers
    I can confirm that SMPS exists for Master System, Game Gear, MegaDrive and Sega CD. Sega Pico seems to use SMPS, too, according to a new other people.
    The first variants of SMPS were used in SMS games like Phantasy Star. It was preSMPS back then, which uses a different file header. The SMPS variant we know seems to be made for the MD, but got ported back to the SMS for games like Sonic 2, Chaos, Triple Trouble and Labyrinth.

    For SFX, Sonic CD uses a Z80 sound driver stored in LOGO_M.MMD (510 Beta) or MDINIT.MMD (all other versions). I'll just quote my hacking notes:
    Code (Text):
    1. General Pointer List:   06D7 (JUE, 720 Beta) / 1900 (510 Beta) (Z80 RAM)
    2. SFX Pointer List:   06EB (JUE, 720 Beta) / 0B00 (510 Beta) (Z80 RAM)
    3. Z80 Snd Driver Offset:  0001DA (JUE, 720 Beta) / 000B10 (510 Beta)
    4. Additional Z80 Data #1: 0015F8 (510 Beta only) (goes to Z80 RAM 0B00)
    5. Additional Z80 Data #2: 001D90 (510 Beta only) (goes to Z80 RAM 1900)
    Trivia: The 510 beta driver is still able to play music. (although it doesn't have any songs to play) The other drivers can only play SFX.

    Just open the ISO and get the SNCBNK##.BIN files. Each file contains an 68k SMPS PCM driver, one song, a few PCM SFX and the respective samples.
     
  9. Hitaxas

    Hitaxas

    Retro 80's themed Paladins Twich streamer Member
    1,438
    0
    0
    Litchfield,CT
    Becoming a Twitch partner, and getting my life back together
    That would mean that it uses very few z80 sfx as each SNCBNK##.BIN houses a handful of samples, some are repeats which are present in every single file (but that's due to how the game loads levels, if I am correct). What other formats might Sonic CD use, and where could those be located then?
     
  10. ValleyBell

    ValleyBell

    Tech Members Tech Member
    236
    0
    0
    researching SMPS sound drivers
    The SNCBNK##.BIN files contain only PCM stuff, so it does PCM SFX. The Z80 driver does all FM SFX.

    In the sound test, there is "FM", "PCM" and "DA". Everything "FM" is done by the Z80 driver (and they removed tons of stuff from it so that there was enough space in the Z80's RAM for all the SFX). Everything "PCM" is done by the SMPS 68k/PCM drivers (SNCBNK##.BIN files).
    And that's all.
     
  11. Hitaxas

    Hitaxas

    Retro 80's themed Paladins Twich streamer Member
    1,438
    0
    0
    Litchfield,CT
    Becoming a Twitch partner, and getting my life back together
    Edit: I'm an idiot. Since those sfx aren't pcm they cannot be played in audio playing software. >.<


    Edit 2: Any chance anybody has ripped the driver and sfx from Sonic CD then?
     
  12. trykaar

    trykaar

    Member Member
    14
    0
    0
    St. Louis, MO
    Sega Roguelike Exploration/Disassembly
    I am working on a disassembly of Dragon Crystal for the Master System, released in Europe only sometime in 1991, and I believe it is also using SMPS:

    See here, and compare it to the known SMPS Sonic 2 SMS disassembled sound driver here- the flags used are different, but the code is otherwise nearly identical.

    Dragon Crystal for Game Gear, which has a definitive release date a little earlier, in December 1990, shares the same memory addresses for its sound control, so it's very likely it is also SMPS. The two games have completely different soundtracks, though- I've wondered if it was due to some difference in sound capability between the two systems or the two sound engines. I know the Game Gear supports panning and never has the FM chip (which doesn't seem relevant, as the GG version seems to have come first here), is that the only real difference?

    Both Dragon Crystals have a lot in common with Fatal Labyrinth for the Genesis/Mega Drive as well, which is SMPS-z80 according to this thread- Fatal Labyrinth was also released sometime in 1991 through the Game Toshokan download service, but I don't know whether it was before or after DCSMS. All three games share the same composer, E. Fugu, and I suspect that the games were developed in very close sequence if not simultaneously. It might be interesting to compare them to each other as a snapshot of SMPS across platforms at that time.
     
  13. ValleyBell

    ValleyBell

    Tech Members Tech Member
    236
    0
    0
    researching SMPS sound drivers
    Researching and ripping SMPS drivers is fun, you know, so here is a bump for the release of my SMPS Research Package, now in version 4.

    Summary of the contents:
    • 35 SMPS 68k games (that means I ripped all known MegDrive SMPS 68k games, btw)
    • 80 SMPS Z80 games + 12 Game Toshokan games
    • 3 Sega Pico games
    • more disassembled SMPS drivers (including Sega Pico, MegaCD SMPS and a few Master System drivers)
    • comparisons of the coordination flags of various SMPS drivers
    • updated and new tools (SMPSExtract was improved a lot and I wrote a few tools to analyze SMPS 68k and SMPS Z80 drivers)
    Note: Even though Revenge of Shinobi and Streets of Rage are SMPS drivers at their core, their sequence format is completely different and largely matches Yuzo Koshiro's Mucom format. So I put them into the "Other" folder.


    Because all the stuff got pretty large, I split the package into two parts.
    Part 1 (rips and tools) (10.5 MB) and Part 2 (disassemblies) (20.6 MB)

    Of course there is also a new version of SMPSPlay, supporting all the new stuff. (like Sega Pico PCM)
    SMPSPlay v2.11: Win32/64 Binary (source archive, GitHub repo)

    Enjoy!
     
  14. ICEknight

    ICEknight

    Researcher Researcher
    Awesome!


    ...But some of the rips give me this error message:

    Code (Text):
    1. Error opening Rips/Other/Revenge of Shinobi, The/config.ini
    2. No extentions defined! Closing.
    :(

    Any clues on how to avoid this?
     
  15. ValleyBell

    ValleyBell

    Tech Members Tech Member
    236
    0
    0
    researching SMPS sound drivers
    SMPSPlay can't play any of the rips in the "Other" folder, due to them using a fundamentally different format. (Because of this, they also important lack files like "config.ini" and "DefCFlag.txt").
    Revenge of Shinobi for example uses separate coordination flag sets for FM and PSG channels. That's something no other SMPS game does (but Streets Of Rage), but it's commonly seen in games that use Koshiro's Mucom driver.

    preSMPS rips are also working only partly, because some of them are untouched since I rewrote SMPSPlay. SMPSPlay still lacks support for preSMPS headers and Phantasy Star 2's chord mode.
     
  16. ICEknight

    ICEknight

    Researcher Researcher
    Ah, Ok. I was wondering if I was doing something wrong...
     
  17. Herm the Germ

    Herm the Germ

    Hmm, not bad. Well done, doctor! Member
    1,482
    0
    0
    Dresden, Saxony, Germany
    MIDI-to-SMPS-conversions, mostly. Takin' requests, too.
    I love you and I am going to have so much fun with this. <3
     
  18. muteKi

    muteKi

    Fuck it Member
    7,543
    0
    16
    Interesting. What the hell are the S3K tracks with the .org extension?
     
  19. ValleyBell

    ValleyBell

    Tech Members Tech Member
    236
    0
    0
    researching SMPS sound drivers
    Everytime I need to patch some SMPS file to make it play properly with SMPSPlay, I also provide the original dump as .org.
    In case of S3K, some of the tracks share data (SMPS Z80 games love to do that). So in the original dump, only one of those tracks has the data and it's missing in the other songs.
    The fixed tracks have the additional data added to them.
     
  20. muteKi

    muteKi

    Fuck it Member
    7,543
    0
    16
    Ah, I see. The Launch Base .org file was fascinating to listen to.

    The docs for the program hint at a way to use the program to log VGMs while playing -- is there a way to enable that?