03.20.08
Rendering Complete
Finally finished and mostly debugged the new rendering architecture of the engine. Aside from some strange crashes and random functionality failures (probably some bad initialization code), I’m pretty happy with everything. I thought that the animation would be rock-solid under KEGS since it emulates the VBL signal decently, but there is still flicker at high speeds. It goes away when I drop the emulated speed down, so maybe it actually is working properly. Need to dig out a real machine to test…
The bulk of the work was not in the rendering path itself, but the sprite compiler. By changing the line-by-line sprite decomposition, I had to rewrite the compiler to produce whole sprites. I also lost the ability to reuse the same data for vertically flipped drawing. I’m a little disappointed that the size of the sprites has ballooned so much. For instance, a simple 16×16 sprite takes up over 4K of memory!
I may rework the new compiler to produce small subroutines that call the sprite code fragments in the proper order to restore the space advantage. This is doable now because the sprite code has its own private stack in Bank $01, so it can freely use JSR/RTS instructions without stomping over memory.