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/Nintendo/Koji Kondo

From SnesLab
Revision as of 00:20, 21 February 2022 by KungFuFurby (talk | contribs) (Adding the other two CPUIO registers for Super Mario All-Stars)
Jump to: navigation, search

Go back to N-SPC Engine/Nintendo

NOTE: This page is under construction.

Koji Kondo is the first user of the N-SPC engine, having used its earliest known version in two games.

TODO insert table here

The raw build sorting notes can be found here for all variants by Nintendo.

Communication with the SNES

For Super Mario World and Pilotwings, see the Prototype Variant's page.

Super Mario All-Stars

The protocol in general is mostly adapted from Super Mario World's, though with some differences here and there, most notably in the triggering of the Hurry Up! SFX and the SFX sequences in general.

CPUIO0 ($2140/$F4)

This register controls the SFX to play on channel 5.

Command ID Description
$00 NOP
%?xxxxxxx
$01-$7E/$81-$FE
Play SFX Sequence Set 1
%?1111111
$7F/$FF
Hurry Up!
NOP (Command $00)

Does absolutely nothing.

Play SFX Sequence Set 1 (Command $01-$7E/$81-$FE)
%?xxxxxxx
  • %xxxxxxx is the SFX ID to play. The ID currently playing is echoed back to $2140 on the SNES, including the highest bit (which otherwise can be toggled for retriggering purposes, but otherwise doesn't actually do anything.
    • $11 keys off all notes and pauses the music once it has finished playing. $12 will unpause the music.
    • $11 and $1D cannot be interrupted except by $43, $11 or $12.
    • $3B and $43 force echo off while they are playing.

The $FF VCMD for this set only is programmed to restart the SFX from the beginning.

SFX Sequence Format

See the SFX Sequence Format subpage.

Hurry Up! (Command $7F/$FF)

Plays SFX ID $1D on both SFX sequence sets and offsets the tempo by $0A without overflow checks. This can stack if it is played multiple times, but only the first one will remain in effect until forced off.

CPUIO1 ($2141/$F5)

This register controls some hard-coded SFX on channel 8.

Command ID Description
$00 NOP
xy
$01-$EF, $F1-$FE
Hard-coded SFX + BRR Wind Control
$F0 Go to IPL Boot ROM
$FF Load New Data
NOP (Command $00)

Does absolutely nothing.

Hard-coded SFX + Noise BRR Wind Control (Command $01-$EF, $F1-$FE)

Input

xy

Output

%000xyyyy
  • x controls the BRR wind on channel 6 as following...
    • $1 activates BRR wind on channel 6. The upper four bits will output a $1 to $2141 on the SNES.
    • $2 deactivates BRR wind. This clears the output of the upper four bits for $2141.
  • y plays hard-coded SFX on channel 8 as following...
    • $1 plays Mario's jumping SFX on channel 8. The value is echoed back to the SNES via $2141 while the SFX is playing.
    • $4 plays the turnaround SFX. The value is echoed back to the SNES via $2141 while the SFX is playing.
    • All other values are NOPs.
Go to IPL Boot ROM (Command $F0)

TODO go into specifics on what exactly is cleared out here before going to the loader

Load New Data (Command $FF)

TODO go into specifics on what exactly is cleared out here before going to the loader

CPUIO2 ($2142/$F6)

This register controls the music.

Command ID Description
$00 NOP
%01-$72 Play Music
$73-$EF Stop Noise BRR Wind + Fade Out
$F0 Stop Music
$F1 Fade Song Volume
$F2 Restore Song Volume
$F3 Stop Noise BRR Wind + Fade Out + Reset Tempo Speedup
$F4-$FF NOP
NOP (Command $00, $F4-$FF)

Does absolutely nothing.

Play Music (Command $01-$72)
  • The command ID provided is the music ID to play. The ID currently playing is echoed back to $2142 on the SNES.
    • $07, $09, $0D, $11-$12 and $14 reset the tempo speedup effect done by the Hurry Up! command.
Stop Noise BRR Wind + Fade Out (Command $73-$EF)

Fades out the song volume to zero over 144 tempo ticks. The Noise BRR Wind is also halted.

Reset Tempo Speedup (Command $F3)

Identical to the fade out command above, except the tempo speedup effect done by the Hurry Up! command is also reset, effective next tempo change or when another song is played.

Fade Song Volume (Command $F1)

Sets the song volume to $70.

Restore Song Volume (Command $F2)

Restores the song volume from a backup created from the $F1 command. If the backup turns out to be a zero volume case, this doesn't work.

CPUIO3 ($2143/$F7)

This register controls the SFX to play on channel 7.

Command ID Description
$00 NOP
%?xxxxxxx
$01-$FF
Play SFX Sequence Set 2
NOP (Command $00)

Does absolutely nothing.

Play SFX Sequence Set 2 (Command $01-$FF)
%?xxxxxxx
  • %xxxxxxx is the SFX ID to play. The ID currently playing is echoed back to $2143 on the SNES, including the highest bit (which otherwise can be toggled for retriggering purposes, but otherwise doesn't actually do anything.
    • $05 and $1D cannot be interrupted by any other instances. $1D, however, can interrupt $05.

The $FF VCMD for this set only is programmed to move the pointer back one byte instead of forward.

SFX Sequence Format

See the SFX Sequence Format subpage.

SimCity

This is the earliest released game to not have a command to load new data at all. Therefore, there is no way to switch sound drivers or even go back to the IPL ROM.
TODO insert protocol here

Super Donkey 1

TODO insert protocol here

Legend of Zelda - A Link To The Past

TODO insert protocol here

Star Glider

TODO insert protocol here

Star Fox/Star Wing

TODO insert protocol here

Super Mario: Yoshi Island/Super Mario World 2: Yoshi's Island

TODO insert protocol here

Star Fox 2

TODO insert protocol here (there may be quite a few revisions)