DEFINITION MODULE GraphicsD; (*$ Implementation:=FALSE *)
(* 29-May-1993/bp *)

FROM SYSTEM IMPORT ADDRESS,BITSET,BYTE,CAST,
                   LONGSET,WORD,SHIFT,SHORTSET;

FROM ExecD IMPORT
 Interrupt,Library,List,Message,MinList,Node,NodePtr,NodeType,
 SignalSemaphore,SignalSemaphorePtr,TaskPtr,MsgPortPtr;

FROM Hardware IMPORT
 BltnodePtr,BeamConFlags,BeamConFlagSet;

FROM UtilityD IMPORT
 HookPtr,tagUser,TagItemPtr;

TYPE
(*
 Die Datentypen von Graphics referenzieren sich oft gegenseitig.
 Aus diesem Grund werden alle Zeiger zuerst deklariert.
*)
 (*36*)AnalogSignalIntervalPtr=POINTER TO AnalogSignalInterval;
 AnimCompPtr=POINTER TO AnimComp;
 AnimObPtr=POINTER TO AnimOb;
 AreaInfoPtr=POINTER TO AreaInfo;
 BitMapPtr=POINTER TO BitMap;
 (*36*)BitScaleArgsPtr=POINTER TO BitScaleArgs;
 BobPtr=POINTER TO Bob;
 ClipRectPtr=POINTER TO ClipRect;
 CollTablePtr=POINTER TO CollTable;
 (*36*)ColorFontColorsPtr=POINTER TO ColorFontColors;
 ColorMapPtr=POINTER TO ColorMap;
 (*36*)ColorTextFontPtr=POINTER TO ColorTextFont;
 CopinitPtr=POINTER TO Copinit;
 CopInsPtr=POINTER TO CopIns;
 CopListPtr=POINTER TO CopList;
 CprlistPtr=POINTER TO Cprlist;
 (*39*)DBufInfoPtr=POINTER TO DBufInfo;
 DBufPacketPtr=POINTER TO DBufPacket;
 (*36*)DimensionInfoPtr=POINTER TO DimensionInfo;
 (*36*)DisplayInfoPtr=POINTER TO DisplayInfo;
 (*36*)ExtendedNodePtr=POINTER TO ExtendedNode;
 (*39*)ExtSpritePtr=POINTER TO ExtSprite;
 GelsInfoPtr=POINTER TO GelsInfo;
 GfxBasePtr=POINTER TO GfxBase;
 IsrvstrPtr=POINTER TO Isrvstr;
 LayerPtr=POINTER TO Layer;
 LayerInfoPtr=POINTER TO LayerInfo;
 (*36*)MonitorInfoPtr = POINTER TO MonitorInfo;
 (*36*)MonitorSpecPtr=POINTER TO MonitorSpec;
 (*36*)NameInfoPtr=POINTER TO NameInfo;
 (*39*)PaletteExtraPtr=POINTER TO PaletteExtra;
 (*36*)PointPtr=POINTER TO Point;
 (*36*)QueryHeaderPtr=POINTER TO QueryHeader;
 RasInfoPtr=POINTER TO RasInfo;
 RastPortPtr=POINTER TO RastPort;
 (*36*)Rect32Ptr=POINTER TO Rect32;
 RectanglePtr=POINTER TO Rectangle;
 RegionPtr=POINTER TO Region;
 RegionRectanglePtr=POINTER TO RegionRectangle;
 SimpleSpritePtr=POINTER TO SimpleSprite;
 (*36*)SpecialMonitorPtr=POINTER TO SpecialMonitor;
 TextAttrPtr=POINTER TO TextAttr;
 (*36*)TextExtentPtr=POINTER TO TextExtent;
 (*36*)TextFontExtensionPtr=POINTER TO TextFontExtension;
 TextFontPtr=POINTER TO TextFont;
 TmpRasPtr=POINTER TO TmpRas;
 (*36*)TTextAttrPtr=POINTER TO TTextAttr;
 UCopListPtr=POINTER TO UCopList;
 (*36*)ViewExtraPtr=POINTER TO ViewExtra;
 ViewPtr=POINTER TO View;
 (*36*)ViewPortExtraPtr=POINTER TO ViewPortExtra;
 ViewPortPtr=POINTER TO ViewPort;
 VSpritePtr=POINTER TO VSprite;

(* gfx.h *)

 Rectangle=RECORD
  minX,minY,maxX,maxY:INTEGER;
 END;

 Rect32=RECORD
  minX,minY,maxX,maxY:LONGINT
 END;

 Point=RECORD
  x,y:INTEGER;
 END;

 BitMap=RECORD
  bytesPerRow:CARDINAL;
  rows:CARDINAL;
  flags:SHORTCARD;
  depth:SHORTCARD;
  pad:CARDINAL;
  planes:ARRAY [0..7] OF ADDRESS;
 END;

CONST
 (* Bitnummern für AllocBitMap: *)
 (*39*)bmClear=0H;
 (*39*)bmDisplayable=1H;
 (*39*)bmInterleaved=2H;
 (*39*)bmStandard=3H;
 (*39*)bmMinplanes=4H;

 (* Werte für GetBitMapAttr: *)
 (*39*)bmaHeight=0;
 (*39*)bmaDepth=4;
 (*39*)bmaWidth=8;
 (*39*)bmaFlags=12;

(* clip.h *)
TYPE
 Layer=RECORD
  front:LayerPtr;
  back:LayerPtr;
  clipRect:ClipRectPtr;
  rp:RastPortPtr;
  bounds:Rectangle;
  reserved:ARRAY [0..3] OF BYTE;
  priority:CARDINAL;
  flags:CARDINAL;
  superBitMap:BitMapPtr;
  superClipRect:ClipRectPtr;
  window:ADDRESS;
  scrollX:INTEGER;
  scrollY:INTEGER;
  cr:ClipRectPtr;
  cr2:ClipRectPtr;
  crnew:ClipRectPtr;
  superSaveClipRects:ClipRectPtr;
  cliprects:ClipRectPtr;
  layerInfo:LayerInfoPtr;
  lock:SignalSemaphore;
  backFill:HookPtr;
  reserved1:LONGCARD;
  clipRegion:RegionPtr;
  saveClipRects:RegionPtr;
  width,height:INTEGER;
  reserved2:ARRAY [0..17] OF BYTE;
  damageList:RegionPtr;
 END;

 ClipRect=RECORD
  next:ClipRectPtr;
  prev:ClipRectPtr;
  lobs:LayerPtr;
  bitMap:BitMapPtr;
  bounds:Rectangle;
  p1:ClipRectPtr;
  p2:ClipRectPtr;
  reserved:LONGINT;
  flags:LONGINT;
 END;

