|
CONTENTS Home Projects Electronics Graphics Java Java Mobile Other Stuff Resume Music Links To Friends Pictures About Mike Contact Random Link |
JatariIntroduction This is an attempt to make an Atari 2600 emulator in Java. I actually started this a long time ago, but after getting the CPU fully implemented I didn't have time to finish it. A few weeks ago an I did an FPGA VGA project and it reminded me about Jatari.. plus I got a couple emails asking me about.. so I decided to start development up again. My ultimate goal was to get this working with J2ME for mobile phones, although I'm not sure if a mobile phone CPU will be fast enough. I actually ported the CPU part of the code to C so I could compile it on a Playstation 2 and to SPIN to run a propeller CPU. Maybe if I finish the Java version I'll finish those. What It Does Right now Jatari consists of a number of Java class files: TIA (graphics and sound.. I believe this chip is also nicknamed Stella), Television (emulates the raster beam of a TV), PIA (the RIOT IO, timer chip, and RAM), ROM (where cartridge memory sits), m65xx (decodes instructions from a 6502/6507/6510 cpu), MemoryBus (routes to object/chip where memory read/writes should go), and Jatari (simply the "main" class that starts it all up). I normally stay away from heavily object oriented programming like this, but I decided to give this a try here. Originally I was trying to keep everything realtime with the TV and video drawing pieces asyncronous and everything in a few and bigger class files, but I changed my mind and decided to just try and get it working like this first. Most likely even on a desktop running this model it will be too slow to run a game, but we'll see. To make Jatari run as an applet or in J2ME should be as simple as adjusting the Television class to use an applet/midlet canvas instead of a Frame and making the ROM read from an HTTP socket to grab the game file. The Jatari class would have to be modified too to extend Applet or Midlet. In its current state, Jatari will render the test.bin file included in the download correctly. Now I have to make sure the PIA works, add sprites, collision dectection, and connect the keyboard with the Joystick interface. I think I won't add sound, at least not immediately, since sound on j2me (the ultimate goal here) is pretty goofy. Btw, I wrote a little javascript program to help define the colors in the system. If anyone is interested in playing with it it's here: yuv / rgb converter. I found some really nice example programs on http://khryssun.free.fr/programming.html. I've been using these to test and make sure Jatari is working properly. Right now I can perfectly render the heart picture with Jatari. I'm currently getting about 30 frames per second on an Althlon XP 1.8GHz. I'll have to optimize some code here when I get done implementing the full hardware. Download
jatari-2008-05-11.tar.gz
|