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/Source Variant ARAM Map: Difference between revisions
From SnesLab
KungFuFurby (talk | contribs) (Adding some fine print on the CPUIO I/O register mirrors ($00-$0B).) |
KungFuFurby (talk | contribs) (Some whole/fraction portions were organized backwards.) |
||
Line 103: | Line 103: | ||
|<tt>$57</tt> || Music tempo fade rate per music tempo tick, whole portion. | |<tt>$57</tt> || Music tempo fade rate per music tempo tick, whole portion. | ||
|- | |- | ||
|<tt>$58</tt> || Song volume, | |<tt>$58</tt> || Song volume, fraction portion. | ||
|- | |- | ||
|<tt>$59</tt> || Song volume, | |<tt>$59</tt> || Song volume, whole portion. | ||
|- | |- | ||
|<tt>$5A</tt> || Song volume fade tick counter. Ends up reused as fractional part of target song volume once zero. | |<tt>$5A</tt> || Song volume fade tick counter. Ends up reused as fractional part of target song volume once zero. | ||
Line 187: | Line 187: | ||
|<tt>$211,$213,$215,$217,$219,$21B,$21D,$21F</tt> || Current instrument ID. | |<tt>$211,$213,$215,$217,$219,$21B,$21D,$21F</tt> || Current instrument ID. | ||
|- | |- | ||
|<tt>$220,$222,$224,$226,$228,$22A,$22C,$22E</tt> || Pitch base multiplier, | |<tt>$220,$222,$224,$226,$228,$22A,$22C,$22E</tt> || Pitch base multiplier, fraction portion. | ||
|- | |- | ||
|<tt>$221,$223,$225,$227,$229,$22B,$22D,$22F</tt> || Pitch base multiplier, | |<tt>$221,$223,$225,$227,$229,$22B,$22D,$22F</tt> || Pitch base multiplier, whole portion. | ||
|- | |- | ||
|<tt>$230-$23F</tt> || Pointer to return to once exiting the subroutine and all loops have been executed. One word per track. | |<tt>$230-$23F</tt> || Pointer to return to once exiting the subroutine and all loops have been executed. One word per track. |
Latest revision as of 20:15, 3 January 2022
NOTE: This ARAM map only goes up to $800, which is the start of the SPC700 program. This is intended to show the purpose of the RAM-like memory locations that are used, which are stored prior to the start of this program.
NOTE 2: This is not a representative ARAM map for all N-SPC variants. However, a lot of these memory locations may be recycled, depending on the variant.
ARAM Address | Description |
---|---|
$00-$03 | CPUIO register input. Technically only $00 is used in the code, but the structure is set up for all four CPUIO registers to be read from. |
$04-$07 | CPUIO register output. Technically only $04 is used in the code, but the structure is set up for all four CPUIO registers to be read from. |
$08-$0B | Last value read by the CPUIO register. Technically only $08 is used in the code, but the structure is set up for all four CPUIO registers to be read from. |
$0C | Tick counter for the song to initialize itself. |
$0D | Unused. However, its internal variable name in the source code is sf3c. sf0c is $0C's internal variable name in the source code. Thus, it's probably an initialization tick counter for something else. |
$0E-$0F | Always zero. Read for an operation where YA needs to have its bits inverted. |
$10-$13 | Scratch RAM with varying purposes. |
$14-$17 | Scratch RAM mostly used for storing word addresses, though sometimes this isn't the case. |
$18-$19 | Contains an RNG value. Generated every timer 0 tick. |
$1A | SFX voice on flag (AKA which music channels should not play notes) |
$1B | Fast Forward flag. |
$1C-$1F | Unused. |
$20 | Unused. However, its internal variable name in the source code is skc, and it appears to have been intended for a chs/soko-on routine, where the code is commented out in the source. TODO guess purpose |
$21 | Unused. However, its internal variable name in the source code is skdw, and it appears to have been intended for a chs/soko-on routine, where the code to call it is commented out in the source. TODO guess purpose |
$22 | Unused. However, its internal variable name in the source code is skd, and it appears to have been intended for a chs/soko-on routine, where the code to call it is commented out in the source. TODO guess purpose |
$23 | Unused. However, its internal variable name in the source code is skdadw, and it appears to have been intended for a chs/soko-on routine, where the code to call it is commented out in the source. TODO guess purpose |
$24 | Unused. However, its internal variable name in the source code is skdad, and it appears to have been intended for a chs/soko-on routine, where the code to call it is commented out in the source. TODO guess purpose |
$25 | Unused. However, its internal variable name in the source code is skca, and it appears to have been intended for a chs/soko-on routine, where the code to call it is commented out in the source. TODO guess purpose |
$26 | Unused. However, its internal variable name in the source code is skcb, and it appears to have been intended for a chs/soko-on routine, where the code to call it is commented out in the source. TODO guess purpose |
$27 | Unused. However, its internal variable name in the source code is skcs, and it appears to have been intended for a chs/soko-on routine, where the code to call it is commented out in the source. TODO guess purpose |
$28-$2B | Unused. However, its internal variable name in the source code is bkc, and it appears to have been intended for a chc/bakuhatu-on routine, where the code to call it is commented out in the source. TODO guess purpose |
$2C-$2D | Unused. However, its internal variable name in the source code is adk, and it appears to have been intended for a chd/sound effect routine, where the code to call it is commented out in the source. The variable itself is internally marked as kokaon add.. TODO guess purpose |
$2E | Unused. However, its internal variable name in the source code is sac, and it appears to have been intended for a chd/sound effect routine, where the code to call it is commented out in the source. TODO guess purpose |
$2F | Unused. However, its internal variable name in the source code is sacs, and it appears to have been intended for a chd/sound effect routine, where the code to call it is commented out in the source. TODO guess purpose |
$30-$3F | Track pointer for the music, one word per track. |
$40-$41 | Phrase pointer. |
$42 | Phrase jump counter. |
$43 | Fractional counter for the CPUIO/SFX tempo ticker (running at a tempo of $20). |
$44 | Current channel being processed times 2. |
$45 | Key on flag for all channels. Cleared every timer tick. |
$46 | Key off flag for all channels. Cleared every timer tick. |
$47 | Voice bit being processed for music. |
$48 | FLG mirror. |
$49 | NON mirror. |
$4A | EON mirror. |
$4B | PMON mirror. Never set by the sound driver to anything other than zero, but clearly it sets up possible support by the programmer of the variant. |
$4C | Counter to wait for the echo buffer to initialize itself for. |
$4D | EDL mirror. |
$4E | EFB mirror. |
$4F | Unused. |
$50 | Global transposition. |
$51 | Fractional counter for the music tempo ticker. |
$52 | Fractional part of music tempo. |
$53 | Music tempo. |
$54 | Music tempo fade tick counter. Ends up reused as fractional part of target tempo once zero. |
$55 | Target music tempo. |
$56 | Music tempo fade rate per music tempo tick, fraction portion. |
$57 | Music tempo fade rate per music tempo tick, whole portion. |
$58 | Song volume, fraction portion. |
$59 | Song volume, whole portion. |
$5A | Song volume fade tick counter. Ends up reused as fractional part of target song volume once zero. |
$5B | Target song volume. |
$5C | Song volume fade rate per music tempo tick, fraction portion. |
$5D | Song volume fade rate per music tempo tick, whole portion. |
$5E | Voice volume change flag. |
$5F | Percussion base instrument ID. Defines the lowest instrument ID to use for the percussion kit. |
$60 | Fractional part of left echo volume. |
$61 | Left echo volume. |
$62 | Fractional part of right echo volume. |
$63 | Right echo volume. |
$64 | Left echo volume fade rate per music tempo tick, fraction portion. |
$65 | Left echo volume fade rate per music tempo tick, whole portion. |
$66 | Right echo volume fade rate per music tempo tick, fraction portion. |
$67 | Right echo volume fade rate per music tempo tick, whole portion. |
$68 | Echo volume fade tick counter. |
$69 | Target left echo volume. |
$6A | Target right echo volume. |
$6B-$6F | Unused. |
$70,$72,$74,$76,$78,$7A,$7C,$7E | Music note duration, one byte per track. |
$71,$73,$75,$77,$79,$7B,$7D,$7F | Music note duration after quantization. |
$80,$82,$84,$86,$88,$8A,$8C,$8E | Subroutine loop counter. |
$81,$83,$85,$87,$89,$8B,$8D,$8F | Unused. |
$90,$92,$94,$96,$98,$9A,$9C,$9E | Track volume fade tick counter, one byte per track. |
$91,$93,$95,$97,$99,$9B,$9D,$9F | Track panning fade tick counter, one byte per track. |
$A0,$A2,$A4,$A6,$A8,$AA,$AC,$AE | Pitch slide tick counter. |
$A1,$A3,$A5,$A7,$A9,$AB,$AD,$AF | Pitch slide delay in music tempo ticks. |
$B0,$B2,$B4,$B6,$B8,$BA,$BC,$BE | Vibrato tick counter. |
$B1,$B3,$B5,$B7,$B9,$BB,$BD,$BF | Maximum pitch offset for vibrato. |
$C0,$C2,$C4,$C6,$C8,$CA,$CC,$CE | Tremolo tick counter. |
$C1,$C3,$C5,$C7,$C9,$CB,$CD,$CF | Maximum volume offset for tremolo. |
$D0-$EF | Unused. |
$100,$102,$104,$106,$108,$10A,$10C,$10E | Vibrato fade tick counter. |
$101,$103,$105,$107,$109,$10B,$10D,$10F | Unused. |
$110-$1CF | Reserved for stack. |
$1D0-$1DF | Unused mirrors for the SPC700 registers (referring to $F0-$FF). The TEST register is not defined in the original source, while the others are. |
$1E0-$1FF | Unused. |
$200,$202,$204,$206,$208,$20A,$20C,$20E | Saved note duration for music. |
$201,$203,$205,$207,$209,$20B,$20D,$20F | Quantization, which is in 256ths of a note. |
$210,$212,$214,$216,$218,$21A,$21C,$21E | Note velocity. |
$211,$213,$215,$217,$219,$21B,$21D,$21F | Current instrument ID. |
$220,$222,$224,$226,$228,$22A,$22C,$22E | Pitch base multiplier, fraction portion. |
$221,$223,$225,$227,$229,$22B,$22D,$22F | Pitch base multiplier, whole portion. |
$230-$23F | Pointer to return to once exiting the subroutine and all loops have been executed. One word per track. |
$240-$24F | Start of subroutine pointer, used when looping. One word per track. |
$250-$27F | Unused. |
$280,$282,$284,$286,$288,$28A,$28C,$28E | Pitch envelope slide length in music tempo ticks. |
$281,$283,$285,$287,$289,$28B,$28D,$28F | Number of music tempo ticks to delay the pitch envelope for. |
$290,$292,$294,$296,$298,$29A,$29C,$29E | Pitch envelope sign. |
$291,$293,$295,$297,$299,$29B,$29D,$29F | Pitch envelope offset in semitones. |
$2A0,$2A2,$2A4,$2A6,$2A8,$2AA,$2AC,$2AE | Current vibrato pitch offset. |
$2A1,$2A3,$2A5,$2A7,$2A9,$2AB,$2AD,$2AF | Vibrato pitch offset per music tempo tick. |
$2B0,$2B2,$2B4,$2B6,$2B8,$2BA,$2BC,$2BE | Vibrato delay in music tempo ticks. |
$2B1,$2B3,$2B5,$2B7,$2B9,$2BB,$2BD,$2BF | Vibrato fade length in music tempo ticks. |
$2C0,$2C2,$2C4,$2C6,$2C8,$2CA,$2CC,$2CE | Vibrato fade rate per music tempo tick. There is no fractional portion involved. |
$2C1,$2C3,$2C5,$2C7,$2C9,$2CB,$2CD,$2CF | Target vibrato maximum pitch offset for fade in. |
$2D0,$2D2,$2D4,$2D6,$2D8,$2DA,$2DC,$2DE | Current tremolo volume offset. |
$2D1,$2D3,$2D5,$2D7,$2D9,$2DB,$2DD,$2DF | Tremolo volume offset per music tempo tick. |
$2E0,$2E2,$2E4,$2E6,$2E8,$2EA,$2EC,$2EE | Tremolo delay in music tempo ticks. |
$2E1,$2E3,$2E5,$2E7,$2E9,$2EB,$2ED,$2EF | Unused. |
$2F0,$2F2,$2F4,$2F6,$2F8,$2FA,$2FC,$2FE | Transposition on a per-channel basis. |
$2F1,$2F3,$2F5,$2F7,$2F9,$2FB,$2FD,$2FF | Unused. |
$300,$302,$304,$306,$308,$30A,$30C,$30E | Fractional part of track volume for music. |
$301,$303,$305,$307,$309,$30B,$30D,$30F | Track volume for music. |
$310,$312,$314,$316,$318,$31A,$31C,$31E | Track volume fade rate per music tempo tick, fraction portion. |
$311,$313,$315,$317,$319,$31B,$31D,$31F | Track volume fade rate per music tempo tick, whole portion. |
$320,$322,$324,$326,$328,$32A,$32C,$32E | Target track volume. |
$321,$323,$325,$327,$329,$32B,$32D,$32F | Final voice volume for music prior to adjustments just before writing to DSP. |
$330,$332,$334,$336,$338,$33A,$33C,$33E | Fractional part of panning for music. |
$331,$333,$335,$337,$339,$33B,$33D,$33F | Panning for music. |
$340,$342,$344,$346,$348,$34A,$34C,$34E | Panning fade rate per music tempo tick, fraction portion. |
$341,$343,$345,$347,$349,$34B,$34D,$34F | Panning fade rate per music tempo tick, whole portion. |
$350,$352,$354,$356,$358,$35A,$35C,$35E | Target panning. |
$351,$353,$355,$357,$359,$35B,$35D,$35F | Panning with phase inversion settings. |
$360,$362,$364,$366,$368,$36A,$36C,$36E | Current note, fractional portion. |
$361,$363,$365,$367,$369,$36B,$36D,$36F | Current note, whole portion. |
$370,$372,$374,$376,$378,$37A,$37C,$37E | Pitch slide rate per music tempo tick, fraction of a note. |
$371,$373,$375,$377,$379,$37B,$37D,$37F | Pitch slide rate per music tempo tick, whole note. |
$380,$382,$384,$386,$388,$38A,$38C,$38E | Target note. |
$381,$383,$385,$387,$389,$38B,$38D,$38F | Fine tune. |
$390-$3FF | Unused. |
$400,$402,$404,$406,$408,$40A,$40C,$40E | Channel mute flag. |
$401,$403,$405,$407,$409,$40B,$40D,$40F | Unused. |
$410-$7FF | Unused. |