CONST
 needsNoConcealedRasters=01H;
 needsNoLayerblitDamage=02H;

 isLessX=1;
 isLessY=2;
 isGrtrX=4;
 isGrtrY=8;

(* collide.h *)
CONST
 borderHit=0;
 topHit=1;
 bottomHit=2;
 leftHit=4;
 rightHit=8;

(* coerce.h *)
CONST
 (* Bitnummern für CoerceMode(): *)
 (*39*)preserveColors=0;
 (*39*)avoidFlicker=1;

(* copper.h *)
CONST
 move=0;
 wait=1;
 next=2;
 sys=13;
 sht=14;
 lof=15;

TYPE
 CopIns=RECORD
  CASE opCode:CARDINAL OF
  | move:
   destAddr:INTEGER;
   destData:INTEGER;
  | wait:
   vWaitPos:INTEGER;
   hWaitPos:INTEGER;
  | next:
   nxtlist:CopListPtr;
  END;
 END;

 Cprlist=RECORD
  next:CprlistPtr;
  start:ADDRESS;
  maxCount:INTEGER;
 END;

 CopList=RECORD
  next:CopListPtr;
  copList:CopListPtr;
  viewPort:ViewPortPtr;
  copIns:CopInsPtr;
  copPtr:CopInsPtr;
  copLStart:ADDRESS;
  copSStart:ADDRESS;
  count:INTEGER;
  maxCount:INTEGER;
  dyOffset:INTEGER;
  (*34*)cop2Start:ADDRESS;
  (*34*)cop3Start:ADDRESS;
  (*34*)cop4Start:ADDRESS;
  (*34*)cop5Start:ADDRESS;
 END;

 UCopList=RECORD
  next:UCopListPtr;
  firstCopList:CopListPtr;
  copList:CopListPtr;
 END;

 Copinit=RECORD
  vsyncHBlank:ARRAY [0..1] OF CARDINAL;
  diwstart:ARRAY [0..3] OF CARDINAL;
  diagstrt:ARRAY [0..3] OF CARDINAL;
  sprstrtup:ARRAY [0..(2*8*2)-1] OF CARDINAL;
  wait14:ARRAY [0..1] OF CARDINAL;
  normHBlank:ARRAY [0..1] OF CARDINAL;
  genloc:ARRAY [0..3] OF CARDINAL;
  jump:ARRAY [0..(2*2)-1] OF CARDINAL;
  waitForever:ARRAY [0..1] OF CARDINAL;
  sprstop:ARRAY [0..7] OF CARDINAL;
 END;

(* display.h *)
CONST
 m640=08000H;
 plnCntMsk=07H;
 plnCntShft=12;
 pf2pri=40H;
 colorOn=200H;
 dblpf=400H;
 holdnmodify=800H;
 interlace=04H;

 fineScroll=0FH;
 fineScrollShift=04H;
 fineScrollMask=0FH;
 horizPos=07FH;
 vrtclPos=01FFH;
 vrtclPosShift=07H;
 dftchMask=0FFH;
 vposrlof=08000H;

(* gfxnodes.h *)
TYPE
 ExtendedNode=RECORD
  succ:NodePtr;
  pred:NodePtr;
  type:NodeType;
  pri:SHORTINT;
  name:ADDRESS;
  subsystem:SHORTCARD;
  subtype:SHORTCARD;
  library:LONGINT;
  init:PROCEDURE():LONGINT;
 END;

CONST
 ssGraphics=02H;

 viewExtraType=1;
 viewportExtraType=2;
 specialMonitorType=3;
 monitorSpecType=4;

(* monitor.h *)
TYPE
 LongProc=PROCEDURE():LONGINT;

 MonitorSpec=RECORD
  node:ExtendedNode;
  flags:BITSET;
  ratioh:LONGINT;
  ratiov:LONGINT;
  totalRows:CARDINAL;
  totalColorclocks:CARDINAL;
  deniseMaxDisplayColumn:CARDINAL;
  beamCon0:CARDINAL;
  minRow:CARDINAL;
  special:SpecialMonitorPtr;
  openCount:CARDINAL;
  transform:LongProc;
  translate:LongProc;
  scale: LongProc;
  xoffset:CARDINAL;
  yoffset:CARDINAL;
  legalView:Rectangle;
  maxoscan:LongProc;
  videoscan:LongProc;
  deniseMinDisplayColumn:CARDINAL;
  displayCompatible:LONGCARD;
  displayInfoDataBase:List;
  displayInfoDataBaseSemaphore:SignalSemaphore;
  (*39*)mrgCop:LongProc;
  (*39*)loadView:LongProc;
  (*39*)killView:LongProc;
 END;

CONST
 toMonitor=0;
 fromMonitor=1;

 standardXoffset=9;
 standardYoffset=0;

 (* Bitnummern für MonitorSpec: *)
 msRequestNtsc=0;
 msRequestPal=1;
 msRequestSpecial=2;
 msRequestA2024=3;
 (*39*)msDoubleSprites=4;

 defaultMonitorName="default.monitor";
 ntscMonitorName="ntsc.monitor";
 palMonitorName="pal.monitor";

 standardMonitorMask=BITSET{msRequestNtsc,msRequestPal};

 standardNtscRows=262;
 standardPalRows=312;
 standardColorclocks=226;
 standardDeniseMax=455;
 standardDeniseMin=93;
 standardNtscBeamcon=0000H;
 standardPalBeamcon=displayPal;

 specialBeamcon=BeamConFlagSet{
         varVBlank,lolDis,varVSync,varBeam,cSBlank,vSyncTrue};

 minNtscRow=21;
 minPalRow=29;

 standardViewX=81H;
 standardViewY=2CH;
 standardHbstrt=06H;
 standardHsstrt=0BH;
 standardHsstop=1CH;
 standardHbstop=2CH;
 standardVbstrt=0122H;
 standardVsstrt=02A6H;
 standardVsstop=03AAH;
 standardVbstop=1066H;

 vgaColorclocks=standardColorclocks DIV 2;
 vgaTotalRows=standardNtscRows*2;
 vgaDeniseMin=59;

 minVgaRow=29;

 vgaHbstrt=08H;
 vgaHsstrt=0EH;
 vgaHsstop=1CH;
 vgaHbstop=1EH;
 vgaVbstrt=0000H;
 vgaVsstrt=0153H;
 vgaVsstop=0235H;
 vgaVbstop=0CCDH;

 vgaMonitorName="vga.monitor";

 vga70Colorclocks=standardColorclocks DIV 2;
 vga70TotalRows=449;
 vga70DeniseMin=59;
 minVga70Row=35;
 vga70Hbstrt=08H;
 vga70Hsstrt=0EH;
 vga70Hsstop=1CH;
 vga70Hbstop=1EH;
 vga70Vbstrt=0000H;
 vga70Vsstrt=02A6H;
 vga70Vsstop=0388H;
 vga70Vbstop=0F73H;

 vga70Beamcon=specialBeamcon/BeamConFlagSet{vSyncTrue};

 vga70MonitorName="vga70.monitor";

 broadcastHbstrt=01H;
 broadcastHsstrt=06H;
 broadcastHsstop=17H;
 broadcastHbstop=27H;
 broadcastVbstrt=0000H;
 broadcastVsstrt=02A6H;
 broadcastVsstop=054CH;
 broadcastVbstop=1C40H;
 broadcastBeamcon=BeamConFlagSet{lolDis,cSBlank};

 ratioFixedpart=4;
 ratioUnity=SHIFT(LONGCARD(1),ratioFixedpart);

TYPE
 AnalogSignalInterval=RECORD
  strt:CARDINAL;
  stop:CARDINAL;
 END;

 SpecialMonitor=RECORD
  node:ExtendedNode;
  flags:BITSET;
  doMonitor:LongProc;
  reserved1:LongProc;
  reserved2:LongProc;
  reserved3:LongProc;
  hblank:AnalogSignalInterval;
  vblank:AnalogSignalInterval;
  hsync:AnalogSignalInterval;
  vsync:AnalogSignalInterval;
 END;

(* displayinfo.h *)
TYPE
 DisplayInfoHandle=ADDRESS;

CONST
 dtagDisp=80000000H;
 dtagDims=80001000H;
 dtagMntr=80002000H;
 dtagName=80003000H;

TYPE
 QueryHeader=RECORD
  structID:LONGCARD;
  displayID:LONGCARD;
  skipID:LONGCARD;
  length:LONGCARD;
 END;

 PropertyFlags=(
  isLace,isDualpf,isPf2pri,isHam,
  isEcs,isPal,isSprites,isGenlock,
  isWb,isDraggable,isPanelled,isBeamsync,
  isExtrahalfbrite,(*39*)isSpritesAtt,(*39*)isSpritesChngRes,(*39*)isSpritesBorder,
  (*39*)isAA,(*39*)isScanDbl,(*39*)isSpritesChngBase,(*39*)isSpritesChngPri,
  (*39*)isDBuffer,(*39*)isProgBeam,pf22,pf23,
  pf24,pf25,pf26,pf27,
  pf28,pf29,pf30,(*39*)isForeign
 );
 PropertyFlagSet=SET OF PropertyFlags;

 AvailabilityFlags=(
  availNochips,availNomonitor,availNotwithgenlock,avf3,
  avf4,avf5,avf6,avf7,avf8
 );
 AvailabilityFlagSet=SET OF AvailabilityFlags;

 DisplayInfo=RECORD
  header:QueryHeader;
  notAvailable:AvailabilityFlagSet;
  propertyFlags:PropertyFlagSet;
  resolution:Point;
  pixelSpeed:CARDINAL;
  numStdSprites:CARDINAL;
  paletteRange:CARDINAL;
  spriteResolution:Point;
  pad:ARRAY [0..3] OF SHORTCARD;
  (*39*)redBits:SHORTCARD;
  (*39*)greenBits:SHORTCARD;
  (*39*)blueBits:SHORTCARD;
  pad20:SHORTCARD;
  pad21,pad22,pad23,pad24:SHORTCARD;
  reserved2:ARRAY [0..1] OF LONGCARD;
 END;

 DimensionInfo=RECORD
  header:QueryHeader;
  maxDepth:CARDINAL;
  minRasterWidth:CARDINAL;
  minRasterHeight:CARDINAL;
  maxRasterWidth:CARDINAL;
  maxRasterHeight:CARDINAL;
  nominal:Rectangle;
  maxOScan:Rectangle;
  videoOScan:Rectangle;
  txtOScan:Rectangle;
  stdOScan:Rectangle;
  pad:ARRAY [0..13] OF SHORTCARD;
  reserved:ARRAY [0..1] OF LONGCARD;
 END;

 MonitorInfo=RECORD
  header:QueryHeader;
  mspc:MonitorSpecPtr;
  viewPosition:Point;
  viewResolution:Point;
  viewPositionRange:Rectangle;
  totalRows:CARDINAL;
  totalColorClocks:CARDINAL;
  minRow:CARDINAL;
  compatibility:INTEGER;
  pad:ARRAY [0..35] OF SHORTCARD;
  defaultViewPosition:Point;
  preferredModeID:LONGCARD;
  reserved:ARRAY [0..1] OF LONGCARD;
 END;

CONST
 mcompatMixed=0;
 mcompatSelf=1;
 mcompatNobody=-1;

 displayNameLen=32;

TYPE
 NameInfo=RECORD
  header:QueryHeader;
  name:ARRAY [0..displayNameLen-1] OF CHAR;
  reserved:ARRAY [0..1] OF LONGCARD;
 END;

 (* (*39*)VecInfo ist PRIVATE! *)

(* modeid.h *)
CONST
 invalidID=0FFFFFFFFH; (* LONGCARD! *)

 monitorIDmask=0FFFF1000H;

 defaultMonitorID=00000000H;
 ntscMonitorID=00011000H;
 palMonitorID=00021000H;

 loresKey=00000000H;
 hiresKey=00008000H;
 superKey=00008020H;
 hamKey=00000800H;
 loreslaceKey=00000004H;
 hireslaceKey=00008004H;
 superlaceKey=00008024H;
 hamlaceKey=00000804H;
 loresdpfKey=00000400H;
 hiresdpfKey=00008400H;
 superdpfKey=00008420H;
 loreslacedpfKey=00000404H;
 hireslacedpfKey=00008404H;
 superlacedpfKey=00008424H;
 loresdpf2Key=00000440H;
 hiresdpf2Key=00008440H;
 superdpf2Key=00008460H;
 loreslacedpf2Key=00000444H;
 hireslacedpf2Key=00008444H;
 superlacedpf2Key=00008464H;
 extrahalfbriteKey=00000080H;
 extrahalfbritelaceKey=00000084H;

 (*39*)hireshamKey=00008800H;
 (*39*)superhamKey=00008820H;
 (*39*)hiresehbKey=00008080H;
 (*39*)superehbKey=000080A0H;
 (*39*)hireshamlaceKey=00008804H;
 (*39*)superhamlaceKey=00008824H;
 (*39*)hiresehblaceKey=00008084H;
 (*39*)superehblaceKey=000080A4H;

 vgaMonitorID=00031000H;

 vgaextraloresKey=00031004H;
 vgaloresKey=00039004H;
 vgaproductKey=00039024H;
 vgahamKey=00031804H;
 vgaextraloreslaceKey=00031005H;
 vgaloreslaceKey=00039005H;
 vgaproductlaceKey=00039025H;
 vgahamlaceKey=00031805H;
 vgaextraloresdpfKey=00031404H;
 vgaloresdpfKey=00039404H;
 vgaproductdpfKey=00039424H;
 vgaextraloreslacedpfKey=00031405H;
 vgaloreslacedpfKey=00039405H;
 vgaproductlacedpfKey=00039425H;
 vgaextraloresdpf2Key=00031444H;
 vgaloresdpf2Key=00039444H;
 vgaproductdpf2Key=00039464H;
 vgaextraloreslacedpf2Key=00031445H;
 vgaloreslacedpf2Key=00039445H;
 vgaproductlacedpf2Key=00039465H;
 vgaextrahalfbriteKey=00031084H;
 vgaextrahalfbritelaceKey=00031085H;
 (*39*)vgaproducthamKey=39824H;
 (*39*)vgaloreshamKey=39804H;
 (*39*)vgaextraloreshamKey=vgahamKey;
 (*39*)vgaproducthamlaceKey=39825H;
 (*39*)vgaloreshamlaceKey=39805H;
 (*39*)vgaextraloreshamlaceKey=vgahamlaceKey;

 (*39*)vgaextraloresehbKey=vgaextrahalfbriteKey;
 (*39*)vgaextraloresehblaceKey=vgaextrahalfbritelaceKey;
 (*39*)vgaloresehbKey=39084H;
 (*39*)vgaloresehblaceKey=39085H;
 (*39*)vgaehbKey=390A4H;
 (*39*)vgaehblaceKey=390A5H;

 a2024MonitorID=00041000H;

 a2024tenhertzKey=00041000H;
 a2024fifteenhertzKey=00049000H;

 protoMonitorID=00051000H;

 (* Restliche IDs sind >=38! *)
 euro72MonitorID=000061000H;

 euro72extraloresKey		=00061004H;
 euro72loresKey			=00069004H;
 euro72productKey		=00069024H;
 euro72hamKey			=00061804H;
 euro72extraloreslaceKey	=00061005H;
 euro72loreslaceKey		=00069005H;
 euro72productlaceKey		=00069025H;
 euro72hamlaceKey		=00061805H;
 euro72extraloresdpfKey		=00061404H;
 euro72loresdpfKey		=00069404H;
 euro72productdpfKey		=00069424H;
 euro72extraloreslacedpfKey	=00061405H;
 euro72loreslacedpfKey		=00069405H;
 euro72productlacedpfKey	=00069425H;
 euro72extraloresdpf2Key	=00061444H;
 euro72loresdpf2Key		=00069444H;
 euro72productdpf2Key		=00069464H;
 euro72extraloreslacedpf2Key	=00061445H;
 euro72loreslacedpf2Key		=00069445H;
 euro72productlacedpf2Key	=00069465H;
 euro72extrahalfbriteKey	=00061084H;
 euro72extrahalfbritelaceKey	=00061085H;
(* Neue AA modes (V39) *)
 euro72producthamKey		=00069824H;
 euro72producthamlaceKey	=00069825H;
 euro72loreshamKey		=00069804H;
 euro72loreshamlaceKey		=00069805H;
 euro72extraloreshamKey		=euro72hamKey;
 euro72extraloreshamlaceKey	=euro72hamlaceKey;
 euro72extraloresehbKey		=euro72extrahalfbriteKey;
 euro72extraloresehblaceKey	=euro72extrahalfbritelaceKey;
 euro72loresehbKey		=00069084H;
 euro72loresehblaceKey		=00069085H;
 euro72ehbKey			=000690A4H;
 euro72ehblaceKey		=000690A5H;

 euro36MonitorID		=00071000H;

 super72MonitorID		=00081000H;

 dblntscMonitorID		=00091000H;

 dblntscloresKey		=00091000H;
 dblntscloresffKey		=00091004H;
 dblntscloreshamKey		=00091800H;
 dblntscloreshamffKey		=00091804H;
 dblntscloresehbKey		=00091080H;
 dblntscloresehbffKey		=00091084H;
 dblntscloreslaceKey		=00091005H;
 dblntscloreshamlaceKey		=00091805H;
 dblntscloresehblaceKey		=00091085H;
 dblntscloresdpfKey		=00091400H;
 dblntscloresdpflaceKey		=00091404H;
 dblntscloresdpf2Key		=00091440H;
 dblntscloresdpf2laceKey	=00091444H;
 dblntschiresKey		=00099000H;
 dblntschiresffKey		=00099004H;
 dblntschireshamKey		=00099800H;
 dblntschireshamffKey		=00099804H;
 dblntschireslaceKey		=00099005H;
 dblntschireshamlaceKey		=00099805H;
 dblntschiresehbKey		=00099080H;
 dblntschiresehbffKey		=00099084H;
 dblntschiresehblaceKey		=00099085H;
 dblntschiresdpfKey		=00099400H;
 dblntschiresdpflaceKey		=00099404H;
 dblntschiresdpf2Key		=00099440H;
 dblntschiresdpf2laceKey	=00099444H;

 dblpalMonitorID		=000A1000H;

 dblpalloresKey			=000A1000H;
 dblpalloresffKey		=000A1004H;
 dblpalloreshamKey		=000A1800H;
 dblpalloreshamffKey		=000A1804H;
 dblpalloresehbKey		=000A1080H;
 dblpalloresehbffKey		=000A1084H;
 dblpalloreslaceKey		=000A1005H;
 dblpalloreshamlaceKey		=000A1805H;
 dblpalloresehblaceKey		=000A1085H;
 dblpalloresdpfKey		=000A1400H;
 dblpalloresdpflaceKey		=000A1404H;
 dblpalloresdpf2Key		=000A1440H;
 dblpalloresdpf2laceKey		=000A1444H;
 dblpalhiresKey			=000A9000H;
 dblpalhiresffKey		=000A9004H;
 dblpalhireshamKey		=000A9800H;
 dblpalhireshamffKey		=000A9804H;
 dblpalhireslaceKey		=000A9005H;
 dblpalhireshamlaceKey		=000A9805H;
 dblpalhiresehbKey		=000A9080H;
 dblpalhiresehbffKey		=000A9084H;
 dblpalhiresehblaceKey		=000A9085H;
 dblpalhiresdpfKey		=000A9400H;
 dblpalhiresdpflaceKey		=000A9404H;
 dblpalhiresdpf2Key		=000A9440H;
 dblpalhiresdpf2laceKey		=000A9444H;

 (* Tags für BestModeIDA(): *)
 specialFlags=PropertyFlagSet{isDualpf,isPf2pri,isHam,isExtrahalfbrite};
 bidtagDIPFMustHave	=80000001H;
 bidtagDIPFMustNotHave	=80000002H;
 bidtagViewPort		=80000003H;
 bidtagNominalWidth	=80000004H;
 bidtagNominalHeight	=80000005H;
 bidtagDesiredWidth	=80000006H;
 bidtagDesiredHeight	=80000007H;
 bidtagDepth		=80000008H;
 bidtagMonitorID	=80000009H;
 bidtagSourceID		=8000000AH;
 bidtagRedBits		=8000000BH;
 bidtagBlueBits		=8000000CH;
 bidtagGreenBits	=8000000DH;

