SAMPLE06.MOD 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. (******************************************************************************)
  2. (* SAMPLE06.MOD *)
  3. (* *)
  4. (* Defining a Custom Display Bitmap *)
  5. (* Taken from SAMPLE06.PAS - Metagraphics Software Corporation (c) 1987-1989 *)
  6. (* *)
  7. (* PSW 11/01/90 08:18pm *)
  8. (******************************************************************************)
  9. MODULE Sample06;
  10. (*
  11. * Graphix
  12. * Release 3.7
  13. * (c) Copyright 1986-1992 PMI
  14. * Green Bay, Wisconsin
  15. * (414) 468-6040
  16. * All rights reserved
  17. *
  18. *)
  19. IMPORT GrQry;
  20. IMPORT GrConst;
  21. IMPORT GrPorts;
  22. IMPORT Meta;
  23. IMPORT IO;
  24. FROM GrPorts IMPORT bitmap, rowTblPtr, adsBMap;
  25. FROM Storage IMPORT ALLOCATE, DEALLOCATE, Available;
  26. VAR
  27. GrafixCard,
  28. CommPort,
  29. i: INTEGER;
  30. myBitmap: GrPorts.bitmap;
  31. addrBMap: GrPorts.adsBMap;
  32. rowTbl: rowTblPtr;
  33. GotKey: BOOLEAN;
  34. BEGIN
  35. (* init the system *)
  36. GrQry.GrInit(GrafixCard, CommPort);
  37. i := Meta.InitGrafix(-GrafixCard);
  38. IF (i # 0) THEN
  39. (* Display reason for no go *)
  40. GrQry.GrInitErr(GrafixCard, CommPort, i);
  41. END;
  42. myBitmap.devClass := 24; (* Initialize bitmap data fields *)
  43. myBitmap.devType := 0;
  44. myBitmap.rowBytes := 90; (*= 720/8*)
  45. myBitmap.pixWidth := 720;
  46. myBitmap.pixHeight := 348;
  47. myBitmap.pixResX := 90;
  48. myBitmap.pixResY := 64;
  49. myBitmap.pixBits := 1;
  50. myBitmap.pixPlanes := 1;
  51. IF NOT(Available(384*4)) THEN
  52. GrQry.GrQuit('Insufficient memory.', 1)
  53. END;
  54. ALLOCATE(ADDRESS(rowTbl), 384*4);
  55. myBitmap.mapTable[0] := rowTbl;
  56. rowTbl^.rowTable[0] := ADDRESS(0B0000000H); (* Initialize 1st entry *)
  57. addrBMap := ADR(myBitmap);
  58. Meta.InitRowTable(addrBMap, 4, 0000, 2000H);
  59. Meta.PortBitmap(addrBMap); (* Assign bitmap to the current port *)
  60. Meta.CursorBitmap(addrBMap); (* Track the cursor on this bitmap. *)
  61. REPEAT
  62. GotKey := IO.KeyPressed();
  63. UNTIL GotKey;
  64. GrQry.GrQuit('', 0);
  65. END Sample06.