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: Difference between revisions

From SnesLab
Jump to: navigation, search
mNo edit summary
(Marking this under the Unique cases instead because it is a one-game case (only found in Special Tee Shot, but it has two builds)...)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
Go back to [[N-SPC Engine]]<br>
Go back to [[N-SPC Engine]]<br>
If you're looking for Super Mario World or Pilotwings, see the [[N-SPC Engine/Prototype|Prototype]] variant instead.
'''NOTE: The following page is a stub, and is under construction.'''


__TOC__
__TOC__


Nintendo is the first user of the N-SPC engine, both at launch and with the prototype variant. There are a variety of game-specific or programmer-specific cases in here, and thus have been sorted accordingly.
Nintendo is the first user of the N-SPC engine, both at launch and with the prototype variant. There are a variety of game-specific or programmer-specific cases in here, and thus have been sorted accordingly for disambiguation reasons.


The raw build sorting notes can be found [[N-SPC Engine/Nintendo/Build Sorting|here]] for all variants by Nintendo.
The raw build sorting notes can be found [[N-SPC Engine/Nintendo/Build Sorting|here]] for all variants by Nintendo.


''TODO most other Nintendo games''
==Unique Cases==
* [[N-SPC Engine/Nintendo/F-Zero|F-Zero]]
* [[N-SPC Engine/Nintendo/Sound Module and Burn-In Test|Sound Module and Burn-In Test]]
* [[N-SPC Engine/Nintendo/Mario Paint|Mario Paint]]
* [[N-SPC Engine/Nintendo/Super Metroid|Super Metroid]]
* [[N-SPC Engine/Nintendo/Tetris and Dr. Mario|Tetris and Dr. Mario]]
* [[N-SPC Engine/Nintendo/Nintendo Power Menu Program|Nintendo Power Menu Program]]
* [[N-SPC Engine/Nintendo/Special Tee Shot|Special Tee Shot]]
* [[N-SPC Engine/Nintendo/Super Scope 6 (Blastris)|Super Scope 6 (Blastris)]]


==F-Zero==
==Multi-Game Cases==
This is the first released game to use the standard N-SPC VCMD set starting at $E0. VCMDs $FB-$FF don't exist, though, and the fast forward phrase commands also don't exist here.
* [[N-SPC Engine/Nintendo/Akito Nakatsuka|Akito Nakatsuka]]
* [[N-SPC Engine/Nintendo/Hirokazu Tanaka|Hirokazu Tanaka]]
* [[N-SPC Engine/Nintendo/Koji Kondo|Koji Kondo]]
** [[N-SPC Engine/Nintendo/Koji Kondo/Prototype|Prototype]]
* [[N-SPC Engine/Nintendo/Taro Bando|Taro Bando]]


{| class="wikitable"
The raw build sorting notes can be found [[N-SPC Engine/Nintendo/Build Sorting|here]] for all variants by Nintendo.
|-
! Game Name !! VCMD Table Location ($E0 and up) !! ROM Offset
|-
| F-Zero || <tt>0x0EE9</tt>, relative to <tt>0x0E29</tt> || <tt>0x01E538</tt> (US & Japanese versions)<br><tt>0x01841E</tt> (European version)
|}
 
===Communication with the SNES===
Each CPUIO register has its own individual usage.
 
====CPUIO0 ($2140/$F4)====
{| class="wikitable sortable"
|-
! Command ID !! Description
|-
|<tt>%xyyzzzzz</tt> || Play Music/Looping SFX/Second Engine Control
|-
|<tt>$FF</tt> || Load New Data
|}
 
=====Play Music/Looping SFX/Second Engine Control (Command <tt>$00-$FE</tt>)=====
<u>Input</u> <pre>%xyyyzaaa</pre>
<u>Output</u> <pre>%00000aaa</pre>
* <tt>x</tt>, when set, fades out the music over 84 tempo ticks. It causes music VCMD <tt>$F5</tt> (echo enable bits and volume) to effectively act as a NOP when this happens.
* <tt>yyy</tt> is a looping SFX ID for channel 6, with a range of <tt>%001($1)</tt>-<tt>%100($4)</tt>, and looping back to <tt>$1</tt> after <tt>$4</tt>. Except for <tt>$3</tt>, they also don't restore the instrument ID after playing them.
* <tt>z</tt>, when set, causes the BRR engine noise generator from $2143/$F7 to output on channels 4-7.
* <tt>aaa</tt> is a music ID that is output to the SNES via $2140. <tt>%110($6)</tt> is a special case, as it utilizes an ID that is defined via loading a single byte to a specific memory location, rather than its own (the ID itself is illegal if forced due to a zero pointer). Music data does not actually need to be loaded in this particular case, as it is all stored in one go.
 