(* gels.h *)
CONST
 ringtrigger=01H;
 anfracsize=06H;
 animhalf=020H;

 b2Norm=0;
 b2Swap=1;
 b2Bobber=2;

TYPE
 VSpriteFlags=(
  vsprite,saveBack,overlay,mustDraw,vf4,vf5,vf6,vf7,
  backSaved,bobUpdate,gelGone,vsOverflow,vf12,vf13,vf14,vf15
 );
 VSpriteFlagSet=SET OF VSpriteFlags;
 VSprite=RECORD
  nextVSprite:VSpritePtr;
  prevVSprite:VSpritePtr;
  drawPath:VSpritePtr;
  clearPath:VSpritePtr;
  oldY:INTEGER;
  oldX:INTEGER;
  flags:VSpriteFlagSet;
  y:INTEGER;
  x:INTEGER;
  height:INTEGER;
  width:INTEGER;
  depth:INTEGER;
  meMask:BITSET;
  hitMask:BITSET;
  imageData:ADDRESS;
  borderLine:ADDRESS;
  collMask:ADDRESS;
  sprColors:ADDRESS;
  vsBob:BobPtr;
  planePick:SHORTCARD;
  planeOnOff:SHORTCARD;
 END;

 BobFlags=(
  saveBob,bobIsComp,bf2,bf3,bf4,bf5,bf6,bf7,
  bWaiting,bDrawn,bobsAway,bobNix,savePreserve,outStep,bf14,bf15
 );
 BobFlagSet=SET OF BobFlags;

 Bob=RECORD
  flags:BobFlagSet;
  saveBuffer:ADDRESS;
  imageShadow:ADDRESS;
  before:BobPtr;
  after:BobPtr;
  bobVSprite:VSpritePtr;
  bobComp:AnimCompPtr;
  dBuffer:DBufPacketPtr;
 END;

 AnimComp=RECORD
  flags:INTEGER;
  timer:INTEGER;
  timeSet:INTEGER;
  nextComp:AnimCompPtr;
  prevComp:AnimCompPtr;
  nextSeq:AnimCompPtr;
  prevSeq:AnimCompPtr;
  animCRoutine:ADDRESS;
  yTrans:INTEGER;
  xTrans:INTEGER;
  headOb:AnimObPtr;
  animBob:BobPtr;
 END;

 AnimOb=RECORD
  nextOb:AnimObPtr;
  prevOb:AnimObPtr;
  clock:LONGINT;
  anOldY:INTEGER;
  anOldX:INTEGER;
  anY:INTEGER;
  anX:INTEGER;
  yVel:INTEGER;
  xVel:INTEGER;
  yAccel:INTEGER;
  xAccel:INTEGER;
  ringYTrans:INTEGER;
  ringXTrans:INTEGER;
  animORoutine:ADDRESS;
  headComp:AnimCompPtr;
 END;

 DBufPacket=RECORD
  bufY:INTEGER;
  bufX:INTEGER;
  bufPath:VSpritePtr;
  bufBuffer:ADDRESS;
 END;

 CollTable=RECORD
  collPtrs:ARRAY [0..15] OF ADDRESS
 END;

(* gfxbase.h *)
TYPE
 DisplayFlags=(
   ntsc,genloc,pal,todaSafe,(*39*)reallyPal,df5,df6,df7,
   df8,df9,df10,df11,df12,df13,df14,df15
 );
 DisplayFlagSet=SET OF DisplayFlags;

 (*36*)ChipRevs=(hrAgnus,hrDenise,(*38*)aaAlice,(*38*)aaLisa,
                 (*38*)aaMLisa,cr5,cr6,cr7);
 (*36*)ChipRevSet=SET OF ChipRevs;

CONST
 bigBlits=hrAgnus;

 blitMsgFault=4;

 (* für SetChipRev(): *)
 setchiprevA=LONGSET{ORD(hrAgnus)};
 setchiprevECS=LONGSET{ORD(hrAgnus),ORD(hrDenise)};
 setchiprevAA=LONGSET{ORD(aaAlice),ORD(aaLisa)}+setchiprevECS;
 setchiprevBest=LONGSET{0..31};

(* memory type *)
 bus16=0;
 nmlCas=0;
 bus32=1;
 dblCas=2;
 bandwidth1x=bus16+nmlCas;
 bandwidth2xnml=bus32;
 bandwidth2xdbl=dblCas;
 bandwidth4x=bus32+dblCas;

