Tuesday, May 3, 2011

Atari 2600

So, after seeing Trip6's forum thread on Lemon and being fairly interested in some of the games I decided to start poking around at a few of them.

To be honest the 2600 games didn't appeal to me, probably because I'd never played them before so I downloaded them to have a quick look. I've got to say I'm a bit of a convert in a couple of cases. Keystone Kapers and Seaquest (especially the former) are really nice little games. Vanguard I've never been fond of and the 2600 version even less so. Kaboom! I can see the appeal of but it's not my kind of thing.

After playing them for a while I started to look at what was going on using Stella's debugger and soon found all the RAM locations of sprite positions, scores, lives etc etc in Keystone. So I used distella (6502 disassembler) to dump the ROM file to some asm source code. A quick C64 setup and subroutines here, a change a couple of bytes there and with a C64 number printing routine spitting out pertinent values I was running around levels on the 2600 version of the game now running almost untouched on the C64. Of course the only thing I could see on screen at this point were the numbers I was printing so I could tell what was going on.

I've now done the same thing with Seaquest, Kaboom and for no reason other than I quite like it, Berzerk.

As Berzerk was the last one I got running I decided to rip the sprites (using my multi purpose graphics finding tool) and include those. I've also done a routine to draw the room (2600 of course does this line by line as it's drawing the rest of the screen) by reading the memory where the 2600 kernel reads it from and interpreting the bits into solid or blank (or 1/2 and 1/2) C64 characters.

Here's the result so far..


The top and bottom lines of the room are drawn a different way, just coding that now.

The main thing to replace/reproduce somehow for doing 2600 to C64 is the collision detection. I know some games don't use the hardware (Pitfall for eg, although even then it might sometimes) but all of these do. In the screenshot above you can see the random placement of robots has dropped one right in a wall. This (I finally worked out) is how it decides how many robots are in the room. I'd originally thought it was random but it turns out if they're in a wall when the screen is drawn for the first time they're just killed off before you even see them.

I'll have to investigate the collision code (2600 hardware collisions are fairly simple) and replace it (or at least fill in the data) from the C64 code. Berzerk should be fairly easy as no robot can ever touch another one so any player vs player collision means you're dead, anyone hitting a wall (so a player against playfield collision) dies and the same goes for any bullet hitting any sprite (bullets are made from PF graphics too).


Not sure how far I'll go with these. The bounty has headed far in another direction but they might be fun to finish anyway..


Pete

No comments:

Post a Comment