Recent Searches


Perform a standard search against the website content.

The Picture
by Jerome Savidan
 
Hi Steven,

Tanks for these interesting readings. I'm currently writing a compiler that compiles ZX81 Basic to bytecode (Java Virtual Machine), and I am quite often referring to your blog to find interesting tests to do. Interestingly, since this compiler produces graphics using unicode characters on a console output, it retains quite the slowness of the ZX81 (not THAT slow, but you can still see it draw).
I've tried my own version of "the picture" but could not exactly use your code as some statements and functions were still to be implemented (FOR.NEXT for example).
I must also say that I'm not very good in Maths, so, inspiring on some good practices of pixel art, I tried to produce "even lines" (see http://www.spriteland.com/tutorials/pixel-art-lines-tutorial.html) with simpler routines. For example, for a line going at 30° (a 3:1 line), I would increment my Y position of 0.33 at each occurence, with X incrementing of 1.
It means that I have for the moment one sub-routine per line type, which is far from being ideal.
Trying to optimize this with a more generic version is a nice exercise for the brain, since I need to balance between the memory taken for "argument" variables (one LET per variable used in a generic routine) versus the more easily predictable space taken in a strategy where each line type has its own routine (something like twelve routine of 5 code lines each should be enough).
I need also to test all these assumptions on a real ZX81 (I have a FPGA computer at hand to test that), because I have no clear idea on the amount of code you can produce before going out of memory.
Well, nice job anyway and thanks for the inspiration shared.

Jerome


  View this comment's full article: