Pages

Tuesday, 26 April 2016

Invaders... from space...

Haven't been able to spend a lot of time on Space Invaders lately (long weekend here) but tonight I finally got the invaders displaying in the demo mode!

The demo mode display, finally. A lot of code ported to get here.

In the process I've had to add the 2nd interrupt - an 8.3ms timer that is started in the VBLANK interrupt - that should (in theory) interrupt somewhere around scan line 96. I haven't checked exactly where that's happening yet, due in part to the fact that the 'BEAMY' value in MESS at the start of the VBLANK ISR increments every frame!!! Taking that into consideration though, the TIMER interrupt appears to be happening around 120 scan lines earlier, which is a good thing.

Now if I could only get someone on MESSDEV to give two hoots about it...

Something else that only sunk in tonight... non-bit-shifted rendering routines use the CPU address map value of the target video byte when referencing display positions. Such values appear in tables and hard-coded throughout the code. OTOH, potentially bit-shifted routines use the pixel offset - but offset not from the start of the video memory as you'd expect, but rather from the start of all RAM. That threw me for a while when trying to work out how to get the invaders to display correctly. Not sure how I got the animated squigggly alien shot to work in the splash animation though...

And this coupled with the endianity changes can do your head in a bit when debugging.

The source file is around 3,300 lines now. Most of the core code has been ported and what remains is mostly concerned with the player movement & firing, invader bombs and the saucer. I've still got plenty of debugging to do in the code I have ported, let alone what's left. But with both ISR's in place, I'm not expecting any major roadblocks.

2 comments:

  1. I don't think there's a current maintainer for the CoCo/Dragon drivers for MESS, so bugs aren't getting fixed. Hence me having to use an old MESS 0.136 build to find a version that supports banked cartridges...

    The Color Computer Archive has a download of various old versions of MESS that might help you out.

    ReplyDelete
  2. I'll probably have a go at fixing it myself first, failing that I'll do as you suggest - thanks!

    ReplyDelete