lda #$00

Its been another busy week. As expected, work was crazy, and will continue to be for a few weeks yet, so its unlikely that you’ll see massive amounts of code coming from me; I’m just too tired after a whole day of hacking too. But I still get little bits done, and make steady progress.

I’m still working on the tunnel. During the week I put together a first cut of the code, which naturally didn’t work. I’d hadn’t realised just how much debugging tools make life easier. Its being a complete pain to debug - I can’t print values out at key points! I have the VICE monitor only, which only lets me inspect memory, and since my intuition hasn’t come back yet those numbers are really difficult to use without a good mental model. I have managed to debug my point plotting routine so far, so thats something. Next time around (tonight if I’m not too tired, otherwise on the bus tomorrow) I’ll be stripping back the code to a straight circle drawing routine, and then building it back up from there. I have a feeling this may yield some optimisations in the end, as in my efforts to port my C version I lost sight of the fact that all this routine needs to do is draw circles of various sizes, nothing more. Here’s hoping.

I had a bit of an epiphany this morning about how to make filled multicolour vectors run really fast. It works off the fact that only the face edges have more than one colour. The areas within each face are just a single colour.

Naturally, I’d expect that I’d just have to fill in each and every pixel in that space, but not so. Since they’re just solid blocks of colour, I can modify the value in the colour map and effectively “paint” an 8x8 area by just storing to a single memory location, rather than eight (assuming a heavily-optimised routine). Clearing also becomes easier - only the locations that have an edge on it need to be cleared, again speeding things.

I have to assume that this technique has been thought of/used in existing routines, because filled vectors got boring in 1994, but I’m still happy that I came up with the idea independently. Improving my vector code will be my next trick after the tunnel, I think.