Sometimes designing kernels is more fun than actual game programming. Anyway, the idea of doing a better chess kernel has been on my mind for a while. I've been skeptical of the notion that chess could only be done with Venetian blinds or flickering, and this weekend I came up with a design that needs neither. Like my other board game kernels it relies heavily on PF graphics and multiple color changes.Unfortunately I could not figure out a way to use self-modifying code. The PF must be updated every line, and there was not enough time in a loop to retrieve new playfield data. The extra cycle needed for indexed addressing was just too much. What I did for this proof of concept instead was to repeat code. There are 12 groups of nearly identical code for each scanline. The only difference is the addresses from where the PF data is loaded.I can make the colors of the first two pieces variable, so I would need 64 routines to cover every combination. The grand total is about 27K. This chess kernel is theoretically possible, but I'd rather find a way to reduce the size.As usual, a screenshot of a single row and a mockup of the full board is attached.



Create a custom theme








I personally happen to rather like the style of venetian flicker that David Crane invented; I would think it preferable to non-venetian playfield graphics for chess pieces. Nonetheless, your approach is interesting.
One thing I'd suggest looking into, though: you only need to do the COLUPF store if a piece is a different color from its predecessor. This fact should allow you to greatly reduce the number of different cases you need to handle since a non-store provides time to load registers. The different cases that can be handled by different types of code overlap in tricky ways, so you'd probably need some tables to help select which case applies to any particular color combination.
Another notion--not sure it would work well here given the slightly irregular timing requirements--is using the stack as a versatile branching method. I was thinking of doing this awhile ago for an eleven-invaders clone using Venetian blinds. The basic idea would be to have a code segment:
The stack would be set up with a list of 'segments' of invaders, followed by a pointer to the code that should execute after showing the last invader. The stack pointer would be set to the byte before start of this list and an RTS executed. In worst case, the stack would need to hold four entries (there would be two stacks, one for the even rows and one for the odd rows).