Need fast printing procedure 6*8

ZXNet echo conference «code.zx»

From Alexander Shushkov To All 4 October 2002

Hello everyone! The subject is useful, but with certain conditions: - So that the speed is more or less decent - So as not to use additional already shifted fonts (I know what will happen a little slower, but as much as possible) - So that I can print one character and one line - To avoid using a buffer for text (42 bytes as usual) I hope you can help, there is nowhere else to look for help. Alexander

From Aleksandr Majorov To Alexander Shushkov 7 October 2002

Hello Alexander! 04 Oct 02 12:56, Alexander Shushkov -> All: AS> A similar subject, but with certain conditions: AS> - So that the speed is more or less decent Criteria for "decency"? [Windows killed] AS> - So that you can print both one character and a line Here's the bummer. If you print one character at a time, it will be much slower than output immediately in a block (4 characters in 3 spaces). AS> - To avoid using a buffer for text (42 bytes as usual) If you output in a block, then a buffer is simply necessary. You decide what is more important to you: the speed of withdrawal or the possibility of withdrawing one symbol. And look at your project more carefully: maybe there you can get out text in blocks. Or use two printers: one is fast, but in blocks, and the second one-character. Alexand

From Valerij Kozhevnikoff To Alexander Shushkov 8 October 2002

Hello, Alexander! 04 Oct 02 12:56, Alexander Shushkov -> All: AS> A similar subject, but with certain conditions: AS> - So that the speed is more or less decent AS> - So as not to use additional already shifted fonts (I know what will happen AS> somewhat slower, but as much as possible) AS> - So that you can print one character and a line AS> - To avoid using a buffer for text (42 bytes as usual) What is more important to you? To consume little memory, or to work quickly? Get the driver from Isdos. I had Soretz somewhere... If speed is not too critical, I can give you a 5*8 printer from ZXZIP. Let It’s slow, but it’s clearly visible and there’s more information on the screen. WBR, Jason. /*e-mail: jason2000(scary dog)yandex.ru ICQ: 62235830*/ /np:/ *silence*

From Valerij Kozhevnikoff To Alexander Shushkov 8 October 2002

Hello, Alexander! 04 Oct 02 12:56, Alexander Shushkov -> All: Hello All! Is it possible even faster, higher, stronger... without opening cycles? ╒═══< Begin file: print42a.asm >════════ PR42_Y DB 0 ;Y-print position (0-23) PR42_X DB 0 ;X print position (0-255) ;************************************************ ;print character [A] PR42_A exx : ld bc,(PR42_Y) ;24 ld d,FONT/256 : ld e,a ;11 ;35 ;--------------------------------------- ld a,c : and %00011000 ;11 or #40 : ld h,a ;11 ld a,b : and %11111000 ;11 ld l,a ;4 ld a,c : and %00000111 ;11 or l : rrca : rrca : rrca ;16 ld l,a ;4 ;--------------------------------------- ;68 ld a,b : ld b,8 : rrca ;15 and %00000011 : jr z,PR42_A0 ;14 ;137 dec a : jr z,PR42_A2 ;11 ;148 dec a : jr z,PR42_A4 ;11 ;159 ;--------------------------------------- ;154 PR42_A6 ld c,%00000011 ;7 PR42_A7 ld a,(de) : rlca : rlca ;15 xor (hl) : and c : xor (hl) ;18 ld (hl),a : inc l ;11 ld a,(de) ;7 rlca: rlca: rrd;26 ld (hl),a : dec l : inc h,d ;19 djnz PR42_A7 ;13 exx : ret ;14; ---- ;7+109*8-5+14 = 888 + 154 = 1042 ;--------------------------------------- PR42_A4 ld c,%11000000 ;7 PR42_A5 rrd : ld a,(de) ;25 rrca : rrca : rrca : rrca ;16 rld : inc l ;22 xor (hl) : and c : xor (hl) ;18 ld (hl),a : dec l : inc h,d ;19 djnz PR42_A5 ;13 exx : ret ;14 ; ---- ;7+113*8-5+14 = 920 + 159 = 1079 ;--------------------------------------- PR42_A2 ld c,%00111111 ;7 PR42_A3 ld a,(de) : rrca : rrca ;15 xor (hl) : and c : xor (hl) ;18 ld (hl),a : inc h,d ;15 djnz PR42_A3 ;13 exx : ret ;14 ; ---- ;7+61*8-5+14 = 504 + 148 = 652 ;--------------------------------------- PR42_A0 ld c,%11111100 ;7 PR42_A1 ld a,(de) ;7 xor (hl) : and c : xor (hl) ;18 ld (hl),a : inc h,d ;15 djnz PR42_A1 ;13 exx : ret ;14 ; ---- ;7+53*8-5+14 = 440 + 137 = 577 ;--------------------------------------- ;min: 577 ;max: 1079 ;byte: 114 ╘═══< End file: print42a.asm >══════════ Счастливо. Михаил. + Origin: SPbZXNet'2001 (500:812/8) WBR, Jason./*e-mail: jason2000(scary dog)yandex.ru ICQ: 62235830*/ /np:/ *silence*

