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

From SnesLab
Jump to: navigation, search
(Adding documentation for the Prototype version)
(Minor revision to match the recent name changes made to N-SPC's core VCMD list)
Line 66: Line 66:
|<tt>$E3</tt> || Tempo Fade || <tt>xx yy</tt>  
|<tt>$E3</tt> || Tempo Fade || <tt>xx yy</tt>  
|-
|-
|<tt>$E4</tt> || Global Transposition || <tt>xx</tt>
|<tt>$E4</tt> || Global Absolute Transposition || <tt>xx</tt>
|-
|-
|<tt>$E5</tt> || Tremolo On || <tt>xx yy zz</tt>
|<tt>$E5</tt> || Tremolo On || <tt>xx yy zz</tt>
Line 88: Line 88:
|<tt>$EE</tt> || Fine Tune || <tt>xx</tt>
|<tt>$EE</tt> || Fine Tune || <tt>xx</tt>
|-
|-
|<tt>$EF</tt> || Echo On || <tt>xx yy zz</tt>
|<tt>$EF</tt> || Echo Bits and Volume || <tt>%xxxxxxxx yy zz</tt>
|-
|-
|<tt>$F0</tt> || Echo Off ||  
|<tt>$F0</tt> || Echo Off ||  

Revision as of 19:26, 9 October 2020

Go back to N-SPC Engine

The Prototype variant was used in two games: Super Mario World and Pilotwings. They are the only versions of the code that clearly pre-date the source code version provided with the IS-Sound unit. From a sound effect programming point of view, it can also be considered a predecessor to five other games that post-date the source code: SimCity, Legend of Zelda - A Link to the Past/Zelda no Densetsu - Kamigami no Triforce, Star Fox/Star Wing, Super Mario All-Stars/Super Mario Collection and Super Mario: Yoshi Island/Super Mario World 2: Yoshi's Island.

Game Name Music Version VCMD Table Location ($DA and up) ROM Offset
Super Mario World 0.0 0x0F90, relative to 0x0EDC (all other versions)
0x0FC4, relative to 0x0F10 (Super Mario All Stars + Super Mario World)
0x0E8000 (all other versions)
0x4E8000 (Super Mario All-Stars + Super Mario World)
Pilotwings 0.1 0x1317, relative to 0x1263 (US and Japanese versions)
0x12B4, relative to 0x1200 (European version)
0x0C8000 (all versions)

Instrument Format

Compared to common N-SPC, this is mostly the same, except it is missing the pitch base fractional multiplier, and V0.0 doesn't have noise support. Otherwise, it's the same as before: four direct DSP register references, and the pitch base multiplier as following in byte order:

  • SRCN
    • In V0.1, 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

Percussion Format

Percussion is stored separately from the instrument format in the prototype version, because its format is nearly identical to an instrument, but it contains an extra byte at the end that defines the note to play.

Voice Command Format

The IDs are different due to being an earlier version, and some VCMDs may not be defined yet. The ones that are used are listed below.

VCMD ID Description Arguments
$00 Phrase Termination/End of Subroutine
$01-$7F Note Duration xy
$80-$C5 Note
$C6 Tie
$C7-$CF Rest
$D0-$D9 Percussion
$DA Instrument xx
$DB Panning %xyzzzzz
$DC Panning Fade xx yy
$DD Pitch Slide to Note xx yy zz
$DE Vibrato On xx yy zz
$DF Vibrato Off
$E0 Master Volume xx
$E1 Master Volme Fade xx yy zz
$E2 Tempo xx
$E3 Tempo Fade xx yy
$E4 Global Absolute Transposition xx
$E5 Tremolo On xx yy zz
$E6 Tremolo Off
$E7 Volume xx
$E8 Volume Fade xx yy
$E9 Subroutine xx xx yy
$EA Vibrato Fade In xx
$EB Note Pitch Envelope To xx yy zz
$EC Note Pitch Envelope From xx yy zz
$ED Invalid (supposed to be Note Pitch Envelope Off)
$EE Fine Tune xx
$EF Echo Bits and Volume %xxxxxxxx yy zz
$F0 Echo Off
$F1 Echo Parameter Setup xx yy zz
$F2 Echo Volume Fade xx yy zz
$F3-$FF Invalid

Most of these essentially act identically to the common versions (refer back to the main page for info on those), but two of the VCMDs don't work properly: Note Pitch Envelope Off, which has a zeroed out pointer but the code does exist, and Tremolo On, which has a memory location definition bug for one of the parameters that conflicts with an internal value utilized by the tremolo, causing constant overwriting and making the command not work in general.