Initial tests on the power-up/reset state of the CPU/APU and RAM contents were done using an NTSC front-loading NES from 1988 with a RP2A03G CPU on the NES-CPU-07 board revision.
Countless bugs in commercial and homebrew games exist because of a reliance on the initial system state. An NES programmer should not rely on the state of CPU/APU registers and RAM contents not guaranteed at power-up/reset.
Register | At Power | After Reset |
---|---|---|
A, X, Y | 0 | unchanged |
PC | ($FFFC) | ($FFFC) |
S[1] | $00 - 3 = $FD | S -= 3 |
C | 0 | unchanged |
Z | 0 | unchanged |
I | 1 | 1 |
D | 0 | unchanged |
V | 0 | unchanged |
N | 0 | unchanged |
Register | At Power | After Reset |
---|---|---|
Pulses ($4000-$4007) | 0 | unchanged? |
Triangle ($4008-$400B) | 0 | unchanged? |
Triangle phase | ? | 0 (output = 15) |
Noise ($400C-$400F) | 0 | unchanged? |
Noise 15-bit LFSR | $0000 (all 0s, first clock shifts in a 1)[2] | unchanged? |
DMC flags and rate ($4010)[3] | 0 | unchanged |
DMC direct load ($4011)[3] | 0 | [$4011] &= 1 |
DMC sample address ($4012)[3] | 0 | unchanged |
DMC sample length ($4013)[3] | 0 | unchanged |
DMC LFSR | 0? (revision-dependent?) | ? (revision-dependent?) |
Status ($4015) | 0 (all channels disabled) | 0 (all channels disabled) |
Frame Counter ($4017) | 0 (frame IRQ enabled) | unchanged |
Frame Counter LFSR[4] | $7FFF (all 1s) | revision-dependent |
Register | At Power | After Reset |
---|---|---|
DMC LFSR | 0? | ? |
Frame Counter LFSR[4] | $7FFF (all 1s) | unchanged |
Register | At Power | After Reset |
---|---|---|
DMC LFSR | 0? | ? |
Frame Counter LFSR[4] | $7FFF (all 1s) | $7FFF (all 1s) |
Internal RAM ($0000-$07FF) and cartridge RAM (usually $6000–$7FFF, depends on mapper) have an unreliable state on power-up and is unchanged after a reset. Some machines may have consistent RAM contents at power-up, but others may not. Emulators often implement a consistent RAM startup state (e.g. all $00 or $FF, or a particular pattern), and flashcarts may partially or fully initialize RAM before starting a program.
Battery-backed save RAM and other types of SRAM/NVRAM have an unreliable state on the first power-up and is generally unchanged after subsequent resets and power-ups. However, there is an added chance of data corruption due to loss of power or other external factors (bugs, cheats, etc). Emulators and flashcarts may initialize save files with a consistent state (much like other sections of RAM) and persist this data without corruption after closing or reloading a game.
Because of these factors, an NES programmer must be careful not to blindly trust the initial contents of RAM.