N-SPC Engine
WIP: currently a stub
Nintendo SPC Sound Engine, abbreviated N-SPC and officially known as Kankichi-kun [1], is the most common sound engine used in all of the SNES/SFC games. Only the music portion was initially provided in the source code included in the IS-Sound unit along with some templating for a protocol for music and sound effects [2]: usually it was modified by developers on an individual basis, resulting in many different variants, some of them more heavily modifying the sound driver than others. Usually what was added on was sound effect support, but sometimes the music VCMDs were modified as well.
The following games are purely based off of the source code provided with the IS-Sound unit, and are either unmodified or barely modified, if at all:
Game Name | VCMD Table Location (usually $E0 and up) | ROM Offset |
---|---|---|
Hong Kong '97 | 0x0DEC, relative to 0x0D2C | 0x0F800A (both versions) |
SM Choukyoushi Hitomi - Bangai Hen | 0x0DEC, relative to 0x0D2C | 0x01801C |
SM Choukyoushi Hitomi Vol. 2 Trial Version | 0x0DEC, relative to 0x0D2C | 0x01801C |
SM Choukyoushi Hitomi Vol. 2 | 0x0DEC, relative to 0x0D2C | 0x03801C |
SM Choukyoushi Hitomi Vol. 2 Remix | 0x0DEC, relative to 0x0D2C | 0x01801C |
SM Choukyoushi Hitomi Vol. 3 Trial Version | 0x0DEC, relative to 0x0D2C | 0x018058 |
SM Choukyoushi Hitomi Vol. 3 (Alt 1) | 0x0DF0, relative to 0x0D30 | 0x018076 |
Wheel of Fortune - Deluxe Edition | 0x0DEC, relative to 0x0D2C | 0x01D842 |
Of the games listed here, two of them are very minor edits...
- Wheel of Fortune - Deluxe Edition's build is unused and is missing an opcode near the *Ver S1.20* string.
- SM Choukyoushi Hitomi Vol. 3 (Alt 1)'s program starts with a JMP opcode, and contains a NOP between the first and second opcodes of the actual program.
Instrument Format
The instrument format is most commonly defined as direct writes to DSP registers for the first four bytes, followed by two pitch-related bytes. They are defined in this order, from top to bottom...
- SRCN
- If this value is above $7F, noise is used, and the lowest five bits contains the noise clock rate.
- ADSR1
- ADSR2
- GAIN
- Pitch Base Multiplier
- Pitch Base Fractional Multiplier (in 256ths)
Phrase Format
Song entries point to a list of phrases for the song to play.
Each phrase is a pointer to a collection of eight pointers to track data. If the pointer is zero, there is no track data.
Voice Command Format
NOTE: This is not representative of every single variant. Instead, it represents the collection of VCMDs from the source code included in the IS-Sound unit, which in turn is carried over to most variants.
VCMD ID | Description | Arguments |
---|---|---|
$00 | Phrase Termination/End of Subroutine | |
$01-$7F | Note Duration | xy |
$80-$C7 | Note | |
$C8 | Tie | |
$C9 | Rest | |
$CA-$DF | Percussion | |
$E0 | Instrument | xx |
$E1 | Panning | %xyzzzzz |
$E2 | Panning Fade | xx yy |
$E3 | Vibrato On | xx yy zz |
$E4 | Vibrato Off | |
$E5 | Master Volume | xx |
$E6 | Master Volme Fade | xx yy zz |
$E7 | Tempo | xx |
$E8 | Tempo Fade | xx yy |
$E9 | Global Transposition | xx |
$EA | Single Channel Transposition | xx |
$EB | Tremolo On | xx yy zz |
$EC | Tremolo Off | |
$ED | Volume | xx |
$EE | Volume Fade | xx yy |
$EF | Subroutine | xx xx yy |
$F0 | Vibrato Fade In | xx |
$F1 | Note Pitch Envelope To | xx yy zz |
$F2 | Note Pitch Envelope From | xx yy zz |
$F3 | Note Pitch Envelope Off | |
$F4 | Fine Tune | xx |
$F5 | Echo On | xx yy zz |
$F6 | Echo Off | |
$F7 | Echo Parameter Setup | xx yy zz |
$F8 | Echo Volume Fade | xx yy zz |
$F9 | Pitch Slide to Note | xx yy zz |
$FA | Percussion Patch Base Redefine | xx |
$FB | NOP | ?? |
$FC | Channel Mute | |
$FD | Fast Forward On | |
$FE | Fast Forward Off | |
$FF | Invalid |
TODO: Voice Command Descriptions
Variants
References
- Video Game Music Preservation Foundation - Kankichi-kun
- Retro Reversing - SNES (Super Famicom) Development Kit Hardware - Intelligent Systems SHVC Development System
- Super Famicom Wiki - N-SPC
- GDRI - Super Famicom/Super NES Sound Driver List
- Github - N-SPC VCMD $FB-$FE identifications
TODO: There are a lot of variants... these will be split into sub-pages depending on the modifications made