The chip flags
Byte +7B of the header (and byte 7 of the NSFe INFO chunk) has one bit for each
extra sound chip a tune uses. A player enables the registers of the chips that are set and
ignores writes to the others. The registers of the APU, the five sound channels inside the
console’s processor, are always there. All registers listed are write only unless said otherwise,
and a tune uses the lowest address of each register, because the mapper chips mirror them.
| Bit | Chip | Registers | Channels |
|---|---|---|---|
| – | APU | $4000–$4013, $4015 | Two pulse, triangle, noise, DPCM |
| 0 | Konami VRC6 | $9000–$9003, $A000–$A002, $B000–$B002 | Two pulse, sawtooth |
| 1 | Konami VRC7 | $9010, $9030 | Six FM voices |
| 2 | Famicom Disk System | $4040–$4092 | One wavetable with a modulator |
| 3 | Nintendo MMC5 | $5000–$5015, the multiplier at $5205–$5206, the extra RAM $5C00–$5FF5 | Two pulse, PCM |
| 4 | Namco 163 | $4800, $F800 | Up to eight wavetable channels |
| 5 | Sunsoft 5B | $C000, $E000 | Three square channels, noise, envelope |
| 6 | VT02+ | A second APU at $4020–$402F, $4030 (DMA address bits, output switches, raw PCM), $4031 (8-bit PCM) and $4035 (channel enable and length status of the second APU) | Two more pulse, triangle and noise channels, and raw PCM |
| 7 | Reserved, must be 0. | ||
The registers a tune may read are $4015, and the chip’s own where listed:
$4040–$407F, $4090 and $4092 for the FDS,
$4800 for the Namco 163 and $5205–$5206 and
$5C00–$5FF5 for the MMC5.
Notes on single chips
- APU. Most players set
$4015to$0Fbefore INIT, and a few tunes (Battletoads, Castlevania, Gremlins 2) need that. The interrupts of the APU (the frame counter and the DMC) are not reliably available in NSF players and were not used in rips; NSF2 allows them explicitly. - VRC6. On a few games the two address lines are swapped, so the register
pairs
xxx1andxxx2change places (Esper Dream 2 and Madara need this; Akumajou Densetsu does not). - FDS. Switches on the writable RAM and the extra bank registers.
- MMC5. The multiplier takes two bytes at
$5205and$5206and gives the product when they are read back. - Sunsoft 5B. Used in one game, Gimmick!, and many players leave out its noise and envelope.
Several chips in one tune
Cartridges never had more than one expansion chip, so how a multi-chip tune plays differs between
players. The addresses clash in some places: the Namco 163’s $F800 overlaps a mirror
of the Sunsoft 5B’s $E000 (the 5B’s index register $C000 can be set to
$0E or $0F first), the VRC6’s first pulse register is mirrored at the
VRC7’s $9010 and $9030, the VRC7 and the Namco 163 each have a mute at
$E000, and the FDS makes $8000 to $DFFF writable.
In the explorer
The Tune tab names every chip of the flags. The Code tab labels the registers of every chip that is
set. The sound of the APU and of every expansion chip that is set is mixed, each at the level of the NSFe
mixe chunk (or its default); the FDS registers $4040–$407F,
$4090 and $4092 read back. On the VT02+ the data sheets give the triangle’s linear counter its own clock,
250 Hz (200 Hz when bit 7 of $4017 is set), and the DMA reads the whole CPU address range.
The register $4030 is, from bit 7 to bit 0: OP2L OP1L PCML DP DA2 DA1 ~A15 ~A14.
~A14 and ~A15 are the complements of DMA address bits 14 and 15; DA1 set
switches the first APU’s output off and DA2 set switches the second APU’s on (off at reset); DP
set makes the DMA play raw PCM instead of delta samples (into the second APU only); PCML clear limits the PCM
data length to 4,081 bytes (length $FF fetches $000–$FF0 of its 4 KiB), set to 4,096
(the player counts the length as $4013 × 16 + 16 instead of + 1; the data sheet states only the $FF case);
OP1L and OP2L are “loudness enable/disable” of the first and second APU’s output, 0 (enabled) being the default.
The player keeps the two loudness flags but does not change the sound for them (the data sheets give no effect).
See not described for what is left out.