SNESMusic.org Forums
http://snesmusic.jukor.net/

Understanding the SPC format
http://snesmusic.jukor.net/viewtopic.php?f=17&t=1728
Page 1 of 1

Author:  ProfOak [ Wed Jan 27, 2016 9:56 pm ]
Post subject:  Understanding the SPC format

I'm trying to better understand the SPC format. A couple days ago I made a little script to unpack an RSN archive, and the extract info from the SPC files inside. Now I want to actually play the music in an SPC file.

https://github.com/ProfOak/rsn-info

I'm using this link for reference. http://snesmusic.org/files/spc_file_format.txt

* What is the point of having ID666 data in text and binary form?

* What is the point of having an extended ID666 section?

* Where is the actual audio data stored?

* (probably related) What is the 64KB ram for?

* If I were to make an SPC player, would I have to basically emulate the audio of an SNES?

Author:  Revenant [ Thu Jan 28, 2016 1:37 pm ]
Post subject:  Re: Understanding the SPC format

I assume the extended ID666 section is just the result of the format gradually developing over time and people deciding that the original tag format wasn't entirely sufficient (to contain information about official soundtrack releases, for example). As for the binary vs. text format, I don't really see the point, given that they have nearly the same size and layout as each other and store exactly the same information. Maybe the binary format is slightly easier to handle for hardware-based players, but the majority of the time there's no real reason to use one over the other.

The last three questions are more or less all related. A SPC file is essentially like an emulator savestate, but only for the audio component of the system - 64 kb of RAM, plus the SPC and DSP register state. The 64 kb of RAM is used to store the game's sound programming, as well as the data and instrument samples that the sound code uses to actually play back music. So to answer the last question - yes, SPC players essentially are SNES audio emulators.

The good news is that there are enough open-source emulators (and standalone SPC players) to use as a reference that you don't necessarily have to do everything from scratch.

Author:  ProfOak [ Thu Jan 28, 2016 5:25 pm ]
Post subject:  Re: Understanding the SPC format

Thanks a bunch. That clarifies some much needed information for me.

Author:  KungFuFurby [ Sat Jan 30, 2016 7:17 am ]
Post subject:  Re: Understanding the SPC format

I have a couple of tests that will put your SPC player to the test. All of them are found on these forums, and all of them don't qualify with SNESAmp...

- Clayfighter 2
- Shin Togenkyo
- We're Back! A Dinosaur's Story

Two of them cause all the channels to stop playing, while Shin Togenkyo is much nastier.

Author:  ProfOak [ Mon Feb 01, 2016 1:29 am ]
Post subject:  Re: Understanding the SPC format

Well I am learning how emulators work first, so I probably won't have anything to show for a while. I appreciate all of the information though!

I had one other question though. Why aren't there SPC-like formats for other consoles?

Author:  KungFuFurby [ Wed Feb 03, 2016 8:35 am ]
Post subject:  Re: Understanding the SPC format

The SPC700 is a CPU that runs all sound-related operations mostly on its own once it receives its program. The vast majority of the music on the SPC700 is done within the sound chip (a select few stream their audio data), and the SPC700 has its own RAM.

Other chips are not so autonomous with their operations, sometimes requiring real-time input from the CPU, which explains the other formats used. I don't know of any other chips at the moment.

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/