From Valerij Kozhevnikoff To Alexander Shushkov 8 October 2002

Hello, Alexander! 04 Oct 02 12:56, Alexander Shushkov -> All: Hello Mikhail! 11 Mar 01 21:21, Mihail Zharov -> All: MZ> Is it possible even faster, higher, stronger... MZ> without cycle expansion? MZ> ╒═══< Begin file: print42a.asm >════════ MZ> PR42_Y DB 0 ;Y-print position (0-23) MZ> PR42_X DB 0 ;X-print position (0-255) The least significant bit of the X coordinate is ignored, ^^^^^ i.e. your signet is honorable :) [--skip--] MZ> PR42_A6 ld c,%00000011 ;7 MZ> PR42_A7 ld a,(de) : rlca : rlca ;15 MZ> xor (hl) : and c : xor (hl) ;18 MZ> ld (hl),a : incl ;11 MZ> ld a,(de) ;7 MZ> rlca : rlca : rrd ;26 MZ> ld (hl),a : dec l : inc h,d ;19 MZ> djnz PR42_A7 ;13 MZ> exx : ret ;14 MZ> ;--- MZ> ;7+109*8-5+14 = 888 This flow can be speeded up a little. Here: HL = address on screen DE = font address B=8PR42_A6 LD A,(HL) ;07 RRCA : RRCA : LD C,A ;12 LD A,(DE) ;07 RLCA : RL C : RLCA : RL C ;24 LD (HL),C : INC L : RRD ;27 LD (HL),A : DEC L : INC H,D ;19 DJNZ PR42_A6 ;13 EXX : RET ;14 ;--- ;109*8-5+14 = 881 A total of 7 bars, and for the scorpion - another 15, by reducing odd-clock instructions in the cycle. [--skip--] ... + Origin: not present (500:812/8.29) WBR, Jason. /*e-mail: jason2000(scary dog)yandex.ru ICQ: 62235830*/ /np:/ *silence*

From Alexander Shushkov To Aleksandr Majorov 9 October 2002

Thanks for the answer...

From Mihail Zharov To Alexander Shushkov 11 October 2002

Hello Alexander! Friday, 04 October 2002, at 12:56:32 Alexander Shushkov -> All. AS> A similar subject, but with certain conditions: AS> - So that the speed is more or less decent How many clock cycles is this per character? Or in other words - “decent” in relation to what? After all, no one specifically writes “brakes”... ;) They write for a specific program, but what is it for you? How many bytes can you allocate in main memory? AS> - To avoid using additional already shifted fonts AS> (I know there will be several AS> slower, but as much as possible) You cannot use fast font, where the bytes of the character matrix offset by 256 bytes? Why? Is the font full (256 characters - 2 kilos) or not? AS> - So that you can print both one character and a line Outer loop over a one-character typewriter, but better, two different/specialized items. AS> - To avoid using a buffer for text (as usual 42 AS> bytes) Bad. All the requirements together are a terrible drag on the line. It will turn out approximately: for _one_ character, from 600 to 1200 clock cycles, about 150 bytes; for _line_ it turns out to be over 36,000 cycles. (all repetitions are collapsed into cycles) AS> I hope you can help, there is nowhere else to look for help.I only have everything for fast font. I don't want to "slow down" ;) Have a nice conversation, Alexander.

From Mihail Zharov To Valerij Kozhevnikoff 12 October 2002

Hello Valerij! Tuesday, 08 October 2002, at 14:20:49, Valerij Kozhevnikoff -> Alexander Shushkov. VK> ;--------------------------------------- VK> ;min: 577 VK> ;max: 1079 VK> ;byte: 114 VK> ╘═══< End file: print42a.asm >══════════ Long outdated. Here's the last one: ╒═════════════════< Begin file: print42a.asm >═════════════════╕ ;************************************************ ;PRINT CHARACTER (a), X:0-255, Y:0-23. ;(c) 2000 JAM&POL, VIVID, MAS. ;************************************************ ; in: a - number of the character to print ;--------------------------------------- PR42_A ld d,FONT/256: ld e,a ld bc,#0000 PR42_Y EQU $-2 ;c - Y PR42_X EQU $-1 ;b - X ;t=21 ;------------------- ;calculate the address on the screen. ld a,c: and %00011000 or #40: ld h,a: ld a,c xor b: and %00000111: xor b rrca: rrca: rrca: ld l,a ;t=57 ;------------------- ;print at even X-coordinate... ld a,b: ld b,8: rrca rrca: jr nc,PR42_A0 ;109 rrca: jr c,PR42_A6 ;120 ;115 ;------------------- ;print from 2 pixels - %00111111 ld c,%00111111 PR42_A2_ld a,(de): rrca: rrca xor (hl): and c: xor (hl) ld (hl),a: inc h,d djnz PR42_A2_ret ;t=7+61*8-5+10=500 +115=615 ;------------------- PR42_A0 rrca: jr c,PR42_A4 ;print from 0 pixels - %11111100 ld c,%00000011: ex de,hl PR42_A0_ ld a,(de): and c: or (hl) ld (de),a: inc h,d djnz PR42_A0_ ret ;t=22+46*8-5+10=395 +109=504 ;------------------- ;print with 4 pixels - %00001111-1 PR42_A4 ld c,%11000000 PR42_A4_ rrd: ld a,(de) rrca: rrca: rrca: rrca rld: inc l xor (hl): and c: xor (hl) ld (hl),a: dec l: inc h,d djnz PR42_A4_ ret ;t=7+113*8-5+10=916 +125=1041 ;------------------- ;print with 6 pixels - %00000011-11110000 PR42_A6 ld a,(de) rlca: rlca: ld c,a xor (hl): and %00000011 xor (hl): ld (hl),a: inc l ld a,c: rrd ld (hl),a: dec l: inc h,d djnz PR42_A6 ret ;t=105*8-5+10=845 +120=965 ;-------------------------------------- ;504,615,965,1041 bps / 102 bytes ╘═════════════════< End file: print42a.asm >═══════════════════╛ Ha cleaning exx not foam. And people asked not for fast-font ... Nice connections, Valerij.

From Mihail Zharov To Valerij Kozhevnikoff 12 October 2002

Hello Valerij! Tuesday, 08 October 2002, at 14:21:23, Valerij Kozhevnikoff -> Alexander Shushkov. VK> This flow can be speeded up a little. VK> Here: HL = address on screen VK> DE = address in font VK> B = 8 VK> PR42_A6 LD A,(HL) ;07 VK> RRCA : RRCA : LD C,A ;12 VK> LD A,(DE) ;07 VK> RLCA : RL C : RLCA : RL C ;24 VK> LD (HL),C : INC L : RRD ;27 VK> LD (HL),A : DEC L : INC H,D ;19 VK> DJNZ PR42_A6 ;13 VK> EXX : RET ;14 VK> ;--- VK> ;109*8-5+14 = 881 It can be even faster ;) Stream A4 begs to be rewritten faster, but for some reason it doesn't work ;( And the most interesting optimization in block printing is 4 symbols with pixel lines, wave and amble ;) Like 19,000 clock cycles per 50 bytes to print a line. 2all: What options do you have? ;) Have a nice conversation, Valerij.

From Alexander Shushkov To Valerij Kozhevnikoff 15 October 2002

Hello Valerij! VK> What is more important to you? To consume little memory, or to work quickly? VK> Take the driver from Isdos. Soretz was with me somewhere... VK> If speed is not too critical, I can give you a 5*8 printer from ZXZIP. VK> It may be slow, but it’s clearly visible and more information fits onto the screen. I need your more or less decent speed and I also need memory for others goals. The 5*8 printing machine doesn’t look very nice, but I would also like some beauty. Alexander

From Alexander Shushkov To Valerij Kozhevnikoff 15 October 2002

Hello Valerij! Thanks for the procedure. I'll test it and compare it with others. Alexander

From Alexander Bondarenko To Alexander Shushkov 17 October 2002

*You will live long, Alexander!* It was Oct 15, 2002, you gave birth to a whole footcloth for Valerij Kozhevnikoff, about "A fast 6*8 printing procedure is needed." She intrigued me, I'm sending oncoming VK>> If speed is not too critical, I can give a printer 5*8 from VK>> ZXZIP. It may be slow, but it’s clearly visible and there’s more information on the screen VK>> fits in. AS> I need your more or less decent speed and I also need memory for AS> other purposes. Printer 5*8 does not look very nice, but beauty AS> too AS> I would like to. The most beautiful printing machine is a proportional font. /That’s all, Alexander, what follows is only the truth.../