| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- (******************************************************************************)
- (* SAMPLE06.MOD *)
- (* *)
- (* Defining a Custom Display Bitmap *)
- (* Taken from SAMPLE06.PAS - Metagraphics Software Corporation (c) 1987-1989 *)
- (* *)
- (* PSW 11/01/90 08:18pm *)
- (******************************************************************************)
- MODULE Sample06;
- (*
- * Graphix
- * Release 3.7
- * (c) Copyright 1986-1992 PMI
- * Green Bay, Wisconsin
- * (414) 468-6040
- * All rights reserved
- *
- *)
- IMPORT GrQry;
- IMPORT GrConst;
- IMPORT GrPorts;
- IMPORT Meta;
- IMPORT IO;
- FROM GrPorts IMPORT bitmap, rowTblPtr, adsBMap;
- FROM Storage IMPORT ALLOCATE, DEALLOCATE, Available;
- VAR
- GrafixCard,
- CommPort,
- i: INTEGER;
- myBitmap: GrPorts.bitmap;
- addrBMap: GrPorts.adsBMap;
- rowTbl: rowTblPtr;
- GotKey: BOOLEAN;
- BEGIN
- (* init the system *)
- GrQry.GrInit(GrafixCard, CommPort);
- i := Meta.InitGrafix(-GrafixCard);
- IF (i # 0) THEN
- (* Display reason for no go *)
- GrQry.GrInitErr(GrafixCard, CommPort, i);
- END;
- myBitmap.devClass := 24; (* Initialize bitmap data fields *)
- myBitmap.devType := 0;
- myBitmap.rowBytes := 90; (*= 720/8*)
- myBitmap.pixWidth := 720;
- myBitmap.pixHeight := 348;
- myBitmap.pixResX := 90;
- myBitmap.pixResY := 64;
- myBitmap.pixBits := 1;
- myBitmap.pixPlanes := 1;
- IF NOT(Available(384*4)) THEN
- GrQry.GrQuit('Insufficient memory.', 1)
- END;
- ALLOCATE(ADDRESS(rowTbl), 384*4);
- myBitmap.mapTable[0] := rowTbl;
- rowTbl^.rowTable[0] := ADDRESS(0B0000000H); (* Initialize 1st entry *)
- addrBMap := ADR(myBitmap);
- Meta.InitRowTable(addrBMap, 4, 0000, 2000H);
- Meta.PortBitmap(addrBMap); (* Assign bitmap to the current port *)
- Meta.CursorBitmap(addrBMap); (* Track the cursor on this bitmap. *)
- REPEAT
- GotKey := IO.KeyPressed();
- UNTIL GotKey;
- GrQry.GrQuit('', 0);
- END Sample06.
|