home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / OB3.2D3.DMS / in.adf / Interfaces / Graphics.mod < prev    next >
Encoding:
Text File  |  1993-12-10  |  104.3 KB  |  2,481 lines

  1. (*-------------------------------------------------------------------------*)
  2. (*                                                                         *)
  3. (*  Amiga Oberon Interface Module:                    Date: 21-May-93      *)
  4. (*                                                                         *)
  5. (*   © 1992 by Fridtjof Siebert                                            *)
  6. (*   updated for V39 by hartmut Goebel                                     *)
  7. (*                                                                         *)
  8. (*-------------------------------------------------------------------------*)
  9.  
  10. MODULE Graphics;
  11.  
  12. IMPORT e * := Exec,
  13.        u * := Utility,
  14.        h * := Hardware,
  15.        SYSTEM *;
  16.  
  17. TYPE
  18.   RectanglePtr            * = UNTRACED POINTER TO Rectangle;
  19.   Rect32Ptr               * = UNTRACED POINTER TO Rect32;
  20.   PointPtr                * = UNTRACED POINTER TO Point;
  21.   BitMapPtr               * = UNTRACED POINTER TO BitMap;
  22.   LayerPtr                * = UNTRACED POINTER TO Layer;
  23.   ClipRectPtr             * = UNTRACED POINTER TO ClipRect;
  24.   CopInsPtr               * = UNTRACED POINTER TO CopIns;
  25.   CopInsCLPtr             * = UNTRACED POINTER TO CopInsCL;
  26.   CprlistPtr              * = UNTRACED POINTER TO Cprlist;
  27.   CopListPtr              * = UNTRACED POINTER TO CopList;
  28.   UCopListPtr             * = UNTRACED POINTER TO UCopList;
  29.   CopinitPtr              * = UNTRACED POINTER TO Copinit;
  30.   ExtendedNodePtr         * = UNTRACED POINTER TO ExtendedNode;
  31.   MonitorSpecPtr          * = UNTRACED POINTER TO MonitorSpec;
  32.   AnalogSignalIntervalPtr * = UNTRACED POINTER TO AnalogSignalInterval;
  33.   SpecialMonitorPtr       * = UNTRACED POINTER TO SpecialMonitor;
  34.   QueryHeaderPtr          * = UNTRACED POINTER TO QueryHeader;
  35.   DisplayInfoPtr          * = UNTRACED POINTER TO DisplayInfo;
  36.   DimensionInfoPtr        * = UNTRACED POINTER TO DimensionInfo;
  37.   MonitorInfoPtr          * = UNTRACED POINTER TO MonitorInfo;
  38.   NameInfoPtr             * = UNTRACED POINTER TO NameInfo;
  39.   VSpritePtr              * = UNTRACED POINTER TO VSprite;
  40.   BobPtr                  * = UNTRACED POINTER TO Bob;
  41.   AnimCompPtr             * = UNTRACED POINTER TO AnimComp;
  42.   AnimObPtr               * = UNTRACED POINTER TO AnimOb;
  43.   DBufPacketPtr           * = UNTRACED POINTER TO DBufPacket;
  44.   CollTablePtr            * = UNTRACED POINTER TO CollTable;
  45.   IsrvstrPtr              * = UNTRACED POINTER TO Isrvstr;
  46.   LayerInfoPtr            * = UNTRACED POINTER TO LayerInfo;
  47.   AreaInfoPtr             * = UNTRACED POINTER TO AreaInfo;
  48.   TmpRasPtr               * = UNTRACED POINTER TO TmpRas;
  49.   GelsInfoPtr             * = UNTRACED POINTER TO GelsInfo;
  50.   RastPortPtr             * = UNTRACED POINTER TO RastPort;
  51.   RegionRectanglePtr      * = UNTRACED POINTER TO RegionRectangle;
  52.   RegionPtr               * = UNTRACED POINTER TO Region;
  53.   BitScaleArgsPtr         * = UNTRACED POINTER TO BitScaleArgs;
  54.   SimpleSpritePtr         * = UNTRACED POINTER TO SimpleSprite;
  55.   TextAttrPtr             * = UNTRACED POINTER TO TextAttr;
  56.   TTextAttrPtr            * = UNTRACED POINTER TO TTextAttr;
  57.   TextFontPtr             * = UNTRACED POINTER TO TextFont;
  58.   TextFontExtensionPtr    * = UNTRACED POINTER TO TextFontExtension;
  59.   ColorFontColorsPtr      * = UNTRACED POINTER TO ColorFontColors;
  60.   ColorTextFontPtr        * = UNTRACED POINTER TO ColorTextFont;
  61.   TextextentPtr           * = UNTRACED POINTER TO Textextent;
  62.   ViewPortPtr             * = UNTRACED POINTER TO ViewPort;
  63.   ViewPtr                 * = UNTRACED POINTER TO View;
  64.   ViewExtraPtr            * = UNTRACED POINTER TO ViewExtra;
  65.   ViewPortExtraPtr        * = UNTRACED POINTER TO ViewPortExtra;
  66.   RasInfoPtr              * = UNTRACED POINTER TO RasInfo;
  67.   ColorMapPtr             * = UNTRACED POINTER TO ColorMap;
  68.   GfxBasePtr              * = UNTRACED POINTER TO GfxBase;
  69.   VecInfoPtr              * = UNTRACED POINTER TO VecInfo;
  70.   ExtSpritePtr            * = UNTRACED POINTER TO ExtSprite;
  71.   PaletteExtraPtr         * = UNTRACED POINTER TO PaletteExtra;
  72.   DBufInfoPtr             * = UNTRACED POINTER TO DBufInfo;
  73.  
  74.   Rectangle * = STRUCT
  75.     minX*, minY* : INTEGER;
  76.     maxX*, maxY* : INTEGER;
  77.   END;
  78.  
  79.   Rect32 * = STRUCT
  80.     minX*, minY* : LONGINT;
  81.     maxX*, maxY* : LONGINT;
  82.   END;
  83.  
  84.   Point * = STRUCT
  85.     x*,y*: INTEGER;
  86.   END;
  87.  
  88.   PLANEPTR * = e.APTR;
  89.  
  90.   BitMap * = STRUCT
  91.     bytesPerRow * : INTEGER;
  92.     rows        * : INTEGER;
  93.     flags       * : e.BYTE;
  94.     depth       * : SHORTINT;
  95.     pad         * : INTEGER;
  96.     planes      * : ARRAY 8 OF PLANEPTR;
  97.   END;
  98.  
  99. CONST
  100. (* flags for AllocBitMap, etc. *)
  101.   bmbClear       * = 0;
  102.   bmbDisplayable * = 1;
  103.   bmbInterleaved * = 2;
  104.   bmbStandard    * = 3;
  105.   bmbMinplanes   * = 4;
  106.  
  107. (* the following are for GetBitMapAttr() *)
  108.   bmaHeight * = 0;
  109.   bmaDepth  * = 4;
  110.   bmaWidth  * = 8;
  111.   bmaFlags  * = 12;
  112.  
  113. TYPE
  114.   Layer * = STRUCT
  115.     front*, back* : LayerPtr;
  116.     clipRect * : ClipRectPtr;           (* read by roms to find first cliprect *)
  117.     rp * : RastPortPtr;
  118.     bounds * : Rectangle;
  119.     reserved * : ARRAY 4 OF e.BYTE;
  120.     priority * : INTEGER;               (* system use only *)
  121.     flags * : SET;                      (* obscured ?, Virtual BitMap? *)
  122.     superBitMap * : BitMapPtr;
  123.     superClipRect * : ClipRectPtr;      (* super bitmap cliprects if VBitMap != 0*)
  124.                                         (* else damage cliprect list for refresh *)
  125.     window * : e.APTR;                  (* reserved for user interface use *)
  126.     scrollX*,scrollY* : INTEGER;
  127.     cr*,cr2*,crnew * : ClipRectPtr;     (* used by dedice *)
  128.     superSaveClipRects * : ClipRectPtr; (* preallocated cr's *)
  129.     cliprects * : ClipRectPtr;          (* system use during refresh *)
  130.     layerInfo * : LayerInfoPtr;         (* points to head of the list *)
  131.     lock * : e.SignalSemaphore;
  132.     backFill * : u.HookPtr;
  133.     reserved1 * : LONGINT;
  134.     clipRegion * : RegionPtr;
  135.     saveClipRects * : RegionPtr;        (* used to back out when in trouble*)
  136.     width*,height* : INTEGER;           (* system use *)
  137.     reserved2 * : ARRAY 18 OF e.BYTE;
  138.     (* this must stay here *)
  139.     damageList * : RegionPtr;           (* list of rectangles to refresh through *)
  140.   END;
  141.  
  142.   ClipRect * = STRUCT
  143.     next * : ClipRectPtr;           (* roms used to find next ClipRect *)
  144.     prev * : ClipRectPtr;           (* ignored by roms, used by windowlib *)
  145.     lobs * : LayerPtr;              (* ignored by roms, used by windowlib *)
  146.     bitMap * : BitMapPtr;
  147.     bounds * : Rectangle;           (* set up by windowlib, used by roms *)
  148.     p1*,p2* : ClipRectPtr;          (* system reserved *)
  149.     reserved * : LONGINT;           (* system use *)
  150.     flags * : LONGSET;              (* only exists in layer allocation *)
  151.                                     (* MUST be multiple of 8 bytes to buffer *)
  152.   END;
  153.  
  154.  
  155. CONST
  156. (* internal cliprect flags *)
  157.   needsNoConcealedRasters * = 1;
  158.   needsNoLayerBlitDamage  * = 2;
  159.  
  160. (* defines for code values for getcode *)
  161.   isLessX * = 1;
  162.   isLessY * = 2;
  163.   isGrtrX * = 4;
  164.   isGrtrY * = 8;
  165.  
  166.  
  167. (* These bit descriptors are used by the GEL collide routines.
  168.  *  These bits are set in the hitMask and meMask variables of
  169.  *  a GEL to describe whether or not these types of collisions
  170.  *  can affect the GEL.  BNDRY_HIT is described further below;
  171.  *  this bit is permanently assigned as the boundary-hit flag.
  172.  *  The other bit GEL_HIT is meant only as a default to cover
  173.  *  any GEL hitting any other; the user may redefine this bit.
  174.  *)
  175.   borderHit * = 0;
  176.  
  177. (* These bit descriptors are used by the GEL boundry hit routines.
  178.  *  When the user's boundry-hit routine is called (via the argument
  179.  *  set by a call to SetCollision) the first argument passed to
  180.  *  the user's routine is the address of the GEL involved in the
  181.  *  boundry-hit, and the second argument has the appropriate bit(s)
  182.  *  set to describe which boundry was surpassed
  183.  *)
  184.   topHit    * = 1;
  185.   bottomHit * = 2;
  186.   leftHit   * = 4;
  187.   rightHit  * = 8;
  188.  
  189.  
  190. (* Copper: *)
  191.  
  192.   move  * = 0;     (* pseude opcode for move #XXXX,dir *)
  193.   wait  * = 1;     (* pseudo opcode for wait y,x *)
  194.   next  * = 2;     (* continue processing with next buffer *)
  195.   ntLof * = 15;    (* copper instruction only for short frames *)
  196.   ntSht * = 14;    (* copper instruction only for long frames *)
  197.   ntSys * = 13;    (* copper user instruction only *)
  198.  
  199. TYPE
  200.  
  201.   CopIns * = STRUCT
  202.     opCode * : INTEGER; (* 0 = move, 1 = wait *)
  203.     destAddr * : INTEGER; (* vertical beam wait OR
  204.                            * destination address of copper move *)
  205.     destData * : INTEGER; (* beam wait position OR
  206.                              * destination immediate data to send *)
  207.   END;
  208.  
  209.   CopInsCL * = STRUCT
  210.     opCode * : INTEGER; (* should be 2 = next *)
  211.     nxtList * : CopListPtr;
  212.   END;
  213.  
  214. (* structure of cprlist that points to list that hardware actually executes *)
  215.   Cprlist * = STRUCT
  216.     next * : CprlistPtr;
  217.     start * : e.APTR;       (* start of copper list *)
  218.     maxCount * : INTEGER;   (* number of long instructions *)
  219.   END;
  220.  
  221.   CopList * = STRUCT
  222.     next * : CopListPtr;  (* next block for this copper list *)
  223.     copList * : CopListPtr;  (* system use *)
  224.     viewPort * : ViewPortPtr;    (* system use *)
  225.     copIns * : CopInsPtr; (* start of this block *)
  226.     copPtr * : CopInsPtr; (* intermediate ptr *)
  227.     copLStart * : e.APTR; (* mrgcop fills this in for Long Frame*)
  228.     copSStart * : e.APTR; (* mrgcop fills this in for Short Frame*)
  229.     count * : INTEGER;          (* intermediate counter *)
  230.     maxCount * : INTEGER; (* max # of copins for this block *)
  231.     dyOffset * : INTEGER; (* offset this copper list vertical waits *)
  232.     cop2Start * : e.APTR;
  233.     cop3Start * : e.APTR;
  234.     cop4Start * : e.APTR;
  235.     cop5Start * : e.APTR;
  236.   END;
  237.  
  238.   UCopList * = STRUCT
  239.     next * : UCopListPtr;
  240.     firstCopList * : CopListPtr; (* head node of this copper list *)
  241.     copList * : CopListPtr;      (* node in use *)
  242.   END;
  243.  
  244. (* Private graphics data structure. This structure has changed in the past,
  245.  * and will continue to change in the future. Do Not Touch!
  246.  *)
  247.  
  248.   Copinit * = STRUCT
  249.     vsyncHblank * : ARRAY 2 OF INTEGER;
  250.     diagstart   * : ARRAY 12 OF INTEGER; (* copper list for first bitplane *)
  251.     fm0         * : ARRAY 2 OF INTEGER;
  252.     diwstart    * : ARRAY 10 OF INTEGER;
  253.     bplcon2     * : ARRAY 2 OF INTEGER;
  254.     sprfix      * : ARRAY (2*8) OF INTEGER;
  255.     sprstrtup   * : ARRAY (2*8*2) OF INTEGER;
  256.     wait14      * : ARRAY 2 OF INTEGER;
  257.     normHblank  * : ARRAY 2 OF INTEGER;
  258.     jump        * : ARRAY 2*2 OF INTEGER;
  259.     waitForever * : ARRAY 2 OF INTEGER;
  260.     sprstop     * : ARRAY 8 OF INTEGER;
  261.   END;
  262.  
  263. CONST
  264.  
  265. (* bplcon0 defines *)
  266.   mode640  * = 15;
  267.   plnCntMsk * = {0..2};    (* how many bit planes? *)
  268.                            (* 0 = none, 1->6 = 1->6, 7 = reserved *)
  269.   plnCntShft * = 12;       (* bits to shift for bplcon0 *)
  270.   pf2pri * = 6;            (* bplcon2 bit *)
  271.   colorOn * = 9;           (* disable color burst *)
  272.   dblpf * = 10;
  273.   holdnmodify * = 11;
  274.   interlace * = 2;         (* interlace mode for 400 *)
  275.  
  276. (* bplcon1 defines *)
  277.   fineScroll      * = {0..3};
  278.   fineScrollShift * = 4;
  279.   fineScrollMask  * = {0..3};
  280.  
  281. (* display window start and stop defines *)
  282.   horizPos * = {0..6};   (* horizontal start/stop *)
  283.   vrtclPos * = {0..8};   (* vertical start/stop *)
  284.   vrtclPosShift * = 7;
  285.  
  286. (* Data fetch start/stop horizontal position *)
  287.   dftchMask * = {0..7};
  288.  
  289. (* vposr bits *)
  290.   vposrlof  * = {15};
  291.  
  292.  
  293. TYPE
  294.  
  295.   ExtendedNode * = STRUCT (node * : e.Node)
  296.     subsystem * : SHORTINT;
  297.     subtype * : SHORTINT;
  298.     library * : LONGINT;
  299.     init * : e.PROC;
  300.   END;
  301.  
  302. CONST
  303.  
  304.   ssGraphics * = 2;
  305.  
  306.   viewExtraType       * = 1;
  307.   viewPortExtraType   * = 2;
  308.   specialMonitorType  * = 3;
  309.   monitorSpecType     * = 4;
  310.  
  311. TYPE
  312.  
  313.   MonitorSpec * = STRUCT (node * : ExtendedNode)
  314.     flags * : SET;
  315.     ratioh * : LONGINT;
  316.     ratiow * : LONGINT;
  317.     totalRows * : INTEGER;
  318.     totalColorclocks * : INTEGER;
  319.     deniseMaxDisplayColumn * : INTEGER;
  320.     beamCon0 * : INTEGER;
  321.     minRow * : INTEGER;
  322.     special * : SpecialMonitorPtr;
  323.     openCount * : INTEGER;
  324.     transform * : e.PROC;
  325.     translate * : e.PROC;
  326.     scale * : e.PROC;
  327.     xoffset * : INTEGER;
  328.     yoffset * : INTEGER;
  329.     legalView * : Rectangle;
  330.     maxoscan * : e.PROC;       (* maximum legal overscan *)
  331.     videoscan * : e.PROC;      (* video display overscan *)
  332.     deniseMinDisplayColumn * : INTEGER;
  333.     displayCompatible * : LONGINT;
  334.     displayInfoDataBase * : e.List;
  335.     displayInfoDataBaseSemaphore * : e.SignalSemaphore;
  336.     mrgCop   *: e.PROC;
  337.     loadView *: e.PROC;
  338.     killView *: e.PROC;
  339.   END;
  340.  
  341. CONST
  342.  
  343.   toMonitor       * = 0;
  344.   fromMonitor     * = 1;
  345.   standardXOffset * = 9;
  346.   standardYOffset * = 0;
  347.  
  348.   msbRequestNTSC     * = 0;
  349.   msbRequestPAL      * = 1;
  350.   msbRequestSpecial  * = 2;
  351.   msbRequestA2024    * = 3;
  352.   msbDoubleSprites   * = 4;
  353.  
  354. (* obsolete, v37 compatible definitions follow *)
  355.   requestNTSC     * = 1;  (* note: this are SET-values! [hG] *)
  356.   requestPAL      * = 2;
  357.   requestSpecial  * = 4;
  358.   requestA2024    * = 8;
  359.  
  360.   defaultMonitorName     * = "default.monitor";
  361.   ntscMonitorName        * = "ntsc.monitor";
  362.   palMonitorName         * = "pal.monitor";
  363.   standardMonitorMask    * = requestNTSC + requestPAL;
  364.  
  365.   standardNTSCRows       * = 262;
  366.   standardPALRows        * = 312;
  367.   standardColorClocks    * = 226;
  368.   standardDeniseMax      * = 455;
  369.   standardDeniseMin      * = 93;
  370.   standardNTSCBeamCon    * = {};
  371.   standardPALBeamCon     * = {h.displayPal};
  372.  
  373.   specialBeamCon * = {h.varVBlank,h.loLDis,h.varVSync,h.varHSync,h.varBeam,h.csBlank,h.vSyncTrue};
  374.  
  375.   minNTSCRow     * = 21;
  376.   minPALRow      * = 29;
  377.   standardViewX  * = 81H;
  378.   standardViewY  * = 2CH;
  379.   standardHBStrt * = 06H;
  380.   standardHSStrt * = 0BH;
  381.   standardHSStop * = 1CH;
  382.   standardHBStop * = 2CH;
  383.   standardVBStrt * = 0122H;
  384.   standardVSStrt * = 02A6H;
  385.   standardVSStop * = 03AAH;
  386.   standardVBStop * = 1066H;
  387.  
  388.   vgaColorClocks * = standardColorClocks DIV 2;
  389.   vgaTotalRows   * = standardNTSCRows * 2;
  390.   vgaDeniseMin   * = 59;
  391.   minvgaRow      * = 29;
  392.   vgaHBStrt      * = 08H;
  393.   vgaHSStrt      * = 0EH;
  394.   vgaHSStop      * = 1CH;
  395.   vgaHBStop      * = 1EH;
  396.   vgaVBStrt      * = 0000H;
  397.   vgaVSStrt      * = 0153H;
  398.   vgaVSStop      * = 0235H;
  399.   vgaVBStop      * = 0CCDH;
  400.  
  401.   vgaMonitorName         * = "vga.monitor";
  402.  
  403. (* NOTE: VGA70 definitions are obsolete - a VGA70 monitor has never been
  404.  * implemented.
  405.  *)
  406.   vga70ColorClocks * = standardColorClocks DIV 2;
  407.   vga70TotalRows  * = 449;
  408.   vga70DeniseMin  * = 59;
  409.   minvga70Row     * = 35;
  410.   vga70HBStrt     * = 08H;
  411.   vga70HSStrt     * = 0EH;
  412.   vga70HSStop     * = 1CH;
  413.   vga70HBStop     * = 1EH;
  414.   vga70VBStrt     * = 0000H;
  415.   vga70VSStrt     * = 02A6H;
  416.   vga70VSStop     * = 0388H;
  417.   vga70VBStop     * = 0F73H;
  418.  
  419.   vga70BeamCon            * = specialBeamCon / {h.vSyncTrue};
  420.   vga70MonitorName        * = "vga70.monitor";
  421.  
  422.   broadcastHBStrt        * = 01H;
  423.   broadcastHSStrt        * = 06H;
  424.   broadcastHSStop        * = 17H;
  425.   broadcastHBStop        * = 27H;
  426.   broadcastVBStrt        * = 0000H;
  427.   broadcastVSStrt        * = 02A6H;
  428.   broadcastVSStop        * = 054CH;
  429.   broadcastVBStop        * = 1C40H;
  430.   broadcastBeamCon       * = {h.loLDis,h.csBlank};
  431.   ratioFixedPart  * = 4;
  432.   rationUnity     * = ASH(1,ratioFixedPart);
  433.  
  434. TYPE
  435.  
  436.   AnalogSignalInterval * = STRUCT
  437.     start * : INTEGER;
  438.     stop * : INTEGER;
  439.   END;
  440.  
  441.   SpecialMonitor * = STRUCT (node * : ExtendedNode)
  442.     flags * : SET;
  443.     doMonitor * : e.PROC;
  444.     reserved1 * : e.PROC;
  445.     reserved2 * : e.PROC;
  446.     reserved3 * : e.PROC;
  447.     hblank * : AnalogSignalInterval;
  448.     vblank * : AnalogSignalInterval;
  449.     hsync * : AnalogSignalInterval;
  450.     vsync * : AnalogSignalInterval;
  451.   END;
  452.  
  453.  
  454. (* the "public" handle to a DisplayInfoRecord *)
  455.  
  456.   DisplayInfoHandle * = e.APTR;
  457.  
  458. CONST
  459.  
  460. (* datachunk type identifiers *)
  461.  
  462.   dtagDisp  * = 80000000H;
  463.   dtagDims  * = 80001000H;
  464.   dtagMntr  * = 80002000H;
  465.   dtagName  * = 80003000H;
  466.   dtagVec   * = 80004000H;   (* internal use only *)
  467.  
  468. TYPE
  469.  
  470.   QueryHeader * = STRUCT
  471.     structID * : LONGINT;       (* datachunk type identifier *)
  472.     displayID * : LONGINT;      (* copy of display record key   *)
  473.     skipID * : LONGINT;         (* TAG_SKIP -- see tagitems.h *)
  474.     length * : LONGINT;         (* length of local data in double-longwords *)
  475.   END;
  476.  
  477.   DisplayInfo * = STRUCT (header * : QueryHeader)
  478.     notAvailable * : INTEGER;   (* if NULL available, else see defines *)
  479.     propertyFlags * : LONGSET;  (* Properties of this mode see defines *)
  480.     resolution * : Point;       (* ticks-per-pixel X/Y                 *)
  481.     pixelSpeed * : INTEGER;     (* aproximation in nanoseconds         *)
  482.     numStdSprites * : INTEGER;  (* number of standard amiga sprites    *)
  483.     paletteRange * : INTEGER;   (* OBSOLETE - use Red/Green/Blue bits instead *)
  484.     spriteResolution * : Point; (* std sprite ticks-per-pixel X/Y    *)
  485.     pad * : ARRAY 4 OF e.BYTE;
  486.     redBits  *: e.UBYTE;        (* number of Red bits this display supports (V39) *)
  487.     greenBits *: e.UBYTE;       (* number of Green bits this display supports (V39) *)
  488.     blueBits  *: e.UBYTE;       (* number of Blue bits this display supports (V39) *)
  489.     pad2 *: ARRAY 5 OF e.UBYTE; (* find some use for this. *)
  490.     reserved * : ARRAY 2 OF LONGINT;    (* terminator *)
  491.   END;
  492.  
  493. CONST
  494.  
  495. (* availability *)
  496.  
  497.   availNoChips        * = 0001H;
  498.   availNoMonitor      * = 0002H;
  499.   availNotWithGenlock * = 0004H;
  500.  
  501. (* mode properties *)
  502.  
  503.   isLace           * = 0;
  504.   isDualPF         * = 1;
  505.   isPF2pri         * = 2;
  506.   isHAM            * = 3;
  507.   isECS            * = 4;  (*      note: ECS modes (SHIRES, VGA, and **
  508.                            **      PRODUCTIVITY) do not support      **
  509.                            **      attached sprites.                 **
  510.                            *)
  511.   isAA             * = 16; (* AA modes - may only be available
  512.                            ** if machine has correct memory
  513.                            ** type to support required
  514.                            ** bandwidth - check availability.
  515.                            ** (V39)
  516.                            *)
  517.   isPAL            * = 5;
  518.   isSprites        * = 6;
  519.   isGenlock        * = 7;
  520.   isWB             * = 8;
  521.   isDraggable      * = 9;
  522.   isPanelled       * = 10;
  523.   isBeamSync       * = 11;
  524.   isExtraHalfBrite * = 12;
  525.  
  526. (* The following DIPF_IS_... flags are new for V39 *)
  527.   isSpritesAtt      * = 13; (* supports attached sprites *)
  528.   isSpritesChngRes  * = 14; (* supports variable sprite resolution *)
  529.   isSpritesBorder   * = 15; (* sprite can be displayed in the border *)
  530.   isScandbl         * = 17; (* scan doubled *)
  531.   isSpritesChngBase * = 18; (* can change the sprite base colour *)
  532.   isSpritesChngPri  * = 19; (* can change the sprite priority
  533.                             ** with respect to the playfield(s).
  534.                             *)
  535.   isDbuffer         * = 20; (* can support double buffering *)
  536.   isProgbeam        * = 21; (* is a programmed beam-sync mode *)
  537.   isForeign         * = 31; (* this mode is not native to the Amiga *)
  538.  
  539.  
  540. TYPE
  541.  
  542.   DimensionInfo * = STRUCT (header * : QueryHeader)
  543.     maxDepth * : INTEGER;             (* log2( max number of colors ) *)
  544.     minRasterWidth * : INTEGER;       (* minimum width in pixels      *)
  545.     minRasterHeight * : INTEGER;      (* minimum height in pixels     *)
  546.     maxRasterWidth * : INTEGER;       (* maximum width in pixels      *)
  547.     maxRasterHeight * : INTEGER;      (* maximum height in pixels     *)
  548.     nominal * : Rectangle;            (* "standard" dimensions        *)
  549.     maxOScan * : Rectangle;           (* fixed, hardware dependant    *)
  550.     videoOScan * : Rectangle;         (* fixed, hardware dependant    *)
  551.     txtOScan * : Rectangle;           (* editable via preferences     *)
  552.     stdOScan * : Rectangle;           (* editable via preferences     *)
  553.     pad * : ARRAY 14 OF e.BYTE;
  554.     reserved * : ARRAY 2 OF LONGINT;  (* terminator *)
  555.   END;
  556.  
  557.   MonitorInfo * = STRUCT (header * : QueryHeader)
  558.     mspc * : MonitorSpecPtr;          (* pointer to monitor specification  *)
  559.     viewPosition * : Point;           (* editable via preferences          *)
  560.     viewResolution * : Point;         (* standard monitor ticks-per-pixel  *)
  561.     viewPositionRange * : Rectangle;  (* fixed, hardware dependant *)
  562.     totalRows * : INTEGER;            (* display height in scanlines       *)
  563.     totalColorClocks * : INTEGER;     (* scanline width in 280 ns units    *)
  564.     minRow * : INTEGER;               (* absolute minimum active scanline  *)
  565.     compatibility * : INTEGER;        (* how this coexists with others     *)
  566.     pad * : ARRAY 36 OF e.BYTE;
  567.     reserved * : ARRAY 2 OF LONGINT;  (* terminator *)
  568.   END;
  569.  
  570. (******************************************************************************)
  571.  
  572. TYPE
  573. (* The following VecInfo structure is PRIVATE, for our use only
  574.  * Touch these, and burn! (V39)
  575.  *)
  576.   VecInfo * = STRUCT
  577.      header   *: QueryHeader;
  578.      vec      *: e.APTR;
  579.      data     *: e.APTR;
  580.      type     *: INTEGER;
  581.      pad      *: ARRAY 3 OF INTEGER;
  582.      reserved *: ARRAY 2 OF LONGINT;
  583.   END;
  584.  
  585. CONST
  586.  
  587. (* monitor compatibility *)
  588.  
  589.   mCompatMixed  * =  0;       (* can share display with other mCompatMixed *)
  590.   mCompatSelf   * =  1;       (* can share only within same monitor *)
  591.   mCompatNobody * = -1;       (* only one viewport at a time *)
  592.  
  593.   displayNameLen * = 32;
  594.  
  595. TYPE
  596.  
  597.   NameInfo * = STRUCT (header * : QueryHeader)
  598.     name * : ARRAY displayNameLen OF CHAR;
  599.     reserved * : ARRAY 2 OF LONGINT;          (* terminator *)
  600.   END;
  601.  
  602. CONST
  603.  
  604. (* DisplayInfoRecord identifiers *)
  605.  
  606.   invalidID * = -1;
  607.  
  608. (* normal identifiers *)
  609.  
  610.   monitorIDMask * = 0FFFF1000H;
  611.  
  612.   defaultMonitorID   * = 00000000H;
  613.   ntscMonitorID      * = 00011000H;
  614.   palMonitorID       * = 00021000H;
  615.  
  616. (* the following 22 composite keys are for Modes on the default Monitor
  617.  * ntsc & pal "flavors" of these particular keys may be made by or'ing
  618.  * the ntsc or pal MONITOR_ID with the desired MODE_KEY...
  619.  * For example, to specifically open a PAL HAM interlaced ViewPort
  620.  * (or intuition screen), you would use the modeid of
  621.  * (PAL_MONITOR_ID | HAMLACE_KEY)
  622.  *)
  623.  
  624.   loresKey                      * = 00000000H;
  625.   hiresKey                      * = 00008000H;
  626.   superKey                      * = 00008020H;
  627.   hamKey                        * = 00000800H;
  628.   loresLaceKey                  * = 00000004H;
  629.   hiresLaceKey                  * = 00008004H;
  630.   superLaceKey                  * = 00008024H;
  631.   hamLaceKey                    * = 00000804H;
  632.   loresDPFKey                   * = 00000400H;
  633.   hiresDPFKey                   * = 00008400H;
  634.   superDPFKey                   * = 00008420H;
  635.   loresLaceDPFKey               * = 00000404H;
  636.   hiresLaceDPFKey               * = 00008404H;
  637.   superLaceDPFKey               * = 00008424H;
  638.   loresDPF2Key                  * = 00000440H;
  639.   hiresDPF2Key                  * = 00008440H;
  640.   superDPF2Key                  * = 00008460H;
  641.   loresLaceDPF2Key              * = 00000444H;
  642.   hiresLaceDPF2Key              * = 00008444H;
  643.   superLaceDPF2Key              * = 00008464H;
  644.   extraHalfBriteKey             * = 00000080H;
  645.   extraHalfBriteLaceKey         * = 00000084H;
  646. (* New for AA ChipSet (V39) *)
  647.   hiresHAMKey                   * = 000008800H;
  648.   superHAMKey                   * = 000008820H;
  649.   hiresEHBKey                   * = 000008080H;
  650.   superEHBKey                   * = 0000080A0H;
  651.   hiresHAMLaceKey               * = 000008804H;
  652.   superHAMLaceKey               * = 000008824H;
  653.   hiresEHBLaceKey               * = 000008084H;
  654.   superEHBLaceKey               * = 0000080A4H;
  655.  
  656. (* VGA identifiers *)
  657.  
  658.   vgaMonitorID                  * = 00031000H;
  659.  
  660.   vgaExtraLoresKey              * = 00031004H;
  661.   vgaLoresKey                   * = 00039004H;
  662.   vgaProductKey                 * = 00039024H;
  663.   vgaHAMKey                     * = 00031804H;
  664.   vgaExtraLoresLaceKey          * = 00031005H;
  665.   vgaLoresLaceKey               * = 00039005H;
  666.   vgaProductLaceKey             * = 00039025H;
  667.   vgaHAMLaceKey                 * = 00031805H;
  668.   vgaExtraLoresDPFKey           * = 00031404H;
  669.   vgaLoresDPFKey                * = 00039404H;
  670.   vgaProductDPFKey              * = 00039424H;
  671.   vgaExtraLoresLaceDPFKey       * = 00031405H;
  672.   vgaLoresLaceDPFKey            * = 00039405H;
  673.   vgaProductLaceDPFKey          * = 00039425H;
  674.   vgaExtraLoresDPF2Key          * = 00031444H;
  675.   vgaLoresDPF2Key               * = 00039444H;
  676.   vgaProductDPF2Key             * = 00039464H;
  677.   vgaExtraLoresLaceDPF2Key      * = 00031445H;
  678.   vgaLoresLaceDPF2Key           * = 00039445H;
  679.   vgaProductLaceDPF2Key         * = 00039465H;
  680.   vgaExtraHalfBriteKey          * = 00031084H;
  681.   vgaExtraHalfBriteLaceKey      * = 00031085H;
  682. (* New for AA ChipSet (V39) *)
  683.   vgaProductHAMKey              * = 000039824H;
  684.   vgaLoresHAMKey                * = 000039804H;
  685.   vgaExtraLoresHAMKey           * = vgaHAMKey;
  686.   vgaProductHAMLaceKey          * = 000039825H;
  687.   vgaLoresHAMLaceKey            * = 000039805H;
  688.   vgaExtraLoresHAMLaceKey       * = vgaHAMLaceKey;
  689.   vgaExtraLoresEHBKey           * = vgaExtraHalfBriteKey;
  690.   vgaExtraLoresEHBLaceKey       * = vgaExtraHalfBriteLaceKey;
  691.   vgaLoresEHBKey                * = 000039084H;
  692.   vgaLoresEHBLaceKey            * = 000039085H;
  693.   vgaEHBKey                     * = 0000390A4H;
  694.   vgaEHBLaceKey                 * = 0000390A5H;
  695.  
  696. (* a2024 identifiers *)
  697.  
  698.   a2024MonitorID                * = 00041000H;
  699.  
  700.   a2024tenHertzKey              * = 00041000H;
  701.   a2024fifteenHertzKey          * = 00049000H;
  702.  
  703. (* prototype identifiers (private ) *)
  704.  
  705.   protoMonitorID                * = 00051000H;
  706.  
  707. (* These monitors and modes were added for the V38 release. *)
  708.  
  709.   euro72MonitorId               * = 000061000H;
  710.  
  711.   euro72ExtraLoresKey           * = 000061004H;
  712.   euro72LoresKey                * = 000069004H;
  713.   euro72ProductKey              * = 000069024H;
  714.   euro72HAMKey                  * = 000061804H;
  715.   euro72ExtraLoresLaceKey       * = 000061005H;
  716.   euro72LoresLaceKey            * = 000069005H;
  717.   euro72ProductLaceKey          * = 000069025H;
  718.   euro72HAMLaceKey              * = 000061805H;
  719.   euro72ExtraLoresDPFKey        * = 000061404H;
  720.   euro72LoresDPFKey             * = 000069404H;
  721.   euro72ProductDPFKey           * = 000069424H;
  722.   euro72ExtraLoresLaceDPFKey    * = 000061405H;
  723.   euro72LoresLaceDPFKey         * = 000069405H;
  724.   euro72ProductLaceDPFKey       * = 000069425H;
  725.   euro72ExtraLoresDPF2Key       * = 000061444H;
  726.   euro72LoresDPF2Key            * = 000069444H;
  727.   euro72ProductDPF2Key          * = 000069464H;
  728.   euro72ExtraLoresLaceDPF2Key   * = 000061445H;
  729.   euro72LoresLaceDPF2Key        * = 000069445H;
  730.   euro72ProductLaceDPF2Key      * = 000069465H;
  731.   euro72ExtraHalfBriteKey       * = 000061084H;
  732.   euro72ExtraHalfBriteLaceKey   * = 000061085H;
  733. (* New AA modes (V39) *)
  734.   euro72ProductHAMKey           * = 000069824H;
  735.   euro72ProductHAMLaceKey       * = 000069825H;
  736.   euro72LoresHAMKey             * = 000069804H;
  737.   euro72LoresHAMLaceKey         * = 000069805H;
  738.   euro72ExtraLoresHAMKey        * = euro72HAMKey;
  739.   euro72ExtraLoresHAMLaceKey    * = euro72HAMLaceKey;
  740.   euro72ExtraLoresEHBKey        * = euro72ExtraHalfBriteKey;
  741.   euro72ExtraLoresEHBLaceKey    * = euro72ExtraHalfBriteLaceKey;
  742.   euro72LoresEHBKey             * = 000069084H;
  743.   euro72LoresEHBLaceKey         * = 000069085H;
  744.   euro72EHBKey                  * = 0000690A4H;
  745.   euro72EHBLaceKey              * = 0000690A5H;
  746.  
  747.  
  748.   euro36MonitorId               * = 000071000H;
  749.  
  750.  
  751. (* Euro36 modeids can be ORed with the default modeids a la NTSC and PAL.
  752.  * For example, Euro36 SuperHires is
  753.  * (EURO36_MONITOR_ID | SUPER_KEY)
  754.  *)
  755.  
  756.   super72MonitorId              * = 000081000H;
  757.  
  758. (* Similarly for Super72 modes. *)
  759.  
  760.  
  761. (* These monitors and modes were added for the V39 release. *)
  762.  
  763.   dblNTSCMonitorId              * = 000091000H;
  764.  
  765.   dblNTSCLoresKey               * = 000091000H;
  766.   dblNTSCLoresffKey             * = 000091004H;
  767.   dblNTSCLoresHAMKey            * = 000091800H;
  768.   dblNTSCLoresHAMffKey          * = 000091804H;
  769.   dblNTSCLoresEHBKey            * = 000091080H;
  770.   dblNTSCLoresEHBffKey          * = 000091084H;
  771.   dblNTSCLoresLaceKey           * = 000091005H;
  772.   dblNTSCLoresHAMLaceKey        * = 000091805H;
  773.   dblNTSCLoresEHBLaceKey        * = 000091085H;
  774.   dblNTSCLoresDPFKey            * = 000091400H;
  775.   dblNTSCLoresDPFLaceKey        * = 000091404H;
  776.   dblNTSCLoresDPF2Key           * = 000091440H;
  777.   dblNTSCLoresDPF2LaceKey       * = 000091444H;
  778.   dblNTSCHiresKey               * = 000099000H;
  779.   dblNTSCHiresffKey             * = 000099004H;
  780.   dblNTSCHiresHAMKey            * = 000099800H;
  781.   dblNTSCHiresHAMffKey          * = 000099804H;
  782.   dblNTSCHiresLaceKey           * = 000099005H;
  783.   dblNTSCHiresHAMLaceKey        * = 000099805H;
  784.   dblNTSCHiresEHBKey            * = 000099080H;
  785.   dblNTSCHiresEHBffKey          * = 000099084H;
  786.   dblNTSCHiresEHBLaceKey        * = 000099085H;
  787.   dblNTSCHiresDPFKey            * = 000099400H;
  788.   dblNTSCHiresDPFLaceKey        * = 000099404H;
  789.   dblNTSCHiresDPF2Key           * = 000099440H;
  790.   dblNTSCHiresDPF2LaceKey       * = 000099444H;
  791.  
  792.   dblPALMonitorId               * = 0000A1000H;
  793.  
  794.   dblPALLoresKey                * = 0000A1000H;
  795.   dblPALLoresffKey              * = 0000A1004H;
  796.   dblPALLoresHAMKey             * = 0000A1800H;
  797.   dblPALLoresHAMffKey           * = 0000A1804H;
  798.   dblPALLoresEHBKey             * = 0000A1080H;
  799.   dblPALLoresEHBffKey           * = 0000A1084H;
  800.   dblPALLoresLaceKey            * = 0000A1005H;
  801.   dblPALLoresHAMLaceKey         * = 0000A1805H;
  802.   dblPALLoresEHBLaceKey         * = 0000A1085H;
  803.   dblPALLoresDPFKey             * = 0000A1400H;
  804.   dblPALLoresDPFLaceKey         * = 0000A1404H;
  805.   dblPALLoresDPF2Key            * = 0000A1440H;
  806.   dblPALLoresDPF2LaceKey        * = 0000A1444H;
  807.   dblPALHiresKey                * = 0000A9000H;
  808.   dblPALHiresffKey              * = 0000A9004H;
  809.   dblPALHiresHAMKey             * = 0000A9800H;
  810.   dblPALHiresHAMffKey           * = 0000A9804H;
  811.   dblPALHiresLaceKey            * = 0000A9005H;
  812.   dblPALHiresHAMLaceKey         * = 0000A9805H;
  813.   dblPALHiresEHBKey             * = 0000A9080H;
  814.   dblPALHiresEHBffKey           * = 0000A9084H;
  815.   dblPALHiresEHBLaceKey         * = 0000A9085H;
  816.   dblPALHiresDPFKey             * = 0000A9400H;
  817.   dblPALHiresDPFLaceKey         * = 0000A9404H;
  818.   dblPALHiresDPF2Key            * = 0000A9440H;
  819.   dblPALHiresDPF2LaceKey        * = 0000A9444H;
  820.  
  821.  
  822. (* Use these tags for passing to BestModeID() (V39) *)
  823.  
  824.   specialFlags * = LONGSET{isDualPF, isPF2pri, isHAM, isExtraHalfBrite};
  825.  
  826.   bidTagDipfMustHave            * = 080000001H;      (* mask of the DIPF_ flags the ModeID must have *)
  827.                                                      (* Default - NULL *)
  828.   bidTagDipfMustNotHave         * = 080000002H;      (* mask of the DIPF_ flags the ModeID must not have *)
  829.                                                      (* Default - SPECIAL_FLAGS *)
  830.   bidTagViewPort                * = 080000003H;      (* ViewPort for which a ModeID is sought. *)
  831.                                                      (* Default - NULL *)
  832.   bidTagNominalWidth            * = 080000004H;      (* \ together make the aspect ratio and *)
  833.   bidTagNominalHeight           * = 080000005H;      (* / override the vp->Width/Height. *)
  834.                                                      (* Default - SourceID NominalDimensionInfo,
  835.                                                       * or vp->DWidth/Height, or (640 * 200),
  836.                                                       * in that preferred order.
  837.                                                       *)
  838.   bidTagDesiredWidth            * = 080000006H;      (* \ Nominal Width and Height of the *)
  839.   bidTagDesiredHeight           * = 080000007H;      (* / returned ModeID. *)
  840.                                                      (* Default - same as Nominal *)
  841.   bidTagDepth                   * = 080000008H;      (* ModeID must support this depth. *)
  842.                                                      (* Default - vp->RasInfo->BitMap->Depth or 1 *)
  843.   bidTagMonitorID               * = 080000009H;      (* ModeID must use this monitor. *)
  844.                                                      (* Default - use best monitor available *)
  845.   bidTagSourceID                * = 08000000AH;      (* instead of a ViewPort. *)
  846.                                                      (* Default - VPModeID(vp) or HIRES_KEY *)
  847.   bidTagRedBits                 * = 08000000BH;      (* \                            *)
  848.   bidTagBlueBits                * = 08000000CH;      (* } Match up from the database *)
  849.   bidTagGreenBits               * = 08000000DH;      (* /                            *)
  850.                                                      (* Default - 4 *)
  851.  
  852.  
  853. (* VSprite flags *)
  854. (* user-set VSprite flags: *)
  855.   sUserFlags* = {0..7}; (* mask of all user-settable VSprite-flags *)
  856.   vsprite   * = 0;      (* set if VSprite, clear if Bob *)
  857.   saveBack  * = 1;      (* set if background is to be saved/restored *)
  858.   overlay   * = 2;      (* set to mask image of Bob onto background *)
  859.   mustDraw  * = 3;      (* set if VSprite absolutely must be drawn *)
  860. (* system-set VSprite flags: *)
  861.   backSaved * = 8;      (* this Bob's background has been saved *)
  862.   bobUpdate * = 9;      (* temporary flag, useless to outside world *)
  863.   gelGone   * = 10;     (* set if gel is completely clipped (offscreen) *)
  864.   vsOverflow* = 11;     (* VSprite overflow (if MUSTDRAW set we draw!) *)
  865.  
  866. (* Bob flags *)
  867. (* these are the user flag bits *)
  868.   bUserFlags * = {0..7};(* mask of all user-settable Bob-flags *)
  869.   saveBob     * = 0;    (* set to not erase Bob *)
  870.   bobIsComp   * = 1;    (* set to identify Bob as AnimComp *)
  871. (* these are the system flag bits *)
  872.   bWaiting    * = 8;    (* set while Bob is waiting on 'after' *)
  873.   bDrawn      * = 9;    (* set when Bob is drawn this DrawG pass*)
  874.   bobsAway    * = 10;   (* set to initiate removal of Bob *)
  875.   bobNix      * = 11;   (* set when Bob is completely removed *)
  876.   savePreserve * = 12;  (* for back-restore during double-buffer*)
  877.   outStep     * = 13;   (* for double-clearing if double-buffer *)
  878.  
  879. (* defines for the animation procedures *)
  880.   anfracsize  * = 6;
  881.   animhalf    * = 0020H;
  882.   ringTrigger * = 0001H;
  883.  
  884.  
  885. TYPE
  886.  
  887. (* UserStuff definitions
  888.  *  the user can define these to be a single variable or a sub-structure
  889.  *  if undefined by the user, the system turns these into innocuous variables
  890.  *  see the manual for a thorough definition of the UserStuff definitions
  891.  *
  892.  *)
  893.   VUserStuff * = INTEGER;
  894.  
  895.   BUserStuff * = INTEGER;
  896.  
  897.   AUserStuff * = INTEGER;
  898.  
  899.  
  900.  
  901. (*********************** GEL STRUCTURES ***********************************)
  902.  
  903.   VSprite * = STRUCT
  904.  
  905. (* --------------------- SYSTEM VARIABLES ------------------------------- *)
  906. (* GEL linked list forward/backward pointers sorted by y,x value *)
  907.     nextVSprite * : VSpritePtr;
  908.     prevVSprite * : VSpritePtr;
  909.  
  910. (* GEL draw list constructed in the order the Bobs are actually drawn, then
  911.  *  list is copied to clear list
  912.  *  must be here in VSprite for system boundary detection
  913.  *)
  914.     drawPath * : VSpritePtr;     (* pointer of overlay drawing *)
  915.     clearPath * : VSpritePtr;    (* pointer for overlay clearing *)
  916.  
  917. (* the VSprite positions are defined in (y,x) order to make sorting
  918.  *  sorting easier, since (y,x) as a long integer
  919.  *)
  920.     oldY * ,oldX * : INTEGER;       (* previous position *)
  921.  
  922. (* --------------------- COMMON VARIABLES --------------------------------- *)
  923.     flags * : SET;       (* VSprite flags *)
  924.  
  925.  
  926. (* --------------------- USER VARIABLES ----------------------------------- *)
  927. (* the VSprite positions are defined in (y,x) order to make sorting
  928.  *  sorting easier, since (y,x) as a long integer
  929.  *)
  930.     y * ,x * : INTEGER;                 (* screen position *)
  931.  
  932.     height * : INTEGER;
  933.     width * : INTEGER;       (* number of words per row of image data *)
  934.     depth * : INTEGER;       (* number of planes of data *)
  935.  
  936.     meMask * : SET;              (* which types can collide with this VSprite*)
  937.     hitMask * : SET;             (* which types this VSprite can collide with*)
  938.  
  939.     imageData * : e.APTR;          (* pointer to VSprite image *)
  940.  
  941. (* borderLine is the one-dimensional logical OR of all
  942.  *  the VSprite bits, used for fast collision detection of edge
  943.  *)
  944.     borderLine * : e.APTR;         (* logical OR of all VSprite bits *)
  945.     collMask * : e.APTR;           (* similar to above except this is a matrix *)
  946.  
  947. (* pointer to this VSprite's color definitions (not used by Bobs) *)
  948.     sprColors * : e.APTR;
  949.  
  950.     vsBob * : BobPtr;        (* points home if this VSprite is part of
  951.                                    a Bob *)
  952.  
  953. (* planePick flag:  set bit selects a plane from image, clear bit selects
  954.  *  use of shadow mask for that plane
  955.  * OnOff flag: if using shadow mask to fill plane, this bit (corresponding
  956.  *  to bit in planePick) describes whether to fill with 0's or 1's
  957.  * There are two uses for these flags:
  958.  *      - if this is the VSprite of a Bob, these flags describe how the Bob
  959.  *        is to be drawn into memory
  960.  *      - if this is a simple VSprite and the user intends on setting the
  961.  *        MUSTDRAW flag of the VSprite, these flags must be set too to describe
  962.  *        which color registers the user wants for the image
  963.  *)
  964.     planePick * : SHORTSET;
  965.     planeOnOff * : SHORTSET;
  966.  
  967.     vUserExt * : VUserStuff;      (* user definable:  see note above *)
  968.   END;
  969.  
  970.   Bob * = STRUCT
  971. (* blitter-objects *)
  972.  
  973. (* --------------------- SYSTEM VARIABLES --------------------------------- *)
  974.  
  975. (* --------------------- COMMON VARIABLES --------------------------------- *)
  976.     flags * : SET; (* general purpose flags (see definitions below) *)
  977.  
  978. (* --------------------- USER VARIABLES ----------------------------------- *)
  979.     saveBuffer * : e.APTR;   (* pointer to the buffer for background save *)
  980.  
  981. (* used by Bobs for "cookie-cutting" and multi-plane masking *)
  982.     imageShadow * : e.APTR;
  983.  
  984. (* pointer to BOBs for sequenced drawing of Bobs
  985.  *  for correct overlaying of multiple component animations
  986.  *)
  987.     before * : BobPtr; (* draw this Bob before Bob pointed to by before *)
  988.     after * : BobPtr;  (* draw this Bob after Bob pointed to by after *)
  989.  
  990.     bobVSprite * : VSpritePtr;   (* this Bob's VSprite definition *)
  991.  
  992.     bobComp * : AnimCompPtr;     (* pointer to this Bob's AnimComp def *)
  993.  
  994.     dBuffer * : DBufPacketPtr;   (* pointer to this Bob's dBuf packet *)
  995.  
  996.     bUserExt * : BUserStuff;            (* Bob user extension *)
  997.   END;
  998.  
  999.   AnimComp * = STRUCT
  1000.  
  1001. (* --------------------- SYSTEM VARIABLES --------------------------------- *)
  1002.  
  1003. (* --------------------- COMMON VARIABLES --------------------------------- *)
  1004.     flags * : SET;             (* AnimComp flags for system & user *)
  1005.  
  1006. (* timer defines how long to keep this component active:
  1007.  *  if set non-zero, timer decrements to zero then switches to nextSeq
  1008.  *  if set to zero, AnimComp never switches
  1009.  *)
  1010.     timer * : INTEGER;
  1011.  
  1012. (* --------------------- USER VARIABLES ----------------------------------- *)
  1013. (* initial value for timer when the AnimComp is activated by the system *)
  1014.     timeSet * : INTEGER;
  1015.  
  1016. (* pointer to next and previous components of animation object *)
  1017.     nextComp * : AnimCompPtr;
  1018.     prevComp * : AnimCompPtr;
  1019.  
  1020. (* pointer to component component definition of next image in sequence *)
  1021.     nextSeq * : AnimCompPtr;
  1022.     prevSeq * : AnimCompPtr;
  1023.  
  1024.     animCRoutine * : e.PROC; (* address of special animation procedure *)
  1025.  
  1026.     yTrans * : INTEGER;     (* initial y translation (if this is a component) *)
  1027.     xTrans * : INTEGER;     (* initial x translation (if this is a component) *)
  1028.  
  1029.     headOb * : AnimObPtr;
  1030.  
  1031.     animBob * : BobPtr;
  1032.   END;
  1033.  
  1034.   AnimOb * = STRUCT
  1035.  
  1036. (* --------------------- SYSTEM VARIABLES --------------------------------- *)
  1037.     nextOb * , prevOb * : AnimObPtr;
  1038.  
  1039. (* number of calls to Animate this AnimOb has endured *)
  1040.     clock * : LONGINT;
  1041.  
  1042.     anOldY * , anOldX * : INTEGER;            (* old y,x coordinates *)
  1043.  
  1044. (* --------------------- COMMON VARIABLES --------------------------------- *)
  1045.     anY * , anX * : INTEGER;                  (* y,x coordinates of the AnimOb *)
  1046.  
  1047. (* --------------------- USER VARIABLES ----------------------------------- *)
  1048.     yVel * , xVel * : INTEGER;                (* velocities of this object *)
  1049.     yAccel * , xAccel * : INTEGER;            (* accelerations of this object *)
  1050.  
  1051.     ringYTrans * , ringXTrans * : INTEGER;    (* ring translation values *)
  1052.  
  1053.     animoRoutine * : e.PROC;         (* address of special animation
  1054.                                        procedure *)
  1055.  
  1056.     headComp * : AnimCompPtr;      (* pointer to first component *)
  1057.  
  1058.     aUserExt * : AUserStuff;            (* AnimOb user extension *)
  1059.   END;
  1060.  
  1061. (* dBufPacket defines the values needed to be saved across buffer to buffer
  1062.  *  when in double-buffer mode
  1063.  *)
  1064.   DBufPacket * = STRUCT
  1065.     bufY * , bufX * : INTEGER;     (* save the other buffers screen coordinates *)
  1066.     bufPath * : VSpritePtr;        (* carry the draw path over the gap *)
  1067.  
  1068. (* these pointers must be filled in by the user *)
  1069. (* pointer to other buffer's background save buffer *)
  1070.     bufBuffer * : e.APTR;
  1071.   END;
  1072.  
  1073.  
  1074. CONST
  1075.  
  1076. (* ************************************************************************ *)
  1077.  
  1078.   b2Norm    * = 0;
  1079.   b2Swap    * = 1;
  1080.   b2Bobber  * = 2;
  1081.  
  1082. (* ************************************************************************ *)
  1083.  
  1084. TYPE
  1085.  
  1086. (* a structure to contain the 16 collision procedure addresses *)
  1087.   CollTable * = STRUCT
  1088.     collPtrs * : ARRAY 16 OF e.APTR;
  1089.   END;
  1090.  
  1091. (* structure used by AddTOFTask *)
  1092.   Isrvstr * = STRUCT (node * : e.Node)
  1093.     iptr * : IsrvstrPtr;   (* passed to srvr by os *)
  1094.     code * : e.PROC;
  1095.     ccode * : e.PROC;
  1096.     carg * : LONGINT;
  1097.   END;
  1098.  
  1099. CONST
  1100.  
  1101. (* Layers *)
  1102.  
  1103.   layerSimple        * =  0;
  1104.   layerSmart         * =  1;
  1105.   layerSuper         * =  2;
  1106.   layerUpdating      * =  4;
  1107.   layerBackdrop      * =  6;
  1108.   layerRefresh       * =  7;
  1109.   layerIRefresh      * =  9;
  1110.   layerIRefresh2     * = 10;
  1111.   layerClipRectsLost * =  8;     (* during BeginUpdate *)
  1112.                                  (* or during layerop *)
  1113.                                  (* this happens if out of memory *)
  1114.   lmnRegion * = -1;              (* removed in V39 includes *)
  1115.  
  1116. TYPE
  1117.  
  1118.   LayerInfo * = STRUCT
  1119.     layer * : LayerPtr;
  1120.     lp    * : LayerPtr;             (* !!PRIVATE!! *)
  1121.     obs   * : ClipRectPtr;
  1122.     freeClipRects * : ClipRectPtr;  (* !!PRIVATE!! *)
  1123.     privateReserve1 : LONGINT;      (* !!PRIVATE!! *)
  1124.     privateReserve2 : LONGINT;      (* !!PRIVATE!! *)
  1125.     lock * : e.SignalSemaphore;     (* !!PRIVATE!! *)
  1126.     head * : e.MinList;             (* !!PRIVATE!! *)
  1127.     privateReserve3 : INTEGER;      (* !!PRIVATE!! *)
  1128.     privateReserve4 : e.APTR;       (* !!PRIVATE!! *)
  1129.     flags * : SET;
  1130.     count * : SHORTINT;             (* !!PRIVATE!! *)
  1131.     lockLayersCount *: SHORTINT;    (* !!PRIVATE!! *)
  1132.     privateReserve5  : INTEGER;     (* !!PRIVATE!! *)
  1133.     blankHook * : e.APTR;           (* !!PRIVATE!! *)
  1134.     extra     * : e.APTR;           (* !!PRIVATE!! *)
  1135.   END;
  1136.  
  1137. CONST
  1138.   newLayerInfoCalled * = 1;
  1139.   alertLayersNoMem   * = 83010000H;  (* removed in V39 includes *)
  1140.  
  1141. (*
  1142.  * LAYERS_NOBACKFILL is the value needed to get no backfill hook
  1143.  * LAYERS_BACKFILL is the value needed to get the default backfill hook
  1144.  *)
  1145.   noBackFill * = SYSTEM.VAL(u.HookPtr,1);
  1146.   backFill   * = SYSTEM.VAL(u.HookPtr,0);
  1147.  
  1148. TYPE
  1149.  
  1150.   AreaInfo * = STRUCT
  1151.     vctrTbl * : e.APTR;              (* ptr to start of vector table *)
  1152.     vctrPtr * : e.APTR;              (* ptr to current vertex *)
  1153.     flagTbl * : e.APTR;              (* ptr to start of vector flag table *)
  1154.     flagPtr * : e.APTR;              (* ptrs to areafill flags *)
  1155.     count * : INTEGER;               (* number of vertices in list *)
  1156.     maxCount * : INTEGER;            (* AreaMove/Draw will not allow Count>MaxCount*)
  1157.     firstX * ,FirstY * : INTEGER;    (* first point for this polygon *)
  1158.   END;
  1159.  
  1160.   TmpRas * = STRUCT
  1161.     rasPtr * : e.APTR;
  1162.     size * : LONGINT;
  1163.   END;
  1164.  
  1165. (* unoptimized for 32bit alignment of pointers *)
  1166.   GelsInfo * = STRUCT
  1167.     sprRsrvd * : SHORTINT;     (* flag of which sprites to reserve from
  1168.                                  vsprite system *)
  1169.     flags * : e.BYTE;            (* system use *)
  1170.     gelHead * ,gelTail * : VSpritePtr; (* dummy vSprites for list management*)
  1171.     (* pointer to array of 8 WORDS for sprite available lines *)
  1172.     nextLine * : e.APTR;
  1173.     (* pointer to array of 8 pointers for color-last-assigned to vSprites *)
  1174.     lastColor * : e.APTR;
  1175.     collHandler * : CollTablePtr;     (* addresses of collision routines *)
  1176.     leftmost * , rightmost * , topmost * , bottommost * : INTEGER;
  1177.     firstBlissObj * ,lastBlissObj * : e.APTR;    (* system use only *)
  1178.   END;
  1179.  
  1180.   RastPort * = STRUCT
  1181.     layer * : LayerPtr;
  1182.     bitMap * : BitMapPtr;
  1183.     areaPtrn * : e.APTR;        (* ptr to areafill pattern *)
  1184.     tmpRas * : TmpRasPtr;
  1185.     areaInfo * : AreaInfoPtr;
  1186.     gelsInfo * : GelsInfoPtr;
  1187.     mask * : SHORTSET;             (* write mask for this raster *)
  1188.     fgPen * : SHORTINT;            (* foreground pen for this raster *)
  1189.     bgPen * : SHORTINT;            (* background pen  *)
  1190.     aOlPen * : SHORTINT;           (* areafill outline pen *)
  1191.     drawMode * : SHORTSET;         (* drawing mode for fill, lines, and text *)
  1192.     areaPtSz * : SHORTINT;         (* 2^n words for areafill pattern *)
  1193.     linPatCnt * : SHORTINT;        (* current line drawing pattern preshift *)
  1194.     dummy * : e.BYTE;
  1195.     flags * : SET;            (* miscellaneous control bits *)
  1196.     linePtrn * : INTEGER;         (* 16 bits for textured lines *)
  1197.     x * , y * : INTEGER;       (* current pen position *)
  1198.     minterms * : ARRAY 8 OF e.BYTE;
  1199.     penWidth * : INTEGER;
  1200.     penHeight * : INTEGER;
  1201.     font * : TextFontPtr;   (* current font address *)
  1202.     algoStyle * : SHORTSET;        (* the algorithmically generated style *)
  1203.     txFlags * : SHORTSET;          (* text specific flags *)
  1204.     txHeight* : INTEGER;         (* text height *)
  1205.     txWidth * : INTEGER;          (* text nominal width *)
  1206.     txBaseline* : INTEGER;       (* text baseline *)
  1207.     txSpacing * : INTEGER;        (* text spacing (per character) *)
  1208.     user * : e.APTR;
  1209.     longreserved * : ARRAY 2 OF LONGINT;
  1210.     wordreserved * : ARRAY 7 OF INTEGER;  (* used to be a node *)
  1211.     reserved * : ARRAY 8 OF e.BYTE;       (* for future use *)
  1212.   END;
  1213.  
  1214. CONST
  1215.  
  1216. (* drawing modes *)
  1217.   jam1        * = SHORTSET{};  (* jam 1 color into raster *)
  1218.   jam2        * = SHORTSET{0}; (* jam 2 colors into raster *)
  1219.   complement  * = 1;           (* XOR bits into raster *)
  1220.   inversvid   * = 2;           (* inverse video for drawing modes *)
  1221.  
  1222. (* these are the flag bits for RastPort flags *)
  1223.   firstDot    * = 0;      (* draw the first dot of this line ? *)
  1224.   oneDot      * = 1;      (* use one dot mode for drawing lines *)
  1225.   dBuffer     * = 2;      (* flag set when RastPorts are double-buffered *)
  1226.  
  1227.              (* only used for bobs *)
  1228.  
  1229.   areaOutline * = 3;      (* used by areafiller *)
  1230.   noCrossFill * = 5;      (* areafills have no crossovers *)
  1231.  
  1232. (* there is only one style of clipping: raster clipping *)
  1233. (* this preserves the continuity of jaggies regardless of clip window *)
  1234. (* When drawing into a RastPort, if the ptr to ClipRect is nil then there *)
  1235. (* is no clipping done, this is dangerous but useful for speed *)
  1236.  
  1237. TYPE
  1238.  
  1239.   RegionRectangle * = STRUCT
  1240.     next * , prev * : RegionRectanglePtr;
  1241.     bounds * : Rectangle;
  1242.   END;
  1243.  
  1244.   Region * = STRUCT (bounds * : Rectangle)
  1245.     regionRectangle * : RegionRectanglePtr;
  1246.   END;
  1247.  
  1248.  
  1249.   BitScaleArgs * = STRUCT
  1250.     srcX * , srcY * : INTEGER;                 (* source origin *)
  1251.     srcWidth * , srcHeight * : INTEGER;        (* source size *)
  1252.     xSrcFactor * , ySrcFactor * : INTEGER;     (* scale factor denominators *)
  1253.     destX * , destY * : INTEGER;               (* destination origin *)
  1254.     destWidth * , destHeight * : INTEGER;      (* destination size result *)
  1255.     xDestFactor * , yDestFactor * : INTEGER;   (* scale factor numerators *)
  1256.     srcBitMap * : BitMapPtr;               (* source BitMap *)
  1257.     destBitMap * : BitMapPtr;              (* destination BitMap *)
  1258.     flags * : LONGINT;                          (* reserved.  Must be zero! *)
  1259.     xdda * , ydda * : INTEGER;                 (* reserved *)
  1260.     reserved1 * : LONGINT;
  1261.     reserved2 * : LONGINT;
  1262.   END;
  1263.  
  1264. CONST
  1265.  
  1266.   spriteAttached * = 80H;
  1267.  
  1268. TYPE
  1269.  
  1270.   SimpleSprite * = STRUCT
  1271.     posctldata * : e.APTR;
  1272.     height * : INTEGER;
  1273.     x * ,y * : INTEGER;    (* current position *)
  1274.     num * : INTEGER;
  1275.   END;
  1276.  
  1277.   ExtSprite * = STRUCT (simpleSprite *: SimpleSprite)
  1278.                                    (* conventional simple sprite structure *)
  1279.     wordwidth *: INTEGER;          (* graphics use only, subject to change *)
  1280.     flags *: SET;                  (* graphics use only, subject to change *)
  1281.   END;
  1282.  
  1283.  
  1284. CONST
  1285. (* tags for AllocSpriteData() *)
  1286.   spriteaWidth         * =  081000000H;
  1287.   spriteaXreplication  * =  081000002H;
  1288.   spriteaYreplication  * =  081000004H;
  1289.   spriteaOutputheight  * =  081000006H;
  1290.   spriteaAttached      * =  081000008H;
  1291.   spriteaOlddataformat * =  08100000AH; (* MUST pass in outputheight if using this tag *)
  1292.  
  1293. (* tags for GetExtSprite() *)
  1294.   gstagSpriteNum  * = 082000020H;
  1295.   gstagAttached   * = 082000022H;
  1296.   gstagSoftsprite * = 082000024H;
  1297.  
  1298. (* tags valid for either GetExtSprite or ChangeExtSprite *)
  1299.   gstagScandoubled * = 083000000H;      (* request "NTSC-Like" height if possible. *)
  1300.  
  1301. CONST
  1302.  
  1303. (*------ Font Styles ------------------------------------------------*)
  1304.   normal      * = SHORTSET{};      (* normal text (no style bits set) *)
  1305.   normalFont  * = SHORTSET{};      (* prehistoric synonym             *)
  1306.   underlined  * = 0;       (* underlined (under baseline) *)
  1307.   bold        * = 1;       (* bold face text (ORed w/ shifted) *)
  1308.   italic      * = 2;       (* italic (slanted 1:2 right) *)
  1309.   extended    * = 3;       (* extended face (wider than normal) *)
  1310.  
  1311.   colorFont   * = 6;       (* this uses ColorTextFont structure *)
  1312.   tagged      * = 7;       (* the TextAttr is really an TTextAttr, *)
  1313.  
  1314. (*------ Font Flags -------------------------------------------------*)
  1315.   romFont     * = 0;       (* font is in rom *)
  1316.   diskFont    * = 1;       (* font is from diskfont.library *)
  1317.   revPath     * = 2;       (* designed path is reversed (e.g. left) *)
  1318.   tallDot     * = 3;       (* designed for hires non-interlaced *)
  1319.   wideDot     * = 4;       (* designed for lores interlaced *)
  1320.   proportional * = 5;      (* character sizes can vary from nominal *)
  1321.   designed    * = 6;       (* size explicitly designed, not constructed *)
  1322.                            (* note: if you do not set this bit in your *)
  1323.                            (* textattr, then a font may be constructed *)
  1324.                            (* for you by scaling an existing rom or disk *)
  1325.                            (* font (under V36 and above). *)
  1326.     (* bit 7 is always clear for fonts on the graphics font list *)
  1327.   removed     * = 7;       (* the font has been removed *)
  1328.  
  1329. TYPE
  1330.  
  1331. (****** TextAttr node, matches text attributes in RastPort **********)
  1332.   TextAttr * = STRUCT
  1333.     name * : e.STRPTR;            (* name of the font *)
  1334.     ySize * : INTEGER;            (* height of the font *)
  1335.     style * : SHORTSET;           (* intrinsic font style *)
  1336.     flags * : SHORTSET;           (* font preferences and flags *)
  1337.   END;
  1338.  
  1339.   TTextAttr * = STRUCT
  1340.     name * : e.STRPTR;           (* name of the font *)
  1341.     ySize * : INTEGER;           (* height of the font *)
  1342.     style * : SHORTSET;          (* intrinsic font style *)
  1343.     flags * : SHORTSET;          (* font preferences and flags *)
  1344.     tags * : u.TagListPtr;       (* extended attributes *)
  1345.   END;
  1346.  
  1347. CONST
  1348.  
  1349. (****** Text Tags ***************************************************)
  1350.   deviceDPI   * = 1+u.user;    (* Tag value is Point union: *)
  1351.                                (* Hi word XDPI, Lo word YDPI *)
  1352.  
  1353.   maxFontMatchweight * = 32767;  (* perfect match from WeighTAMatch *)
  1354.  
  1355. TYPE
  1356.  
  1357. (****** TextFonts node **********************************************)
  1358.   TextFont * = STRUCT (message * : e.Message)
  1359.                                 (* reply message for font removal *)
  1360.                                 (* font name in LN        \    used in this *)
  1361.     ySize * : INTEGER;          (* font height            |    order to best *)
  1362.     style * : SHORTSET;         (* font style             |    match a font *)
  1363.     flags * : SHORTSET;         (* preferences and flags  /    request. *)
  1364.     xSize * : INTEGER;          (* nominal font width *)
  1365.     baseline * : INTEGER;       (* distance from the top of char to baseline *)
  1366.     boldSmear * : INTEGER;      (* smear to affect a bold enhancement *)
  1367.  
  1368.     accessors * : INTEGER;      (* access count *)
  1369.  
  1370.     loChar * : CHAR;            (* the first character described here *)
  1371.     hiChar * : CHAR;            (* the last character described here *)
  1372.     charData * : e.APTR;        (* the bit character data *)
  1373.  
  1374.     modulo * : INTEGER;         (* the row modulo for the strike font data *)
  1375.     charLoc * : e.APTR;         (* ptr to location data for the strike font *)
  1376.                                 (*   2 words: bit offset then size *)
  1377.     charSpace * : e.APTR;       (* ptr to words of proportional spacing data *)
  1378.     charKern * : e.APTR;        (* ptr to words of kerning data *)
  1379.   END;
  1380.  
  1381. CONST
  1382.  
  1383. (*----- TextFontExtension.flags0 (partial definition) ----------------------------*)
  1384.   noRemFont * = 0;        (* disallow RemFont for this font *)
  1385.  
  1386. TYPE
  1387.  
  1388.   TextFontExtension * = STRUCT          (* this structure is read-only *)
  1389.     matchWord * : INTEGER;              (* a magic cookie for the extension *)
  1390.     flags0 * : SHORTSET;                (* (system private flags) *)
  1391.     flags1 * : SHORTSET;                (* (system private flags) *)
  1392.     backPtr * : TextFontPtr;            (* validation of compilation *)
  1393.     origReplyPort * : e.MsgPortPtr;     (* original value in tf_Extension *)
  1394.     tags * : u.TagListPtr;              (* Text Tags for the font *)
  1395.     oFontPatchS * : e.APTR;             (* (system private use) *)
  1396.     oFontPatchK * : e.APTR;             (* (system private use) *)
  1397.     (* this space is reserved for future expansion *)
  1398.   END;
  1399.  
  1400. CONST
  1401.  
  1402. (****** ColorTextFont node ******************************************)
  1403. (*----- ColorTextFont.flags ----------------------------------------*)
  1404.   ctColorMask  * = {0..3}; (* mask to get to following color styles *)
  1405.   ctColorFont  * = 0;      (* color map contains designer's colors *)
  1406.   ctGreyFont   * = 1;      (* color map describes even-stepped *)
  1407.                            (* brightnesses from low to high *)
  1408.   ctAntiAlias  * = 2;      (* zero background thru fully saturated char *)
  1409.  
  1410.   ctMapColor   * = 0;      (* map ctf_FgColor to the rp_FgPen if it's *)
  1411.                            (* is a valid color within ctf_Low..ctf_High *)
  1412.  
  1413. TYPE
  1414.  
  1415. (*----- ColorFontColors --------------------------------------------*)
  1416.   ColorFontColors * = STRUCT
  1417.     reserved * : INTEGER;       (* *must* be zero *)
  1418.     count * : INTEGER;          (* number of entries in cfc_ColorTable *)
  1419.     colorTable * : e.APTR;      (* 4 bit per component color map packed xRGB *)
  1420.   END;
  1421.  
  1422. (*----- ColorTextFont ----------------------------------------------*)
  1423.   ColorTextFont * = STRUCT (tf * : TextFont)
  1424.     flags * : SET;           (* extended flags *)
  1425.     depth * : SHORTINT;      (* number of bit planes *)
  1426.     fgColor * : SHORTINT;    (* color that is remapped to FgPen *)
  1427.     low * : SHORTINT;        (* lowest color represented here *)
  1428.     high * : SHORTINT;       (* highest color represented here *)
  1429.     planePick * : SHORTSET;  (* PlanePick ala Images *)
  1430.     planeOnOff * : SHORTSET; (* PlaneOnOff ala Images *)
  1431.     colorFontColors * : ColorFontColorsPtr; (* colors for font *)
  1432.     charData * : ARRAY 8 OF e.APTR;         (*pointers to bit planes ala tf_CharData *)
  1433.   END;
  1434.  
  1435. (****** TextExtent node *********************************************)
  1436.   Textextent * = STRUCT
  1437.     width * : INTEGER;           (* same as TextLength *)
  1438.     height * : INTEGER;          (* same as tf_YSize *)
  1439.     extent * : Rectangle;        (* relative to CP *)
  1440.   END;
  1441.  
  1442. CONST
  1443.  
  1444.   vTagEndCM              * = 00000000H;
  1445.   vTagChromaKeyClr       * = 80000000H;
  1446.   vTagChromaKeySet       * = 80000001H;
  1447.   vTagBitPlaneKeyClr     * = 80000002H;
  1448.   vTagBitPlaneKeySet     * = 80000003H;
  1449.   vTagBorderBlankClr     * = 80000004H;
  1450.   vTagBorderBlankSet     * = 80000005H;
  1451.   vTagBorderNoTransClr   * = 80000006H;
  1452.   vTagBorderNoTransSet   * = 80000007H;
  1453.   vTagChromaPenClr       * = 80000008H;
  1454.   vTagChromaPenSet       * = 80000009H;
  1455.   vTagChromaPlaneSet     * = 8000000AH;
  1456.   vTagAttachCMSet        * = 8000000BH;
  1457.   vTagNextBufCM          * = 8000000CH;
  1458.   vTagBatchCMClr         * = 8000000DH;
  1459.   vTagBatchCMSet         * = 8000000EH;
  1460.   vTagNormalDispGet      * = 8000000FH;
  1461.   vTagNormalDisplSet     * = 80000010H;
  1462.   vTagCoerceDispGet      * = 80000011H;
  1463.   vTagCoerceDispSet      * = 80000012H;
  1464.   vTagViewPortExtraGet   * = 80000013H;
  1465.   vTagViewPortExtraSet   * = 80000014H;
  1466.   vTagChromaKeyGet       * = 80000015H;
  1467.   vTagBitPlaneKeyGet     * = 80000016H;
  1468.   vTagBorderBlankGet     * = 80000017H;
  1469.   vTagBorderNoTransGet   * = 80000018H;
  1470.   vTagChromaPenGet       * = 80000019H;
  1471.   vTagChromaPlaneGet     * = 8000001AH;
  1472.   vTagAttachCMGet        * = 8000001BH;
  1473.   vTagBatchCMGet         * = 8000001CH;
  1474.   vTagBatchItemsGet      * = 8000001DH;
  1475.   vTagBatchItemsSet      * = 8000001EH;
  1476.   vTagBatchItemsAdd      * = 8000001FH;
  1477.   vTagVPModeIDGet        * = 80000020H;
  1478.   vTagVPMoedIDSet        * = 80000021H;
  1479.   vTagVPModeIDClr        * = 80000022H;
  1480.   vTagUserClipGet        * = 80000023H;
  1481.   vTagUserClipSet        * = 80000024H;
  1482.   vTagUserClipClr        * = 80000025H;
  1483. (* The following tags are V39 specific. They will be ignored (returing error -3) by
  1484.       earlier versions *)
  1485.   vtagPf1BaseGet         * = 080000026H;
  1486.   vtagPf2BaseGet         * = 080000027H;
  1487.   vtagSpEvenBaseGet      * = 080000028H;
  1488.   vtagSpOddBaseGet       * = 080000029H;
  1489.   vtagPf1BaseSet         * = 08000002AH;
  1490.   vtagPf2BaseSet         * = 08000002BH;
  1491.   vtagSpEvenBaseSet      * = 08000002CH;
  1492.   vtagSpOddBaseSet       * = 08000002DH;
  1493.   vtagBorderSpriteGet    * = 08000002EH;
  1494.   vtagBorderSpriteSet    * = 08000002FH;
  1495.   vtagBorderSpriteClr    * = 080000030H;
  1496.   vtagSpriteResnSet      * = 080000031H;
  1497.   vtagSpriteResnGet      * = 080000032H;
  1498.   vtagPf1ToSpritePriSet  * = 080000033H;
  1499.   vtagPf1ToSpritePriGet  * = 080000034H;
  1500.   vtagPf2ToSpritePriSet  * = 080000035H;
  1501.   vtagPf2ToSpritePriGet  * = 080000036H;
  1502.   vtagImmediate          * = 080000037H;
  1503.   vtagFullPaletteSet     * = 080000038H;
  1504.   vtagFullPaletteGet     * = 080000039H;
  1505.   vtagFullPaletteClr     * = 08000003AH;
  1506.   vtagDefSpriteResnSet   * = 08000003BH;
  1507.   vtagDefSpriteResnGet   * = 08000003CH;
  1508.  
  1509. TYPE
  1510.  
  1511.   ViewPort * = STRUCT
  1512.     next * : ViewPortPtr;
  1513.     colorMap * : ColorMapPtr;    (* table of colors for this viewport *)
  1514.           (* if this is nil, MakeVPort assumes default values *)
  1515.     dspIns * : CopListPtr;       (* user by MakeView() *)
  1516.     sprIns * : CopListPtr;       (* used by sprite stuff *)
  1517.     clrIns * : CopListPtr;       (* used by sprite stuff *)
  1518.     uCopIns * : UCopListPtr;     (* User copper list *)
  1519.     dWidth * , dHeight * : INTEGER;
  1520.     dxOffset * , dyOffset * : INTEGER;
  1521.     modes * : SET;
  1522.     spritePriorities * : SHORTINT;               (* used by makevp *)
  1523.     extendedModes * : SHORTINT;
  1524.     rasInfo * : RasInfoPtr;
  1525.   END;
  1526.  
  1527.  
  1528.   View * = STRUCT
  1529.     viewPort * : ViewPortPtr;
  1530.     lofCprList * : CprlistPtr;   (* used for interlaced and noninterlaced *)
  1531.     shfCprList * : CprlistPtr;   (* only used during interlace *)
  1532.     dyOffset * , dxOffset * : INTEGER;   (* for complete View positioning *)
  1533.                                (* offsets are +- adjustments to standard #s *)
  1534.     modes * : SET;             (* such as INTERLACE, GENLOC *)
  1535.   END;
  1536.  
  1537. (* these structures are obtained via GfxNew *)
  1538. (* and disposed by GfxFree *)
  1539.   ViewExtra * = STRUCT (n * : ExtendedNode)
  1540.     view    * : ViewPtr;           (* backwards link *)
  1541.     monitor * : MonitorSpecPtr; (* monitors for this view *)
  1542.     topLine * : INTEGER;
  1543.   END;
  1544.  
  1545. (* this structure is obtained via GfxNew *)
  1546. (* and disposed by GfxFree *)
  1547.   ViewPortExtra * = STRUCT (n * : ExtendedNode)
  1548.     viewPort * : ViewPortPtr;   (* backwards link *)
  1549.     displayClip * : Rectangle;  (* makevp display clipping information *)
  1550.     (* These are added for V39 *)
  1551.     vecTable   *: e.APTR;       (* Private *)
  1552.     driverData *: ARRAY 2 OF e.APTR;
  1553.     flags  *: SET;
  1554.     origin *: ARRAY 2 OF Point; (* First visible point relative to the DClip.
  1555.                                  * One for each possible playfield.
  1556.                                  *)
  1557.   END;
  1558.  
  1559. CONST
  1560. (* defines used for Modes in IVPargs *)
  1561.  
  1562.   genLockVideo    * = 1;
  1563.   lace            * = 2;
  1564.   doubleScan      * = 3;
  1565.   superHires      * = 5;
  1566.   pfba            * = 6;
  1567.   extraHalfbrite  * = 7;
  1568.   genlockAudio    * = 8;
  1569.   dualpf          * = 10;
  1570.   ham             * = 11;
  1571.   extendedMode    * = 12;
  1572.   vpHide          * = 13;
  1573.   sprites         * = 14;
  1574.   hires           * = 15;
  1575.  
  1576. (* ViewPort *)
  1577.   vpxbFreeMe       * = 0;       (* private *)
  1578.   vpxbLast         * = 1;
  1579.   vpxbStraddles256 * = 4;
  1580.   vpxbStraddles512 * = 5;
  1581.  
  1582.   extendVStruct * = 12;   (* unused bit in Modes field of View *)
  1583.  
  1584.   a2024     * = 6;   (* VP?_ fields internal only *)
  1585.   tenHz     * = 4;   (* may be wrong [hG] *)
  1586.  
  1587. (* old definition from 2.04 includes [hG]
  1588.   a2024           * = 6;
  1589.   agnus           * = 5;
  1590.   tenHz           * = 5;
  1591. *)
  1592. TYPE
  1593.  
  1594.   RasInfo * = STRUCT (* used by callers to and InitDspC() *)
  1595.     next * : RasInfoPtr;          (* used for dualpf *)
  1596.     bitMap * : BitMapPtr;
  1597.     rxOffset * , ryOffset * : INTEGER;      (* scroll offsets in this BitMap *)
  1598.   END;
  1599.  
  1600.   ColorMap * = STRUCT
  1601.     flags * : SHORTSET;
  1602.     type * : SHORTINT;
  1603.     count * : INTEGER;
  1604.     colorTable * : e.APTR;
  1605.     vpe * : ViewPortExtraPtr;
  1606.     lowColorBits * : e.APTR;         (* was: transparencyBits *)
  1607.     transparencyPlane * : SHORTINT;
  1608.     spriteResolution *: e.UBYTE;
  1609.     spriteResDefault *: e.UBYTE;     (* what resolutiion you get when
  1610.                                       * you have set SPRITERESN_DEFAULT *)
  1611.     auxFlags *: SHORTSET;
  1612.     vp       *: ViewPortPtr;
  1613.     normalDisplayInfo * : DisplayInfoPtr;
  1614.     coerceDisplayInfo * : DisplayInfoPtr;
  1615.     cmBatchItems * : u.TagListPtr;
  1616.     vpModeID * : LONGINT;
  1617.     palExtra * : PaletteExtraPtr;
  1618.     spriteBaseEven *: INTEGER;
  1619.     spriteBaseOdd  *: INTEGER;
  1620.     bp0base *: INTEGER;
  1621.     bp1base *: INTEGER;
  1622.   END;
  1623.  
  1624. CONST
  1625.  
  1626. (* if Type == 0 then ColorMap is V1.2/V1.3 compatible *)
  1627. (* if Type != 0 then ColorMap is V38     compatible *)
  1628. (* the system will never create other than V39 type colormaps when running V39 *)
  1629.  
  1630.   colorMapTypeV12     * = 0;
  1631.   colorMapTypeV14     * = 1;
  1632.   colorMapTypeV36     * = colorMapTypeV14;      (* use this definition *)
  1633.   colormapTypeV39     * = 2;
  1634.  
  1635. (* Flags variable *)
  1636.   colorMapTransparency    * = 0;
  1637.   colorPlaneTransparency  * = 1;
  1638.   borderBlanking          * = 2;
  1639.   boderNoTransparency     * = 3;
  1640.   videoControlBatch       * = 4;
  1641.   userCopperClip          * = 5;
  1642.   borderSprites           * = 6;
  1643.  
  1644.   resnEcs     * =  0;
  1645. (* ^140ns, except in 35ns viewport, where it is 70ns. *)
  1646.   resn140ns   * =  1;
  1647.   resn70ns    * =  2;
  1648.   resn35ns    * =  3;
  1649.   resnDefault * = -1;
  1650.  
  1651. (* AuxFlags : *)
  1652.   fullPalette * = 0;
  1653.  
  1654. TYPE
  1655.   PaletteExtra * = STRUCT            (* structure may be extended so watch out! *)
  1656.     semaphore *: e.SignalSemaphore;  (* shared semaphore for arbitration     *)
  1657.     firstFree *: INTEGER;            (* *private*                            *)
  1658.     nFree     *: INTEGER;            (* number of free colors                *)
  1659.     firstShared *: INTEGER;          (* *private*                            *)
  1660.     nShared     *: INTEGER;          (* *private*                            *)
  1661.     refCnt      *: e.APTR;           (* *private*                            *)
  1662.     allocList   *: e.APTR;           (* *private*                            *)
  1663.     viewPort *: ViewPortPtr;         (* back pointer to viewport             *)
  1664.     sharableColors *: INTEGER;       (* the number of sharable colors.       *)
  1665.   END;
  1666.  
  1667. CONST
  1668. (* flags values for ObtainPen *)
  1669.   penbExclusive  * = 0;
  1670.   penbNoSetcolor * = 1;
  1671.  
  1672. (* precision values for ObtainBestPen : *)
  1673.   precisionExact * = -1;
  1674.   precisionImage * =  0;
  1675.   precisionIcon  * = 16;
  1676.   precisionGui   * = 32;
  1677.  
  1678.  
  1679. (* tags for ObtainBestPen: *)
  1680.   obpPrecision * = 084000000H;
  1681.   obpFailIfBad * = 084000001H;
  1682.  
  1683. (* From V39, MakeVPort() will return an error if there is not enough memory,
  1684.  * or the requested mode cannot be opened with the requested depth with the
  1685.  * given bitmap (for higher bandwidth alignments).
  1686.  *)
  1687.  
  1688.   mvpOk        * = 0;   (* you want to see this one *)
  1689.   mvpNoMem     * = 1;   (* insufficient memory for intermediate workspace *)
  1690.   mvpNoVPE     * = 2;   (* ViewPort does not have a ViewPortExtra, and
  1691.                          * insufficient memory to allocate a temporary one.
  1692.                          *)
  1693.   mvpNoDspIns  * = 3;   (* insufficient memory for intermidiate copper
  1694.                          * instructions.
  1695.                          *)
  1696.   mvpNoDisplay * = 4;   (* BitMap data is misaligned for this viewport's
  1697.                          * mode and depth - see AllocBitMapData().
  1698.                          *)
  1699.  
  1700. (* From V39, MrgCop() will return an error if there is not enough memory,
  1701.  * or for some reason MrgCop() did not need to make any copper lists.
  1702.  *)
  1703.  
  1704.   mcopOk    * = 0;  (* you want to see this one *)
  1705.   mcopNoMem * = 1;  (* insufficient memory to allocate the system
  1706.                      * copper lists.
  1707.                      *)
  1708.   mcopNop   * = 2;  (* MrgCop() did not merge any copper lists
  1709.                      * (eg, no ViewPorts in the list, or all marked as
  1710.                      * hidden).
  1711.                      *)
  1712.  
  1713. TYPE
  1714.   DBufInfo * = STRUCT
  1715.     link1 *: e.APTR;
  1716.     count1 *: LONGINT;
  1717.     safeMessage *: e.Message; (* replied to when safe to write to old bitmap *)
  1718.     userData1 *: e.APTR;      (* first user data *)
  1719.  
  1720.     link2 *: e.APTR;
  1721.     count2 *: LONGINT;
  1722.     dispMessage *: e.Message; (* replied to when new bitmap has been displayed at least
  1723.                                  once *)
  1724.     userData2 *: e.APTR;      (* second user data *)
  1725.     matchLong *: LONGINT;
  1726.     copPtr1 *: e.APTR;
  1727.     copPtr2 *: e.APTR;
  1728.     copPtr3 *: e.APTR;
  1729.     beamPos1 *: INTEGER;
  1730.     beamPos2 *: INTEGER;
  1731.   END;
  1732.  
  1733.  
  1734. TYPE
  1735.   GfxBase * = STRUCT (libNode * : e.Library)
  1736.     actiView * : ViewPtr;
  1737.     copinit * : CopinitPtr;    (* ptr to copper start up list *)
  1738.     cia * : e.APTR;            (* for 8520 resource use *)
  1739.     blitter * : e.APTR;           (* for future blitter resource use *)
  1740.     loFlist * : e.APTR;
  1741.     shFlist * : e.APTR;
  1742.     blthd * , blttl * : h.BltnodePtr;
  1743.     bsblthd * ,bsblttl * : h.BltnodePtr;
  1744.     vbsrv * ,timsrv * ,bltsrv * : e.Interrupt;
  1745.     textFonts * : e.List;
  1746.     defaultFont * : TextFontPtr;
  1747.     modes * : SET;                       (* copy of current first bplcon0 *)
  1748.     vBlank * : e.BYTE;
  1749.     debug * : e.BYTE;
  1750.     beamSync * : INTEGER;
  1751.     bplcon0 * : SET;       (* it is ored into each bplcon0 for display *)
  1752.     spriteReserved * : e.BYTE;
  1753.     bytereserved * : e.BYTE;
  1754.     flags * : SET;
  1755.     blitLock * : INTEGER;
  1756.     blitNest * : INTEGER;
  1757.  
  1758.     blitWaitQ * : e.List;
  1759.     blitOwner * : e.TaskPtr;
  1760.     waitQ * : e.List;
  1761.     displayFlags * : SET;    (* NTSC PAL GENLOC etc*)
  1762.                             (* flags initialized at power on *)
  1763.     simpleSprites * : e.APTR;
  1764.     maxDisplayRow * : INTEGER;          (* hardware stuff, do not use *)
  1765.     maxDisplayColumn * : INTEGER;       (* hardware stuff, do not use *)
  1766.     normalDisplayRows * : INTEGER;
  1767.     normalDisplayColumns * : INTEGER;
  1768.     (* the following are for standard non interlace, 1/2 wb width *)
  1769.     normalDPMX * : INTEGER;             (* Dots per meter on display *)
  1770.     normalDPMY * : INTEGER;             (* Dots per meter on display *)
  1771.     lastChanceMemory * : e.SignalSemaphorePtr;
  1772.     lcMptr * : e.APTR;
  1773.     microsPerLine * : INTEGER;          (* 256 time usec/line *)
  1774.     minDisplayColumn * : INTEGER;
  1775.     chipRevBits0 * : SHORTSET;
  1776.     memType  * :  e.BYTE;
  1777.     reserved * : ARRAY 4 OF e.BYTE;
  1778.     monitorID * : INTEGER;
  1779.     hedley * : ARRAY 8 OF LONGINT;
  1780.     hedleySprites * : ARRAY 8 OF LONGINT;     (* sprite ptrs for intuition mouse *)
  1781.     hedleySprites1 * : ARRAY 8 OF LONGINT;    (* sprite ptrs for intuition mouse *)
  1782.     hedleyCount * : INTEGER;
  1783.     hedleyFlags * : SET;
  1784.     hedleyTmp * : INTEGER;
  1785.     hashTable * : e.APTR;
  1786.     currentTotRows * : INTEGER;
  1787.     currentTotCclks * : INTEGER;
  1788.     hedleyHint * : e.BYTE;
  1789.     hedleyHint2 * : e.BYTE;
  1790.     nreserved * : ARRAY 4 OF LONGINT;
  1791.     a2024SyncRaster * : e.APTR;
  1792.     controlDeltaPAL * : INTEGER;
  1793.     controlDeltaNTSC * : INTEGER;
  1794.     currentMonitor * : MonitorSpecPtr;
  1795.     monitorList * : e.List;
  1796.     defaultMonitor * : MonitorSpecPtr;
  1797.     monitorListSemaphore * : e.SignalSemaphorePtr;
  1798.     displayInfoDataBase * : e.APTR;
  1799.     topLine * : INTEGER;
  1800.     actiViewCprSemaphore * : e.SignalSemaphorePtr;
  1801.     utilBase * : e.LibraryPtr;           (* for hook and tag utilities   *)
  1802.     execBase * : e.LibraryPtr;           (* to link with rom.lib *)
  1803.     bwshifts * : e.APTR; (* to UBYTE; *)
  1804.     strtFetchMasks * : e.APTR; (* to UWORD *)
  1805.     stopFetchMasks * : e.APTR; (* to UWORD *)
  1806.     overrun * : e.APTR;        (* to UWORD *)
  1807.     realStops * : e.APTR;      (* to WORD  *)
  1808.     spriteWidth * : INTEGER;   (* current width (in words) of sprites *)
  1809.     spriteFMode * : INTEGER;   (* current sprite fmode bits    *)
  1810.     softSprites * : e.BYTE;    (* bit mask of size change knowledgeable sprites *)
  1811.     arraywidth  * : e.BYTE;
  1812.     defaultSpriteWidth * : INTEGER;     (* what width intuition wants *)
  1813.     sprMoveDisable * : e.BYTE;
  1814.     wantChips * : e.UBYTE;
  1815.     boardMemType * : e.UBYTE;
  1816.     bugs * : e.UBYTE;
  1817.     layersBase *: e.APTR; (* to LONGINT *)
  1818.     colorMask *: LONGINT;
  1819.     iVector * : e.APTR;
  1820.     iData * : e.APTR;
  1821.     specialCounter *: LONGINT;         (* special for double buffering *)
  1822.     dbList * : e.APTR;
  1823.     monitorFlags * : INTEGER;
  1824.     scanDoubledSprites * : e.UBYTE;
  1825.     bp3Bits * : e.UBYTE;
  1826.     monitorVBlank  *: AnalogSignalInterval;
  1827.     naturalMonitor *: MonitorSpecPtr;
  1828.     progData * : e.APTR;
  1829.     extSprites * : e.UBYTE;
  1830.   END;
  1831.  
  1832. CONST
  1833.  
  1834.   ntsc           * = 0;
  1835.   genloc         * = 1;
  1836.   pal            * = 2;
  1837.   todaSafe       * = 3;
  1838.   reallyPal      * = 16;  (* what is actual crystal frequency
  1839.                              (as opposed to what bootmenu set the agnus to)? *)
  1840.   blitMsgFault * = 4;
  1841.  
  1842. (* bits defs for ChipRevBits *)
  1843.   bigBlits  * = 0;
  1844.   hrAgnus   * = 0;
  1845.   hrDenise  * = 1;
  1846.   aaAlice   * = 2;
  1847.   aaLisa    * = 3;
  1848.   aaMLisa   * = 4;       (* internal use only. *)
  1849.  
  1850. (* Pass ONE of these to SetChipRev() *)
  1851.   chipRevA    * = LONGSET{hrAgnus};
  1852.   chipRevECS  * = LONGSET{hrAgnus, hrDenise};
  1853.   chipRevAA   * = LONGSET{aaAlice, aaLisa} + chipRevECS;
  1854.   chipRevBest * = LONGSET{0..31};
  1855.  
  1856. (* memory type *)
  1857.   bus16  * = 0;
  1858.   nmlCAS * = 0;
  1859.   bus32  * = 1;
  1860.   dblCAS * = 2;
  1861.   bandwidth1x    * =  LONGSET{bus16, nmlCAS};
  1862.   bandwidth2xNml * =  LONGSET{bus32};
  1863.   bandwidth2xDbl * =  LONGSET{dblCAS};
  1864.   bandwidth4x    * =  LONGSET{bus32, dblCAS};
  1865.  
  1866.   graphicsName * = "graphics.library";
  1867.  
  1868. (*------- coerce -------------*)
  1869.  
  1870. (* These flags are passed (in combination) to CoerceMode() to determine the
  1871.  * type of coercion required.
  1872.  *)
  1873.  
  1874. (* Ensure that the mode coerced to can display just as many colours as the
  1875.  * ViewPort being coerced.
  1876.  *)
  1877.   preserveColors * = 1;
  1878.  
  1879. (* Ensure that the mode coerced to is not interlaced. *)
  1880.   avoidFlicker   * = 2;
  1881.  
  1882. (*------- rpattr -------------*)
  1883.  
  1884.   rpFont       * = 080000000H;   (* get/set font *)
  1885.   rpAPen       * = 080000002H;   (* get/set apen *)
  1886.   rpBPen       * = 080000003H;   (* get/set bpen *)
  1887.   rpDrMd       * = 080000004H;   (* get/set draw mode *)
  1888.   rpOutLinePen * = 080000005H;   (* get/set outline pen *)
  1889.   rpWriteMask  * = 080000006H;   (* get/set WriteMask *)
  1890.   rpMaxPen     * = 080000007H;   (* get/set maxpen *)
  1891.  
  1892.   rpDrawBounds * = 080000008H;   (* get only rastport draw bounds. pass &rect *)
  1893.  
  1894.  
  1895. VAR
  1896.   gfx *, base * : GfxBasePtr;  (* synonyms *)
  1897.  
  1898.  
  1899. (*------ BitMap primitives ------*)
  1900. PROCEDURE BltBitMap      *{gfx,- 30}(srcBitMap{8}    : BitMapPtr;
  1901.                                      xSrc{0}         : INTEGER;
  1902.                                      ySrc{1}         : INTEGER;
  1903.                                      destBitMap{9}   : BitMapPtr;
  1904.                                      xDest{2}        : INTEGER;
  1905.                                      yDest{3}        : INTEGER;
  1906.                                      xSize{4}        : INTEGER;
  1907.                                      ySize{5}        : INTEGER;
  1908.                                      minterm{6}      : e.BYTE;
  1909.                                      mask{7}         : SHORTSET;
  1910.                                      tempA{10}       : PLANEPTR): LONGINT;
  1911. PROCEDURE BltTemplate    *{gfx,- 36}(source{8}       : PLANEPTR;
  1912.                                      xSrc{0}         : INTEGER;
  1913.                                      srcMod{1}       : INTEGER;
  1914.                                      destRP{9}       : RastPortPtr;
  1915.                                      xDest{2}        : INTEGER;
  1916.                                      yDest{3}        : INTEGER;
  1917.                                      xSize{4}        : INTEGER;
  1918.                                      ySize{5}        : INTEGER);
  1919. (*------ Text routines ------*)
  1920. PROCEDURE ClearEOL       *{gfx,- 42}(rp{9}           : RastPortPtr);
  1921. PROCEDURE ClearScreen    *{gfx,- 48}(rp{9}           : RastPortPtr);
  1922. PROCEDURE TextLength     *{gfx,- 54}(rp{9}           : RastPortPtr;
  1923.                                      string{8}       : ARRAY OF CHAR;
  1924.                                      count{0}        : LONGINT): INTEGER;
  1925. PROCEDURE Text           *{gfx,- 60}(rp{9}           : RastPortPtr;
  1926.                                      string{8}       : ARRAY OF CHAR;
  1927.                                      count{0}        : LONGINT);
  1928. PROCEDURE SetFont        *{gfx,- 66}(rp{9}           : RastPortPtr;
  1929.                                      textFont{8}     : TextFontPtr);
  1930. PROCEDURE OpenFont       *{gfx,- 72}(textAttr{8}     : TextAttr): TextFontPtr;
  1931. PROCEDURE CloseFont      *{gfx,- 78}(textFont{9}     : TextFontPtr);
  1932. PROCEDURE AskSoftStyle   *{gfx,- 84}(rp{9}           : RastPortPtr): SHORTSET;
  1933. PROCEDURE SetSoftStyle   *{gfx,- 90}(rp{9}           : RastPortPtr;
  1934.                                      style{0}        : SHORTSET;
  1935.                                      enable{1}       : SHORTSET): SHORTSET;
  1936. (*------        Gels routines ------*)
  1937. PROCEDURE AddBob         *{gfx,- 96}(bob{8}          : BobPtr;
  1938.                                      rp{9}           : RastPortPtr);
  1939. PROCEDURE AddVSprite     *{gfx,-102}(vSprite{8}      : VSpritePtr;
  1940.                                      rp{9}           : RastPortPtr);
  1941. PROCEDURE DoCollision    *{gfx,-108}(rp{9}           : RastPortPtr);
  1942. PROCEDURE DrawGList      *{gfx,-114}(rp{9}           : RastPortPtr;
  1943.                                      vp{8}           : ViewPortPtr);
  1944. PROCEDURE InitGels       *{gfx,-120}(head{8}         : VSpritePtr;
  1945.                                      tail{9}         : VSpritePtr;
  1946.                                      gelsInfo{10}    : GelsInfoPtr);
  1947. PROCEDURE InitMasks      *{gfx,-126}(vSprite{8}      : VSpritePtr);
  1948. PROCEDURE RemIBob        *{gfx,-132}(bob{8}          : BobPtr;
  1949.                                      rp{9}           : RastPortPtr;
  1950.                                      vp{10}          : ViewPortPtr);
  1951. PROCEDURE RemVSprite     *{gfx,-138}(vSprite{8}      : VSpritePtr);
  1952. PROCEDURE SetCollision   *{gfx,-144}(num{0}          : LONGINT;
  1953.                                      routine{8}      : e.PROC;
  1954.                                      gelsInfo{9}     : GelsInfoPtr);
  1955. PROCEDURE SortGList      *{gfx,-150}(rp{9}           : RastPortPtr);
  1956. PROCEDURE AddAnimOb      *{gfx,-156}(anOb{8}         : AnimObPtr;
  1957.                                      VAR anKey{9}    : AnimObPtr;
  1958.                                      rp{10}          : RastPortPtr);
  1959. PROCEDURE Animate        *{gfx,-162}(VAR anKey{8}    : AnimObPtr;
  1960.                                      rp{9}           : RastPortPtr);
  1961. PROCEDURE GetGBuffers    *{gfx,-168}(anOb{8}         : AnimObPtr;
  1962.                                      rp{9}           : RastPortPtr;
  1963.                                      flag{0}         : BOOLEAN): BOOLEAN;
  1964. PROCEDURE InitGMasks     *{gfx,-174}(animOb{8}       : AnimObPtr);
  1965. (*------        General graphics routines ------*)
  1966. PROCEDURE DrawEllipse    *{gfx,-180}(rp{9}           : RastPortPtr;
  1967.                                      xCenter{0}      : INTEGER;
  1968.                                      yCenter{1}      : INTEGER;
  1969.                                      a{2}            : INTEGER;
  1970.                                      b{3}            : INTEGER);
  1971. PROCEDURE AreaEllipse    *{gfx,-186}(rp{9}           : RastPortPtr;
  1972.                                      xCenter{0}      : INTEGER;
  1973.                                      yCenter{1}      : INTEGER;
  1974.                                      a{2}            : INTEGER;
  1975.                                      b{3}            : INTEGER): BOOLEAN;
  1976. PROCEDURE LoadRGB4       *{gfx,-192}(vp{8}           : ViewPortPtr;
  1977.                                      colors{9}       : ARRAY OF INTEGER;
  1978.                                      count{0}        : LONGINT);
  1979. PROCEDURE InitRastPort   *{gfx,-198}(VAR rp{9}       : RastPort);
  1980. PROCEDURE InitVPort      *{gfx,-204}(VAR vp{8}       : ViewPort);
  1981. PROCEDURE MrgCop         *{gfx,-210}(view{9}         : ViewPtr);
  1982. PROCEDURE MakeVPort      *{gfx,-216}(view{8}         : ViewPtr;
  1983.                                      vp{9}           : ViewPortPtr): LONGINT;
  1984. PROCEDURE LoadView       *{gfx,-222}(view{9}         : ViewPtr);
  1985. PROCEDURE WaitBlit       *{gfx,-228}();
  1986. PROCEDURE SetRast        *{gfx,-234}(rp{9}           : RastPortPtr;
  1987.                                      pen{0}          : INTEGER);
  1988. PROCEDURE Move           *{gfx,-240}(rp{9}           : RastPortPtr;
  1989.                                      x{0}            : INTEGER;
  1990.                                      y{1}            : INTEGER);
  1991. PROCEDURE Draw           *{gfx,-246}(rp{9}           : RastPortPtr;
  1992.                                      x{0}            : INTEGER;
  1993.                                      y{1}            : INTEGER);
  1994. PROCEDURE AreaMove       *{gfx,-252}(rp{9}           : RastPortPtr;
  1995.                                      x{0}            : INTEGER;
  1996.                                      y{1}            : INTEGER): BOOLEAN;
  1997. PROCEDURE AreaDraw       *{gfx,-258}(rp{9}           : RastPortPtr;
  1998.                                      x{0}            : INTEGER;
  1999.                                      y{1}            : INTEGER): BOOLEAN;
  2000. PROCEDURE AreaEnd        *{gfx,-264}(rp{9}           : RastPortPtr): BOOLEAN;
  2001. PROCEDURE WaitTOF        *{gfx,-270}();
  2002. PROCEDURE QBlit          *{gfx,-276}(blit{9}         : h.BltnodePtr);
  2003. PROCEDURE InitArea       *{gfx,-282}(VAR areaInfo{8} : AreaInfo;
  2004.                                      vectorBuffer{9} : e.APTR;
  2005.                                      maxVectors{0}   : LONGINT);
  2006. PROCEDURE SetRGB4        *{gfx,-288}(vp{8}           : ViewPortPtr;
  2007.                                      index{0}        : INTEGER;
  2008.                                      red{1}          : INTEGER;
  2009.                                      green{2}        : INTEGER;
  2010.                                      blue{3}         : INTEGER);
  2011. PROCEDURE QBSBlit        *{gfx,-294}(blit{9}         : h.BltnodePtr);
  2012. PROCEDURE BltClear       *{gfx,-300}(memBlock{9}     : PLANEPTR;
  2013.                                      byteCount{0}    : LONGINT;
  2014.                                      flags{1}        : LONGSET);
  2015. PROCEDURE RectFill       *{gfx,-306}(rp{9}           : RastPortPtr;
  2016.                                      xMin{0}         : INTEGER;
  2017.                                      yMin{1}         : INTEGER;
  2018.                                      xMax{2}         : INTEGER;
  2019.                                      yMax{3}         : INTEGER);
  2020. PROCEDURE BltPattern     *{gfx,-312}(rp{9}           : RastPortPtr;
  2021.                                      mask{8}         : PLANEPTR;
  2022.                                      xMin{0}         : INTEGER;
  2023.                                      yMin{1}         : INTEGER;
  2024.                                      xMax{2}         : INTEGER;
  2025.                                      yMax{3}         : INTEGER;
  2026.                                      bytecnt{4}      : INTEGER);
  2027. PROCEDURE ReadPixel      *{gfx,-318}(rp{9}           : RastPortPtr;
  2028.                                      x{0}            : INTEGER;
  2029.                                      y{1}            : INTEGER): LONGINT;
  2030. PROCEDURE WritePixel     *{gfx,-324}(rp{9}           : RastPortPtr;
  2031.                                      x{0}            : INTEGER;
  2032.                                      y{1}            : INTEGER): BOOLEAN;
  2033. PROCEDURE Flood          *{gfx,-330}(rp{9}           : RastPortPtr;
  2034.                                      mode{2}         : LONGINT;
  2035.                                      x{0}            : INTEGER;
  2036.                                      y{1}            : INTEGER): BOOLEAN;
  2037. PROCEDURE PolyDraw       *{gfx,-336}(rp{9}           : RastPortPtr;
  2038.                                      count{0}        : INTEGER;
  2039.                                      polyTable{8}    : ARRAY OF Point);
  2040. PROCEDURE PolyDrawList   *{gfx,-336}(rp{9}           : RastPortPtr;
  2041.                                      count{0}        : INTEGER;
  2042.                                      coors{8}..      : INTEGER);
  2043. PROCEDURE SetAPen        *{gfx,-342}(rp{9}           : RastPortPtr;
  2044.                                      pen{0}          : INTEGER);
  2045. PROCEDURE SetBPen        *{gfx,-348}(rp{9}           : RastPortPtr;
  2046.                                      pen{0}          : INTEGER);
  2047. PROCEDURE SetDrMd        *{gfx,-354}(rp{9}           : RastPortPtr;
  2048.                                      drawMode{0}     : SHORTSET);
  2049. PROCEDURE InitView       *{gfx,-360}(VAR view{9}     : View);
  2050. PROCEDURE CBump          *{gfx,-366}(copList{9}      : UCopListPtr);
  2051. PROCEDURE CMove          *{gfx,-372}(copList{9}      : UCopListPtr;
  2052.                                      destination{0}  : e.APTR;
  2053.                                      data{1}         : INTEGER);
  2054. PROCEDURE CWait          *{gfx,-378}(copList{9}      : UCopListPtr;
  2055.                                      v{0}            : INTEGER;
  2056.                                      h{1}            : INTEGER);
  2057. PROCEDURE VBeamPos       *{gfx,-384}(): LONGINT;
  2058. PROCEDURE InitBitMap     *{gfx,-390}(VAR bitMap{8}   : BitMap;
  2059.                                      depth{0}        : INTEGER;
  2060.                                      width{1}        : INTEGER;
  2061.                                      height{2}       : INTEGER);
  2062. PROCEDURE ScrollRaster   *{gfx,-396}(rp{9}           : RastPortPtr;
  2063.                                      x{0}            : INTEGER;
  2064.                                      y{1}            : INTEGER;
  2065.                                      xMin{2}         : INTEGER;
  2066.                                      yMin{3}         : INTEGER;
  2067.                                      xMax{4}         : INTEGER;
  2068.                                      yMax{5}         : INTEGER);
  2069. PROCEDURE WaitBOVP       *{gfx,-402}(vp{8}           : ViewPortPtr);
  2070. PROCEDURE GetSprite      *{gfx,-408}(VAR sprite{8}   : SimpleSprite;
  2071.                                      num{0}          : INTEGER): INTEGER;
  2072. PROCEDURE FreeSprite     *{gfx,-414}(num{0}          : INTEGER);
  2073. PROCEDURE ChangeSprite   *{gfx,-420}(vp{8}           : ViewPortPtr;
  2074.                                      VAR sprite{9}   : SimpleSprite;
  2075.                                      newData{10}     : PLANEPTR);
  2076. PROCEDURE MoveSprite     *{gfx,-426}(vo{8}           : ViewPortPtr;
  2077.                                      VAR sprite{9}   : SimpleSprite;
  2078.                                      x{0}            : INTEGER;
  2079.                                      y{1}            : INTEGER);
  2080. PROCEDURE LockLayerRom   *{gfx,-432}(layer{13}       : LayerPtr);
  2081. PROCEDURE UnlockLayerRom *{gfx,-438}(layer{13}       : LayerPtr);
  2082. PROCEDURE SyncSBitMap    *{gfx,-444}(layer{8}        : LayerPtr);
  2083. PROCEDURE CopySBitMap    *{gfx,-450}(layer{8}        : LayerPtr);
  2084. PROCEDURE OwnBlitter     *{gfx,-456}();
  2085. PROCEDURE DisownBlitter  *{gfx,-462}();
  2086. PROCEDURE InitTmpRas     *{gfx,-468}(VAR tmpras{8}   : TmpRas;
  2087.                                      buffer{9}       : PLANEPTR;
  2088.                                      size{0}         : LONGINT);
  2089. PROCEDURE AskFont        *{gfx,-474}(rp{9}           : RastPortPtr;
  2090.                                      textAttr{8}     : TextAttr);
  2091. PROCEDURE AddFont        *{gfx,-480}(textfont{9}     : TextFontPtr);
  2092. PROCEDURE RemFont        *{gfx,-486}(textfont{9}     : TextFontPtr);
  2093. PROCEDURE AllocRaster    *{gfx,-492}(width{0}        : INTEGER;
  2094.                                      height{1}       : INTEGER): PLANEPTR;
  2095. PROCEDURE FreeRaster     *{gfx,-498}(p{8}            : PLANEPTR;
  2096.                                      width{0}        : INTEGER;
  2097.                                      height{1}       : INTEGER);
  2098. PROCEDURE AndRectRegion  *{gfx,-504}(region{8}       : RegionPtr;
  2099.                                      rectangle{9}    : Rectangle);
  2100. PROCEDURE OrRectRegion   *{gfx,-510}(region{8}       : RegionPtr;
  2101.                                      rectangle{9}    : Rectangle): BOOLEAN;
  2102. PROCEDURE NewRegion      *{gfx,-516}(): RegionPtr;
  2103. PROCEDURE ClearRectRegion*{gfx,-522}(region{8}       : RegionPtr;
  2104.                                      rectangle{9}    : Rectangle): BOOLEAN;
  2105. PROCEDURE ClearRegion    *{gfx,-528}(region{8}       : RegionPtr);
  2106. PROCEDURE DisposeRegion  *{gfx,-534}(region{8}       : RegionPtr);
  2107. PROCEDURE FreeVPortCopLists*{gfx,-540}(vp{8}         : ViewPortPtr);
  2108. PROCEDURE FreeCopList    *{gfx,-546}(copList{8}      : CopListPtr);
  2109. PROCEDURE ClipBlit       *{gfx,-552}(srcRP{8}        : RastPortPtr;
  2110.                                      xSrc{0}         : INTEGER;
  2111.                                      ySrc{1}         : INTEGER;
  2112.                                      destRP{9}       : RastPortPtr;
  2113.                                      xDest{2}        : INTEGER;
  2114.                                      yDest{3}        : INTEGER;
  2115.                                      xSize{4}        : INTEGER;
  2116.                                      ySize{5}        : INTEGER;
  2117.                                      minterm{6}      : e.BYTE);
  2118. PROCEDURE XorRectRegion  *{gfx,-558}(region{8}       : RegionPtr;
  2119.                                      rectangle{9}    : Rectangle): BOOLEAN;
  2120. PROCEDURE FreeCprList    *{gfx,-564}(cprlist{8}      : CprlistPtr);
  2121. PROCEDURE GetColorMap    *{gfx,-570}(entries{0}      : LONGINT): ColorMapPtr;
  2122. PROCEDURE FreeColorMap   *{gfx,-576}(colorMap{8}     : ColorMapPtr);
  2123. PROCEDURE GetRGB4        *{gfx,-582}(colorMap{8}     : ColorMapPtr;
  2124.                                      entry{0}        : LONGINT): INTEGER;
  2125. PROCEDURE ScrollVPort    *{gfx,-588}(vp{8}           : ViewPortPtr);
  2126. PROCEDURE UCopperListInit*{gfx,-594}(uCopList{8}     : UCopListPtr;
  2127.                                      n{0}            : LONGINT): CopListPtr;
  2128. PROCEDURE FreeGBuffers   *{gfx,-600}(anOb{8}         : AnimObPtr;
  2129.                                      rp{9}           : RastPortPtr;
  2130.                                      flag{0}         : BOOLEAN);
  2131. PROCEDURE BltBitMapRastPort*{gfx,-606}(srcBitMap{8}  : BitMapPtr;
  2132.                                      xSrc{0}         : INTEGER;
  2133.                                      ySrc{1}         : INTEGER;
  2134.                                      destRP{9}       : RastPortPtr;
  2135.                                      xDest{2}        : INTEGER;
  2136.                                      yDest{3}        : INTEGER;
  2137.                                      xSize{4}        : INTEGER;
  2138.                                      ySize{5}        : INTEGER;
  2139.                                      minterm{6}      : e.BYTE);
  2140. PROCEDURE OrRegionRegion *{gfx,-612}(srcRegion{8}    : RegionPtr;
  2141.                                      destRegion{9}   : RegionPtr): BOOLEAN;
  2142. PROCEDURE XorRegionRegion*{gfx,-618}(srcRegion{8}    : RegionPtr;
  2143.                                      destRegion{9}   : RegionPtr): BOOLEAN;
  2144. PROCEDURE AndRegionRegion*{gfx,-624}(srcRegion{8}    : RegionPtr;
  2145.                                      destRegion{9}   : RegionPtr): BOOLEAN;
  2146. PROCEDURE SetRGB4CM      *{gfx,-630}(colorMap{8}     : ColorMapPtr;
  2147.                                      index{0}        : INTEGER;
  2148.                                      red{1}          : INTEGER;
  2149.                                      green{2}        : INTEGER;
  2150.                                      blue{3}         : INTEGER);
  2151. PROCEDURE BltMaskBitMapRastPort*{gfx,-636}(srcBitMap{8}  : BitMapPtr;
  2152.                                      xSrc{0}         : INTEGER;
  2153.                                      ySrc{1}         : INTEGER;
  2154.                                      destRP{9}       : RastPortPtr;
  2155.                                      xDest{2}        : INTEGER;
  2156.                                      yDest{3}        : INTEGER;
  2157.                                      xSize{4}        : INTEGER;
  2158.                                      ySize{5}        : INTEGER;
  2159.                                      minterm{6}      : e.BYTE;
  2160.                                      bltMask{10}     : PLANEPTR);
  2161. PROCEDURE GfxInternal1   *{gfx,-0282H}();
  2162. PROCEDURE GfxInternal2   *{gfx,-0288H}();
  2163. PROCEDURE AttemptLockLayerRom*{gfx,-654}(layer{13}   : LayerPtr): BOOLEAN;
  2164. (* ---   functions in V36 or higher (distributed as Release 2.0)    --- *)
  2165. (* --- REMEMBER: You are to check the version BEFORE you use this ! --- *)
  2166.  
  2167. PROCEDURE GfxNew         *{gfx,-660}(gfxNodeType{0}  : LONGINT): ExtendedNodePtr;
  2168. PROCEDURE GfxFree        *{gfx,-666}(gfxNodePtr{8}   : ExtendedNodePtr);
  2169. PROCEDURE GfxAssociate   *{gfx,-672}(associateNode{8}: ExtendedNodePtr;
  2170.                                      gfxNodePtr{9}   : ExtendedNodePtr);
  2171. PROCEDURE BitMapScale    *{gfx,-678}(bitScaleArgs{8} : BitScaleArgsPtr);
  2172. PROCEDURE ScalerDiv      *{gfx,-684}(factor{0}       : LONGINT;
  2173.                                      numerator{1}    : LONGINT;
  2174.                                      denominator{2}  : LONGINT): INTEGER;
  2175. PROCEDURE TextExtent     *{gfx,-690}(rp{9}           : RastPortPtr;
  2176.                                      string{8}       : ARRAY OF CHAR;
  2177.                                      count{0}        : LONGINT;
  2178.                                      textExtent{10}  : TextextentPtr): INTEGER;
  2179. PROCEDURE TextFit        *{gfx,-696}(rp{9}           : RastPortPtr;
  2180.                                      string{8}       : ARRAY OF CHAR;
  2181.                                      strLen{0}       : LONGINT;
  2182.                                      textExtent{10}  : TextextentPtr;
  2183.                                      constrainingExtent{11} : TextextentPtr;
  2184.                                      strDirection{1} : LONGINT;
  2185.                                      constrainingBitWidth{2} : LONGINT;
  2186.                                      constrainingBitHeight{3} : LONGINT): LONGINT;
  2187. PROCEDURE GfxLookUp      *{gfx,-702}(associateNode{8}: ExtendedNodePtr): e.APTR;
  2188. PROCEDURE VideoControlA  *{gfx,-708}(colorMap{8}     : ColorMapPtr;
  2189.                                      tagarray{9}     : ARRAY OF u.TagItem): BOOLEAN;
  2190. PROCEDURE VideoControl   *{gfx,-708}(colorMap{8}     : ColorMapPtr;
  2191.                                      tags{9}..       : u.Tag): BOOLEAN;
  2192. PROCEDURE OpenMonitor    *{gfx,-714}(monitorName{9}  : ARRAY OF CHAR;
  2193.                                      displayID{0}    : LONGINT): MonitorSpecPtr;
  2194. PROCEDURE CloseMonitor   *{gfx,-720}(monitorSpec{8}  : MonitorSpecPtr): BOOLEAN;
  2195. PROCEDURE FindDisplayInfo*{gfx,-726}(displayID{0}    : LONGINT): DisplayInfoHandle;
  2196. PROCEDURE NextDisplayInfo*{gfx,-732}(displayID{0}    : LONGINT): LONGINT;
  2197. PROCEDURE AddDisplayInfo *{gfx,-738};
  2198. PROCEDURE AddDisplayInfoData*{gfx,-744};
  2199. PROCEDURE SetDisplayInfoData*{gfx,-750}(handle{8}    : DisplayInfoHandle;
  2200.                                         buf{9}       : ARRAY OF e.BYTE;
  2201.                                         size{0}      : LONGINT;
  2202.                                         tagID{1}     : LONGINT;
  2203.                                         displayID{2} : LONGINT): LONGINT;
  2204. PROCEDURE GetDisplayInfoData*{gfx,-756}(handle{8}    : DisplayInfoHandle;
  2205.                                         VAR buf{9}   : ARRAY OF e.BYTE;
  2206.                                         size{0}      : LONGINT;
  2207.                                         tagID{1}     : LONGINT;
  2208.                                         displayID{2} : LONGINT): LONGINT;
  2209. PROCEDURE FontExtent     *{gfx,-762}(font{8}         : TextFontPtr;
  2210.                                      fontExtent{9}   : TextFontExtensionPtr);
  2211. PROCEDURE ReadPixelLine8 *{gfx,-768}(rp{8}           : RastPortPtr;
  2212.                                      xstart{0}       : INTEGER;
  2213.                                      ystart{1}       : INTEGER;
  2214.                                      width{2}        : INTEGER;
  2215.                                      VAR array{10}   : ARRAY OF e.BYTE;
  2216.                                      tempRP{9}       : RastPortPtr): LONGINT;
  2217. PROCEDURE WritePixelLine8*{gfx,-774}(rp{8}           : RastPortPtr;
  2218.                                      xstart{0}       : INTEGER;
  2219.                                      ystart{1}       : INTEGER;
  2220.                                      width{2}        : INTEGER;
  2221.                                      array{10}       : ARRAY OF e.BYTE;
  2222.                                      tempRP{9}       : RastPortPtr): LONGINT;
  2223. PROCEDURE ReadPixelArray8*{gfx,-780}(rp{8}           : RastPortPtr;
  2224.                                      xstart{0}       : INTEGER;
  2225.                                      ystart{1}       : INTEGER;
  2226.                                      xstop{2}        : INTEGER;
  2227.                                      ystop{3}        : INTEGER;
  2228.                                      VAR array{10}   : ARRAY OF e.BYTE;
  2229.                                      tempRP{9}       : RastPortPtr): LONGINT;
  2230. PROCEDURE WritePixelArray8*{gfx,-786}(rp{8}           : RastPortPtr;
  2231.                                      xstart{0}       : INTEGER;
  2232.                                      ystart{1}       : INTEGER;
  2233.                                      xstop{2}        : INTEGER;
  2234.                                      ystop{3}        : INTEGER;
  2235.                                      array{10}       : ARRAY OF e.BYTE;
  2236.                                      tempRP{9}       : RastPortPtr): LONGINT;
  2237. PROCEDURE GetVPModeID    *{gfx,-792}(vp{8}           : ViewPortPtr): LONGINT;
  2238. PROCEDURE ModeNotAvailable*{gfx,-798}(modeID{0}      : LONGINT): LONGINT;
  2239. PROCEDURE WeighTAMatchA  *{gfx,-804}(reqTextAttr{8}  : TextAttr;
  2240.                                      VAR targetTextAttr{9} : TextAttr;
  2241.                                      targetTags{10}  : ARRAY OF u.TagItem): INTEGER;
  2242. PROCEDURE WeighTAMatch   *{gfx,-804}(reqTextAttr{8} : TextAttr;
  2243.                                       VAR targetTextAttr{9} : TextAttr;
  2244.                                       targetTags{10}..      : u.Tag): INTEGER;
  2245. PROCEDURE EraseRect      *{gfx,-810}(rp{9}           : RastPortPtr;
  2246.                                      xMin{0}         : INTEGER;
  2247.                                      yMin{1}         : INTEGER;
  2248.                                      xMax{2}         : INTEGER;
  2249.                                      yMax{3}         : INTEGER);
  2250. PROCEDURE ExtendFontA    *{gfx,-816}(font{8}         : TextFontPtr;
  2251.                                      fontTags{9}     : ARRAY OF u.TagItem): BOOLEAN;
  2252. PROCEDURE ExtendFont     *{gfx,-816}(font{8}         : TextFontPtr;
  2253.                                      fontTags{9}..   : u.Tag): BOOLEAN;
  2254. PROCEDURE StripFont      *{gfx,-822}(font{8}         : TextFontPtr);
  2255.  
  2256. (*--- functions in V39 or higher (beta release for developers only) ---*)
  2257. PROCEDURE CalcIVG        *{gfx,-033CH}(v{8}          : ViewPtr;
  2258.                                        vp{8}         : ViewPortPtr): INTEGER;
  2259. PROCEDURE AttachPalExtra *{gfx,-0342H}(cm{8}         : ColorMapPtr;
  2260.                                        vp{9}         : ViewPortPtr): LONGINT;
  2261. PROCEDURE ObtainBestPenA *{gfx,-0348H}(cm{8}         : ColorMapPtr;
  2262.                                        r{1}          : LONGINT;
  2263.                                        g{2}          : LONGINT;
  2264.                                        b{3}          : LONGINT;
  2265.                                        tags{9}       : ARRAY OF u.TagItem): LONGINT;
  2266. PROCEDURE ObtainBestPen *{gfx,-0348H}(cm{8}          : ColorMapPtr;
  2267.                                        r{1}          : LONGINT;
  2268.                                        g{2}          : LONGINT;
  2269.                                        b{3}          : LONGINT;
  2270.                                        tag1Type{9}.. : u.Tag): LONGINT;
  2271. PROCEDURE GfxInternal3   *{gfx,-034EH}();
  2272. PROCEDURE SetRGB32       *{gfx,-0354H}(vp{8}         : ViewPortPtr;
  2273.                                        n{0}          : LONGINT;
  2274.                                        r{1}          : LONGINT;
  2275.                                        g{2}          : LONGINT;
  2276.                                        b{3}          : LONGINT);
  2277. PROCEDURE GetAPen        *{gfx,-035AH}(rp{8}         : RastPortPtr): LONGINT;
  2278. PROCEDURE GetBPen        *{gfx,-0360H}(rp{8}         : RastPortPtr): LONGINT;
  2279. PROCEDURE GetDrMd        *{gfx,-0366H}(rp{8}         : RastPortPtr): LONGSET;
  2280. PROCEDURE GetOutlinePen  *{gfx,-036CH}(rp{8}         : RastPortPtr): LONGINT;
  2281. PROCEDURE LoadRGB32      *{gfx,-0372H}(vp{8}         : ViewPortPtr;
  2282.                                        VAR table{9}  : ARRAY OF LONGINT);
  2283. PROCEDURE SetChipRev     *{gfx,-0378H}(want{0}       : LONGSET): LONGSET;
  2284. PROCEDURE SetABPenDrMd   *{gfx,-037EH}(rp{9}         : RastPortPtr;
  2285.                                        apen{0}       : LONGINT;
  2286.                                        bpen{1}       : LONGINT;
  2287.                                        drawmode{2}   : SHORTSET);
  2288. PROCEDURE GetRGB32       *{gfx,-0384H}(cm{8}         : ColorMapPtr;
  2289.                                        firstcolor{0} : LONGINT;
  2290.                                        ncolors{1}    : LONGINT;
  2291.                                        VAR table{9}  : ARRAY OF LONGINT);
  2292. PROCEDURE GfxSpare1      *{gfx,-038AH}();
  2293. PROCEDURE AllocBitMap    *{gfx,-0396H}(sizex{0}      : LONGINT;
  2294.                                        sizey{1}      : LONGINT;
  2295.                                        depth{2}      : LONGINT;
  2296.                                        flags{3}      : LONGSET;
  2297.                                        friendBitmap{8}: BitMapPtr): BitMapPtr;
  2298. PROCEDURE FreeBitMap     *{gfx,-039CH}(bm{8}         : BitMapPtr);
  2299. PROCEDURE GetExtSpriteA  *{gfx,-03A2H}(ss{10}        : ExtSpritePtr;
  2300.                                        tags{9}       : ARRAY OF u.TagItem): LONGINT;
  2301. PROCEDURE GetExtSprite   *{gfx,-03A2H}(ss{10}        : ExtSpritePtr;
  2302.                                        tag1Type{9}.. : u.Tag): LONGINT;
  2303. PROCEDURE CoerceMode     *{gfx,-03A8H}(vp{8}         : ViewPortPtr;
  2304.                                        monitorid{0}  : LONGINT;
  2305.                                        flags{7}      : LONGINT): LONGINT;
  2306. PROCEDURE ChangeVPBitMap *{gfx,-03AEH}(vp{8}         : ViewPortPtr;
  2307.                                        bm{9}         : BitMapPtr;
  2308.                                        db{10}        : DBufInfoPtr);
  2309. PROCEDURE ReleasePen     *{gfx,-03B4H}(cm{8}         : ColorMapPtr;
  2310.                                        n{0}          : LONGINT);
  2311. PROCEDURE ObtainPen      *{gfx,-03BAH}(cm{8}         : ColorMapPtr;
  2312.                                        n{0}          : LONGINT;
  2313.                                        r{1}          : LONGINT;
  2314.                                        g{2}          : LONGINT;
  2315.                                        b{3}          : LONGINT;
  2316.                                        f{4}          : LONGINT): LONGINT;
  2317. PROCEDURE GetBitMapAttr  *{gfx,-03C0H}(bm{8}         : BitMapPtr;
  2318.                                        attrnum{1}    : LONGINT): LONGINT;
  2319. PROCEDURE AllocDBufInfo  *{gfx,-03C6H}(vp{8}         : ViewPortPtr): DBufInfoPtr;
  2320. PROCEDURE FreeDBufInfo   *{gfx,-03CCH}(dbi{9}        : DBufInfoPtr);
  2321. PROCEDURE SetOutlinePen  *{gfx,-03D2H}(rp{8}         : RastPortPtr;
  2322.                                        pen{0}        : LONGINT): LONGINT;
  2323. PROCEDURE SetWriteMask   *{gfx,-03D8H}(rp{8}         : RastPortPtr;
  2324.                                        msk{0}        : LONGSET): BOOLEAN;
  2325. PROCEDURE SetMaxPen      *{gfx,-03DEH}(rp{8}         : RastPortPtr;
  2326.                                        maxpen{0}     : LONGINT);
  2327. PROCEDURE SetRGB32CM     *{gfx,-03E4H}(cm{8}         : ColorMapPtr;
  2328.                                        n{0}          : LONGINT;
  2329.                                        r{1}          : LONGINT;
  2330.                                        g{2}          : LONGINT;
  2331.                                        b{3}          : LONGINT);
  2332. PROCEDURE ScrollRasterBF *{gfx,-03EAH}(rp{9}         : RastPortPtr;
  2333.                                        dx{0}         : LONGINT;
  2334.                                        dy{1}         : LONGINT;
  2335.                                        xMin{2}       : LONGINT;
  2336.                                        yMin{3}       : LONGINT;
  2337.                                        xMax{4}       : LONGINT;
  2338.                                        yMax{5}       : LONGINT);
  2339. PROCEDURE FindColor      *{gfx,-03F0H}(cm{11}        : ColorMapPtr;
  2340.                                        r{1}          : LONGINT;
  2341.                                        g{2}          : LONGINT;
  2342.                                        b{3}          : LONGINT;
  2343.                                        maxcolor{4}   : LONGINT): LONGINT;
  2344. PROCEDURE GfxSpare2      *{gfx,-03F6H}();
  2345. PROCEDURE AllocSpriteDataA*{gfx,-03FCH}(bm{10}       : BitMapPtr;
  2346.                                        tags{9}       : ARRAY OF u.TagItem): ExtSpritePtr;
  2347. PROCEDURE AllocSpriteData*{gfx,-03FCH}(bm{10}        : BitMapPtr;
  2348.                                        tag1Type{9}.. : u.Tag): ExtSpritePtr;
  2349. PROCEDURE ChangeExtSpriteA*{gfx,-0402H}(vp{8}        : ViewPortPtr;
  2350.                                        oldsprite{9}  : ExtSpritePtr;
  2351.                                        newsprite{10} : ExtSpritePtr;
  2352.                                        tags{11}      : ARRAY OF u.TagItem): BOOLEAN;
  2353. PROCEDURE ChangeExtSprite*{gfx,-402H}(vp{8}          : ViewPortPtr;
  2354.                                        oldsprite{9}  : ExtSpritePtr;
  2355.                                        newsprite{10} : ExtSpritePtr;
  2356.                                        tag1Type{11}..: u.Tag): BOOLEAN;
  2357. PROCEDURE FreeSpriteData *{gfx,-0408H}(sp{10}        : ExtSpritePtr);
  2358. PROCEDURE SetRPAttrsA    *{gfx,-040EH}(rp{8}         : RastPortPtr;
  2359.                                        tags{9}       : ARRAY OF u.TagItem);
  2360. PROCEDURE SetRPAttrs     *{gfx,-040EH}(rp{8}         : RastPortPtr;
  2361.                                         tag1Type{9}..: u.Tag);
  2362. PROCEDURE GetRPAttrsA    *{gfx,-0414H}(rp{8}         : RastPortPtr;
  2363.                                        tags{9}       : ARRAY OF u.TagItem);
  2364. PROCEDURE GetRPAttrs     *{gfx,-0414H}(rp{8}         : RastPortPtr;
  2365.                                        tag1Type{9}.. : u.Tag);
  2366. PROCEDURE BestModeIDA    *{gfx,-041AH}(tags{8}       : ARRAY OF u.TagItem): LONGINT;
  2367. PROCEDURE BestModeID     *{gfx,-041AH}(tag1Type{8}.. : u.Tag): LONGINT;
  2368.  
  2369. (* $OvflChk- $RangeChk- $StackChk- $NilChk- $ReturnChk- $CaseChk- *)
  2370.  
  2371. (* This macro is obsolete as of V39. AllocBitMap() should be used for allocating
  2372.    bitmap data, since it knows about the machine's particular alignment
  2373.    restrictions.
  2374. *)
  2375. PROCEDURE RASSIZE * (w,h: INTEGER): LONGINT;
  2376. BEGIN
  2377.   RETURN (LONG(w)+15) DIV 16 * 2 * h;
  2378. END RASSIZE;
  2379.  
  2380. (* ************************************************************************ *)
  2381.  
  2382. (* these are GEL functions that are currently simple enough to exist as a
  2383.  *  definition.  It should not be assumed that this will always be the case
  2384.  *)
  2385.  
  2386. PROCEDURE InitAnimate(VAR anKey: AnimObPtr);
  2387. BEGIN anKey := NIL; END InitAnimate;
  2388.  
  2389. PROCEDURE RemBob * (b: BobPtr);
  2390. BEGIN INCL(b.flags,bobsAway); END RemBob;
  2391.  
  2392. PROCEDURE OnDisplay*;  BEGIN h.custom.dmacon := {h.dmaSet,h.raster} END OnDisplay;
  2393.  
  2394. PROCEDURE OffDisplay*; BEGIN h.custom.dmacon :=          {h.raster} END OffDisplay;
  2395.  
  2396. PROCEDURE OnSprite*;   BEGIN h.custom.dmacon := {h.dmaSet,h.sprite} END OnSprite;
  2397.  
  2398. PROCEDURE OffSprite*;  BEGIN h.custom.dmacon :=          {h.sprite} END OffSprite;
  2399.  
  2400. PROCEDURE OnVBlank*;   BEGIN h.custom.intena := {h.dmaSet,h.vertb } END OnVBlank;
  2401.  
  2402. PROCEDURE OffVBlank*;  BEGIN h.custom.intena :=          {h.vertb } END OffVBlank;
  2403.  
  2404. PROCEDURE SetOPen*(w: RastPortPtr; c: e.BYTE);
  2405. BEGIN w.aOlPen := c; INCL(w.flags,areaOutline); END SetOPen;
  2406.  
  2407. PROCEDURE SetDrPt*(w: RastPortPtr; p: INTEGER);
  2408. BEGIN
  2409.   w.linePtrn := p;
  2410.   INCL(w.flags,firstDot);
  2411.   w.linPatCnt := 15;
  2412. END SetDrPt;
  2413.  
  2414. PROCEDURE SetWrMsk*(w: RastPortPtr; m: SHORTSET);
  2415. BEGIN w.mask := m END SetWrMsk;
  2416.  
  2417. (* the SafeSetxxx macros are backwards (pre V39 graphics) compatible versions *)
  2418. (* using these macros will make your code do the right thing under V39 AND V37 *)
  2419.  
  2420. PROCEDURE SafeSetOutlinePen * (w: RastPortPtr; c: e.BYTE);
  2421. BEGIN
  2422.   IF gfx.libNode.version<39 THEN w.aOlPen := c; INCL(w.flags,areaOutline);
  2423.   ELSE
  2424.     IF SetOutlinePen(w,ORD(c)) = 0 THEN END;
  2425.   END;
  2426. END SafeSetOutlinePen;
  2427.  
  2428. PROCEDURE SafeSetWriteMask * (w: RastPortPtr; m: SHORTSET);
  2429. TYPE
  2430.   fourBytes = ARRAY 4 OF e.BYTE;
  2431. VAR
  2432.   bytes: fourBytes;
  2433. BEGIN
  2434.   IF gfx.libNode.version<39 THEN w.mask := m;
  2435.   ELSE
  2436.     bytes := fourBytes(0,0,0,0);
  2437.     bytes[3] := SYSTEM.VAL(e.BYTE,m);  (* bytes[3] is correct, I checked this [hG] *)
  2438.     IF SetWriteMask(w,SYSTEM.VAL(LONGSET,bytes)) THEN END;
  2439.   END;
  2440. END SafeSetWriteMask;
  2441.  
  2442. PROCEDURE SetAfPt*(w: RastPortPtr; p: e.ADDRESS; n: e.BYTE);
  2443. BEGIN
  2444.   w.areaPtrn := p;
  2445.   w.areaPtSz := n;
  2446. END SetAfPt;
  2447.  
  2448. PROCEDURE BndryOff*(w: RastPortPtr);
  2449. BEGIN EXCL(w.flags,areaOutline) END BndryOff;
  2450.  
  2451. PROCEDURE CINIT*(c: UCopListPtr; n: LONGINT);
  2452. BEGIN IF UCopperListInit(c,n)=NIL THEN END END CINIT;
  2453.  
  2454. PROCEDURE CMOVE*(c: UCopListPtr; a: e.ADDRESS; b: INTEGER);
  2455. BEGIN CMove(c,a,b); CBump(c) END CMOVE;
  2456.  
  2457. PROCEDURE CWAIT*(c: UCopListPtr; a,b: INTEGER);
  2458. BEGIN CWait(c,a,b); CBump(c) END CWAIT;
  2459.  
  2460. PROCEDURE CEND*(c: UCopListPtr);
  2461. BEGIN CWAIT(c,10000,255) END CEND;
  2462.  
  2463. PROCEDURE DrawCircle*(rp: RastPortPtr; cx,cy: INTEGER; r: INTEGER);
  2464. BEGIN DrawEllipse(rp,cx,cy,r,r); END DrawCircle;
  2465.  
  2466. PROCEDURE AreaCircle*(rp: RastPortPtr; cx,cy: INTEGER; r: INTEGER): BOOLEAN;
  2467. BEGIN RETURN AreaEllipse(rp,cx,cy,r,r); END AreaCircle;
  2468.  
  2469. (*-------------------------------------------------------------------------*)
  2470.  
  2471. BEGIN
  2472.   gfx :=  e.OpenLibrary(graphicsName,33);
  2473.   IF gfx = NIL THEN HALT(0) END;
  2474.   base := gfx;
  2475.  
  2476. CLOSE
  2477.   IF gfx#NIL THEN e.CloseLibrary(gfx) END;
  2478.  
  2479. END Graphics.
  2480.  
  2481.