home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug072.arc
/
SETRES.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1979-12-31
|
2KB
|
92 lines
{
Microbeσ Graphic≤ Technology
Par⌠ 3║ Savinτ Graphic≤ File≤
anΣ Poin⌠ Plotting.
POIN╘ PLOTTIN╟ ALGORITH═ TES╘
Fo≥ MBU╟ Australiß Inc..
╨ ╧ Bo° 157,
Nunawaddinτ 3131.
}
const
Scr64by16 : array[0..15] of byte =
($6B,$40,$51,$37,$12,$09,$10,$12,$48,$0F,$2F,$0F,0,0,0,0);
Scr80by24 : array[0..15] of byte =
($6B,$50,$58,$37,$1B,$05,$18,$1A,$48,$0A,$2A,$0A,$20,0,0,0);
var
xpos, ypos : integer;
procedure Set64by16; {Set up 6454 for 64*16 screen}
var
i : integer;
begin
for i := 0 to 15 do
begin
port[$0c] := i;
port[$0d] := Scr64by16[i];
end;
end;
procedure point_plot ( x,y : integer);
var
byteadr : integer;
mask : byte;
begin
byteadr := $F800 + (x div 8)*16 + (y mod 16);
if ((y mod 32) - 15) > 0 then byteadr := byteadr+$400;
mask := 1 shl (7 - (x mod 8));
port[$1C] := (y div 32) + $80;
mem[byteadr] := mem[byteadr] or mask;
end;
procedure FillAttribute;
var
x,y : integer;
begin
port[$1C] := $90; {Latch Attribute Ram}
for y := 0 to 7 do
for x := 0 to 127 do
mem[$f000+x+y*128] := y;
end;
procedure ColScreen;
var
y : integer;
begin
port[8] := $40;
for y := 0 to $3FF doè mem[$F800+y] := 14;
port[8] := $00;
end;
procedure FillScreen;
var
x,y : integer;
begin
port[$1c] := $80; {Latch Screen Ram}
for y := 0 to 7 do
for x := 0 to 127 do
mem[$f000+x+(y*128)] := x+$80;
end;
procedure blankmem;
var x,y : integer;
begin
for y := 0 to 7 do begin
port[$1c] := $80 + y;
for x := 0 to $7FF do mem[$F800+x] := $00;
end;
end;
begiε √ maiε prograφ }
set64by16; fillscreen; colscreen; fillattribute;
blankmem;
for xpos := 0 to 511 do
for ypos := 0 to 255 do
point_plot(xpos,ypos);
end.