home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG099.ARC
/
TEXT.I
< prev
next >
Wrap
Text File
|
1979-12-31
|
2KB
|
59 lines
Procedure Text(CursX,CursY : Byte; Writing : Script; F : Operation);
{Given : 1. CursX - Byte in [1..64]
2. CursY - Byte in [1..16]
3. Writing - A String of any length
4. F - ResDot,SetDot,InvDot
it will : 1. Read ROM data for Writing[Loop] into $3000
2. Mask 'Writing' onto screen at position
CursX,CursY}
var
PCG, Temp, ASCII : Integer;
Loop, MaskData, Mask : Byte;
Begin
for Loop := 1 to Length(Writing) do
begin
ASCII := Ord(Writing[Loop]);
Inline($3E/$01/ { LD A,1 }
$D3/$0B/ { OUT (0BH),A }
$2A/ASCII/ { LD HL,ASCII }
$11/0/$F0/ { LD DE,$F000 }
$29/ { ADD HL,HL }
$29/ { ADD HL,HL }
$29/ { ADD HL,HL }
$29/ { ADD HL,HL }
$19/ { ADD HL,DE }
$11/0/$30/ { LD DE,$3000 }
6/$10/ { LD B,16 }
$7E/ {READ LD A,(HL) }
$12/ { LD (DE),A }
$13/ { INC DE }
$23/ { INC HL }
$10/$FA/ { DJNZ READ }
$AF/ { XOR A }
$D3/$0B); { OUT (0BH),A }
if ((CursX>0) and (CursX<65) and (CursY>0) and (CursY<17)) then
begin
PCG := Mem[$EFBF + CursX + CursY * 64];
Port[28] := 128 + ((CursY - 1) div 2);
for MaskData := 0 to 15 do
begin
Temp := $F000 + PCG * 16 + MaskData;
Mask := Mem[$3000 + MaskData];
case F of
ResDot : Mem[Temp] := Mem[Temp] And not Mask;
SetDot : Mem[Temp] := Mem[Temp] Or Mask;
InvDot : Mem[Temp] := Mem[Temp] Xor Mask;
end;
end;
Port[28] := 128;
end;
CursX := CursX + 1;
if CursX > 64 then
begin
CursX := 1;
CursY := CursY + 1;
end;
end;
End;