I'm making this code available so that maybe it will live on in the web.

Looking back on it, this is pretty standard Apple code for me except that I went to the trouble of actually commenting it (what was I thinking, right?).

One thing which will leap out is that I use a stack-like structure in the routine CELLCH. This code is effectively a push operation which pushes the (X,Y) coordinates of a cell to a stack that starts at $4000. This code is self-modifying. The 6502 didn't really have particularly good addressing modes for pointers that were fast, so I got in the habit of using self-modifying code instead.

The function DISPL takes advantage of the changes made by CELLCH to basically rip it as a display list.

The function CELL is a typical bit-blitter that I wrote for games. It's special cased to handle the fact that cells (which are 3x2 IIRC) use the same data for the doubled scanline. The blitter is nice in that it doesn't need the X register at all (even though it uses it) the loop is unrolled. A more normal blitter (for me), would use X for the scanline pointer, Y for the byte within a row and use self-modifying code for the source data.

Last edited Apr 23, 2013 at 5:00 PM by plinth666, version 1

Comments

No comments yet.