More Ramblings from a Los Angeles Programmer

January 25, 2007

Working (sort of) NES Emulator

Filed under: coding, technology — Tags: — Josh DeWald @ 6:46 am

Well, I spent all day hacking on Sunday and managed to get some graphics to display on the NES emulator. As I hoped, I was able to use the same architecture as the C64 Emulator and actually am using the exact same processor implementation. The ADC and SBC instructions have slightly different modifications (the version of the 6502 used in the NES does not make use of the Decimal flag for BCD mode), but that’s *it*.

I had a business trip and hacked on the plane and manged to get Pacman to become playable (but look horrible).
Pacman screenshot
I was having some major palette issues. Using the tried and true bug-fixing technique of…stepping away…I was able to track down why the graphics were totally jacked (had some incorrect handling of the Attribute tables as they relate to the tiles displayed on the screen). So now Pacman looks *almost* correct. At least I thought so until I made the screenshot. There is a lot of work to do to get the sprites to draw correctly. Thankfully the background is at least correct.

My “end goal” is to get it so that my wife can play Super Mario Brothers 3. I’m hoping to implement the mapping for it soon. Currently Super Mario Brothers (1) will play the starting demo (but has all sorts of artifacts on the screen including the fact that I’m not handling transparent pixels).
Super Mario Brothers screenshot 2Super Mario Brothers screenshot

So, as you can tell, a lot of work left… but I’m pleased with it as a proof of concept and a definite work in progress. I’d like to also implement the audio for this one (which can hopefully be reused for the C64).

Update (11/30/2007): Here are screenshots from the more recent version of the emulator (these are actually from April) of which I have released the source

Super Mario Brothers 3 Home ScreenZelda SwordMario 1 Level 2

Advertisements

2 Comments »

  1. […] I think this is something of a Holy Grail for me and in fact when I started this in January, my wife said all she wanted to play was her favorite game (Super Mario Brothers 3) so that has kept the drive. She had beat it already on the real system and still loved it. So it […]

    Pingback by A great past few days « More Ramblings from a Los Angeles Programmer (well, UK at the moment) — April 17, 2007 @ 9:10 am

  2. planet ford houston

    Comment by unsumsLoum — June 25, 2007 @ 12:39 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: