Coding - Bystrai printing 64 characters per line.

Deja Vu #09
(C) Morozov Ilya / Death Moroz
__________________________________________



             Hello!


   Today "talk" about the rapid withdrawal
rows with 64 characters. The whole secret of the following 
methods in a pair of tables, additional fonts and custom 
printing: characters are displayed as soon as 2 (in one of 
familiarity), which together with Stack scrolling gives The 
outstanding results. 

; (C) All work in Xas by D.M0R0Zz


font2 EQU # 6000; address of the second font (created below)
t2 EQU font2 +2048; address tables
t1 EQU t2 +512; with the addresses of symbols


              ORG t1 +512; ship the base font (must be
font1 EQU $; shifted upward (when only 6 bytes)

              LCODE "F4.1"

              ORG font1 +2048; beginning of the program

              ENT

              CALL creat; create everything we need ...

              LD de, text; in DE address of text

              CALL print; print ...
oprs CALL 8020, when pressing "backspace" - out ...

              JR c, oprs

              RET


print LD hl, # 4000; from start to print

              LD (t_poz +1), hl

              LD a, 0, number of that line

              LD (n_lin +1), a

              DI

              LD (sp_ +1), sp; preserved

              LD hl, p1; initial installation

              LD bc, # 2120


p1 LD a, (DE); have a character code

              INC de; increased

              CP b; if the code is> 32 (space)

              JP nc, p1_1; then go to print

              CP c; if it is not blank,

              JP nz, p1_3; then go to p1_3

              EXX

              LD de, 32 * 8 + font1; in DE 'address space

              EXX

              JP p2; the transition to the second half of 
familiarity 

p1_3 CP # 0d; sign of the end of the line?

              JP z, n_lin; if so, crawling on the trail.

              CP 3, the end of the text?

              JP z, sp_; if so, the output

p1_1 EXX; take the address of the symbol from the table

              LD l, A; and store it in DE '

              LD h, t1 '& amph; taken byte

              LD e, (HL)

              INC h

              LD d, (HL)

              EXX


p2 LD a, (DE); took sleduyuschgo symbol

              INC de

              CP b; if> 32 then print

              JP nc, p2_2

              CP c

              JP nz, p2_3

              EXX; the SP address space in the second Fonte

              LD sp, 32 * 8 + font2

              JP t_poz
p2_3 CP # 0d; if the end of the line, then go to

              JP z, n_lin_; print the first half

              CP 3

              JP z, sp_


p2_2 EXX; take the address in Fonte

              LD l, A

              LD h, t2 '& amph

              LD a, (HL)

              INC h

              LD h, (HL)

              LD l, A

              LD sp, HL; shoved in SP

t_poz LD bc, sh4000, and the address on the screen

              ! ASSM 2, repeat the piece before! Cont 2 times
, (Replaced by 3, if you want to display the characters in full)

              POP hl; take 2 bytes from the second font

              LD a, (DE); and one of the first ...

              OR l; merged

              LD (bc), A; printed

              INC e; moved to the second byte of the first font

              INC b; and on down the line

              LD a, (DE)

              OR h

              LD (bc), A

              INC b

              INC e

              ! CONT

              POP hl; dopechatali residues

              LD a, (DE)

              OR l

              LD (bc), A

              INC b

              INC e

              LD a, (DE)

              OR h

              LD (bc), A



              LD hl, t_poz +1; increased position

              INC (hl)

              EXX

              JP (hl); repeat
n_lin_ EXX; output only the first halves of familiarity

              LD l, E

              LD h, D

              LD sp, HL

              LD hl, (t_poz +1)

              ! ASSM 2

              POP de

              LD (hl), E

              INC h

              LD (hl), D

              INC h

              ! CONT

              POP de

              LD (hl), E

              INC h

              LD (hl), D

              EXX


n_lin LD a, 0; transition to sled.liniyu

              CP 23, or exit if the end of the screen

              JP z, sp_
n_lin1 EXX

              LD l, A

              INC a

              LD (n_lin +1), a

              LD b, A

              AND # 18

              ADD a, # 40

              LD h, A

              LD a, B

              AND 7

              RRCA

              RRCA

              RRCA

              LD l, A

              LD (t_poz +1), hl

              LD bc, t1

              EXX

              JP (hl)
sp_ LD sp, 0, output

              EI

              RET


creat

              LD bc, 2048, creating the second, pre-

              LD de, font1; shifted font

              LD hl, font2
cr2 LD a, (DE)

              RRCA

              RRCA

              RRCA

              RRCA

              LD (hl), A

              INC de

              INC hl

              DEC bc

              LD a, B

              OR c

              JR nz, cr2



              LD b, 0; creating tables

              LD de, 8

              LD hl, font1

              LD ix, t1

              LD iy, t2

              EXX

              LD hl, font2

              LD de, 8

              EXX
cr1 LD (ix), l; for quick access, the first part of

              INC hx; mladyuy stores, and the second part of 
the table 

              LD (ix), h; byte address

              DEC hx

              INC ix

              ADD hl, DE

              EXX

              LD (iy), l

              INC hy

              LD (iy), h

              DEC hy

              INC iy

              ADD hl, DE

              EXX

              DJNZ cr1

              RET

              ORG $
text EQU $; ship text

              LCODE "TEXT"