Architecture Overview
The Nintendo Entertainment System has the following components: 2A03 CPU based on the MOS Technology 6502 8-bit microprocessor, 2C02 PPU (picture processing unit), serial input for game controllers, audio output comprising four tone generators and a delta modulation playback device, 2 KiB of RAM for use by the CPU and 2 KiB of RAM for use by the PPU.
The NES CPU core is based on the 6502 processor and runs at approximately 1.79 MHz (1.66 MHz in a PAL NES). It is made by Ricoh and lacks the MOS6502's decimal mode. In the NTSC NES, the RP2A03 chip contains the CPU and APU; in the PAL NES, the CPU and APU are contained within the RP2A07 chip.
The NES PPU, or Picture Processing Unit, generates a composite video signal with 240 lines of pixels, designed to be received by a television. When the Famicom chipset was designed in the early 1980s, it was considered quite an advanced 2D picture generator for video games. It has its own address space, which typically contains 10 kilobytes of memory: 8 kilobytes of ROM or RAM on the Game Pak (possibly more with one of the common mappers) to store the shapes of background and sprite tiles, plus 2 kilobytes of RAM in the console to store a map or two. Two separate, smaller address spaces hold a palette, which controls which colors are associated to various indices, and OAM (Object Attribute Memory), which stores the position, orientation, shape, and color of the sprites, or independent moving objects. These are internal to the PPU itself, and while the palette is made of static memory, OAM uses dynamic memory (which will slowly decay if the PPU is not rendering).
The NES APU is the audio processing unit in the NES console which generates sound for games. It is implemented in the RP2A03 (NTSC) and RP2A07 (PAL) chips. Its registers are mapped in the range $4000 to $4013, $4015 and $4017. The APU has five channels: two pulse wave generators, a triangle wave, noise, and a delta modulation channel for playing DPCM samples. Each channel has a variable-rate timer clocking a waveform generator, and various modulators driven by low-frequency clocks from the frame counter. The DMC plays samples while the other channels play waveforms. Each sub-unit of a channel generally runs independently and in parallel to other units, and modification of a channel's parameter usually affects only one sub-unit and doesn't take effect until that unit's next internal cycle begins. The read/write status register allows channels to be enabled and disabled, and their current length counter status to be queried. The outputs from all the channels are combined using a non-linear mixing scheme.
The NES has two general-purpose controller ports on the front of the console, as well as a (rarely used) 48-pin expansion port underneath. The Famicom's standard controllers are hardwired to the front of the unit, and a special 15-pin expansion port is commonly used for third-party controllers. The AV Famicom, however, features detachable controllers using the same ports as the NES. The NES and Famicom have a set of I/O ports used for controllers and other peripherals.
