APU DMC/Register table
7 bit 0
---- ----
IL.. RRRR
|| ||||
|| ++++- Playback rate index
|+-------- Sample loop flag
+--------- Enable DMC sample-end interrupt (hereinafter "DMC IRQ")
The rate (R bits) determines for how many CPU cycles happen between changes in the output level during automatic sample playback.
Setting the loop flag (L bit) inhibits DMC IRQ pending flag from being set.
| NTSC | PAL | |||||||||||
| $4010.0-3 | Period | Frequency | Note (raw) | Note (1-byte loop) | Note (17-byte loop) | Note (33-byte loop) | Period | Frequency | Note (raw) | Note (1-byte loop) | Note (17-byte loop) | Note (33-byte loop) |
| $0 | 428 | 4181.71 Hz | C-8 -2c | C-5 -2c | B-0 -7c | infrasound | 398 | 4177.40 Hz | C-8 -4c | C-5 -4c | B-0 -9c | infrasound |
| $1 | 380 | 4709.93 Hz | D-8 +4c | D-5 +4c | C#1 -1c | infrasound | 354 | 4696.63 Hz | D-8 -1c | D-5 -1c | C#1 -6c | infrasound |
| $2 | 340 | 5264.04 Hz | E-8 -3c | E-5 -3c | Eb1 -8c | infrasound | 316 | 5261.41 Hz | E-8 -4c | E-5 -4c | Eb1 -9c | infrasound |
| $3 | 320 | 5593.04 Hz | F-8 +2c | F-5 +2c | E-1 -3c | E-0 +48c | 298 | 5579.22 Hz | F-8 -3c | F-5 -3c | E-1 -8c | E-0 +44c |
| $4 | 286 | 6257.95 Hz | G-8 -4c | G-5 -4c | F#1 -9c | F#0 +43c | 276 | 6023.94 Hz | G-8 -70c | G-5 -70c | F#1 -75c | F#0 -23c |
| $5 | 254 | 7046.35 Hz | A-8 +2c | A-5 +2c | Ab1 -3c | Ab0 +48c | 236 | 7044.94 Hz | A-8 +1c | A-5 +1c | Ab1 -4c | Ab0 +48c |
| $6 | 226 | 7919.35 Hz | B-8 +4c | B-5 +4c | Bb1 -1c | Bb0 +50c | 210 | 7917.18 Hz | B-8 +3c | B-5 +3c | Bb1 -2c | Bb0 +50c |
| $7 | 214 | 8363.42 Hz | C-9 -2c | C-6 -2c | B-1 -7c | B-0 +45c | 198 | 8397.01 Hz | C-9 +5c | C-6 +5c | B-1 +0c | B-0 +52c |
| $8 | 190 | 9419.86 Hz | D-9 +4c | D-6 +4c | C#2 -1c | C#1 +51c | 176 | 9446.63 Hz | D-9 +9c | D-9 +9c | C#2 +4c | C#1 +56c |
| $9 | 160 | 11186.1 Hz | F-9 +2c | F-6 +2c | E-2 -3c | E-1 +48c | 148 | 11233.8 Hz | F-9 +9c | F-6 +9c | E-2 +4c | E-1 +56c |
| $A | 142 | 12604.0 Hz | G-9 +8c | G-6 +8c | F#2 +3c | F#1 +55c | 132 | 12595.5 Hz | G-9 +7c | G-6 +7c | F#2 -2c | G-1 +54c |
| $B | 128 | 13982.6 Hz | A-9 -12c | A-6 -12c | Ab2 -17c | Ab1 +35c | 118 | 14089.9 Hz | A-9 +1c | A-6 +1c | Ab2 -4c | Ab1 +48c |
| $C | 106 | 16884.6 Hz | C-10 +14c | C-7 +14c | B-2 +10c | B-1 +61c | 98 | 16965.4 Hz | C-10 +23c | C-7 +23c | B-2 +18c | B-1 +69c |
| $D | 84 | 21306.8 Hz | E-10 +17c | E-7 +17c | Eb3 +12c | Eb2 +64c | 78 | 21315.5 Hz | E-10 +18c | E-7 +18c | Eb3 +13c | Eb2 +65c |
| $E | 72 | 24858.0 Hz | G-10 -16c | G-7 -16c | F#3 -21c | F#2 +31c | 66 | 25191.0 Hz | G-10 +7c | G-7 +7c | F#3 +2c | F#2 +54c |
| $F | 54 | 33143.9 Hz | C-11 -18c | C-8 -18c | B-3 -23c | B-2 +29c | 50 | 33252.1 Hz | C-11 -12c | C-8 -12c | B-3 -17c | B-2 +34c |
(Deviation from note is given in cents, which are defined as 1/100th of a semitone.)
On RP2A07, rate $4 and $C appear to be incorrect with respect to their intended A-440 tuning scheme. [1]
All “dendy timing” clone CPUs are known to use NTSC period table.
7 bit 0
---- ----
.DDD DDDD
||| ||||
+++-++++- Unsigned 7-bit counter value
Writing to this register directly sets the counter value (final output level). If the automatic DMC playback unit clocks the counter at the same time, the output level is occasionally not changed properly. [2]
The change still occurs even when the automatic DMC playback unit is deactivated.
7 bit 0
---- ----
AAAA AAAA
|||| ||||
++++-++++- Sample address = $C000 + (A * 64)
This register sets reload value. Retrigerring the sample playback reloads the value back from this register.
7 bit 0
---- ----
LLLL LLLL
|||| ||||
++++-++++- Sample length = (L * 16) + 1 bytes
This register sets reload value. Retrigerring the sample playback reloads the value back from this register.
7 bit 0 (read)
---- ----
IF.D NT21
| |
| +------ Sample is on playback flag
+--------- DMC IRQ asserted
The D bit returns 1 when the bytes-remaining counter is not zero.
7 bit 0 (write)
---- ----
...D NT21
|
+------ Start / Stop DMC sample playback
When writing to this register with the D bit clear, the bytes-remaining counter is set to 0, consequently finishes the playback before the next sample byte is fetched. When the write is done with the bit set and if the bytes-remaining counter is 0, the sample playback is restarted, by reloading the address counter and bytes-remaining counter based on $4012 and $4013.
Writing to this register also clears DMC IRQ pending flag.
For descriptions for other bits, see APU#Register overview#APU master control and status ($4015, read/write).