Sonic and Sega Retro Message Board: Valley Bell's SMPS Research - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 5 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

Valley Bell's SMPS Research includes lots of rips, disassemblies and hacking information

#1 User is offline ValleyBell 

Posted 31 December 2013 - 10:45 AM

  • Posts: 227
  • Joined: 08-September 10
  • Gender:Male
  • Project:researching SMPS sound drivers
  • Wiki edits:10
Most recent releases
SMPS Research Pack v4: direct link part 1 / part 2, release post
SMPSPlay 2.11: Win32/64 binary, source code archive / git repo, release post


Original post
Over the last two years I did a lot of research on SMPS drivers, both 68k and Z80.
I ripped songs from 21 SMPS 68k and 35 SMPS Z80 games, did some research on preSMPS, especially Rent-A-Hero, and disassembled some sound drivers.

And today I want to show you the results: the SMPS Research Pack.
The probably most interesting thing inside are rips from almost 60 games.
Except for the preSMPS games, every ripped game has not only the extracted SMPS files, but DAC and PSG data, too. (PSG data is stored in mid2smps' PSG list format.)

There is also a file called "Pointers.txt" in every folder that lists the locations of pointer lists and other data, as well as the format of the DAC sound list. Later rips are more complete and have more notes than earlier ones.
For two games, OutRunners and Virtua Racing (SVP), there is also table that explains the custom coordination flags.

Some folders have songs patched to work with SMPSPlay. The original songs are marked with .org in this case.

The folder for Rent-A-Hero contains files in SMPS 68k format. I converted them from preSMPS 68k to SMPS 68k using a small tool I wrote. The conversion is not perfect (missing tempo changes and DAC on/off flags), but pretty close.


The programmer guys may be interested in the folder with disassembled SMPS drivers. (Included are original .bin, the .idb and an exported .asm file.)

There are disassemblies of a fair number of DAC drivers. I also compared them and noted the differences in a separate .txt file.
I also collected some SMPS Z80 drivers, sorted them into categories and disassembled a few of them. Please note that some of the older disassemblies (2012 and early 2013) contain mistakes.
Finally there are also a few disassembled preSMPS drivers. I didn't get far with Phantasy Star 2, but the other two are labelled well. PS2 with its "chord mode" and Space Harrier 2 with a 2x 2-Operator FM drum are both pretty interesting.


Finally, there is also a folder with a few .txt files with tables that tell you the playback speed of a few DAC drivers. These are DAC rate -> frequency in Hz conversion tables and the values are reused by SMPSPlay to determinate the playback speed of the DAC samples.


You think that's all? No, it's not.

In order to play all those rips, you probably want to download an updated version of SMPSPlay, an SMPS player for Windows.
It includes a Win32 binary, as well as a 64-bit one.
If you want to look at the source code, you can get it here. Be warned though, it's pretty messy right now and I plan to make some larger changes that make it easier to support various SMPS variants.

Important notes about SMPS Z80:
- The offset autodetection is unstable and doesn't work on some games or songs. It's pretty much impossible to guess if there is garbage data between header and actual song data or not.
- For some songs you will need instrument sets that are shared between songs. You can edit data\config.ini to use the respective InsSet.bin files.
- Some SMPS Z80 games use FM and PSG drums by playing notes on the DAC/Rhythm channel. SMPSPlay currently supports only DAC sounds on this channel, so I tried to replace them with DAC drums in a few folders. The only game where it worked well was Dyna Brothers 2 though.

Now, enjoy and happy hacking!

P.S.: It's not ready yet, but I will release an updated version of my SMPS Extractor soon, too. I used it to extract all songs and DAC sounds.

EDIT: You can download a slightly updated SMPSPlay here.
This post has been edited by ValleyBell: 19 July 2015 - 04:13 PM

#2 User is offline amphobius 

Posted 31 December 2013 - 12:44 PM

  • where are the japanese shaman girls, lintahlo?
  • Posts: 2118
  • Joined: 19-February 08
  • Gender:Male
  • Location:Northern Ireland, Belfast
  • Project:life
  • Wiki edits:165
Oh my god I fucking love you

#3 User is online Master Emerald 

Posted 01 January 2014 - 01:38 AM

  • Posts: 3289
  • Joined: 14-December 07
  • Gender:Male
  • Location:Rio de Janeiro - Brazil
  • Project:College
  • Wiki edits:22
H

O

L

Y


S

H

I

T

Non-crappy PCM playback? Incredible I say. Please rip Sonic 3 when you have time. I bet the 'Go' and 'Woo' samples would sound much better this way!

Awesome work :D Btw the tracks that have that fake reverse cymbal in 3D blast got a corrupted bass in your rip.

The PSG also behaves differently from real hardware, dunno maybe the tremolo is too fast?
This post has been edited by Master Emerald: 01 January 2014 - 06:38 AM

#4 User is offline ValleyBell 

Posted 01 January 2014 - 05:32 AM

  • Posts: 227
  • Joined: 08-September 10
  • Gender:Male
  • Project:researching SMPS sound drivers
  • Wiki edits:10
Thanks for the nice feedback :)

