Skip to content

Extracting samples from multipcm games?

Technical discussion about the VGM format, and all the software you need to handle VGM files.

Moderator: Staff

  • 8bit_coder Offline
  • Posts: 4
  • Joined: 2018-03-12, 3:20:13

Extracting samples from multipcm games?

Post by 8bit_coder »

I've been trying to complete an .it file with all the daytona usa samples, ranging from sound effects to full sountrack. I already have all the playable vgm files, but I'm wondering if there's a way to extract the sample data from each one. I already found an .it file with most of the samples, but it's missing some key ones. I figured out with audacity that importing the MPR data files of the game results in individual samples being played after each other, and there's a click when a new one starts playing. I wonder if there's a tool to extract the individual samples from multipcm vgm files or games using multipcm audio. Any help is appreciated!
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

I don't know of any tool that can extract samples from MultiPCM VGMs. Ripping from the VGM files directly also might be a bad idea as they are usually stripped from samples that the song doesn't use.

However, it should be pretty simple to write a small program that rips the samples from the MPR files.
At first you need to combine the sound ROM files so that you get one file per region defined in MAME. (e.g. mpr-16491.32 and mpr-16492.33 result in one one, mpr-16493.4 and mpr-16494.5 result in another one)
Each of those files begins with a sample table that contains up to 512 samples, with 12 bytes per sample. You can look at this code in order to get an idea of the format. (Or look it up in the YMF278B/OPL4 manual - it's the same format.)

A small note: SEGA's arcade boards use some special logic to access anything past the 1 MB mark. Feel free to ask us about that on IRC.
  • 8bit_coder Offline
  • Posts: 4
  • Joined: 2018-03-12, 3:20:13

Post by 8bit_coder »

Since I accidentally closed the chatbox and the chatbox link isn't there, I'm going to reply from here.

Yeah, I thought so. I still can't figure out how to get the data from the data table normally, and now I wan't to know, how would I get the data past the 1mb mark? Is there some sort of bank switching or complicated stuff or is it just encrypted or something?
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

It's just some custom bank switching. Depending on the game, the bank size is 1x 1 MB (Sega Model 1/2) or 2x 512 KB (Sega System 32). So an offset that points to the ROM area between 0x10 0000 and 0x1F FFFF might point to any bank in the ROM.
You might need to do some guesswork for the banks, but I think it should be pretty safe that earlier entries from the sample table point to the lower banks. (And when the offsets jump from 0x1Fxxxx to 0x10xxxx, that would probably mark the beginning of the next bank.)

You should probably try to understand the table format in general at first and try to extract some of the samples that use the lower 1 MB of the ROMs.
Post Reply