RC 2.x

ZXNet echo conference «real.speccy»

From Mihail Zharov To All 16 January 2002


Hello, Pawel!

Friday, January 04, 2002, at 00:10:23,
Pawel Kislyak -> Mihail Zharov.

MZ>> Please show me the one-character and lowercase typer.
MZ>> I bet 3 euros on a more brutal optimization... ;)))
PK> Let's go!

Oh. ;)
Sorry for the slow response. Time.
Sorry, I’m still doing it in a hurry.

MZ>> Both by bytes and clock cycles.
MZ>> (too lazy to climb, but panels, for example, are displayed slowly ;)
PK> Since RC, starting from version 2.0, was completely transferred
PK> to a 42-character font, a fast printer
PK> was added that outputs immediately 4 characters at a time, the
PK> procedure from RC 1.x also remains, allowing you to print from any
PK> pixel horizontally. These two procedures are combined and allow
PK> to print from any pixel horizontally (preferably
PK> even).

Yes, it’s more profitable.

PK> I’m bringing the source code (by the way, I’ve already been optimizing it
PK> Alone coder,
PK> the fast printer was not originally written by me, mine was only
PK> PRSYMX ;).

I correctly understood that in lowercase printer only in a clean
space?

PK> So the procedure WRITEX - print a line, PRSYMX - print
PK> one character.

For a one-character printer:
You did it with one tuning thread - you gained in
bytes, but lost in speed.
Similar"move" is good if you also have a separate and string
printer... otherwise it's slow.

For a line printer:
At one time I tried many different approaches, aka printing algorithms. It turned out to be the fastest, aka ergonomic - printing
from right to left (ambling;), in a wave of four characters in pixel
lines ;)
I never got used to code. Time.
The last thing we have at the moment is direct printing
with pixel lines.
Here is the main cycle:

╒══════════════════< Begin file: pr_lin .C >══════════════════і

;***************************************
;PRINT LINE, 42 CHARACTERS FROM BUFFER
; - pixel lines
;************************************************
; in: hl - address of the beginning of the line in the screen
; de - buff/256-42
; b - font/256
;---------------------------------------

PR42_LIN ld (hl),%00000000
jr PR42_L2
;-------------------
PR42_L6
;6-66/13
ld a,(de): ld c,a: ld a,(bc)
rlca: rlca: ld c,a
and #00000011: or (hl)
ld (hl),a: inc l
ld (hl),c: inc e
;4-84/15
ld a,(de): ld c,a: ld a,(bc)
ld c,(hl): inc l
ld (hl),a: ld a,c
and %11110000: rld
dec l: ld (hl),a: inc l,e
PR42_L2
;2-48/9
ld a,(de): ld c,a: ld a,(bc)
rrca: rrca: or (hl)
ld(hl),a: inc l,e
;0-29/5
ld a,(de): ld c,a: ld a,(bc)
ld (hl),a: inc e
;-227/42
jr nz,PR42_L6
; ...
;end of printing one pixel line
ld a,l: and #E0: ld l,a
ld e,256-42: inc b,h
ld a,h: and #07 ;8 line?
jr nz,PR42_LIN
; ...
;end of character string print
;---------------------------------------
;2+0+6+4 = 227/42
;t=22+48+29+(65+84+48+29+12)*10+7=2486
;

╘══════════════════< End file: pr_lin .C >════════════════════╛

t=(2486+?)*8=
b=42+?=

Imho, less... ;)

[delete]


Have fun, Pawel.

... ┌─[ZX]─>─[Scorpion]─┬─[SMUC]─>─[MIDI]─>─[PROSCO]─>─[GMX]──┐