=====Load New Data (Command <tt>$FF</tt>)=====
Loads new data when set to <tt>$FF</tt>. See [[N-SPC_Engine#Load_New_Data_.28Command_.24FF.29|the source build's Load New Data command]] for the loading protocol, as it is identical binary-wise to the copy used in this one minus the *Ver S1.20* string.
 
====CPUIO1 ($2141/$F5)====
<u>Input</u> <pre>%xyzzzzzz</pre>
<u>Output</u> <pre>%00zzzzzz</pre>
* <tt>x</tt> increases the overall BRR engine noise generator frequency on channel 8. The BRR engine noise generator frequency is designed to hiccup like a gearshift when activating.
* <tt>y</tt> plays a continuous beeping tone on channel 6... unless the music that's currently playing is <tt>$11</tt>, which means a different SFX plays on channels 6 and 8.
* <tt>zzzzzz</tt> controls the BRR engine noise generator frequency on channel 8. Disable with zero. This value is what is output to the SNES via $2141.
 
====CPUIO2 ($2142/$F6)====
<pre>%xyzzaaaa</pre>
The value output to the SNES via $2142 is which bits are being utilized to play the SFX. Higher bits have more priority, but CPUIO0's channel 6 SFX has higher priority, which in turn is out-prioritized by CPUIO1's channel 6 SFX.
* <tt>x</tt> stops the music and goes '''BOOM!''' Channels 3-8 are used, with 5-8 being continuously used afterwards.
* <tt>y</tt> plays a UFO-like SFX on channel 6.
* <tt>zz</tt> controls the BRR engine noise with vibrato on channel 6.
* <tt>aaaa</tt> controls incidental SFX on channel 6. <tt>$4</tt> doesn't play anthing, and the values wrap around to <tt>$1</tt> after <tt>$8</tt>, except for $C, which plays <tt>$8</tt>.
 
====CPUIO3 ($2143/$F7)====
<u>Input</u> <pre>%xxxxyyyy</pre>
<u>Output</u> <pre>%0000xxxx</pre>
*<tt>xxxx</tt> controls the panning of the second vehicle on channel 7, with zero representing left and $E representing right. Sets up a whole bunch of vehicle noises on channels 4-7 if set to $F instead that are not pitch-controllable. These bits are output to the SNES via $2143 as the lowest four bits.
*<tt>yyyy</tt> controls the BRR engine noise generator frequency (and volume) of the second vehicle on channel 7, or several at once on channels 1-5 and 7 if bit <tt>z</tt> on $2140/$F4 is set.
 
====SFX Sequence Format====
Most of the SFX is hard-coded and the instrument format, when utilized outside of the actual instrument table, is identical to a music instrument's. The only SFX that actually uses a SFX sequence format beyond an array of notes is CPUIO0's bit <tt>yyy</tt> ID <tt>%010 ($2)</tt> (there's actually a second one defined, but it appears to never have been used). These are headerless, unlike a song, and they only support one channel at a time, with the channel used being fixed.
 
{| class="wikitable sortable"
|-
! VCMD ID !! Description !! Arguments
|-
|<tt>$00</tt> || End of SFX ||
|-
|<tt>$01-$7F</tt> || Note Duration || <tt>(xx)</tt>
|-
|<tt>$80-$C7</tt> || Note ||
|-
|<tt>$C8</tt> || Tie ||
|-
|<tt>$C9</tt> || Rest ||
|-
|<tt>$CA-$DF</tt> || Percussion ||
|-
|<tt>$E0</tt> || Instrument || <tt>xx</tt>
|-
|<tt>$E1-$FE</tt> || Invalid Note ||
|-
|<tt>$FF</tt> || Restart SFX ||
|}
 
=====End of SFX (VCMD <tt>$00</tt>)=====
Terminates the SFX.
 
=====Note Duration (VCMD <tt>$01-$7F</tt>)=====
<pre>%0xxxxxxx (yy)</pre>
 
* <tt>xxxxxxx</tt> represents your note length (as seven bits) in tempo ticks.
* <tt>yy</tt>, if less than <tt>$80</tt>, represents the volume of the note.
 
=====Note (VCMD <tt>$80-$C7</tt>)=====
Plays a note and delays the channel for one note length before reading another VCMD.
 
=====Tie (VCMD <tt>$C8</tt>)=====
Continues playing the previous note and delays the channel for one note length before reading another VCMD.
 
=====Rest (VCMD <tt>$C9</tt>)=====
Keys off the previous note and delays the channel for one note length before reading another VCMD.
 
=====Percussion (VCMD <tt>$CA-$DF</tt>)=====
Plays a percussion note.
 
By default, percussion uses the same instrument set as the song, and all percussion is keyed on with a note of <tt>$A4</tt>. Note that there is no way to define the base instrument ID used for percussion for the SFX, so it is bound to the music's base instrument ID for percussion instead.
 
=====Instrument (VCMD <tt>$E0</tt>)=====
<pre>$E0 xx</pre>
 
* <tt>xx</tt> is an instrument ID to an array of instruments. The array used is the same one used for the music.
 
=====Invalid Note (VCMD <tt>$E1-$FE</tt>)=====
Doesn't crash the sound driver, but does play an invalid note.
 
=====Restart SFX (VCMD <tt>$FF</tt>)=====
Restarts the SFX from the beginning.
 
==Aging Cassette/Sound Module and Burn-In Test==
{| class="wikitable"
|-
! Game Name !! VCMD Table Location ($E0 and up) !! ROM Offset
|-
| Aging Cassette/Sound Module and Burn-In Test || <tt>0x0EE9</tt>, relative to <tt>0x0E29</tt> || <tt>0x0380BA</tt> (Aging Cassette)<br><tt>0x038792</tt> (SNES Burn-In Test Cartridge)
|}
 
===Voice Command Format===
{| class="wikitable sortable"
|-
! VCMD ID !! Description !! Arguments
|-
|<tt>$00</tt> || Phrase Termination/End of Subroutine ||
|-
|<tt>$01-$7F</tt> || Note Duration || <tt>(xy)</tt>
|-
|<tt>$80-$C7</tt> || Note ||
|-
|<tt>$C8</tt> || Tie ||
|-
|<tt>$C9</tt> || Rest ||
|-
|<tt>$CA-$DD</tt> || Percussion ||
|-
|<tt>$DE</tt> || Instrument || <tt>xx</tt>
|-
|<tt>$DF</tt> || Panning  || <tt>%xyzzzzz</tt> 
|-
|<tt>$E0</tt> || Panning Fade || <tt>xx yy</tt>
|-
|<tt>$E1</tt> || Vibrato On || <tt>xx yy zz</tt>
|-
|<tt>$E2</tt> || Vibrato Off ||
|-
|<tt>$E3</tt> || Song Volume || <tt>xx</tt>
|-
|<tt>$E4</tt> || Song Volume Fade || <tt>xx yy zz</tt>
|-
|<tt>$E5</tt> || Tempo || <tt>xx</tt>
|-
|<tt>$E6</tt> || Tempo Fade || <tt>xx yy</tt>
|-
|<tt>$E7</tt> || Global Absolute Transposition || <tt>xx</tt>
|-
|<tt>$E8</tt> || Single Channel Absolute Transposition || <tt>xx</tt>
|-
|<tt>$E9</tt> || Tremolo On || <tt>xx yy zz</tt>
|-
|<tt>$EA</tt> || Tremolo Off ||
|-
|<tt>$EB</tt> || Volume || <tt>xx</tt>
|-
|<tt>$EC</tt> || Volume Fade || <tt>xx yy</tt>
|-
|<tt>$ED</tt> || Subroutine || <tt>xx xx yy</tt>
|-
|<tt>$EE</tt> || Vibrato Fade In || <tt>xx</tt>
|-
|<tt>$EF</tt> || Note Pitch Envelope To || <tt>xx yy zz</tt>
|-
|<tt>$F0</tt> || Note Pitch Envelope From || <tt>xx yy zz</tt>
|-
|<tt>$F1</tt> || Note Pitch Envelope Off ||
|-
|<tt>$F2</tt> || Fine Tune || <tt>xx</tt>
|-
|<tt>$F3</tt> || Echo On Bits and Volume || <tt>%xxxxxxxx yy zz</tt>
|-
|<tt>$F4</tt> || Echo Off ||
|-
|<tt>$F5</tt> || Echo Parameter Setup || <tt>xx yy zz</tt>
|-
|<tt>$F6</tt> || Echo Volume Fade || <tt>xx yy zz</tt>
|-
|<tt>$F7</tt> || Pitch Slide to Note || <tt>xx yy zz</tt>
|-
|<tt>$F8</tt> || Percussion Patch Base Redefine || <tt>xx</tt>
|-
|<tt>$F9</tt> || NOP || <tt>??</tt>
|-
|<tt>$FA</tt> || Channel Mute ||
|-
|<tt>$FB</tt> || Fast Forward On ||
|-
|<tt>$FC</tt> || Fast Forward Off ||
|-
|<tt>$FD</tt> || Master Volume Fade || xx yy
|-
|<tt>$FE</tt> || Mute Right Master Volume || xx
|-
|<tt>$FF</tt> || Noise Clock || %???xxxxx
|}
''TODO new music VCMDs (the standard set is offset backwards by two IDs, and three new VCMDs are added on)''
 
===Communication with the SNES===
All of the commands used are identical to the source N-SPC/Kankichi set with a set of new commands
 
{| class="wikitable sortable"
|-
! Command ID !! Description !! Register Values & Arguments
|-
|<tt>$00</tt> || Stop Music || <tt>$00 ?? ?? ??</tt>
|-
|<tt>$01-??</tt> || Play Music || <tt>xx ?? ?? ??</tt>
|-
|<tt>$80</tt> || Run All Tests || <tt>$80 ?? ?? ??</tt>
|-
|<tt>$90</tt> || Memory Write Test || <tt>$90 ?? ?? ??</tt>
|-
|<tt>$91</tt> || ''TODO identify test'' || <tt>$91 ?? ?? ??</tt>
|-
|<tt>$92</tt> || ''TODO identify test'' || <tt>$92 ?? ?? ??</tt>
|-
|<tt>$93</tt> || ''TODO identify test'' || <tt>$93 ?? ?? ??</tt>
|-
|<tt>$F0</tt> || Pause Music || <tt>$F0 ?? ?? ??</tt>
|-
|<tt>$F1</tt> || Continue Music || <tt>$F1 ?? ?? ??</tt>
|-
|<tt>$FF</tt> || Load New Data || <tt>$FF ?? xx xx</tt>
|}
''TODO new commands''
 
==Zootto Mahjong!==
{| class="wikitable"
|-
! Game Name !! VCMD Table Location ($E0 and up) !! ROM Offset
|-
| Zootto Mahjong! || <tt>0x0B5B</tt> || <tt>0xCAE03A</tt>
|}
 
Voice command format is mostly identical to standard N-SPC except VCMDs $FB-$FE are not here, and neither are the fast forward phrase commands.
 
===Communication with the SNES===
''TODO not analyzed yet (utilizes a command ID system with $2140/$F4 as the command ID, with other CPUIO registers as parameters)''
 
<br><br><br>
''TODO all other Nintendo variant games (that aren't known to be associated with other Nintendo variant games and likely have sound driver command differences between each other)''


[[Category:SPC Sound Engines]]
[[Category:SPC Sound Engines]]
[[Category:N-SPC Variants]]
[[Category:N-SPC Variants]]

Latest revision as of 18:02, 23 November 2022

Go back to N-SPC Engine

Nintendo is the first user of the N-SPC engine, both at launch and with the prototype variant. There are a variety of game-specific or programmer-specific cases in here, and thus have been sorted accordingly for disambiguation reasons.

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

Unique Cases

Multi-Game Cases

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