SPC data upload
Moderator: Moderators
Forum rules
- For making cartridges of your Super NES games, see Reproduction.
That and Wario's Woods (and the rest of this list), including a lot of games that use the ARDI music engine. These rely on the host CPU to send NoteOn messages and the like. Or were you talking about rewriting its music engine from 65C816 to SPC700?Bregalad wrote:As far I know this is the only song that can't be played with .spc
There's also stuff like my NSF player, and Sid Mania by Censor. I can't imagine why anyone wouldn't want to write an SNES demo with NES or C64 sound. 
But the main thing is that it is absurd to have to load 64kB of data to play even a sound effect. Other than the general-purpose RAM, there's probably only a few bytes real difference between a lot of SPC files.
But the main thing is that it is absurd to have to load 64kB of data to play even a sound effect. Other than the general-purpose RAM, there's probably only a few bytes real difference between a lot of SPC files.
You mean from the perspective of a generic SNES program, or from the perspective of an SPC player? As I understand it, a generic SNES program can load a couple instruments and start the SPC700 playing an opening drum fill while the rest of the instruments load, but most don't.Memblers wrote:But the main thing is that it is absurd to have to load 64kB of data to play even a sound effect.
Which is why SPC sets are distributed in a solid archive such as .rar or .7z: compression recognizes this and stores the majority of each file as references to the previous file in the set.Other than the general-purpose RAM, there's probably only a few bytes real difference between a lot of SPC files.
I mean from the perspective of an SNES program. Trying to play a set of SPC files is just painful. There would be too much load time, even if there was solid RAR type compression on SNES.
That's interesting, what games do that?tepples wrote:As I understand it, a generic SNES program can load a couple instruments and start the SPC700 playing an opening drum fill while the rest of the instruments load, but most don't.
I'm relieved to say that after a lot of BSNES tracing, looking at SPC files in hex editors, reading eKid's and Anomie's documentation, and good old-fashioned trial and error my loader now works with every single one of the songs in my test set (currently 19). I still need to do hardware tests with my latest code and clean things up a bit.
Here is my code: http://jiggawatt.org/badc0de/spcplayer-1.zip
I've verified it on a real PAL SNES. If you don't get any audio output at first (occasionally happens on HW); press the reset button.
And here's my test set of .SPC files: http://jiggawatt.org/muzak/spctestset.zip
I've verified it on a real PAL SNES. If you don't get any audio output at first (occasionally happens on HW); press the reset button.
And here's my test set of .SPC files: http://jiggawatt.org/muzak/spctestset.zip
Looks like we started from the same flawed sample code
Good idea putting F0/F1 in the init code. Just a couple questions:
How did you decide on $FF70 for init code?
Where do the io port init values come from?
Any idea why it sometimes doesn't start playing on real hardware? I noticed this too on files I knew worked.
How did you decide on $FF70 for init code?
Where do the io port init values come from?
Any idea why it sometimes doesn't start playing on real hardware? I noticed this too on files I knew worked.
It was $FFA0 in the original code, but I looked at some .SPC files in a hex editor and saw that at least one didn't have padding (all 00/FF) in that area. But all seemed to contain padding at $FF70..$FF8F, so I picked $FF70 as my starting address.How did you decide on $FF70 for init code?
From $1F4..$1F7 in the .SPC file.Where do the io port init values come from?
Who the hell knows..Any idea why it sometimes doesn't start playing on real hardware? I noticed this too on files I knew worked.
Just an idea for the startup code... games usually have an echo buffer where the SPC stores output samples to be feed-back later to create an echo effect. Since this buffer will never by used to store code, variables or samples, it should work to place the init code here - but maybe a click will be heard on the start of the song.
I'm pretty sure Squaresoft games uses $fc00-$ff00 to store variables - as I have partially reverse engineered Secret of Mana's sound engine, and the other games uses a variant of it. Secret of Mana uses $ff00-$ffff to store repeat stacks or something, so if you alter anything here it will go crazy, fetch incorrect sound data etc... so no wonder it don't work !
The problem would be for SPC files which doesn't use, such as Super Castlevaia IV.
I'm pretty sure Squaresoft games uses $fc00-$ff00 to store variables - as I have partially reverse engineered Secret of Mana's sound engine, and the other games uses a variant of it. Secret of Mana uses $ff00-$ffff to store repeat stacks or something, so if you alter anything here it will go crazy, fetch incorrect sound data etc... so no wonder it don't work !
The problem would be for SPC files which doesn't use, such as Super Castlevaia IV.
Useless, lumbering half-wits don't scare us.