Wednesday, May 18, 2016

NESDev - Architecture Overview

As I mentioned in my last post, the majority of this process will simply involve following the "Nerdy Nights" tutorial.  Hopefully, my blog posts won't simply just sound like I'm just repeating everything I read there, but more like I'm reading, understanding, and connecting dots, adding my own research in an attempt to learn more of what I can do with this...

Anyway -


For the most part, the system is built just like your standard every-day computer.   It features a central processor (CPU), a graphics processor (PPU - P.icture P.rocessing, an audio processor (APU), RAM and ROM.  Granted, not all of these components are actually featured inside of the NES console itself.  The console contains the CPU, PPU, and APU, while each individual game cartridge holds the ROM and RAM.  Week 2 of Nerdy Nights features a few images that illustrate this architecture well.

A bit more detail...

  • The CPU of the NES is a "custom 6052" processor.  This processor was featured in many other home entertainment units, like the Apple II, Atari, and the Commodore P.E.T..  It is an 8-bit processor featuring a 16-bit address bus.  I will go further into the features of the board when we get into the assembly programming.
  • The PPU fetches all graphical data from the game cartridge, known as CHR (character memory), primarily containing sprites.  This graphical data will come in the form of tiles, sprites, pallettes, tables, and a background.
    • Tiles are 8x8 squares of pixels.  These tiles are tied together to make the background or a Sprite.
      • Background tiles are snapped to a grid and cannot move freely, while sprites are the opposite. 
      • I recall from Rob Santos's post-mortem that getting tiles to work cohesively as a sprite was a bit of a challenge, I guess we'll see what he means when we actually get to coding!
        A single sprite from The Legend of Zelda.  Link is made up of multiple sprites.
    • The Background is 32x30 tiles in size, and has the ability to scroll.  The graphical RAM can hold up to two screens of background, one of which is updated off screen.

    • A Pattern Table is where the tile data is stored on a cartridge.  There are 2 tables, each of which can hold 256 tiles.  One holds tiles for the background, one for sprites.
    • An Attribute Table is a 64 byte array that stores color palette information for the background.  The attribute table controls this information in 2x2 tile sections.
    • The Color Palette for the NES is rather limited; only 16 colors available.  Two are stored, one for the background, and another for sprites.

  • The NES color palette.

  •  The system also features a "Lockout Chip", a 4-bit processor called the 10NES, both within the console and on the cartridge.  This chip was used to authenticate (i.e. approved by Nintendo) any game being inserted into the console.  If the console ever got stuck in a "reboot loop", these chips were the cause.  If I am to port a game onto actual hardware, i may have to find a way around this...Of course, all of these concepts will be covered in much greater detail as this learning process continues.  Next post will go over the introduction to the assembly programming language that the 6052 processor will use.
    I reserve the right to come back and edit this post in case I made mistakes.  :|

No comments:

Post a Comment