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
/
HIRES3.DOC
< prev
next >
Wrap
Text File
|
1979-12-31
|
6KB
|
238 lines
TURBO HIRES2
By Simon Carter
Wσ wil∞ concentratσ oε graphiπ `toolsº no≈ tha⌠ wσ havσ basiπ function≤ ou⌠ ì
oµ thσ way« Thσ firs⌠ i≤ Text.
TEXT procedure
Wheε ß RO═ characte≥ i≤ encountereΣ iε othe≥ graphic≤ routines¼ it≤ ádatß ì
i≤ ácopieΣ int∩ PC╟ RA═ anΣ theε plotteΣ through« Thσ Tex⌠ procedurσ áwil∞ ì
masδ RO═ character≤ ont∩ thσ screeε a≤ thougΦ the∙ haΣ beeε plotteΣ áthere¼ ì
s∩ átha⌠ thσ plo⌠ routinσ doe≤ no⌠ havσ t∩ checδ fo≥ them« T∩ cal∞ i⌠ áusσ ì
thσ followinτ statemen⌠ ║
Text(CursX, ( in [1..64] )
CursY, ( in [1..16] )
Writing, ( a string of any length )
F); ( in [ResDot, SetDot, InvDot] )
eg Text(23,8,'Hopefully centered!',SetDot);
N┬ Thσ routinσ use≤ ß 1╢ bytσ storagσ areß a⌠ 300░ hex¼ thi≤ ma∙ havσ t∩ bσ ì
changeΣ t∩ sui⌠ you≥ needs.
Procedure Text(CursX,CursY : Byte; Writing : Script; F : Operation);
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;
POINT function
Thσ áPoin⌠ functioε return≤ 25╡ iµ onσ o≥ eithe≥ c∩-ordinate≤ arσ ou⌠ áoµ ì
range¼ áß ▒ iµ thσ pixe∞ i≤ se⌠ anΣ ß ░ iµ i⌠ i≤ not« T∩ cal∞ i⌠ áusσ áthσ ì
followinτ statemen⌠ :
Variable := Point(12, ( in [0..511] )
45); ( in [0..255] )
Function Point(X, Y : Integer) : Byte;
var
PCG : Byte;
Begin
If not((X>=0) and (X<512) and (Y>=0) and (Y<256)) then Point := 255
else
begin
PCG := Mem[$F3C0 + X Div 8 - (Y Div 16) * 64];
Port[28] := 135 - (Y Div 32);
if Odd(Mem[PCG * 16 + $F00F - (Y Mod 16)] Shr (7 - X Mod 8)) then
Point := 1
else
Point := 0;
Port[28] := 128
end
End;
CIRCLE procedure
Thi≤ áprocedurσ produce≤ aε elipsσ centereΣ a⌠ XCentre,YCentrσ oµ áradiu≤ ì
XRadius,YRadius« T∩ producσ ß circle¼ multipl∙ thσ ╪ valuσ b∙ 1.6
Procedure Circle(XCentre,YCentre,XRadius,YRadius : Integer;
F : Operation);
èvar
X, Y, A, B : Integer;
H : Byte;
Rotate : Real;
Begin
for H := 0 to 40 do
begin
Rotate := 0.15707962 * H;
X := XCentre + Round(XRadius*Cos(Rotate));
Y := YCentre + Round(YRadius*Sin(Rotate));
if H = 0 then begin A := X; B := Y; end;
Plot(A,B,X,Y,F);
A := X; B := Y;
end;
End;
ARC procedure
WitΦ thi≤ procedurσ yo⌡ caε plo⌠ Arc≤ centereΣ a⌠ XCentre¼ YCentrσ witΦ ß ì
radiu≤ oµ XRadius,YRadius¼ froφ anglσ Star⌠ t∩ anglσ Finish¼ wherσ
90 degrees
^
180 degrees <--|--> 0 degrees
V
270 degrees
Arc≤ startinτ a⌠ 27░ througΦ 9░ wil∞ bσ plotteΣ froφ 270..36░ anΣ theε froφ ì
0..9░ NO╘ froφ 270..180..9░ iσ al∞ arc≤ arσ plotteΣ anticlockwise«
Procedure Arc(XCentre,YCentre,XRadius,YRadius,Start,Finish : Integer;
F : Operation);
Procedure PlotArc(XCentre,YCentre,XRadius,YRadius,Start,Finish : Integer;
F : Operation);
const
Radians = 57.295779;
var
X, Y, XStore, YStore : Integer;
Loop : Real;
Begin
Loop := Start / Radians;
While Loop <= Finish / Radians do
begin
X := Round(XRadius * Cos(Loop)) + XCentre;
Y := Round(YRadius * Sin(Loop)) + YCentre;
if Loop = Start / Radians then begin XStore := X; YStore := Y; end;
Plot(XStore,YStore,X,Y,F);
XStore := X; YStore := Y;
Loop := Loop + 0.15707962;
end;
End;
Beginè if Start > Finish then
begin
PlotArc(XCentre,YCentre,XRadius,YRadius,Start,360,F);
Start := 0;
end;
PlotArc(XCentre,YCentre,XRadius,YRadius,Start,Finish,F);
End;
That'≤ áal∞ áfo≥ áthi≤ ámonth« á Nex⌠ átime¼ áscreensave¼ áloaΣ áanΣ áádum≡ ì
procedures¼ a≤ wel∞ a≤ aε experimenta∞ Fil∞ routine.
No time to type them in?
Send $5, a stamped, self - addressed envelope and 5.25" disk to
Simon Carter,
14 Canterbury Rd,
Heathmont, 3135.
anΣ ╔ wil∞ fil∞ you≥ disδ witΦ Hires▓ routine≤ anΣ anythinτ elsσ tha⌠ come≤ ì
t∩ mind....
è 90 degrees
^
180 degrees <--|--> 0 degrees
V
270 degrees