View PostMaster Emerald, on 01 January 2014 - 01:38 AM, said:

Non-crappy PCM playback? Incredible I say. Please rip Sonic 3 when you have time. I bet the 'Go' and 'Woo' samples would sound much better this way!
SMPSPlay itself comes with ripped DACs and PSG from Sonic 1, 2, 3, S&K and 3D already.
You can get S3K's songs from the Retro Git. You need to rename them to .s3k, activate the S3K instrument set in config.ini, then most of them should play.

For completeness I'll do my own rip of S3 and S&K sometime though.

View PostMaster Emerald, on 01 January 2014 - 01:38 AM, said:

Btw the tracks that have that fake reverse cymbal in 3D blast got a corrupted bass in your rip.
Oh, right. I remember that these tracks caused me trouble when writing smps2mid, too.
The bass' transpose value is invalid actually, but the note/octave calculation in the original driver results in values that make correctly sounding notes.
If you want to quickly solve the problem, change the byte at offset $000C in both songs from $D4/$D5 to $14/$15.

View PostMaster Emerald, on 01 January 2014 - 01:38 AM, said:

The PSG also behaves different from real hardware, dunno maybe the tremolo is too fast?
It shouldn't, but there is a chance I broke something. It's also possible that it has something to do with the PSG emulation. Especially the noise volume might be a bit off.

#5 User is online Master Emerald 

Posted 01 January 2014 - 07:22 AM

  • Posts: 3289
  • Joined: 14-December 07
  • Gender:Male
  • Location:Rio de Janeiro - Brazil
  • Project:College
  • Wiki edits:22
No problem :D

Before I start, could I make a request? -w for WAV logging! I currently have my audio running through HDMI so my onboard Sound card disables the stereo mix as it's not outputting the audio itself (it's my GPU!) so I can't make recordings from the program, only if I export a VGM and then use Winamp's wav logger. I've used some virtual stereo mix solutions already but it was more a hassle than it's worth...

Quote

It shouldn't, but there is a chance I broke something. It's also possible that it has something to do with the PSG emulation. Especially the noise volume might be a bit off.


The PSG is specially off on the Outrunners set. Ah, an observation, the PCM percussion plays apparently fine inside SMPSPlay but as soon as I export to VGM it doesn't play properly. I've chosen '0A Last Wave' from it and made a comparison:

