Comment by johnklos
2 years ago
I can finally have 85 characters by 48 characters on my Sinclair ZX81, and it'd be printable, too, on my T/S 2040 printer.
(starts thinking in Z80...)
2 years ago
I can finally have 85 characters by 48 characters on my Sinclair ZX81, and it'd be printable, too, on my T/S 2040 printer.
(starts thinking in Z80...)
In my experience you get a lot of density moving to a variable-width font, which is quite easy to write for a Z80 system. For example I've designed a couple with the horizontal size in the first byte of the bitmap:
https://github.com/Veltas/spectrum-env/blob/master/font-orig...
https://github.com/Veltas/spectrum-env/blob/master/font-smal...
Rendering:
https://github.com/Veltas/spectrum-env/blob/master/text.asm#...
Looking back at it, my Z80 for this isn't that good, but it was still fast enough to redraw a whole line of text in 1 or 2 frames, I'm sure others can do better.
Which leads to the question: what is the smallest Z80 assembly function which takes an ASCII code as an input and returns one of these characters some way? 3x4 is 12 bits so with a little waste one can fit it into a 16 bit register pair. You could thus encode it into a 96*2=192 byte lookup table but isn't there some procedural generation to shrink that?
I believe a table and a lookup function would be smaller than a function for generating bitmaps: just for a single pixel I've got this expression [1].
Nah, I am thinking like half a table and half some tricks to generate ... back in the day people were doing crazy crafty tricks to squeeze the most out of the rather limited memory of the machines.
Oops. It's 3x4 inside of a 4x5 box, meaning a Sinclair ZX81 can only do 64 x 38 :(