TYPE
 GfxBase=RECORD
  libNode:Library;
  actiView:ViewPtr;
  copinit:CopinitPtr;
  cia:ADDRESS;
  blitter:ADDRESS;
  loFlist:ADDRESS;
  shFlist:ADDRESS;
  blthd:BltnodePtr;
  blttl:BltnodePtr;
  bsblthd:BltnodePtr;
  bsblttl:BltnodePtr;
  vbsrv:Interrupt;
  timsrv:Interrupt;
  bltsrv:Interrupt;
  textFonts:List;
  defaultFont:TextFontPtr;
  modes:BITSET;
  vBlank:SHORTCARD;
  debug:BYTE;
  beamSync:INTEGER;
  bplcon0:BITSET;
  spriteReserved:SHORTCARD;
  bytereserved:SHORTCARD;
  flags:BITSET;
  blitLock:INTEGER;
  blitNest:INTEGER;
  blitWaitQ:List;
  blitOwner:TaskPtr;
  waitQ:List;
  displayFlags:DisplayFlagSet;
  simpleSprites:ADDRESS;
  maxDisplayRow:CARDINAL;
  maxDisplayColumn:CARDINAL;
  normalDisplayRows:CARDINAL;
  normalDisplayColumns:CARDINAL;
  normalDPMX:CARDINAL;
  normalDPMY:CARDINAL;
  lastChanceMemory:SignalSemaphorePtr;
  lcMptr:ADDRESS;
  microsPerLine:CARDINAL;
  minDisplayColumn:CARDINAL;
  (*36*)chipRevBits0:ChipRevSet;
  (*36*)memType:SHORTCARD;
  (*36*)reserved:ARRAY [0..3] OF SHORTCARD;
  (*36*)monitorId:CARDINAL;
  (*36*)hedley:ARRAY [0..7] OF ADDRESS;
  (*36*)hedleySprites:ARRAY[0..7]OF ADDRESS;
  (*36*)hedleySprites1:ARRAY[0..7]OF ADDRESS;
  (*36*)hedleyCount:INTEGER;
  (*36*)hedleyFlags:BITSET;
  (*36*)hedleyTmp:INTEGER;
  (*36*)hashTable:ADDRESS;
  (*36*)currentTotRows:CARDINAL;
  (*36*)currentTotCclks:CARDINAL;
  (*36*)hedleyHint:SHORTCARD;
  (*36*)hedleyHint2:SHORTCARD;
  (*36*)nreserved:ARRAY [0..3] OF LONGCARD;
  (*36*)a2024SyncRaster:ADDRESS;
  (*36*)controlDeltaPal:INTEGER;
  (*36*)controlDeltaNtsc:INTEGER;
  (*36*)currentMonitor:MonitorSpecPtr;
  (*36*)monitorList:List;
  (*36*)defaultMonitor:MonitorSpecPtr;
  (*36*)monitorListSemaphore:SignalSemaphorePtr;
  (*36*)displayInfoDataBase:ADDRESS;
  (*39*)topLine:CARDINAL;
  (*36*)actiViewCprSemaphore:SignalSemaphorePtr;
  (*36*)utilityBase:ADDRESS;
  (*36*)execBase:ADDRESS;
  (*39*)bwshifts:ADDRESS;
  (*39*)strtFetchMasks:ADDRESS;
  (*39*)stopFetchMasks:ADDRESS;
  (*39*)overrun:ADDRESS;
  (*39*)realStops:ADDRESS;
  (*39*)spriteWidth:CARDINAL;
  (*39*)spriteFMode:BITSET;
  (*39*)softSprites:SHORTINT;
  (*39*)arraywidth:SHORTINT;
  (*39*)defaultSpriteWidth:CARDINAL;
  (*39*)sprMoveDisable:SHORTINT;
  (*39*)wantChips:SHORTCARD;
  (*39*)boardMemType:SHORTCARD;
  (*39*)bugs:SHORTCARD;
  (*39*)layersBase:ADDRESS;
  (*39*)colorMask:LONGCARD;
  (*39*)iVector:ADDRESS;
  (*39*)iData:ADDRESS;
  (*39*)specialCounter:LONGCARD;
  (*39*)dBList:ADDRESS;
  (*39*)monitorFlags:BITSET;
  (*39*)scanDoubledSprites:SHORTCARD;
  (*39*)bP3Bits:SHORTCARD;
  (*39*)monitorVBlank:AnalogSignalInterval;
  (*39*)naturalMonitor:MonitorSpecPtr;
  (*39*)progData:ADDRESS;
  (*39*)extSprites:SHORTCARD;
 END;

(* graphint.h *)
TYPE
 Isrvstr=RECORD
  node:Node;
  iptr:IsrvstrPtr;
  code:ADDRESS;
  ccode:ADDRESS;
  carg:LONGINT;
 END;

(* layers.h *)
TYPE
 LayerFlags=(
  layerSimple,layerSmart,layerSuper,lf3,
  layerUpdating,lf5,layerBackdrop,layerRefresh,
  layerClipRectsLost,(*39*)layerIRefresh,(*39*)layerIRefresh2,lf11,
  lf12,lf13,lf14,lf15
 );
 LayerFlagSet=SET OF LayerFlags;

 LayerInfo=RECORD
  layer:LayerPtr;
  lp:LayerPtr;
  obs:ClipRectPtr;
  freeClipRects:ClipRectPtr;
  privateReserve1,
  privateReserve2:LONGINT;
  lock:SignalSemaphore;
  head:MinList;
  privateReserve3:INTEGER;
  privateReserve4:ADDRESS;
  flags:LayerFlagSet;
  fattenCount:SHORTINT;
  lockLayersCount:SHORTINT;
  privateReserve5:INTEGER;
  blankHook:ADDRESS;
  layerInfoExtra:ADDRESS;
 END;

CONST
 newLayerInfoCalled=01H;
 layersNoBackFill=CAST(HookPtr,LONGINT(1));
 layersBackFill=CAST(HookPtr,NIL);

(* text.h *)
TYPE
 FontStyles=(
  underlined,bold,italic,extended,fs4,fs5,colorFont,tagged
 );
 FontStyleSet=SET OF FontStyles;

CONST
 normalFont=FontStyleSet{};

TYPE
 FontFlags=(
  romFont,diskFont,revPath,tallDot,wideDot,proportional,designed,removed
 );
 FontFlagSet=SET OF FontFlags;

 TextAttr=RECORD
  name:ADDRESS;
  ySize:CARDINAL;
  style:FontStyleSet;
  flags:FontFlagSet;
 END;

 TTextAttr=RECORD
  name:ADDRESS;
  ySize:CARDINAL;
  style:FontStyleSet;
  flags:FontFlagSet;
  tags:TagItemPtr;
 END;

CONST
 taDeviceDPI=tagUser+1;
 maxFontMatchWeight=32767;

TYPE
 TextFont=RECORD
  message:Message;
  ySize:CARDINAL;
  style:FontStyleSet;
  flags:FontFlagSet;
  xSize:CARDINAL;
  baseline:CARDINAL;
  boldSmear:CARDINAL;
  accessors:CARDINAL;
  loChar:CHAR;
  hiChar:CHAR;
  charData:ADDRESS;
  modulo:CARDINAL;
  charLoc:ADDRESS;
  charSpace:ADDRESS;
  charKern:ADDRESS;
 END;

 TextFontExt0Flags=(noRemFont);
 TextFontExt0FlagSet=SET OF TextFontExt0Flags;

 TextFontExtension=RECORD
  matchWord:CARDINAL;
  flags0:TextFontExt0FlagSet;
  flags1:SHORTSET;
  backPtr:TextFontPtr;
  origReplyPort:MsgPortPtr;
  tags:TagItemPtr;
  oFontPatchS:ADDRESS;
  oFontPatchK:ADDRESS;
 END;

 ColorFontColors=RECORD
  reserved:CARDINAL;
  count:CARDINAL;
  colorTable:POINTER TO ARRAY [0..1000] OF CARDINAL;
 END;

 ColorTextFontFlags=(
  colorfont,greyfont,antialias,ctf3,ctf4,ctf5,ctf6,ctf7,
  ctf8,ctf9,ctf10,ctf11,ctf12,ctf13,ctf14,ctf15
 );
 ColorTextFontFlagSet=SET OF ColorTextFontFlags;

CONST
 mapColor=colorFont;
 colorMask=ColorTextFontFlagSet{colorfont..ctf3};