1) Real Hardware from Outrun 20th Anniversary OST - (seems to be an MD2 and with a tad bit of noise there),
2) Dark Pulse's VGz RIP,
3) WAV logged from the VGM export of SMPS Play (the PSG sounds the same as in the program, so it's valid for the PSG matter anyway; you can record yourself and compare, though).

Download the ogg file!
This post has been edited by Master Emerald: 01 January 2014 - 07:31 AM

#6 User is offline ValleyBell 

Posted 01 January 2014 - 12:54 PM

  • Posts: 227
  • Joined: 08-September 10
  • Gender:Male
  • Project:researching SMPS sound drivers
  • Wiki edits:10
Here is an updated SMPSPlay. I fixed the OutRunners modulation bug, the VGM logging and -w for wave logging. (It writes to dumps\wavelog.wav.)
Wave logging logs the raw output stream, so it begins logging when you open the program and stops when you close it.

View PostMaster Emerald, on 01 January 2014 - 07:22 AM, said:

The PSG is specially off on the Outrunners set.
Ahh, so the vibrato was too fast. (Tremolo usually means volume modulation.)
The problem was that the modulation was handled incorrectly. Most things (including modulation) in OutRunners work like SMPS 68k, but it emulated SMPS Z80 modulation due to a small oversight.
I also included a fixed PSG list. OutRunners handles the PSG envelope commands a differently to other games.

Anyway, SMPSPlay is far from perfect and there are still some features missing. Things like "frequency flutter" (see Music Hacking Guide, S3K flag $F1) and YM2612 based timing don't work yet. The latter one is really noticeable with some songs with .smy extention.
SMPSPlay should play SMPS files from Sonic 1 and 2 almost 100% accurately though. (except that it doesn't emulate a few bugs from S1 that S2 has fixed)

View PostMaster Emerald, on 01 January 2014 - 07:22 AM, said:

Ah, an observation, the PCM percussion plays apparently fine inside SMPSPlay but as soon as I export to VGM it doesn't play properly.
Indeed.
This happened only with OutRunners and Virtua Racing, because I disabled the (heavily underdeveloped) SMPS parser that scans the files for DAC sounds in those cases. (I didn't bother to handle their custom coordination flags.)
I added a workaround that puts all existing DAC samples into the VGMs for now. This makes them a lot larger than they would need to be, but it works.

In case you didn't notice, the "Pit In" song in Virtua Racing (SVP) played a wrong DAC sound. I noticed that the game writes another DAC sample to the Z80 RAM if this song is played, so I included a fixed sound.

#7 User is offline Andlabs 

Posted 01 January 2014 - 08:37 PM

  • 「いっきまーす」
  • Posts: 2175
  • Joined: 11-July 08
  • Gender:Male
  • Project:Writing my own MD/Genesis sound driver :D
  • Wiki edits:7,061
boring technical and historical information no one other than ValleyBell (who I already talked to) will care about

I will need to re-prepare a table of SMPS games sorted by date and categorize each; it should give us better insight as to the development history of this driver. However, true insight cannot be obtained without looking at Sega's arcade games, as SMPS has its roots as far back as Space Harrier, if not even further back (but before Space Harrier the only 68000-based games were Hang-On and Major League, so a bit more work will be needed to look at earlier games).

I have a feeling variants of SMPS with hardcoded PCM panning values are properly SMPS/T's Music.

#8 User is online Master Emerald 

Posted 02 January 2014 - 03:28 AM

  • Posts: 3289
  • Joined: 14-December 07
  • Gender:Male
  • Location:Rio de Janeiro - Brazil
  • Project:College
  • Wiki edits:22
Awesome, ValleyBell. Thanks for the fix and the WAV logging! :D

New observations! The pitch on some drums is completely different!
Download the OGG! In the order they appear on my file:

SMPS version: it plays at 7550Hz

Dark Soul's VGz rip: it plays at 5500Hz

Real hardware (Outrun 20th Anniversary OST): it plays at 5250Hz

#9 User is offline Quickman 

Posted 02 January 2014 - 07:51 AM

  • Posts: 5584
  • Joined: 03-December 03
  • Gender:Male
  • Location::x
  • Project:omg porjcet
  • Wiki edits:10

View PostAndlabs, on 01 January 2014 - 08:37 PM, said:

I will need to re-prepare a table of SMPS games sorted by date and categorize each

I can at least start this off - I grabbed the list of sound drivers from SMSPower, dumped it into OpenOffice, then scraped Sega Retro by hand for release dates. This is the result.
This post has been edited by Quickman: 02 January 2014 - 07:52 AM

#10 User is online Master Emerald 

Posted 02 January 2014 - 09:40 AM

  • Posts: 3289
  • Joined: 14-December 07
  • Gender:Male
  • Location:Rio de Janeiro - Brazil
  • Project:College
  • Wiki edits:22
And that is only for the Mega Drive! There are Sega CD games that use SMPS, not to mention the GG and Master System (and I bet Sonic Pocket Adventure uses something similar!).

#11 User is offline ICEknight 

Posted 02 January 2014 - 09:57 AM

  • Posts: 10491
  • Joined: 11-January 03
  • Gender:Male
  • Location:Spain
  • Wiki edits:18
Also, SEGA Pico?

#12 User is offline Quickman 

Posted 02 January 2014 - 10:28 AM

  • Posts: 5584
  • Joined: 03-December 03
  • Gender:Male
  • Location::x
  • Project:omg porjcet
  • Wiki edits:10
I've added the 32X section of the sound engine list in another sheet, but in the absence of lists of Mega CD/Master System/Game Gear/Pico games that use SMPS, I can't do anything more. I'm willing to give edit access to people who can fill in these gaps - PM me your info.
This post has been edited by Quickman: 02 January 2014 - 10:29 AM

#13 User is offline Andlabs 

Posted 02 January 2014 - 11:05 AM

  • 「いっきまーす」
  • Posts: 2175
  • Joined: 11-July 08
  • Gender:Male
  • Project:Writing my own MD/Genesis sound driver :D
  • Wiki edits:7,061
All of the above, and some System C/C2 games (I think all except Thunder Force AC; not sure about Puyo Puyo/Puyo Puyo Tsuu). I think I actually do have a list on Sega Retro already, but I need to check again.

#14 User is online Master Emerald 

Posted 02 January 2014 - 11:35 AM

  • Posts: 3289
  • Joined: 14-December 07
  • Gender:Male
  • Location:Rio de Janeiro - Brazil
  • Project:College
  • Wiki edits:22
Valleybell! I can't play any song from Chaotix 32x! Why?

It just says 'invalid track offset' o.o

#15 User is offline ValleyBell 

Posted 02 January 2014 - 02:20 PM

  • Posts: 227
  • Joined: 08-September 10
  • Gender:Male
  • Project:researching SMPS sound drivers
  • Wiki edits:10

View PostMaster Emerald, on 02 January 2014 - 03:28 AM, said:

New observations! The pitch on some drums is completely different!
You know, this is very obvious actually and I know this already.
I just didn't care a lot about it, because it can be fixed by editing the DAC.ini files. (It takes some work to measure the sample rates and get correct values, because I need to hack the ROMs to inject custom sound data and do some realtime RAM editing.)
You can try to mess around with the BaseRate and RateDiv values to get it right. I recommend to increase both until it fits more or less.
It should fit for most SMPS 68k games, as well as Sonic 2, 3K and 3D and Rent-A-Hero. (I.e. all games that use a DAC driver that's listed in the DACFrequencies folder are verified.)

You don't need to post ogg files of everything, btw, especially when it's obvious what's wrong.

View PostMaster Emerald, on 02 January 2014 - 09:40 AM, said:

There are Sega CD games that use SMPS, not to mention the GG and Master System (and I bet Sonic Pocket Adventure uses something similar!).
I can tell you that Phantasy Star 1 uses preSMPS. Sonic 2/Chaos/TT use usual SMPS, but that is already known.
Sonic Gameworld on the Sega Pico uses SMPS according to Sonic Of 8! from vgmrips. (He was so nice and noted it in the VGM pack's description file.) Same for the Pocket Monsters game.

SPA doesn't use SMPS. It uses SNK's sound driver and I'm still having a hard time disassembling it.

View PostMaster Emerald, on 02 January 2014 - 11:35 AM, said:

Valleybell! I can't play any song from Chaotix 32x! Why?
Because of something you won't find in the readme file: the .skc extention.

That means: There is no support for Chaotix yet.
There are 2 reasons for that:
1. I haven't added PWM support to SMPSPlay. (But I disassembled the PWM sound driver that mixes the samples some months ago.)
2. Unlike all other SMPS files, the DAC/rhythm track is missing (the very first track in every SMPS file), so I'd need to add extra code to handle Chaotix' SMPS files correctly. And I don't want to add anything unless I reworked a majority of the SMPS playback code in SMPSPlay. (because of the huge mess it is right now)

  • 5 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users