We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS

N-SPC Engine/Kemco

From SnesLab
Revision as of 01:30, 14 November 2020 by KungFuFurby (talk | contribs) (Adding command identifications)
Jump to: navigation, search

Go back to N-SPC Engine

Kemco is the first company outside of Nintendo themselves to release a game using their own variant of N-SPC (that being Bombuzal). The main customization that they did was to have the CPUIO registers play sounds on specific channels, and only the channels on the phase list specified to be used by the corresponding CPUIO register would be used. One other CPUIO register was allocated mainly to perform volume fades.

Game Name Version VCMD Table Location ($E0 and up) ROM Offset
Bombuzal 1.0 0x10EB, relative to 0x102B 0x04807A
Lagoon 2.0 0x1156, relative to 0x1096 0x0D80A4 (all versions)
Drakkhen 3.0 0x129E, relative to 0x11DE 0x1C805C (all versions)
Ka-blooey 3.0 0x129E, relative to 0x11DE 0x048080
First Samurai 3.1 0x129E, relative to 0x11DE 0x0DB15E (all versions)
Phalanx - The Enforce Fighter A-144 3.1 0x129E, relative to 0x11DE 0x1EB23E (all versions)
Super Drakkhen/Dragon View 3.1 0x129E, relative to 0x11DE 0x09B6F6 (all versions)
Super Full Metal 3.1 0x129E, relative to 0x11DE 0x0C80B6
X Zone 3.1 0x129E, relative to 0x11DE 0x0FAEE6 (all versions)
Kid Klown in Crazy Chase 4.0 0x12A1, relative to 0x11E1 0x1EC1E0 (all versions)

The raw build sorting notes can be found here.

Communication with the SNES

Each CPUIO register has an individual use.
TODO output for all CPUIO registers on a per-version basis

CPUIO0 ($2140/$F4)

This register always controls which sound ID will play out of channels 1-6, regardless of which sound driver version is used. It also supports the source build's N-SPC/Kankichi commands.

CPUIO1 ($2141/$F5)

This register controls which sound ID will play of of the following channel IDs, depending on the version...

  • V1.0, V3.0: Channels 7-8
  • V2.0, V4.0: Channel 7

CPUIO2 ($2142/$F6)

Only used in V2.0 and V4.0. This register always controls which sound ID will play out of channel 8.

CPUIO3 ($2143/$F7)

Never used in V2.0.
This CPUIO register is used to perform volume fades. The values supported depend on the sound driver version.

Commands (V1.0)

Command ID Description
$00-$9F NOP
$A0 Halt Volume Operations (Channels 1-6)
$A1 Fade Out (Channels 1-6)
$A2 Fade In (Channels 1-6)
$A3 Zero Volume (Channels 1-6)
$A4 Volume Restore (Channels 7-8)
$A5 Halt Volume Operations (Channels 7-8)
$A6 Fade Out (Channels 7-8)
$A7 Fade In (Channels 7-8)
$A8 Zero Volume (Channels 7-8)
$A9 Volume Restore (Channels 7-8)
$AA-$FF NOP

Commands (V3.0-V4.0)

Command ID Description Versions Supported
$00-$7F NOP
$80 Halt Volume Operations (Channels 1-6) V3.0-V3.1
$81 Fade Out (Channels 1-6) V3.0-V3.1
$82 Fade In (Channels 1-6) V3.0-V3.1
$83 Zero Volume (Channels 1-6) V3.0-V3.1
$84 Volume Restore (Channels 1-6) V3.0-V3.1
$85-$9F NOP
$A0 Halt Volume Operations (Channels 7-8) V3.0-V3.1
$A1 Fade Out (Channels 7-8) V3.0-V3.1
$A2 Fade In (Channels 7-8) V3.0-V3.1
$A3 Zero Volume (Channels 7-8) V3.0-V3.1
$A4 Volume Restore (Channels 7-8) V3.0-V3.1
$A5-$DF NOP
$E0 Halt Volume Operations (Master Volume) V3.0-V4.0
$E1 Fade Out (Master Volume) V3.0-V4.0
$E2 Fade In (Master Volume) V3.0-V4.0
$E3 Zero Volume (Master Volume) V3.0-V4.0
$E4 Volume Restore (Master Volume) V3.0-V4.0
$E5-$FF NOP

TODO document commands TODO for whatever reason some of these commands are bugged on later versions... document these bugs