SPC memory allocation
Moderator: Moderators
Forum rules
- For making cartridges of your Super NES games, see Reproduction.
SPC memory allocation
In typical SNES music engines, how much SPC RAM is used for the playback engine, sequence data, music samples, sound effect samples, and echo buffer?
Please define a typical music engine.
I'm pretty sure there is many ways to go. An OK practice would be to reserve about 3/4 of the total memory for the echo buffer and samples added together, and that if you need a longer echo buffer for a particular song, you will have less room for samples. I'm pretty sure Chrono Trigger does something like that.
You can also either create sound effects with complex usage of simple sounds, such as what Squaresoft did, which takes few memory, but you can also have all sound effects streamed like Super Double Dragon. Of course a mix of both is also possible.
8 KB (1/4 of memory) should be more than enough for music playback code + it's variable. I just thrown that number out, if you can make it smaller then good you can use more samples / longer samples.
I'm pretty sure there is many ways to go. An OK practice would be to reserve about 3/4 of the total memory for the echo buffer and samples added together, and that if you need a longer echo buffer for a particular song, you will have less room for samples. I'm pretty sure Chrono Trigger does something like that.
You can also either create sound effects with complex usage of simple sounds, such as what Squaresoft did, which takes few memory, but you can also have all sound effects streamed like Super Double Dragon. Of course a mix of both is also possible.
8 KB (1/4 of memory) should be more than enough for music playback code + it's variable. I just thrown that number out, if you can make it smaller then good you can use more samples / longer samples.
Useless, lumbering half-wits don't scare us.
Into what patterns of memory usage did the common music drivers fall?Bregalad wrote:Please define a typical music engine.
How do games like Kirby's Avalanche and Super Street Fighter II do voices? Are those streamed? But of course, once you get too much streaming going on, the gameplay slows down *cough*LOTR*cough*.You can also either create sound effects with complex usage of simple sounds, such as what Squaresoft did, which takes few memory, but you can also have all sound effects streamed like Super Double Dragon.
I thought memory was 64 KB, not 32 KB. But you're right that one can probably use the size of an NSF as a rough benchmark for how big an SPC might be minus the samples.8 KB (1/4 of memory)
Oh of course you are right SPC's mem is 64 KB.
So yeah if you manage to pull replay code + replay variables in 8KB ($0000-$1fff), music / sound effects in 8KB ($2000-$3fff), this leves 48 KB for samples and echo buffer.
I don't know if this is what needs to be done, but it sounds like a decent deal.
Super Street fighter 2 has streamed voices, but really simples one, it only have something like "Shoryu-ken" and "hado-ken" recorded at very slow rate, with the same "ken" ending. I think particular game does work with only one set of samples loaded at startup, like the vast majority of eariler SNES games.
Voices in Tales of Phantaisa are the opposite, the 6502 streams them to the SPC700 somehow, and it end up being streamed almost in real time. (not really in real time because there is probably a double/triple buffering system sending blocks of BRR data, as opposed to directly steam via the echo buffer like Blargg managed to do).
So yeah if you manage to pull replay code + replay variables in 8KB ($0000-$1fff), music / sound effects in 8KB ($2000-$3fff), this leves 48 KB for samples and echo buffer.
I don't know if this is what needs to be done, but it sounds like a decent deal.
Super Street fighter 2 has streamed voices, but really simples one, it only have something like "Shoryu-ken" and "hado-ken" recorded at very slow rate, with the same "ken" ending. I think particular game does work with only one set of samples loaded at startup, like the vast majority of eariler SNES games.
Voices in Tales of Phantaisa are the opposite, the 6502 streams them to the SPC700 somehow, and it end up being streamed almost in real time. (not really in real time because there is probably a double/triple buffering system sending blocks of BRR data, as opposed to directly steam via the echo buffer like Blargg managed to do).
Useless, lumbering half-wits don't scare us.
Some games, like BS-Zelda and probably earlier SNES games load the SPC with 64kb of data at game load-up. And that's it. However alot of later games probably only keep the engine in memory and swap out music data and samples for both music and sound effects.
Street Fighter Alpha 2 has horrible "load times" that are mistaken by some to be graphics loading when it's actually spending time loading high quality voice samples for the announcer or reloading the samples for the music and characters about to fight again.
I've heard some games like EarthWorm Jim 2 do some on the fly type loading but I imagine that most games do loading of SPC data at your typical key points, between levels or areas of levels, or between matches.
I guess it's too bad that SNES didn't have DMA to the SPC's memory.
Street Fighter Alpha 2 has horrible "load times" that are mistaken by some to be graphics loading when it's actually spending time loading high quality voice samples for the announcer or reloading the samples for the music and characters about to fight again.
I've heard some games like EarthWorm Jim 2 do some on the fly type loading but I imagine that most games do loading of SPC data at your typical key points, between levels or areas of levels, or between matches.
I guess it's too bad that SNES didn't have DMA to the SPC's memory.
I recall a good example of no attempt of hiding this. In Rockman & Forte after defeating a boss your character can move around and if you do so you'll notice everything freeze for a small time while it loads the victory fanfare tune. For the development time and money point of view this makes sense but from another it seems lazy not to hide this.blargg wrote:Yeah, many SNES games have a second or so pause due to loading new music into the SPC. It's too bad games didn't do this in parallel with other CPU-unintensive things like scrolling.
It does seem like it would have been pretty easy to hide the loading. Even the standard bootloader allows the 65816 to set the pace of upload, so for example it could upload for half of the frame time, then leave the rest for moving the player and updating PPU registers. One downside is that it would lengthen the silence between sounds, and it'd have to avoid making any sound effects while uploading. The narrow interface to the SPC is a big cause. I understand that part of this was to reduce difficulties in having another company develop the sound hardware. If the interface were wider, it would have required more collaboration. Given all the features of the SNES, it is a glaring bottleneck for sure.
-
psycopathicteen
- Posts: 3001
- Joined: Wed May 19, 2010 6:12 pm
Yeah, it is pretty obvious that the SPC700 barely has anything to do with the rest of the SNES design. It just doesn't have that "Nintendo architecture" that the rest of the system has.In [url=http://nesdev.com/bbs/viewtopic.php?p=70487#70487]this post[/url], blargg wrote:I understand that [the low bandwidth between the 65C816 and the SPC700] was to reduce difficulties in having another company develop the sound hardware. If the interface were wider, it would have required more collaboration. Given all the features of the SNES, it is a glaring bottleneck for sure.
The rest of the system is all about squares and patterns, while the sound chip is all about complicated curvature.
Sometimes I wonder how it would've been like if Nintendo developed the soundchip in-house. It would probably sound crisper, clearer and more video-gamey.
It would probably have sounded like the GBA's soft PCM mixers and the DS's sound chip: aliased to all heck.psycopathicteen wrote:Sometimes I wonder how it would've been like if Nintendo developed the soundchip in-house. It would probably sound crisper, clearer and more video-gamey.
In this sample I play a short passage four times:
- Original, ripped from the DDR Extreme soundtrack
- Bandlimited to 9 kHz
- Bandlimited to 9 kHz, decimate to 18 kHz (Nyquist rate), upsample with nearest neighbor
- Bandlimited to 9 kHz, decimate to 18 kHz, upsample with linear interpolation
Well now that you mention it it's right. The SPC700 is from Sony.Yeah, it is pretty obvious that the SPC700 barely has anything to do with the rest of the SNES design. It just doesn't have that "Nintendo architecture" that the rest of the system has.
The rest of the system is all about squares and patterns, while the sound chip is all about complicated curvature.
Then the ideal deal would be to upload the initial SPC700 stuff with the included bootloader, then have your own that is more efficient and allows :
It does seem like it would have been pretty easy to hide the loading. Even the standard bootloader allows the 65816 to set the pace of upload, so for example it could upload for half of the frame time, then leave the rest for moving the player and updating PPU registers. One downside is that it would lengthen the silence between sounds, and it'd have to avoid making any sound effects while uploading
* For the 65816 to update SPC data when it is iddle with gameplay
* For the SPC to recieve SPC data when it's iddle, while still being to play SFX that aren't affected by the updated data.
However, the SPC doesn't have any interrupts, which probably makes this hard to do.
I suspect the Playstation has the same problem with games loading music off the disks.
In Final Fantasy 8/9 there is a considerable lag when you win a battle so that the game loads the winning music. This lag doesn't happen in parts of the game where the music doesn't change when you enter in battle.
Useless, lumbering half-wits don't scare us.
-
tomaitheous
- Posts: 592
- Joined: Thu Aug 28, 2008 1:17 am
- Contact:
How so? I thought the PS1 had no SPC processsor. Just the DSP and 512k of ram that it could see/use. And the main/MIPS cpu took care of the DSP reg updates (it does all the song decoding).Bregalad wrote: I suspect the Playstation has the same problem with games loading music off the disks.
In Final Fantasy 8/9 there is a considerable lag when you win a battle so that the game loads the winning music. This lag doesn't happen in parts of the game where the music doesn't change when you enter in battle.
-
psycopathicteen
- Posts: 3001
- Joined: Wed May 19, 2010 6:12 pm
http://www.youtube.com/watch?v=Gi3bZzok ... re=related
I wonder if this is how the SNES would've sounded like without the low-pass-filter, interpolation, and BRR compression.
http://www.youtube.com/watch?v=TGbwL8kSpEk&feature=fvw
This other video is completely irrelevant to this thread. I just saw it on the "related videos" column, clicked on it, and enjoyed it a lot.
Teenage girls + long legs + Japanese + techno = Awsomeness!
I wonder if this is how the SNES would've sounded like without the low-pass-filter, interpolation, and BRR compression.
http://www.youtube.com/watch?v=TGbwL8kSpEk&feature=fvw
This other video is completely irrelevant to this thread. I just saw it on the "related videos" column, clicked on it, and enjoyed it a lot.
Teenage girls + long legs + Japanese + techno = Awsomeness!