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.  :|

Friday, May 6, 2016

It's been a year...


I opened up my blog for the first time in God knows how long, and finally mustered up the courage to look at the date of my last post.  It's been a little more than a year - April 4th, 2015.

I think about games nearly all the time.  Video games are still a big part of my life, and they have been since I was a child.  However, making games has been a slightly different story.  The last couple of weeks I've been kicking around the idea of letting my wife pursue her career and act as the stay at home dad int the future.  Not only would it allow me to dedicate the majority of the day to our kids, but being at home without work or school to stress over would also allow me to actually build.  But these are thoughts for the future, not necessarily something to act upon quite yet.

Something else I've been reflecting on is a feeling I've been fighting with for the last few years is just the motivation to do something of my own volition.  At the end of each day, I just want to sit at my chair and play video games.  So this summer, I'm starting again.  I'm not jumping into game design, like I originally aimed.  Well, not directly, anyway.

This time I'm looking at NES development.  This will just be the study of how games were made back when the cartridge was required, and games were coded purely in (by my understanding) assembly.  Not only will this tie closely to what I've studied the last 3 years, this will also be something exciting, something that I might actually desire to sit and work on.  Now that I have my old computer set-up running again, I can keep a blog about my findings and developments a little more easily as well.

I'll be studying the tutorials found here, and I'll share any relevant information I come across with every blog post I right.  The next post will be observing the NES architecture, but I am just about to finish the semester, so it may not be written for a few days.

Here's to hoping I keep my word this time.