home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d158
/
memboardtest.lha
/
MemBoardTest
/
mdraw.mod
< prev
next >
Wrap
Text File
|
1988-10-02
|
4KB
|
137 lines
IMPLEMENTATION MODULE mdraw;
FROM SYSTEM IMPORT ADDRESS;
FROM myscreen IMPORT RP;
FROM Pens IMPORT SetAPen, SetDrMd, RectFill,Move;
FROM Text IMPORT Text;
FROM GraphicsLibrary IMPORT DrawingModes,DrawingModeSet,Jam1;
FROM Strings IMPORT String;
PROCEDURE initmatrix;
VAR i:CARDINAL;
tx: String;
testadr : LONGCARD;
BEGIN
SetAPen(RP,4);
testadr := 0;
WHILE testadr < 1000000H DO
drawpixel(ADDRESS(testadr),4);
INC(testadr,10000H);
END; (* while *)
FOR i:=0 TO 9 DO
tx[0]:=CHR(i + ORD('0'));
Move(RP,310,65+i*15);
Text(RP,tx,1);
END; (* for *)
FOR i:=0 TO 5 DO
tx[0]:=CHR(i + ORD('A'));
Move(RP,310,215+i*15);
Text(RP,tx,1);
END; (* for *)
FOR i:=0 TO 9 DO
tx[0]:=CHR(i + ORD('0'));
Move(RP,330+i*20,45);
Text(RP,tx,1);
END; (* for *)
FOR i:=0 TO 5 DO
tx[0]:=CHR(i + ORD('A'));
Move(RP,530+i*20,45);
Text(RP,tx,1);
END; (* for *)
SetAPen(RP,1);
END initmatrix;
PROCEDURE drawpixel(adr:ADDRESS; colour:CARDINAL);
VAR ex,wy:CARDINAL;
BEGIN
ex:=CARDINAL(adr DIV 1048576);
wy:=CARDINAL((adr MOD 1048576) DIV 65536);
SetAPen(RP,colour);
SetDrMd(RP,DrawingModeSet(Complement));
RectFill(RP,330+ex*20,60+wy*15,330+ex*20+5,60+wy*15+5);
END drawpixel;
PROCEDURE drawbar(xstart,ystart,length : CARDINAL);
BEGIN
RectFill(RP,xstart,ystart-length,xstart+5,ystart);
END drawbar;
PROCEDURE drawstats;
VAR j : CARDINAL;
tx : String;
adrmaximum,datamaximum : LONGCARD;
BEGIN
SetAPen(RP,0);
RectFill(RP,0,300,639,399);
adrmaximum:=0;
FOR j:= 0 TO 23 DO
IF LONGCARD(addressbits[j]) > adrmaximum THEN
adrmaximum := LONGCARD(addressbits[j]);
END; (* if *)
END; (* for *)
datamaximum:=0;
FOR j:= 0 TO 15 DO
IF LONGCARD(databits[j]) > datamaximum THEN
datamaximum := LONGCARD(databits[j]);
END; (* if *)
END; (* for *)
tx[1]:=CHR(0);
SetAPen(RP,6);
FOR j:= 0 TO 23 DO
IF addressbits[j] > 0 THEN
drawbar(50+j*10,380,CARDINAL(TRUNC(FLOAT(addressbits[j]) * 80.0
/ FLOAT(adrmaximum))));
END; (* if *)
Move(RP,50+j*10,399);
tx[0]:=CHR((j MOD 10) + ORD('0'));
Text(RP,tx,1);
Move(RP,50+j*10,390);
tx[0]:=CHR((j DIV 10) + ORD('0'));
Text(RP,tx,1);
END; (* for *)
SetAPen(RP,6);
FOR j:= 0 TO 15 DO
IF databits[j] > 0 THEN
drawbar(350+j*10,380,CARDINAL(TRUNC(FLOAT(databits[j]) * 80.0
/ FLOAT(datamaximum))));
END; (* if *)
Move(RP,350+j*10,399);
tx[0]:=CHR((j MOD 10) + ORD('0'));
Text(RP,tx,1);
Move(RP,350+j*10,390);
tx[0]:=CHR((j DIV 10) + ORD('0'));
Text(RP,tx,1);
END; (* for *)
SetAPen(RP,2);
SetDrMd(RP,Jam1);
Move(RP,100,340);
tx:='BAD ADDRESS BITS';
Text(RP,tx,16);
Move(RP,370,340);
tx:='BAD DATA BITS';
Text(RP,tx,13);
SetDrMd(RP,DrawingModeSet(Complement));
END drawstats;
END mdraw.