So, the last issue I will
- Proportional printing.
It was made very long and not quite
fast, accurate, not fast, but
Still ahead of print in the ZX-Review. (although
it is quite less good comparison.
There, she emulates the RST # 10)
Printing is up to the pixel
so if it is tied to the rows of Y,
printing will be considerably quicken. More
one option: the use of the stack.
The first byte character generator is proportional to print
contains the character width. Except addition, the character in
the character generator is pressed to right boundary to
minimize the number rotations in print. Font taken from the
procedure proportional to the press, published in
ZX-Revue, maybe 1994, I do not remember exactly.
; Procedure for proportional printing
, Version 5.13
; RELEASE DATE 21.09.1996
;
ORG 35000
CALL INIT; generation table
CALL PROBE; test print
RET
INIT PUSH IX
LD IX, TABST; top of the table
LD B, 192; 192 line screen
INID LD E, B
LD A, 192; calculation of address (0, Y)
SUB E; per-pixel
LD E, A
AND A
RRA
SCF
RRA
AND A
RRA
XOR E
AND # F8
XOR E
LD H, A
LD A, 0
RLCA
RLCA
RLCA
XOR E
AND # C7
XOR E
RLCA
RLCA
LD L, A
LD (IX), L; address in HL-
INC IX; stored in a table
LD (IX), H
INC IX
DJNZ INID
POP IX
RET
PROBE EXX; test print
PUSH HL
EXX
LD A, 32
POWTOR PUSH AF
CALL PROC
POP AF
INC A
CP 128
JR C, POWTOR
EXX
POP HL
EXX
RET
;------ Search address in a set of code ----- PROC LD L, A
XOR A
LD H, A
LD DE, FONTST-256
ADD HL, HL
ADD HL, HL
ADD HL, HL
ADD HL, DE
LD B, (HL); width
INC HL; hl-pointer at the font
LD C, 7; character height
;------ Control output abroad -------
LD A, (XPOS)
ADDIT LD E, A; E-flowing postures. Pec.
ADD A, B; not coming out for the pre
JR NC, DAL1; limits for the press?
LD A, (YPOS); newline
ADD A, C
LD (YPOS), A
XOR A
JR ADDIT
DAL1 LD (XPOS), A; koord.X-for mark.
LD A, (YPOS); Print
CP 192-6; there a way for
JR C, DAL2; downhill?
XOR A; there! take action!
LD (YPOS), A; Eg: Print with 0.0
The calculation of the index table ;------ -------- DAL2 EXX
LD DE, TABST
LD L, A; L-Y coordinate
XOR A
LD H, A; cleaned H
ADD HL, HL; multiplied coord.
ADD HL, DE; 2
EX DE, HL; DE-pointer
EXX; address printing in the table
; Calculation addresses familiarity and position it
LD A, E; Restore A tek.koord
SRL A; divide by 8 residues
SRL A
SRL A
EXX
LD C, A; number of familiar. in C '
EXX
LD A, E
AND C; position to sign.
LD E, A; in the registers E and A
LD D, 8
;---------- How to print will ?----------
ADD A, B; amount of width
CP D; D = 8
JR C, BYT1;>-pech.v first sign.
JR Z, NENADO; do not twist
; Have
;--------- Printing in 2 bytes ----------- BYT2 LD A, D
SUB E; 8-position
LD D, A
LD A, B; boot. width
SUB D; A: = width .- (8-Pos.)
LD D, A; how to twist
; In the C-byte count
CUC LD A, D
LD B, A
XOR A
LD E, (HL)
INC HL
RROT RR E; rotate with the transfer
RRA; from E to A
DJNZ RROT
EXX
LD B, A; 2 nd floors. Save. B '
EXX
LD A, E; 1 st print
EXX
EX AF, AF '; bytes until needed
LD A, (DE); MB ADRs sign (Y, 0)
ADD A, C; arr. familiarity
LD L, A; MB ADRs Print
INC DE
LD A, (DE)
LD H, A; address on the screen
INC DE
EX AF, AF '; printable bytes
OR (HL)
LD (HL), A; print by 'OR'
INC HL; trace and 2 nd floors
LD A, B; incubation symbol on
OR (HL); screen
LD (HL), A
EXX; 1 line character
DEC C; ready
JR NZ, CUC; repeat?
RET; printing completed
;----- Print within a single byte-BYT1 LD A, D; A = 8
SUB E
SUB B; in the A-number of rotations
LD B, A; B - //-//-//-
; In the C-counter
PRINT LD D, B; save
LD A, (HL); read Byte oven
INC HL; sign
ROTOR SLA A
DJNZ ROTOR; twist
LD B, D
EXX; A-B in print
EX AF, AF '; further process
LD A, (DE); similar to print
ADD A, C; in 2 bytes
LD L, A
INC DE
LD A, (DE)
LD H, A
INC DE
EX AF, AF '
OR (HL)
LD (HL), A
EXX
DEC C
JR NZ, PRINT
RET; printing completed
;------------ Printing without rotation ------- NENADO LD A, C
LD B, A
ROT1 LD A, (HL); read bytes
INC HL
EXX; and print it
EX AF, AF '
LD A, (DE)
ADD A, C
LD L, A
INC DE
LD A, (DE)
LD H, A
INC DE
EX AF, AF '
OR (HL)
LD (HL), A
EXX
DJNZ ROT1
RET; printing completed
XPOS DEFB 0
YPOS DEFB 0
FONTST INCBIN NEWFONT
TABST NOP; Here is a table.
At that allow complete.
Text written in ZxIbm Editor v.1.5
Formatted in IS-Dos Editor.
E2 Soft 26.04.1997
__________________________________________