TYPE
 ColorTextFont=RECORD
  tf:TextFont;
  flags:CARDINAL;
  depth:SHORTCARD;
  fgColor:SHORTCARD;
  low:SHORTCARD;
  high:SHORTCARD;
  planePick:SHORTCARD;
  planeOnOff:SHORTCARD;
  colorFontColors:ColorFontColorsPtr;
  charData:ARRAY[0..7] OF ADDRESS;
 END;

 TextExtent=RECORD
  width:CARDINAL;
  height:CARDINAL;
  extent:Rectangle;
 END;

(* rastport.h *)
TYPE
 AreaInfo=RECORD
  vctrTbl:ADDRESS;
  vctrPtr:ADDRESS;
  flagTbl:ADDRESS;
  flagPtr:ADDRESS;
  count:INTEGER;
  maxCount:INTEGER;
  firstX:INTEGER;
  firstY:INTEGER;
 END;

 TmpRas=RECORD
  rasPtr:ADDRESS;
  size:LONGINT;
 END;

 GelsInfo=RECORD
  sprRsrvd:SHORTINT;
  flags:SHORTCARD;
  gelHead:VSpritePtr;
  gelTail:VSpritePtr;
  nextLine:ADDRESS;
  lastColor:ADDRESS;
  collHandler:CollTablePtr;
  leftmost:INTEGER;
  rightmost:INTEGER;
  topmost:INTEGER;
  bottommost:INTEGER;
  firstBlissObj:ADDRESS;
  lastBlissObj:ADDRESS;
 END;

 DrawModes=(dm0,complement,inversvid);
 DrawModeSet=SET OF DrawModes;

 RastPortFlags=(
  firstDot,oneDot,dBuffer,areaOutline,rpf4,noCrossFill,rpf6,rpf7,rpf8
 );
 RastPortFlagSet=SET OF RastPortFlags;

 RastPort=RECORD
  layer:LayerPtr;
  bitMap:BitMapPtr;
  areaPtrn:ADDRESS;
  tmpRas:TmpRasPtr;
  areaInfo:AreaInfoPtr;
  gelsInfo:GelsInfoPtr;
  mask:SHORTCARD;
  fgPen:SHORTCARD;
  bgPen:SHORTCARD;
  aOlPen:SHORTCARD;
  drawMode:DrawModeSet;
  areaPtSz:SHORTCARD;
  linPatCnt:SHORTCARD;
  dummy:BYTE;
  flags:RastPortFlagSet;
  linePtrn:CARDINAL;
  x:INTEGER;
  y:INTEGER;
  minterms:ARRAY [0..7] OF SHORTCARD;
  penWidth:INTEGER;
  penHeight:INTEGER;
  font:TextFontPtr;
  algoStyle:FontStyleSet;
  txFlags:FontFlagSet;
  txHeight:CARDINAL;
  txWidth:CARDINAL;
  txBaseline:CARDINAL;
  txSpacing:INTEGER;
  user:ADDRESS;
  longreserved:ARRAY [0..1] OF LONGINT;
  wordreserved:ARRAY [0..6] OF WORD;
  reserved:ARRAY [0..7] OF BYTE;
 END;

CONST
 jam1=DrawModeSet{};
 jam2=DrawModeSet{dm0};

(* regions.h *)
TYPE
 RegionRectangle=RECORD
  next:RegionRectanglePtr;
  prev:RegionRectanglePtr;
  bounds:Rectangle;
 END;

 Region=RECORD
  bounds:Rectangle;
  regionRectangle:RegionRectanglePtr;
 END;

(* rpattr.h *)
CONST
 (* Tags für GetRPAttr[s]A(), SetRPAttr[s]A(): *)
 rptagFont	=80000000H;
 rptagAPen	=80000002H;
 rptagBPen	=80000003H;
 rptagDrMd	=80000004H;
 rptagOutLinePen=80000005H;
 rptagWriteMask	=80000006H;
 rptagMaxPen    =80000007H;
 rptagDrawBounds=80000008H;

(* scale.h *)
TYPE
 BitScaleArgs=RECORD
  srcX:CARDINAL;
  srcY:CARDINAL;
  srcWidth:CARDINAL;
  srcHeight:CARDINAL;
  srcXFactor:CARDINAL;
  srcYFactor:CARDINAL;
  destX:CARDINAL;
  destY:CARDINAL;
  destWidth:CARDINAL;
  destHeight:CARDINAL;
  xDestFactor:CARDINAL;
  yDestFactor:CARDINAL;
  srcBitMap:BitMapPtr;
  destBitMap:BitMapPtr;
  flags:LONGCARD;
  xDDA:CARDINAL;
  yDDA:CARDINAL;
  reserved1:LONGINT;
  reserved2:LONGINT;
 END;

(* sprite.h *)
CONST
 spriteAttached=080H;

TYPE
 SimpleSprite=RECORD
  posctldata:ADDRESS;
  height:CARDINAL;
  x:CARDINAL;
  y:CARDINAL;
  num:INTEGER;
 END;

 (*39*)ExtSprite=RECORD
         simpleSprite:SimpleSprite;
         wordwidth:CARDINAL;
         flags:BITSET;
       END;

CONST
 (* Tags für AllocSpriteDataA(): *)
 spriteaWidth        =81000000H;
 spriteaXReplication =81000002H;
 spriteaYReplication =81000004H;
 spriteaOutputHeight =81000006H;
 spriteaAttached     =81000008H;
 spriteaOldDataFormat=8100000AH;

 (* Tags für GetExtSpriteA(): *)
 gstagSpriteNum =82000020H;
 gstagAttached  =82000022H;
 gstagSoftSprite=82000024H;

 (* Tags für GetExtSpriteA() u. ChangeExtSpriteA(): *)
 gstagScanDoubled=83000000H;

(* videocontrol.h *)
CONST
 vtagEndCm=00000000H;

TYPE
 VTags=(
  vtagChromakeyClr:=tagUser,
  vtagChromakeySet,
  vtagBitplanekeyClr,
  vtagBitplanekeySet,
  vtagBorderblankClr,
  vtagBorderblankSet,
  vtagBordernotransClr,
  vtagBordernotransSet,
  vtagChromaPenClr,
  vtagChromaPenSet,
  vtagChromaPlaneSet,
  vtagAttachCmSet,
  vtagNextbufCm,
  vtagBatchCmClr,
  vtagBatchCmSet,
  vtagNormalDispGet,
  vtagNormalDispSet,
  vtagCoerceDispGet,
  vtagCoerceDispSet,
  vtagViewportextraGet,
  vtagViewportextraSet,
  vtagChromakeyGet,
  vtagBitplanekeyGet,
  vtagBorderblankGet,
  vtagBordernotransGet,
  vtagChromaPenGet,
  vtagChromaPlaneGet,
  vtagAttachCmGet,
  vtagBatchCmGet,
  vtagBatchItemsGet,
  vtagBatchItemsSet,
  vtagBatchItemsAdd,
  vtagVpmodeidGet,
  vtagVpmodeidSet,
  vtagVpmodeidClr,
  vtagUserclipGet,
  vtagUserclipSet,
  vtagUserclipClr, (* +25H *)
  (*39*)vtagPf1BaseGet,
  (*39*)vtagPf2BaseGet,
  (*39*)vtagSpEvenBaseGet,
  (*39*)vtagSpOddBaseGet,
  (*39*)vtagPf1BaseSet,
  (*39*)vtagPf2BaseSet,
  (*39*)vtagSpEvenBaseSet,
  (*39*)vtagSpOddBaseSet,
  (*39*)vtagBorderSpriteGet,
  (*39*)vtagBorderSpriteSet,
  (*39*)vtagBorderSpriteClr,
  (*39*)vtagSpriteResnSet,
  (*39*)vtagSpriteResnGet,
  (*39*)vtagPf1ToSpritePriSet,
  (*39*)vtagPf1ToSpritePriGet,
  (*39*)vtagPf2ToSpritePriSet,
  (*39*)vtagPf2ToSpritePriGet,
  (*39*)vtagImmediate,
  (*39*)vtagFullPaletteSet,
  (*39*)vtagFullPaletteGet,
  (*39*)vtagFullPaletteClr,
  (*39*)vtagDefSpriteResnSet,
  (*39*)vtagDefSpriteResnGet  (* +3CH *)
 );

(* view.h *)
TYPE
 ViewModes=(
  vm0,genlocVideo,lace,doubleScan,
  vm4,superHires,pfba,extraHalfbrite,
  genlocAudio,vm9,dualpf,ham,
  extendedMode,vpHide,sprites,hires
 );
 ViewModeSet=SET OF ViewModes;

CONST
 extendVStruct=extendedMode;
 (* Bitnummern f. ViewPortExtra.flags: *)
 vpxbFreeMe=0;
 vpxbLast=1;
 vpxbStraddles256=4;
 vpxbStraddles512=5;

TYPE
 ViewPort=RECORD
  next:ViewPortPtr;
  colorMap:ColorMapPtr;
  dspIns:CopListPtr;
  sprIns:CopListPtr;
  clrIns:CopListPtr;
  uCopIns:UCopListPtr;
  dWidth:INTEGER;
  dHeight:INTEGER;
  dxOffset:INTEGER;
  dyOffset:INTEGER;
  modes:ViewModeSet;
  spritePriorities:SHORTCARD;
  extendedModes:SHORTSET;
  rasInfo:RasInfoPtr;
 END;

 View=RECORD
  viewPort:ViewPortPtr;
  lofCprList:CprlistPtr;
  shfCprList:CprlistPtr;
  dyOffset:INTEGER;
  dxOffset:INTEGER;
  modes:ViewModeSet;
 END;

 ViewExtra=RECORD
  n:ExtendedNode;
  view:ViewPtr;
  monitor:MonitorSpecPtr;
  (*39*)topLine:CARDINAL;
 END;

 ViewPortExtra=RECORD
  n:ExtendedNode;
  viewPort:ViewPortPtr;
  displayClip:Rectangle;
  (*39*)vecTable:ADDRESS;
  (*39*)driverData:ARRAY [0..1] OF ADDRESS;
  (*39*)flags:BITSET;
  (*39*)origin:ARRAY [0..1] OF Point;
 END;

 RasInfo=RECORD
  next:RasInfoPtr;
  bitMap:BitMapPtr;
  rxOffset:INTEGER;
  ryOffset:INTEGER;
 END;

 ColorMapType=(colorMapTypeV33,colorMapTypeV36,(*39*)colorMapTypeV39);

 ColorMapFlags=(
  colormapTransparency,colorPlaneTransparency,borderBlanking,
  borderNoTransparency,videoControlBatch,userCopperClip,borderSprites,cm7
 );
 ColorMapFlagSet=SET OF ColorMapFlags;

 ColorMap=RECORD
  flags:ColorMapFlagSet;
  type:ColorMapType;
  count:CARDINAL;
  colorTable:ADDRESS;
  vpe:ViewPortExtraPtr;
  transparencyBits:ADDRESS;
  transparencyPlane:SHORTCARD;
  reserved1:SHORTCARD;
  reserved2:CARDINAL;
  vp:ViewPortPtr;
  normalDisplayInfo:ADDRESS;
  coerceDisplayInfo:ADDRESS;
  batchItems:TagItemPtr;
  vpModeID:LONGCARD;
  (*39*)palExtra:PaletteExtraPtr;
  (*39*)spriteBaseEven:CARDINAL;
  (*39*)spriteBaseOdd:CARDINAL;
  (*39*)bp0Base:CARDINAL;
  (*39*)bp1Base:CARDINAL;
 END;

 (*39*)PaletteExtra=RECORD
        semaphore:SignalSemaphore;
        firstFree:CARDINAL;
        nFree:CARDINAL;
        firstShared:CARDINAL;
        nShared:CARDINAL;
        refCnt:ADDRESS;
        allocList:ADDRESS;
        viewPort:ViewPortPtr;
        sharableColors:CARDINAL;
       END;

CONST
 (* Bitnummern für ObtainPen(): *)
 penExclusive=0;
 penNoSetColor=1;

 (* Werte und Tags für ObtainBestPenA(): *)
 precisionExact=-1;
 precisionImage=0;
 precisionIcon=16;
 precisionGui=32;
 opbPrecision=84000000H;
 opbFailIfBad=84000001H;

 (* Resultate von MakeVPortRes(): (=MakeVPort!) *)
 mvpOk=0;
 mvpNoMem=1;
 mvpNoVpe=2;
 mvpNoDspIns=3;
 mvpNoDisplay=4;

 (* Resultate von MrgCopRes(): (=MrgCop!) *)
 mcopOk=0;
 mcopNoMem=1;
 mcopNop=3;

TYPE
 (*39*)DBufInfo=RECORD
        link1:ADDRESS;
        count1:LONGCARD;
        safeMessage:Message;
        userData1:ADDRESS;
        link2:ADDRESS;
        count2:LONGCARD;
        dispMessage:Message;
        userData2:ADDRESS;
        matchLong:LONGCARD;
        copPtr1:ADDRESS;
        copPtr2:ADDRESS;
        copPtr3:ADDRESS;
        beamPos1:CARDINAL;
        beamPos2:CARDINAL;
       END;

END GraphicsD.noimp
