agraphics.pas 100 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu>
  4. graphics.library interface unit for MorphOS/PowerPC
  5. Based on work of Nils Sjoholm member of the Amiga RTL
  6. development team.
  7. MorphOS port was done on a free Pegasos II/G4 machine
  8. provided by Genesi S.a.r.l. <www.genesi.lu>
  9. See the file COPYING.FPC, included in this distribution,
  10. for details about the copyright.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. **********************************************************************}
  15. {$PACKRECORDS 2}
  16. {$IFNDEF FPC_DOTTEDUNITS}
  17. unit agraphics;
  18. {$ENDIF FPC_DOTTEDUNITS}
  19. interface
  20. {$IFDEF FPC_DOTTEDUNITS}
  21. uses
  22. Amiga.Core.Exec, Amiga.Core.Hardware, Amiga.Core.Utility;
  23. {$ELSE FPC_DOTTEDUNITS}
  24. uses
  25. exec, hardware, utility;
  26. {$ENDIF FPC_DOTTEDUNITS}
  27. const
  28. BITSET = $8000;
  29. BITCLR = 0;
  30. type
  31. PRectangle = ^TRectangle;
  32. TRectangle = record
  33. MinX,
  34. MinY: SmallInt;
  35. MaxX,
  36. MaxY: SmallInt;
  37. end;
  38. PRect32 = ^TRect32;
  39. TRect32 = record
  40. MinX,
  41. MinY: Longint;
  42. MaxX,
  43. MaxY: Longint;
  44. end;
  45. PPoint = ^TPoint;
  46. TPoint = record
  47. x, y: SmallInt;
  48. end;
  49. TPlanePtr = PByte;
  50. PBitMap = ^TBitMap;
  51. TBitMap = record
  52. BytesPerRow: Word;
  53. Rows: Word;
  54. Flags: Byte;
  55. Depth: Byte;
  56. Pad: Word;
  57. Planes: array[0..7] of TPlanePtr;
  58. end;
  59. PExtendedNode = ^TExtendedNode;
  60. TExtendedNode = record
  61. xln_Succ,
  62. xln_Pred: PNode;
  63. xln_Type: Byte; // NT_GRAPHICS
  64. xln_Pri: ShortInt;
  65. xln_Name: PAnsiChar;
  66. xln_Subsystem: Byte; // see below
  67. xln_Subtype: Byte; // SS_GRAPHICS
  68. xln_Library : Longint;
  69. xln_Init : Pointer;
  70. end;
  71. // flags for AllocBitMap, etc.
  72. const
  73. BMB_CLEAR = 0;
  74. BMB_DISPLAYABLE = 1;
  75. BMB_INTERLEAVED = 2;
  76. BMB_STANDARD = 3;
  77. BMB_MINPLANES = 4;
  78. BMF_CLEAR = 1 shl BMB_CLEAR;
  79. BMF_DISPLAYABLE = 1 shl BMB_DISPLAYABLE;
  80. BMF_INTERLEAVED = 1 shl BMB_INTERLEAVED;
  81. BMF_STANDARD = 1 shl BMB_STANDARD;
  82. BMF_MINPLANES = 1 shl BMB_MINPLANES;
  83. // the following IDs are for GetBitMapAttr() *}
  84. BMA_HEIGHT = 0;
  85. BMA_DEPTH = 4;
  86. BMA_WIDTH = 8;
  87. BMA_FLAGS = 12;
  88. { structures used by and constructed by windowlib.a }
  89. { understood by rom software }
  90. type
  91. PClipRect = ^TClipRect;
  92. PLayer = ^TLayer;
  93. PRastPort = ^TRastPort;
  94. PCopList = ^TCopList;
  95. PViewPort = ^TViewPort;
  96. PColorMap = ^TColorMap;
  97. PRegionRectangle = ^TRegionRectangle;
  98. TRegionRectangle = record
  99. Next, Prev: PRegionRectangle;
  100. Bounds: TRectangle;
  101. end;
  102. PRegion = ^TRegion;
  103. TRegion = record
  104. Bounds: TRectangle;
  105. RegionRectangle: PRegionRectangle;
  106. end;
  107. TClipRect = record
  108. Next : PClipRect; // roms used to find next ClipRect
  109. prev : PClipRect; // ignored by roms, used by windowlib
  110. lobs : PLayer; // ignored by roms, used by windowlib
  111. BitMap : PBitMap;
  112. Bounds : TRectangle; // set up by windowlib, used by roms
  113. _p1,
  114. _p2 : APTR; // system reserved
  115. reserved: LongInt; // system use
  116. end;
  117. PLayer_Info = ^TLayer_Info;
  118. TLayer_Info = record
  119. Top_Layer: Player;
  120. check_lp: PLayer;
  121. Obs: PClipRect;
  122. FreeClipRects: PClipRect;
  123. PrivateReserve1: LongInt;
  124. PrivateReserve2: LongInt;
  125. Lock: TSignalSemaphore;
  126. gs_Head: TMinList;
  127. PrivateReserve3: SmallInt;
  128. PrivateReserve4: APTR;
  129. Flags: Word; // LIFLG_SUPPORTS_OFFSCREEN_LAYERS
  130. fatten_count: ShortInt;
  131. LockLayersCount: ShortInt;
  132. PrivateReserve5: SmallInt;
  133. BlankHook: APTR;
  134. LayerInfo_extra: APTR;
  135. end;
  136. TLayer = record
  137. Front,
  138. Back : PLayer; // ignored by roms
  139. ClipRect : PClipRect; // read by roms to find first cliprect
  140. Rp : PRastPort; // ignored by roms, I hope
  141. Bounds : TRectangle; // ignored by roms
  142. Reserved : array[0..3] of Byte;
  143. Priority : Word; // system use only
  144. Flags : Word; // obscured ?, Virtual BitMap?
  145. SuperBitMap : PBitMap;
  146. SuperClipRect : PClipRect; // super bitmap cliprects if VBitMap != 0 else damage cliprect list for refresh
  147. Window : APTR; // reserved for user interface use
  148. Scroll_X,
  149. Scroll_Y : Word;
  150. Cr,
  151. Cr2,
  152. CrNew : PClipRect; // used by dedice
  153. SuperSaveClipRects: PClipRect; // preallocated cr's
  154. _ClipRects : PClipRect; // system use during refresh
  155. LayerInfo : Pointer; // PLayer_Info points to head of the list
  156. Lock : TSignalSemaphore;
  157. BackFill : PHook;
  158. Reserved1 : LongWord;
  159. ClipRegion : PRegion;
  160. SaveClipRects : PRegion; // used to back out when in trouble
  161. Width,
  162. Height : SmallInt;
  163. Reserved2 : array[0..17] of Byte;
  164. { this must stay here }
  165. DamageList : PRegion; // list of rectangles to refresh through
  166. end;
  167. {***** TextAttr node, matches text attributes in RastPort *********}
  168. // TextAttr node, matches text attributes in RastPort
  169. PTextAttr = ^TTextAttr;
  170. TTextAttr = record
  171. ta_Name: STRPTR; // name of the font
  172. ta_YSize: Word; // height of the font
  173. ta_Style: Byte; // intrinsic font style
  174. ta_Flags: Byte; // font preferences and flags
  175. end;
  176. // like TextAttr + Tags
  177. PTTextAttr = ^TTTextAttr;
  178. TTTextAttr = record
  179. tta_Name: STRPTR; // name of the font
  180. tta_YSize: Word; // height of the font
  181. tta_Style: Byte; // intrinsic font style
  182. tta_Flags: Byte; // font preferences and flags
  183. tta_Tags: PTagItem; // TTextAttr specific extension -> extended attributes
  184. end;
  185. {***** TextFonts node *********************************************}
  186. PTextFont = ^TTextFont;
  187. TTextFont = record
  188. tf_Message: TMessage; // reply message for font removal
  189. // font name in LN \ used in this
  190. tf_YSize: Word; // font height | order to best
  191. tf_Style: Byte; // font style | match a font
  192. tf_Flags: Byte; // preferences and flags / request.
  193. tf_XSize: Word; // nominal font width
  194. tf_Baseline: Word; // distance from the top of AnsiChar to baseline
  195. tf_BoldSmear: Word; // smear to affect a bold enhancement
  196. tf_Accessors: Word; // access count
  197. tf_LoChar: Byte; // the first character described here
  198. tf_HiChar: Byte; // the last character described here
  199. tf_CharData: APTR; // the bit character data
  200. tf_Modulo: Word; // the row modulo for the strike font data
  201. tf_CharLoc: APTR; // ptr to location data for the strike font 2 words: bit offset then size
  202. tf_CharSpace: APTR; // ptr to words of proportional spacing data
  203. tf_CharKern: APTR; // ptr to words of kerning data
  204. //property tf_extension: PMsgPort read tf_Message.mn_ReplyPort write tf_Message.mn_ReplyPort;
  205. end;
  206. PTextFontExtension = ^TTextFontExtension;
  207. TTextFontExtension = record // this structure is read-only
  208. tfe_MatchWord: Word; // a magic cookie for the extension
  209. tfe_Flags0: Byte; // (system private flags)
  210. tfe_Flags1: Byte; // (system private flags)
  211. tfe_BackPtr: PTextFont; // validation of compilation
  212. tfe_OrigReplyPort: PMsgPort; // original value in tf_Extension
  213. tfe_Tags: PTagItem; // Text Tags for the font
  214. tfe_OFontPatchS, // (system private use)
  215. tfe_OFontPatchK: PWord; // (system private use)
  216. // this space is reserved for future expansion
  217. end;
  218. PColorFontColors = ^TColorFontColors;
  219. TColorFontColors = record
  220. cfc_Reserved, // *must* be zero
  221. cfc_Count: Word; // number of entries in cfc_ColorTable
  222. cfc_ColorTable: PWord; // 4 bit per component color map packed xRGB
  223. end;
  224. PColorTextFont = ^TColorTextFont;
  225. TColorTextFont = record
  226. ctf_TF: TTextFont;
  227. ctf_Flags: Word; // extended flags
  228. ctf_Depth, // number of bit planes
  229. ctf_FgColor, // color that is remapped to FgPen
  230. ctf_Low, // lowest color represented here }
  231. ctf_High, // highest color represented here }
  232. ctf_PlanePick, // PlanePick ala Images }
  233. ctf_PlaneOnOff: Byte; // PlaneOnOff ala Images
  234. ctf_ColorFontColors: PColorFontColors; // colors for font
  235. ctf_CharData: array[0..7] of APTR; // pointers to bit planes ala tf_CharData
  236. end;
  237. PTextExtent = ^TTextExtent;
  238. TTextExtent = record
  239. te_Width, // same as TextLength
  240. te_Height: Word; // same as tf_YSize
  241. te_Extent: TRectangle; // relative to CP
  242. end;
  243. { Note: The combination VWaitAddr and HWaitAddr replace a three way
  244. union in C. The three possibilities are:
  245. nxtList : CopListPtr; or
  246. VWaitPos : Longint;
  247. HWaitPos : Longint; or
  248. DestAddr : Longint;
  249. DestData : Longint;
  250. }
  251. PCopIns = ^TCopIns;
  252. PUCopList = ^TUCopList;
  253. PVSprite = ^TVSprite;
  254. PPaletteExtra = ^TPaletteExtra;
  255. TCopIns = record
  256. OpCode: SmallInt; // 0 = move, 1 = wait
  257. case SmallInt of
  258. 0:(
  259. NxtList: PCopList;
  260. );
  261. 1:(
  262. DestAddr: SmallInt; // destination Pointer
  263. DestData: SmallInt; // data to send
  264. );
  265. 2:(
  266. VWaitPos: SmallInt; // vertical wait position
  267. HWaitPos: SmallInt; // horizontal wait position
  268. );
  269. end;
  270. // structure of cprlist that points to list that hardware actually executes
  271. PCprList = ^TCprList;
  272. TCprList = record
  273. Next: PCprList;
  274. Start: PWord; // start of copper list
  275. MaxCount: SmallInt; // number of long instructions
  276. end;
  277. TUCopList = record
  278. Next: PUCopList;
  279. FirstCopList: PCopList; // head node of this copper list
  280. CopList: PCopList; // node in use
  281. end;
  282. TCopList = record
  283. Next: PCopList; // next block for this copper list
  284. _CopList: PCopList; // system use
  285. _ViewPort: PViewPort; // system use
  286. CopIns: PCopIns; // start of this block
  287. CopPtr: PCopIns; // intermediate ptr
  288. CopLStart: PSmallInt; // mrgcop fills this in for Long Frame
  289. CopSStart: PSmallInt; // mrgcop fills this in for Longint Frame
  290. Count: Smallint; // intermediate counter
  291. MaxCount: SmallInt; // max # of copins for this block
  292. DyOffset: SmallInt; // offset this copper list vertical waits
  293. SLRepeat: Word;
  294. Flags: Word; // EXACT_LINE or HALF_LINE
  295. end;
  296. PCopInit = ^TCopInit;
  297. TCopInit = record
  298. vsync_hblank: array[0..1] of Word;
  299. diagstrt: array[0..11] of Word;
  300. fm0: array[0..1] of Word;
  301. diwstart: array[0..9] of Word;
  302. bplcon2: array[0..1] of Word;
  303. sprfix: array[0..15] of Word;
  304. sprstrtup: array[0..31] of Word;
  305. wait14: array[0..1] of Word;
  306. norm_hblank: array[0..1] of Word;
  307. jump: array[0..1] of Word;
  308. wait_forever: array[0..5] of Word;
  309. sprstop: array[0..7] of Word;
  310. end;
  311. PAreaInfo = ^TAreaInfo;
  312. TAreaInfo = record
  313. VctrTbl: PSmallInt; // ptr to start of vector table
  314. VctrPtr: PSmallInt; // ptr to current vertex
  315. FlagTbl: PShortInt; // ptr to start of vector flag table
  316. FlagPtr: PShortInt; // ptrs to areafill flags
  317. Count: SmallInt; // number of vertices in list
  318. MaxCount: SmallInt; // AreaMove/Draw will not allow Count>MaxCount
  319. FirstX,
  320. FirstY: SmallInt; // first point for this polygon
  321. end;
  322. PTmpRas = ^TTmpRas;
  323. TTmpRas = record
  324. RasPtr: PShortInt;
  325. Size: Longint;
  326. end;
  327. // a structure to contain the 16 collision procedure addresses
  328. PCollTable = ^TCollTable;
  329. TCollTable = array[0..15] of Pointer;
  330. { unoptimized for 32bit alignment of pointers }
  331. PGelsInfo = ^TGelsInfo;
  332. TGelsInfo = record
  333. sprRsrvd: ShortInt; // flag of which sprites to reserve from vsprite system
  334. Flags: Byte; // system use
  335. gelHead,
  336. gelTail: PVSprite; // dummy vSprites for list management
  337. NextLine: PSmallInt; // pointer to array of 8 WORDS for sprite available lines
  338. LastColor: ^PSmallInt; // pointer to array of 8 pointers for color-last-assigned to vSprites
  339. CollHandler: PCollTable; // Pointeres of collision routines
  340. LeftMost,
  341. RightMost,
  342. TopMost,
  343. BottomMost: Smallint;
  344. FirstBlissObj,
  345. LastBlissObj: APTR; // system use only
  346. end;
  347. TRastPort = record
  348. Layer: PLayer; // LayerPtr
  349. BitMap: PBitMap; // BitMapPtr
  350. AreaPtrn: PWord; // ptr to areafill pattern
  351. TmpRas: PTmpRas;
  352. AreaInfo: PAreaInfo;
  353. GelsInfo: PGelsInfo;
  354. Mask: Byte; // write mask for this raster
  355. FgPen: ShortInt; // foreground pen for this raster
  356. BgPen: ShortInt; // background pen
  357. AOlPen: ShortInt; // areafill outline pen
  358. DrawMode: ShortInt; // drawing mode for fill, lines, and text
  359. AreaPtSz: ShortInt; // 2^n words for areafill pattern
  360. LinPatCnt: ShortInt; // current line drawing pattern preshift
  361. dummy: ShortInt;
  362. Flags: Word; // miscellaneous control bits
  363. LinePtrn: Word; // 16 bits for textured lines
  364. cp_x,
  365. cp_y: SmallInt; // current pen position
  366. minterms: array[0..7] of Byte;
  367. PenWidth: SmallInt;
  368. PenHeight: SmallInt;
  369. Font: PTextFont; // (TextFontPtr) current font Pointer
  370. AlgoStyle: Byte; // the algorithmically generated style
  371. TxFlags: Byte; // text specific flags
  372. TxHeight: Word; // text height
  373. TxWidth: Word; // text nominal width
  374. TxBaseline: Word; // text baseline
  375. TxSpacing: SmallInt; // text spacing (per character)
  376. RP_User: APTR;
  377. longreserved: array[0..1] of LongWord;
  378. wordreserved: array[0..6] of Word; // used to be a node
  379. reserved: array[0..7] of Byte; // for future use
  380. end;
  381. PRasInfo = ^TRasInfo;
  382. TRasInfo = record // used by callers to and InitDspC()
  383. Next: PRasInfo; // Pointer to a next playfield (if there's more than one)
  384. BitMap: PBitMap; // Actual data to display
  385. RxOffset, // Offset of the playfield relative to ViewPort
  386. RyOffset: SmallInt; // scroll offsets in this BitMap (So that different playfields may be shifted against each other)
  387. end;
  388. PAnalogSignalInterval = ^TAnalogSignalInterval;
  389. TAnalogSignalInterval = record
  390. asi_Start,
  391. asi_Stop: Word;
  392. end;
  393. PSpecialMonitor = ^TSpecialMonitor;
  394. TSpecialMonitor = record
  395. spm_Node: TExtendedNode;
  396. spm_Flags: Word; // Reserved, set to 0
  397. do_monitor, // Driver call vector - set up a video mode
  398. reserved1, // Private do not touch
  399. reserved2,
  400. reserved3: Pointer;
  401. hblank, // Signal timings by themselves
  402. vblank,
  403. hsync,
  404. vsync: TAnalogSignalInterval;
  405. end;
  406. PMonitorSpec = ^TMonitorSpec;
  407. TMonitorSpec = record
  408. ms_Node: TExtendedNode;
  409. ms_Flags: Word; // Flags, see below
  410. ratioh,
  411. ratiov: LongInt;
  412. total_rows, // Total number of scanlines per frame
  413. total_colorclocks, // Total number of color clocks per line (in 1/280 ns units)
  414. DeniseMaxDisplayColumn,
  415. BeamCon0, // Value for beamcon0 Amiga(tm) chipset register
  416. min_row: Word;
  417. ms_Special: PSpecialMonitor; // Synchro signal timings description (optional)
  418. ms_OpenCount: Word; // Driver open count
  419. ms_transform,
  420. ms_translate,
  421. ms_scale: Pointer;
  422. ms_xoffset,
  423. ms_yoffset: Word;
  424. ms_LegalView: TRectangle; // Allowed range for view positioning (right-bottom position included)
  425. ms_maxoscan, // maximum legal overscan
  426. ms_videoscan: Pointer; // video display overscan
  427. DeniseMinDisplayColumn: Word;
  428. DisplayCompatible: ULONG;
  429. DisplayInfoDataBase: TList;
  430. DisplayInfoDataBaseSemaphore: TSignalSemaphore;
  431. ms_MrgCop, // Driver call vectors, unused by AROS
  432. ms_LoadView,
  433. ms_KillView: Pointer;
  434. end;
  435. PView = ^TView;
  436. TView = record
  437. ViewPort: PViewPort; // ViewPortPtr
  438. LOFCprList: PCprList; // used for interlaced and noninterlaced
  439. SHFCprList: PCprList; // only used during interlace
  440. DyOffset,
  441. DxOffset: SmallInt; // for complete View positioning offsets are +- adjustments to standard #s
  442. Modes: Word; // such as INTERLACE, GENLOC
  443. end;
  444. // these structures are obtained via GfxNew and disposed by GfxFree
  445. // Additional data for Amiga(tm) chipset. Not used by other hardware.
  446. // these structures are obtained via GfxNew and disposed by GfxFree
  447. PViewExtra = ^TViewExtra;
  448. TViewExtra = record
  449. n: TExtendedNode; // Common Header
  450. View: PView; // View it relates to
  451. Monitor: PMonitorSpec; // Monitor used for displaying this View
  452. TopLine: Word;
  453. end;
  454. // Describes a displayed bitmap (or logical screen). Copperlists are relevant only to Amiga(tm) chipset,
  455. // for other hardware they are NULL.
  456. TViewPort = record
  457. Next: PViewPort;
  458. ColorMap: PColorMap; // table of colors for this viewport if this is nil, MakeVPort assumes default values
  459. DspIns: PCopList; // user by MakeView(), Preliminary partial display copperlist
  460. SprIns: PCopList; // used by sprite stuff, Preliminary partial sprite copperlist
  461. ClrIns: PCopList; // used by sprite stuff
  462. UCopIns: PUCopList; // User copper list
  463. DWidth, // Width of currently displayed part in pixels
  464. DHeight: SmallInt; // Height of currently displayed part in pixels
  465. DxOffset, // Displacement from the (0, 0) of the physical screen to (0, 0) of the raster
  466. DyOffset: SmallInt;
  467. Modes: Word; // The same as in View
  468. SpritePriorities: Byte; // used by makevp
  469. reserved: Byte;
  470. RasInfo: PRasInfo; // Playfield specification
  471. end;
  472. // Holds additional information about the ViewPort it is associated with
  473. // this structure is obtained via GfxNew and disposed by GfxFree
  474. PViewPortExtra = ^TViewPortExtra;
  475. TViewPortExtra = record
  476. n: TExtendedNode;
  477. ViewPort: PViewPort; // ViewPort it relates to (backward link)
  478. DisplayClip: TRectangle; // makevp display clipping information, Total size of displayable part
  479. VecTable: APTR; // Unused in AROS
  480. DriverData: array[0..1] of APTR; // Private storage for display drivers. Do not touch!
  481. Flags: Word; // Flags, see below
  482. Origin: array[0..1] of TPoint; // First visible point relative to the DClip. One for each possible playfield.
  483. cop1ptr, // private
  484. cop2ptr: LongWord; // private
  485. end;
  486. TColorMap = record
  487. Flags: Byte; // see below (CMF_*)
  488. Type_: Byte; // Colormap type (reflects version), see below (COLORMAP_*)
  489. Count: Word; // Number of palette entries
  490. ColorTable: PWord; // Table of high nibbles of color values (see description above)
  491. // The following fields are present only if Type_ >= COLORMAP_TYPE_V36
  492. cm_vpe: PViewPortExtra; // ViewPortExtra, for faster access
  493. LowColorBits: PWord; // Table of low nibbles of color values (see above)
  494. TransparencyPlane,
  495. SpriteResolution, // see below
  496. SpriteResDefault,
  497. AuxFlags: Byte;
  498. cm_vp: PViewPort; // Points back to a ViewPort this colormap belongs to
  499. NormalDisplayInfo,
  500. CoerceDisplayInfo : APTR;
  501. cm_batch_items: PTagItem;
  502. VPModeID: ULONG;
  503. // The following fields are present only if Type_ >= COLORMAP_TYPE_V39
  504. PalExtra: PPaletteExtra; // Structure controlling palette sharing
  505. SpriteBase_Even, // Color bank for even sprites (see above)
  506. SpriteBase_Odd, // The same for odd sprites
  507. Bp_0_base,
  508. Bp_1_base: Word;
  509. end;
  510. TPaletteExtra = record // structure may be extended so watch out!
  511. pe_Semaphore: TSignalSemaphore; // shared semaphore for arbitration
  512. pe_FirstFree, // *private*
  513. pe_NFree, // number of free colors
  514. pe_FirstShared, // *private*
  515. pe_NShared: Word; // *private*
  516. pe_RefCnt: PByte; // *private*
  517. pe_AllocList: PByte; // *private*
  518. pe_ViewPort: PViewPort; // back pointer to viewport
  519. pe_SharableColors: Word; // the number of sharable colors.
  520. end;
  521. { UserStuff definitions
  522. the user can define these to be a single variable or a sub-structure
  523. if undefined by the user, the system turns these into innocuous variables
  524. see the manual for a thorough definition of the UserStuff definitions }
  525. TVUserStuff = SmallInt; // Sprite user stuff
  526. TBUserStuff = SmallInt; // Bob user stuff
  527. TAUserStuff = SmallInt; // AnimOb user stuff
  528. { GEL draw list constructed in the order the Bobs are actually drawn, then
  529. list is copied to clear list
  530. must be here in VSprite for system boundary detection
  531. the VSprite positions are defined in (y,x) order to make sorting
  532. sorting easier, since (y,x) as a long Longint}
  533. PBob = ^TBob;
  534. PAnimComp = ^TAnimComp;
  535. PAnimOb = ^TAnimOb;
  536. TVSprite = record
  537. // SYSTEM VARIABLES
  538. NextVSprite: PVSprite; // GEL linked list forward/backward pointers sorted by y,x value
  539. PrevVSprite: PVSprite;
  540. DrawPath: PVSprite; // pointer of overlay drawing
  541. ClearPath: PVSprite; // pointer for overlay clearing
  542. OldY, OldX: SmallInt; // previous position
  543. // COMMON VARIABLES
  544. Flags: SmallInt; // VSprite flags
  545. // COMMON VARIABLES
  546. Y, X: SmallInt; // screen position
  547. Height: SmallInt;
  548. Width: SmallInt; // number of words per row of image data
  549. Depth: SmallInt; // number of planes of data
  550. MeMask: SmallInt; // which types can collide with this VSprite
  551. HitMask: SmallInt; // which types this VSprite can collide with
  552. ImageData: PSmallInt; // pointer to VSprite image
  553. BorderLine: PSmallInt; // logical OR of all VSprite bits borderLine is the one-dimensional logical OR of all
  554. // the VSprite bits, used for fast collision detection of edge
  555. CollMask: PSmallInt; // similar to above except this is a matrix
  556. //pointer to this VSprite's color definitions (not used by Bobs)
  557. SprColors: PSmallInt;
  558. VSBob: PBob; // points home if this VSprite is part of a Bob
  559. PlanePick: Shortint; { planePick flag: set bit selects a plane from image, clear bit selects
  560. use of shadow mask for that plane
  561. OnOff flag: if using shadow mask to fill plane, this bit (corresponding
  562. to bit in planePick) describes whether to fill with 0's or 1's
  563. There are two uses for these flags:
  564. - if this is the VSprite of a Bob, these flags describe how the Bob
  565. is to be drawn into memory
  566. - if this is a simple VSprite and the user intends on setting the
  567. MUSTDRAW flag of the VSprite, these flags must be set too to describe
  568. which color registers the user wants for the image}
  569. PlaneOnOff: ShortInt;
  570. VUserExt: TVUserStuff; // user definable: see note above
  571. end;
  572. // dBufPacket defines the values needed to be saved across buffer to buffer when in double-buffer mode
  573. PDBufPacket = ^TDBufPacket;
  574. TDBufPacket = record
  575. BufY,
  576. BufX: SmallInt; // save other buffers screen coordinates
  577. BufPath: PVSprite; // carry the draw path over the gap
  578. BufBuffer: PSmallInt; // this pointer must be filled in by the user pointer to other buffer's background save buffer
  579. end;
  580. // blitter-objects
  581. TBob = record
  582. // SYSTEM VARIABLES
  583. // COMMON VARIABLES
  584. Flags: SmallInt; // general purpose flags (see definitions below)
  585. // USER VARIABLES
  586. SaveBuffer: PSmallInt; // pointer to the buffer for background save
  587. ImageShadow: PSmallInt; // used by Bobs for "cookie-cutting" and multi-plane masking
  588. Before: PBob; // draw this Bob before Bob pointed to by before , for correct overlay
  589. After: PBob; // draw this Bob after Bob pointed to by after, for correct overlay
  590. BobVSprite: PVSprite; // this Bob's VSprite definition
  591. BobComp: PAnimComp; // pointer to this Bob's AnimComp def
  592. DBuffer: PDBufPacket; // pointer to this Bob's dBuf packet
  593. BUserExt: TBUserStuff; // Bob user extension
  594. end;
  595. TAnimComp = record
  596. // SYSTEM VARIABLES
  597. // COMMON VARIABLES
  598. Flags: SmallInt; // AnimComp flags for system & user
  599. Timer: SmallInt; // timer defines how long to keep this component active:
  600. // if set non-zero, timer decrements to zero then switches to nextSeq
  601. // if set to zero, AnimComp never switches
  602. // USER VARIABLES
  603. TimeSet: SmallInt; // initial value for timer when the AnimComp is activated by the system
  604. NextComp: PAnimComp; // pointer to next and previous components of animation object
  605. PrevComp: PAnimComp;
  606. NextSeq: PAnimComp; // pointer to component component definition of next image in sequence
  607. PrevSeq: PAnimComp;
  608. AnimCRoutine: Pointer; // Pointer of special animation procedure
  609. YTrans: SmallInt; // initial y translation (if this is a component) }
  610. XTrans: SmallInt; // initial x translation (if this is a component) }
  611. HeadOb: PAnimOb;
  612. AnimBob: PBob;
  613. end;
  614. TAnimOb = record
  615. // SYSTEM VARIABLES
  616. NextOb,
  617. PrevOb: PAnimOb;
  618. Clock: Longint; // number of calls to Animate this AnimOb has endured
  619. AnOldY,
  620. AnOldX: SmallInt; // old y,x coordinates
  621. // COMMON VARIABLES
  622. AnY,
  623. AnX: SmallInt; // y,x coordinates of the AnimOb
  624. // USER VARIABLES
  625. YVel,
  626. XVel: SmallInt; // velocities of this object
  627. YAccel,
  628. XAccel: SmallInt; // accelerations of this object
  629. RingYTrans,
  630. RingXTrans: SmallInt; // ring translation values
  631. AnimORoutine: Pointer; // Pointer of special animation procedure
  632. HeadComp: PAnimComp; // pointer to first component
  633. AUserExt: TAUserStuff; // AnimOb user extension
  634. end;
  635. PPAnimOb = ^PAnimOb;
  636. const
  637. B2NORM = 0;
  638. B2SWAP = 1;
  639. B2BOBBER = 2;
  640. const
  641. // ViewPortExtra Flags
  642. VPXB_FREE_ME = 0; // Temporary ViewPortExtra allocated during MakeVPort(). ViewPortExtra with this flag
  643. VPXF_FREE_ME = 1 shl 0; // will be automatically found and disposed during FreeVPortCopLists().
  644. // Private flag in fact, don't set it by hands
  645. VPXB_LAST = 1;
  646. VPXF_LAST = 1 shl 1;
  647. VPXB_STRADDLES256 = 4;
  648. VPXF_STRADDLES256 = 1 shl 4;
  649. VPXB_STRADDLES512 = 5;
  650. VPXF_STRADDLES512 = 1 shl 5;
  651. // Private
  652. VPB_TENHZ = 4;
  653. VPF_TENHZ = 1 shl 4;
  654. VPB_A2024 = 6;
  655. VPF_A2024 = 1 shl 6;
  656. GENLOCK_VIDEO = 1 shl 1;
  657. LACE = 1 shl 2;
  658. DOUBLESCAN = 1 shl 3;
  659. SUPERHIRES = 1 shl 5;
  660. PFBA = 1 shl 6;
  661. EXTRA_HALFBRITE = 1 shl 7;
  662. GENLOCK_AUDIO = 1 shl 8;
  663. DUALPF = 1 shl 10;
  664. HAM = 1 shl 11;
  665. EXTENDED_MODE = 1 shl 12;
  666. VP_HIDE = 1 shl 13;
  667. SPRITES = 1 shl 14;
  668. HIRES = 1 shl 15;
  669. {***** Text Tags **************************************************}
  670. const
  671. TA_DeviceDPI = TAG_USER + 1; // Tag value is Point union: Hi Longint XDPI, Lo Longint YDPI
  672. // these tags override struct TextAttr fields
  673. TA_Name = TAG_USER+100;
  674. TA_YSize = TAG_USER+101;
  675. TA_Underlined = TAG_USER+102;
  676. TA_Bold = TAG_USER+103;
  677. TA_Italic = TAG_USER+104;
  678. TA_Extended = TAG_USER+105;
  679. TA_ColorFont = TAG_USER+106;
  680. TA_ROMFont = TAG_USER+107;
  681. TA_DiskFont = TAG_USER+108;
  682. TA_RevPath = TAG_USER+109;
  683. TA_TallDot = TAG_USER+110;
  684. TA_WideDot = TAG_USER+111;
  685. TA_Proportional = TAG_USER+112;
  686. TA_Designed = TAG_USER+113;
  687. MAXFONTMATCHWEIGHT = 32767; // perfect match from WeighTAMatch
  688. {----- tfe_Flags0 (partial definition) ----------------------------}
  689. const
  690. TE0B_NOREMFONT = 0; // disallow RemFont for this font
  691. TE0F_NOREMFONT = $01;
  692. {***** ColorTextFont node *****************************************}
  693. {----- ctf_Flags --------------------------------------------------}
  694. CT_COLORMASK = $000F; // mask to get to following color styles
  695. CT_COLORFONT = $0001; // color map contains designer's colors }
  696. CT_GREYFONT = $0002; // color map describes even-stepped brightnesses from low to high
  697. CT_ANTIALIAS = $0004; // zero background thru fully saturated AnsiChar
  698. CTB_MAPCOLOR = 0; // map ctf_FgColor to the rp_FgPen IF it's }
  699. CTF_MAPCOLOR = 1 shl CTB_MAPCOLOR; // is a valid color within ctf_Low..ctf_High
  700. // graphics copper list instruction definitions
  701. const
  702. COPPER_MOVE = 0; // pseude opcode for move #XXXX,dir
  703. COPPER_WAIT = 1; // pseudo opcode for wait y,x
  704. CPRNXTBUF = 2; // continue processing with next buffer
  705. CPR_NT_LOF = $8000; // copper instruction only for Longint frames
  706. CPR_NT_SHT = $4000; // copper instruction only for long frames
  707. CPR_NT_SYS = $2000; // copper user instruction only
  708. const
  709. // internal cliprect flags }
  710. CR_NEEDS_NO_CONCEALED_RASTERS = 1;
  711. CR_NEEDS_NO_LAYERBLIT_DAMAGE = 2;
  712. // defines for code values for getcode
  713. ISLESSX = 1;
  714. ISLESSY = 2;
  715. ISGRTRX = 4;
  716. ISGRTRY = 8;
  717. // ta_Style/tta_Style
  718. FS_NORMAL = 0; // normal text (no style bits set)
  719. FSB_UNDERLINED = 0; // underlined (under baseline)
  720. FSF_UNDERLINED = 1 shl FSB_UNDERLINED;
  721. FSB_BOLD = 1; // bold face text (ORed w/ shifted)
  722. FSF_BOLD = 1 shl FSB_BOLD;
  723. FSB_ITALIC = 2; // italic (slanted 1:2 right)
  724. FSF_ITALIC = 1 shl FSB_ITALIC;
  725. FSB_EXTENDED = 3; // extended face (wider than normal)
  726. FSF_EXTENDED = 1 shl FSB_EXTENDED;
  727. FSB_COLORFONT = 6; // this uses ColorTextFont structure
  728. FSF_COLORFONT = 1 shl FSB_COLORFONT;
  729. FSB_TAGGED = 7; // the TextAttr is really an TTextAttr
  730. FSF_TAGGED = 1 shl FSB_TAGGED;
  731. // ta_Flags/tta_Flags
  732. FPB_ROMFONT = 0; // font is in rom
  733. FPF_ROMFONT = 1 shl FPB_ROMFONT;
  734. FPB_DISKFONT = 1; // font is from diskfont.library
  735. FPF_DISKFONT = 1 shl FPB_DISKFONT;
  736. FPB_REVPATH = 2; // designed path is reversed (e.g. left)
  737. FPF_REVPATH = 1 shl FPB_REVPATH;
  738. FPB_TALLDOT = 3; // designed for hires non-interlaced
  739. FPF_TALLDOT = 1 shl FPB_TALLDOT;
  740. FPB_WIDEDOT = 4; // designed for lores interlaced
  741. FPF_WIDEDOT = 1 shl FPB_WIDEDOT;
  742. FPB_PROPORTIONAL = 5; //character sizes can vary from nominal
  743. FPF_PROPORTIONAL = 1 shl FPB_PROPORTIONAL;
  744. FPB_DESIGNED = 6; // size is "designed", not constructed
  745. FPF_DESIGNED = 1 shl FPB_DESIGNED;
  746. FPB_REMOVED = 7; // the font has been removed
  747. FPF_REMOVED = 1 shl FPB_REMOVED;
  748. // TCopList.Flags
  749. EXACT_LINE = 1;
  750. HALF_LINE = 2;
  751. // drawing modes
  752. JAM1 = 0; // jam 1 color into raster
  753. JAM2 = 1; // jam 2 colors into raster
  754. COMPLEMENT = 2; // XOR bits into raster
  755. INVERSVID = 4; // inverse video for drawing modes
  756. // these are the flag bits for RastPort flags
  757. FRST_DOT = $01; // draw the first dot of this line ?
  758. ONE_DOT = $02; // use one dot mode for drawing lines
  759. DBUFFER = $04; // flag set when RastPorts are double-buffered
  760. // only used for bobs
  761. AREAOUTLINE = $08; // used by areafiller
  762. NOCROSSFILL = $20; // areafills have no crossovers
  763. { there is only one style of clipping: raster clipping }
  764. { this preserves the continuity of jaggies regardless of clip window }
  765. { When drawing into a RastPort, if the ptr to ClipRect is nil then there }
  766. { is no clipping done, this is dangerous but useful for speed }
  767. Const
  768. CleanUp = $40;
  769. CleanMe = CleanUp;
  770. BltClearWait = 1; { Waits for blit to finish }
  771. BltClearXY = 2; { Use Row/Bytes per row method }
  772. { Useful minterms }
  773. StraightCopy = $C0; { Vanilla copy }
  774. InvertAndCopy = $30; { Invert the source before copy }
  775. InvertDest = $50; { Forget source, invert dest }
  776. // mode coercion definitions
  777. const
  778. // These flags are passed (in combination) to CoerceMode() to determine the type of coercion required.
  779. PRESERVE_COLORS = 1; // Ensure that the mode coerced to can display just as many colours as the ViewPort being coerced.
  780. AVOID_FLICKER = 2; // Ensure that the mode coerced to is not interlaced.
  781. IGNORE_MCOMPAT = 4; // Coercion should ignore monitor compatibility issues.
  782. BIDTAG_COERCE = 1; // Private
  783. // graphics GELS definitions
  784. const
  785. // VSprite flags
  786. // user-set VSprite flags:
  787. VSPRITE = $0001; // set if VSprite, clear if Bob
  788. SAVEBACK = $0002; // set if background is to be saved/restored
  789. OVERLAY = $0004; // set to mask image of Bob onto background
  790. MUSTDRAW = $0008; // set if VSprite absolutely must be drawn
  791. SUSERFLAGS = $00FF; // mask of all user-settable VSprite-flags
  792. // system-set VSprite flags:
  793. BACKSAVED = $0100; // this Bob's background has been saved
  794. BOBUPDATE = $0200; // temporary flag, useless to outside world
  795. GELGONE = $0400; // set if gel is completely clipped (offscreen)
  796. VSOVERFLOW = $0800; // VSprite overflow (if MUSTDRAW set we draw!)
  797. // Bob flags
  798. // these are the user flag bits
  799. SAVEBOB = $0001; // set to not erase Bob
  800. BOBISCOMP = $0002; // set to identify Bob as AnimComp
  801. BUSERFLAGS = $00FF; // mask of all user-settable Bob-flags
  802. // these are the system flag bits
  803. BWAITING = $0100; // set while Bob is waiting on 'after'
  804. BDRAWN = $0200; // set when Bob is drawn this DrawG pass
  805. BOBSAWAY = $0400; // set to initiate removal of Bob
  806. BOBNIX = $0800; // set when Bob is completely removed
  807. SAVEPRESERVE = $1000; // for back-restore during double-buffer
  808. OUTSTEP = $2000; // for double-clearing if double-buffer
  809. // defines for the animation procedures
  810. ANFRACSIZE = 6;
  811. RINGTRIGGER = $0001;
  812. ANIMHALF = $0020;
  813. const
  814. { These bit descriptors are used by the GEL collide routines.
  815. These bits are set in the hitMask and meMask variables of
  816. a GEL to describe whether or not these types of collisions
  817. can affect the GEL. BNDRY_HIT is described further below;
  818. this bit is permanently assigned as the boundary-hit flag.
  819. The other bit GEL_HIT is meant only as a default to cover
  820. any GEL hitting any other; the user may redefine this bit. }
  821. BORDERHIT = 0;
  822. { These bit descriptors are used by the GEL boundry hit routines.
  823. When the user's boundry-hit routine is called (via the argument
  824. set by a call to SetCollision) the first argument passed to
  825. the user's routine is the Pointer of the GEL involved in the
  826. boundry-hit, and the second argument has the appropriate bit(s)
  827. set to describe which boundry was surpassed }
  828. TOPHIT = 1;
  829. BOTTOMHIT = 2;
  830. LEFTHIT = 4;
  831. RIGHTHIT = 8;
  832. const
  833. SS_GRAPHICS = $02;
  834. VIEW_EXTRA_TYPE = 1;
  835. VIEWPORT_EXTRA_TYPE = 2;
  836. SPECIAL_MONITOR_TYPE = 3;
  837. MONITOR_SPEC_TYPE = 4;
  838. type
  839. // structure used by AddTOFTask
  840. PIsrvstr = ^TIsrvstr;
  841. TIsrvstr = record
  842. is_Node: TNode;
  843. Iptr: PIsrvstr; // passed to srvr by os
  844. code: Pointer;
  845. ccode: Pointer;
  846. Carg: APTR;
  847. end;
  848. const
  849. TO_MONITOR = 0;
  850. FROM_MONITOR = 1;
  851. STANDARD_XOFFSET = 9;
  852. STANDARD_YOFFSET = 0;
  853. // Flags for TMonitorSpec.ms_Flags
  854. MSB_REQUEST_NTSC = 0;
  855. MSB_REQUEST_PAL = 1;
  856. MSB_REQUEST_SPECIAL = 2;
  857. MSB_REQUEST_A2024 = 3;
  858. MSB_DOUBLE_SPRITES = 4;
  859. MSF_REQUEST_NTSC = 1 shl MSB_REQUEST_NTSC;
  860. MSF_REQUEST_PAL = 1 shl MSB_REQUEST_PAL;
  861. MSF_REQUEST_SPECIAL = 1 shl MSB_REQUEST_SPECIAL;
  862. MSF_REQUEST_A2024 = 1 shl MSB_REQUEST_A2024;
  863. MSF_DOUBLE_SPRITES = 1 shl MSB_DOUBLE_SPRITES;
  864. { obsolete, v37 compatible definitions follow }
  865. REQUEST_NTSC = 1 shl MSB_REQUEST_NTSC;
  866. REQUEST_PAL = 1 shl MSB_REQUEST_PAL;
  867. REQUEST_SPECIAL = 1 shl MSB_REQUEST_SPECIAL;
  868. REQUEST_A2024 = 1 shl MSB_REQUEST_A2024;
  869. DEFAULT_MONITOR_NAME : PAnsiChar = 'default.monitor';
  870. NTSC_MONITOR_NAME : PAnsiChar = 'ntsc.monitor';
  871. PAL_MONITOR_NAME : PAnsiChar = 'pal.monitor';
  872. VGA_MONITOR_NAME : PAnsiChar = 'vga.monitor';
  873. VGA70_MONITOR_NAME : PAnsiChar = 'vga70.monitor';
  874. STANDARD_MONITOR_MASK = REQUEST_NTSC or REQUEST_PAL;
  875. STANDARD_NTSC_ROWS = 262;
  876. STANDARD_PAL_ROWS = 312;
  877. STANDARD_COLORCLOCKS = 226;
  878. STANDARD_DENISE_MAX = 455;
  879. STANDARD_DENISE_MIN = 93 ;
  880. STANDARD_NTSC_BEAMCON = $0000;
  881. STANDARD_PAL_BEAMCON = DISPLAYPAL;
  882. SPECIAL_BEAMCON = VARVBLANK or LOLDIS or VARVSYNC or VARHSYNC or VARBEAM or CSBLANK or VSYNCTRUE;
  883. MIN_NTSC_ROW = 21;
  884. MIN_PAL_ROW = 29;
  885. STANDARD_VIEW_X = $81;
  886. STANDARD_VIEW_Y = $2C;
  887. STANDARD_HBSTRT = $06;
  888. STANDARD_HSSTRT = $0B;
  889. STANDARD_HSSTOP = $1C;
  890. STANDARD_HBSTOP = $2C;
  891. STANDARD_VBSTRT = $0122;
  892. STANDARD_VSSTRT = $02A6;
  893. STANDARD_VSSTOP = $03AA;
  894. STANDARD_VBSTOP = $1066;
  895. VGA_COLORCLOCKS = STANDARD_COLORCLOCKS / 2;
  896. VGA_TOTAL_ROWS = STANDARD_NTSC_ROWS * 2;
  897. VGA_DENISE_MIN = 59;
  898. MIN_VGA_ROW = 29;
  899. VGA_HBSTRT = $08;
  900. VGA_HSSTRT = $0E;
  901. VGA_HSSTOP = $1C;
  902. VGA_HBSTOP = $1E;
  903. VGA_VBSTRT = $0000;
  904. VGA_VSSTRT = $0153;
  905. VGA_VSSTOP = $0235;
  906. VGA_VBSTOP = $0CCD;
  907. VGA70_COLORCLOCKS = STANDARD_COLORCLOCKS / 2;
  908. VGA70_TOTAL_ROWS = 449;
  909. VGA70_DENISE_MIN = 59;
  910. MIN_VGA70_ROW = 35;
  911. VGA70_HBSTRT = $08;
  912. VGA70_HSSTRT = $0E;
  913. VGA70_HSSTOP = $1C;
  914. VGA70_HBSTOP = $1E;
  915. VGA70_VBSTRT = $0000;
  916. VGA70_VSSTRT = $02A6;
  917. VGA70_VSSTOP = $0388;
  918. VGA70_VBSTOP = $0F73;
  919. VGA70_BEAMCON = SPECIAL_BEAMCON xor VSYNCTRUE;
  920. BROADCAST_HBSTRT = $01;
  921. BROADCAST_HSSTRT = $06;
  922. BROADCAST_HSSTOP = $17;
  923. BROADCAST_HBSTOP = $27;
  924. BROADCAST_VBSTRT = $0000;
  925. BROADCAST_VSSTRT = $02A6;
  926. BROADCAST_VSSTOP = $054C;
  927. BROADCAST_VBSTOP = $1C40;
  928. BROADCAST_BEAMCON = LOLDIS OR CSBLANK;
  929. RATIO_FIXEDPART = 4;
  930. RATIO_UNITY = 1 shl RATIO_FIXEDPART;
  931. // if Type == 0 then ColorMap is V1.2/V1.3 compatible
  932. // if Type != 0 then ColorMap is V36 compatible
  933. // the system will never create other than V39 type colormaps when running V39
  934. const
  935. COLORMAP_TYPE_V1_2 = $00;
  936. COLORMAP_TYPE_V1_4 = $01;
  937. COLORMAP_TYPE_V36 = COLORMAP_TYPE_V1_4; // use this definition
  938. COLORMAP_TYPE_V39 = $02;
  939. // Flags variable
  940. COLORMAP_TRANSPARENCY = $01;
  941. COLORPLANE_TRANSPARENCY = $02;
  942. BORDER_BLANKING = $04;
  943. BORDER_NOTRANSPARENCY = $08;
  944. VIDEOCONTROL_BATCH = $10;
  945. USER_COPPER_CLIP = $20;
  946. BORDERSPRITES = $40;
  947. EXTEND_VSTRUCT = $1000; { unused bit in Modes field of View }
  948. CMF_CMTRANS = 0;
  949. CMF_CPTRANS = 1;
  950. CMF_BRDRBLNK = 2;
  951. CMF_BRDNTRAN = 3;
  952. CMF_BRDRSPRT = 6;
  953. SPRITERESN_ECS = 0; // ^140ns, except in 35ns viewport, where it is 70ns.
  954. SPRITERESN_140NS = 1;
  955. SPRITERESN_70NS = 2;
  956. SPRITERESN_35NS = 3;
  957. SPRITERESN_DEFAULT = -1;
  958. // AuxFlags:
  959. CMAB_FULLPALETTE = 0;
  960. CMAF_FULLPALETTE = 1 shl CMAB_FULLPALETTE;
  961. CMAB_NO_INTERMED_UPDATE = 1;
  962. CMAF_NO_INTERMED_UPDATE = 1 shl CMAB_NO_INTERMED_UPDATE;
  963. CMAB_NO_COLOR_LOAD = 2;
  964. CMAF_NO_COLOR_LOAD = 1 shl CMAB_NO_COLOR_LOAD;
  965. CMAB_DUALPF_DISABLE = 3;
  966. CMAF_DUALPF_DISABLE = 1 shl CMAB_DUALPF_DISABLE;
  967. // flags values for ObtainPen
  968. const
  969. PENB_EXCLUSIVE = 0;
  970. PENB_NO_SETCOLOR = 1;
  971. PENF_EXCLUSIVE = 1 shl PENB_EXCLUSIVE;
  972. PENF_NO_SETCOLOR = 1 shl PENB_NO_SETCOLOR;
  973. // obsolete names for PENF_xxx flags:
  974. PEN_EXCLUSIVE = PENF_EXCLUSIVE;
  975. PEN_NO_SETCOLOR = PENF_NO_SETCOLOR;
  976. // precision values for ObtainBestPen:
  977. PRECISION_EXACT = -1;
  978. PRECISION_IMAGE = 0;
  979. PRECISION_ICON = 16;
  980. PRECISION_GUI = 32;
  981. // tags for ObtainBestPen:
  982. OBP_Precision = $84000000;
  983. OBP_FailIfBad = $84000001;
  984. // From V39, MakeVPort() will return an error if there is not enough memory,
  985. // or the requested mode cannot be opened with the requested depth with the
  986. // given bitmap (for higher bandwidth alignments).
  987. MVP_OK = 0; // you want to see this one
  988. MVP_NO_MEM = 1; // insufficient memory for intermediate workspace
  989. MVP_NO_VPE = 2; // ViewPort does not have a ViewPortExtra, and insufficient memory to allocate a temporary one.
  990. MVP_NO_DSPINS = 3; // insufficient memory for intermidiate copper instructions.
  991. MVP_NO_DISPLAY = 4; // BitMap data is misaligned for this viewport's mode and depth - see AllocBitMap().
  992. MVP_OFF_BOTTOM = 5; // PRIVATE - you will never see this.
  993. // From V39, MrgCop() will return an error if there is not enough memory,
  994. // or for some reason MrgCop() did not need to make any copper lists.
  995. MCOP_OK = 0; // you want to see this one
  996. MCOP_NO_MEM = 1; // insufficient memory to allocate the system copper lists.
  997. MCOP_NOP = 2; // MrgCop() did not merge any copper lists (eg, no ViewPorts in the list, or all marked as hidden).
  998. type
  999. PDBufInfo = ^TDBufInfo;
  1000. TDBufInfo = record
  1001. dbi_Link1: APTR;
  1002. dbi_Count1: LongWord;
  1003. dbi_SafeMessage: TMessage; // replied to when safe to write to old bitmap
  1004. dbi_UserData1: APTR; // first user data
  1005. dbi_Link2: APTR;
  1006. dbi_Count2: LongWord;
  1007. dbi_DispMessage: TMessage; // replied to when new bitmap has been displayed at least once
  1008. dbi_UserData2: APTR; // second user data
  1009. dbi_MatchLong: LongWord;
  1010. dbi_CopPtr1,
  1011. dbi_CopPtr2,
  1012. dbi_CopPtr3: APTR;
  1013. dbi_BeamPos1,
  1014. dbi_BeamPos2: Word;
  1015. end;
  1016. const
  1017. // include define file for graphics display mode IDs.
  1018. INVALID_ID = not 0;
  1019. { With all the new modes that are available under V38 and V39, it is highly
  1020. * recommended that you use either the asl.library screenmode requester,
  1021. * and/or the V39 graphics.library function BestModeIDA().
  1022. *
  1023. * DO NOT interpret the any of the bits in the ModeID for its meaning. For
  1024. * example, do not interpret bit 3 ($4) as meaning the ModeID is interlaced.
  1025. * Instead, use GetDisplayInfoData() with DTAG_DISP, and examine the DIPF_...
  1026. * flags to determine a ModeID's characteristics. The only exception to
  1027. * this rule is that bit 7 ($80) will always mean the ModeID is
  1028. * ExtraHalfBright, and bit 11 ($800) will always mean the ModeID is HAM.
  1029. }
  1030. // normal identifiers
  1031. MONITOR_ID_MASK = $FFFF1000;
  1032. DEFAULT_MONITOR_ID = $00000000;
  1033. NTSC_MONITOR_ID = $00011000;
  1034. PAL_MONITOR_ID = $00021000;
  1035. { the following 22 composite keys are for Modes on the default Monitor.
  1036. * NTSC & PAL "flavors" of these particular keys may be made by or'ing
  1037. * the NTSC or PAL MONITOR_ID with the desired MODE_KEY...
  1038. *
  1039. * For example, to specifically open a PAL HAM interlaced ViewPort
  1040. * (or intuition screen), you would use the modeid of
  1041. * (PAL_MONITOR_ID OR HAMLACE_KEY) }
  1042. LORES_KEY = $00000000;
  1043. HIRES_KEY = $00008000;
  1044. SUPER_KEY = $00008020;
  1045. HAM_KEY = $00000800;
  1046. LORESLACE_KEY = $00000004;
  1047. HIRESLACE_KEY = $00008004;
  1048. SUPERLACE_KEY = $00008024;
  1049. HAMLACE_KEY = $00000804;
  1050. LORESDPF_KEY = $00000400;
  1051. HIRESDPF_KEY = $00008400;
  1052. SUPERDPF_KEY = $00008420;
  1053. LORESLACEDPF_KEY = $00000404;
  1054. HIRESLACEDPF_KEY = $00008404;
  1055. SUPERLACEDPF_KEY = $00008424;
  1056. LORESDPF2_KEY = $00000440;
  1057. HIRESDPF2_KEY = $00008440;
  1058. SUPERDPF2_KEY = $00008460;
  1059. LORESLACEDPF2_KEY = $00000444;
  1060. HIRESLACEDPF2_KEY = $00008444;
  1061. SUPERLACEDPF2_KEY = $00008464;
  1062. EXTRAHALFBRITE_KEY = $00000080;
  1063. EXTRAHALFBRITELACE_KEY = $00000084;
  1064. // New for AA ChipSet (V39)
  1065. HIRESHAM_KEY = $00008800;
  1066. SUPERHAM_KEY = $00008820;
  1067. HIRESEHB_KEY = $00008080;
  1068. SUPEREHB_KEY = $000080a0;
  1069. HIRESHAMLACE_KEY = $00008804;
  1070. SUPERHAMLACE_KEY = $00008824;
  1071. HIRESEHBLACE_KEY = $00008084;
  1072. SUPEREHBLACE_KEY = $000080a4;
  1073. // Added for V40 - may be useful modes for some games or animations.
  1074. LORESSDBL_KEY = $00000008;
  1075. LORESHAMSDBL_KEY = $00000808;
  1076. LORESEHBSDBL_KEY = $00000088;
  1077. HIRESHAMSDBL_KEY = $00008808;
  1078. // VGA identifiers
  1079. VGA_MONITOR_ID = $00031000;
  1080. VGAEXTRALORES_KEY = $00031004;
  1081. VGALORES_KEY = $00039004;
  1082. VGAPRODUCT_KEY = $00039024;
  1083. VGAHAM_KEY = $00031804;
  1084. VGAEXTRALORESLACE_KEY = $00031005;
  1085. VGALORESLACE_KEY = $00039005;
  1086. VGAPRODUCTLACE_KEY = $00039025;
  1087. VGAHAMLACE_KEY = $00031805;
  1088. VGAEXTRALORESDPF_KEY = $00031404;
  1089. VGALORESDPF_KEY = $00039404;
  1090. VGAPRODUCTDPF_KEY = $00039424;
  1091. VGAEXTRALORESLACEDPF_KEY = $00031405;
  1092. VGALORESLACEDPF_KEY = $00039405;
  1093. VGAPRODUCTLACEDPF_KEY = $00039425;
  1094. VGAEXTRALORESDPF2_KEY = $00031444;
  1095. VGALORESDPF2_KEY = $00039444;
  1096. VGAPRODUCTDPF2_KEY = $00039464;
  1097. VGAEXTRALORESLACEDPF2_KEY = $00031445;
  1098. VGALORESLACEDPF2_KEY = $00039445;
  1099. VGAPRODUCTLACEDPF2_KEY = $00039465;
  1100. VGAEXTRAHALFBRITE_KEY = $00031084;
  1101. VGAEXTRAHALFBRITELACE_KEY = $00031085;
  1102. // New for AA ChipSet (V39)
  1103. VGAPRODUCTHAM_KEY = $00039824;
  1104. VGALORESHAM_KEY = $00039804;
  1105. VGAEXTRALORESHAM_KEY = VGAHAM_KEY;
  1106. VGAPRODUCTHAMLACE_KEY = $00039825;
  1107. VGALORESHAMLACE_KEY = $00039805;
  1108. VGAEXTRALORESHAMLACE_KEY = VGAHAMLACE_KEY;
  1109. VGAEXTRALORESEHB_KEY = VGAEXTRAHALFBRITE_KEY;
  1110. VGAEXTRALORESEHBLACE_KEY = VGAEXTRAHALFBRITELACE_KEY;
  1111. VGALORESEHB_KEY = $00039084;
  1112. VGALORESEHBLACE_KEY = $00039085;
  1113. VGAEHB_KEY = $000390a4;
  1114. VGAEHBLACE_KEY = $000390a5;
  1115. // These ModeIDs are the scandoubled equivalents of the above, with the
  1116. // exception of the DualPlayfield modes, as AA does not allow for scandoubling
  1117. // dualplayfield.
  1118. VGAEXTRALORESDBL_KEY = $00031000;
  1119. VGALORESDBL_KEY = $00039000;
  1120. VGAPRODUCTDBL_KEY = $00039020;
  1121. VGAEXTRALORESHAMDBL_KEY = $00031800;
  1122. VGALORESHAMDBL_KEY = $00039800;
  1123. VGAPRODUCTHAMDBL_KEY = $00039820;
  1124. VGAEXTRALORESEHBDBL_KEY = $00031080;
  1125. VGALORESEHBDBL_KEY = $00039080;
  1126. VGAPRODUCTEHBDBL_KEY = $000390a0;
  1127. // a2024 identifiers
  1128. A2024_MONITOR_ID = $00041000;
  1129. A2024TENHERTZ_KEY = $00041000;
  1130. A2024FIFTEENHERTZ_KEY = $00049000;
  1131. // prototype identifiers (private)
  1132. PROTO_MONITOR_ID = $00051000;
  1133. // These monitors and modes were added for the V38 release.
  1134. EURO72_MONITOR_ID = $00061000;
  1135. EURO72EXTRALORES_KEY = $00061004;
  1136. EURO72LORES_KEY = $00069004;
  1137. EURO72PRODUCT_KEY = $00069024;
  1138. EURO72HAM_KEY = $00061804;
  1139. EURO72EXTRALORESLACE_KEY = $00061005;
  1140. EURO72LORESLACE_KEY = $00069005;
  1141. EURO72PRODUCTLACE_KEY = $00069025;
  1142. EURO72HAMLACE_KEY = $00061805;
  1143. EURO72EXTRALORESDPF_KEY = $00061404;
  1144. EURO72LORESDPF_KEY = $00069404;
  1145. EURO72PRODUCTDPF_KEY = $00069424;
  1146. EURO72EXTRALORESLACEDPF_KEY = $00061405;
  1147. EURO72LORESLACEDPF_KEY = $00069405;
  1148. EURO72PRODUCTLACEDPF_KEY = $00069425;
  1149. EURO72EXTRALORESDPF2_KEY = $00061444;
  1150. EURO72LORESDPF2_KEY = $00069444;
  1151. EURO72PRODUCTDPF2_KEY = $00069464;
  1152. EURO72EXTRALORESLACEDPF2_KEY = $00061445;
  1153. EURO72LORESLACEDPF2_KEY = $00069445;
  1154. EURO72PRODUCTLACEDPF2_KEY = $00069465;
  1155. EURO72EXTRAHALFBRITE_KEY = $00061084;
  1156. EURO72EXTRAHALFBRITELACE_KEY = $00061085;
  1157. // New AA modes (V39)
  1158. EURO72PRODUCTHAM_KEY = $00069824;
  1159. EURO72PRODUCTHAMLACE_KEY = $00069825;
  1160. EURO72LORESHAM_KEY = $00069804;
  1161. EURO72LORESHAMLACE_KEY = $00069805;
  1162. EURO72EXTRALORESHAM_KEY = EURO72HAM_KEY;
  1163. EURO72EXTRALORESHAMLACE_KEY = EURO72HAMLACE_KEY ;
  1164. EURO72EXTRALORESEHB_KEY = EURO72EXTRAHALFBRITE_KEY;
  1165. EURO72EXTRALORESEHBLACE_KEY = EURO72EXTRAHALFBRITELACE_KEY;
  1166. EURO72LORESEHB_KEY = $00069084;
  1167. EURO72LORESEHBLACE_KEY = $00069085;
  1168. EURO72EHB_KEY = $000690a4;
  1169. EURO72EHBLACE_KEY = $000690a5;
  1170. // These ModeIDs are the scandoubled equivalents of the above, with the
  1171. // exception of the DualPlayfield modes, as AA does not allow for scandoubling
  1172. // dualplayfield.
  1173. EURO72EXTRALORESDBL_KEY = $00061000;
  1174. EURO72LORESDBL_KEY = $00069000;
  1175. EURO72PRODUCTDBL_KEY = $00069020;
  1176. EURO72EXTRALORESHAMDBL_KEY = $00061800;
  1177. EURO72LORESHAMDBL_KEY = $00069800;
  1178. EURO72PRODUCTHAMDBL_KEY = $00069820;
  1179. EURO72EXTRALORESEHBDBL_KEY = $00061080;
  1180. EURO72LORESEHBDBL_KEY = $00069080;
  1181. EURO72PRODUCTEHBDBL_KEY = $000690a0;
  1182. EURO36_MONITOR_ID = $00071000;
  1183. // Euro36 modeids can be ORed with the default modeids a la NTSC and PAL.
  1184. // For example, Euro36 SuperHires is
  1185. // (EURO36_MONITOR_ID OR SUPER_KEY)
  1186. SUPER72_MONITOR_ID = $00081000;
  1187. // Super72 modeids can be ORed with the default modeids a la NTSC and PAL.
  1188. // For example, Super72 SuperHiresLace (80$600) is
  1189. // (SUPER72_MONITOR_ID OR SUPERLACE_KEY).
  1190. // The following scandoubled Modes are the exception:
  1191. SUPER72LORESDBL_KEY = $00081008;
  1192. SUPER72HIRESDBL_KEY = $00089008;
  1193. SUPER72SUPERDBL_KEY = $00089028;
  1194. SUPER72LORESHAMDBL_KEY = $00081808;
  1195. SUPER72HIRESHAMDBL_KEY = $00089808;
  1196. SUPER72SUPERHAMDBL_KEY = $00089828;
  1197. SUPER72LORESEHBDBL_KEY = $00081088;
  1198. SUPER72HIRESEHBDBL_KEY = $00089088;
  1199. SUPER72SUPEREHBDBL_KEY = $000890a8;
  1200. // These monitors and modes were added for the V39 release.
  1201. DBLNTSC_MONITOR_ID = $00091000;
  1202. DBLNTSCLORES_KEY = $00091000;
  1203. DBLNTSCLORESFF_KEY = $00091004;
  1204. DBLNTSCLORESHAM_KEY = $00091800;
  1205. DBLNTSCLORESHAMFF_KEY = $00091804;
  1206. DBLNTSCLORESEHB_KEY = $00091080;
  1207. DBLNTSCLORESEHBFF_KEY = $00091084;
  1208. DBLNTSCLORESLACE_KEY = $00091005;
  1209. DBLNTSCLORESHAMLACE_KEY = $00091805;
  1210. DBLNTSCLORESEHBLACE_KEY = $00091085;
  1211. DBLNTSCLORESDPF_KEY = $00091400;
  1212. DBLNTSCLORESDPFFF_KEY = $00091404;
  1213. DBLNTSCLORESDPFLACE_KEY = $00091405;
  1214. DBLNTSCLORESDPF2_KEY = $00091440;
  1215. DBLNTSCLORESDPF2FF_KEY = $00091444;
  1216. DBLNTSCLORESDPF2LACE_KEY = $00091445;
  1217. DBLNTSCHIRES_KEY = $00099000;
  1218. DBLNTSCHIRESFF_KEY = $00099004;
  1219. DBLNTSCHIRESHAM_KEY = $00099800;
  1220. DBLNTSCHIRESHAMFF_KEY = $00099804;
  1221. DBLNTSCHIRESLACE_KEY = $00099005;
  1222. DBLNTSCHIRESHAMLACE_KEY = $00099805;
  1223. DBLNTSCHIRESEHB_KEY = $00099080;
  1224. DBLNTSCHIRESEHBFF_KEY = $00099084;
  1225. DBLNTSCHIRESEHBLACE_KEY = $00099085;
  1226. DBLNTSCHIRESDPF_KEY = $00099400;
  1227. DBLNTSCHIRESDPFFF_KEY = $00099404;
  1228. DBLNTSCHIRESDPFLACE_KEY = $00099405;
  1229. DBLNTSCHIRESDPF2_KEY = $00099440;
  1230. DBLNTSCHIRESDPF2FF_KEY = $00099444;
  1231. DBLNTSCHIRESDPF2LACE_KEY = $00099445;
  1232. DBLNTSCEXTRALORES_KEY = $00091200;
  1233. DBLNTSCEXTRALORESHAM_KEY = $00091a00;
  1234. DBLNTSCEXTRALORESEHB_KEY = $00091280;
  1235. DBLNTSCEXTRALORESDPF_KEY = $00091600;
  1236. DBLNTSCEXTRALORESDPF2_KEY = $00091640;
  1237. DBLNTSCEXTRALORESFF_KEY = $00091204;
  1238. DBLNTSCEXTRALORESHAMFF_KEY = $00091a04;
  1239. DBLNTSCEXTRALORESEHBFF_KEY = $00091284;
  1240. DBLNTSCEXTRALORESDPFFF_KEY = $00091604;
  1241. DBLNTSCEXTRALORESDPF2FF_KEY = $00091644;
  1242. DBLNTSCEXTRALORESLACE_KEY = $00091205;
  1243. DBLNTSCEXTRALORESHAMLACE_KEY = $00091a05;
  1244. DBLNTSCEXTRALORESEHBLACE_KEY = $00091285;
  1245. DBLNTSCEXTRALORESDPFLACE_KEY = $00091605;
  1246. DBLNTSCEXTRALORESDPF2LACE_KEY = $00091645;
  1247. DBLPAL_MONITOR_ID = $000a1000;
  1248. DBLPALLORES_KEY = $000a1000;
  1249. DBLPALLORESFF_KEY = $000a1004;
  1250. DBLPALLORESHAM_KEY = $000a1800;
  1251. DBLPALLORESHAMFF_KEY = $000a1804;
  1252. DBLPALLORESEHB_KEY = $000a1080;
  1253. DBLPALLORESEHBFF_KEY = $000a1084;
  1254. DBLPALLORESLACE_KEY = $000a1005;
  1255. DBLPALLORESHAMLACE_KEY = $000a1805;
  1256. DBLPALLORESEHBLACE_KEY = $000a1085;
  1257. DBLPALLORESDPF_KEY = $000a1400;
  1258. DBLPALLORESDPFFF_KEY = $000a1404;
  1259. DBLPALLORESDPFLACE_KEY = $000a1405;
  1260. DBLPALLORESDPF2_KEY = $000a1440;
  1261. DBLPALLORESDPF2FF_KEY = $000a1444;
  1262. DBLPALLORESDPF2LACE_KEY = $000a1445;
  1263. DBLPALHIRES_KEY = $000a9000;
  1264. DBLPALHIRESFF_KEY = $000a9004;
  1265. DBLPALHIRESHAM_KEY = $000a9800;
  1266. DBLPALHIRESHAMFF_KEY = $000a9804;
  1267. DBLPALHIRESLACE_KEY = $000a9005;
  1268. DBLPALHIRESHAMLACE_KEY = $000a9805;
  1269. DBLPALHIRESEHB_KEY = $000a9080;
  1270. DBLPALHIRESEHBFF_KEY = $000a9084;
  1271. DBLPALHIRESEHBLACE_KEY = $000a9085;
  1272. DBLPALHIRESDPF_KEY = $000a9400;
  1273. DBLPALHIRESDPFFF_KEY = $000a9404;
  1274. DBLPALHIRESDPFLACE_KEY = $000a9405;
  1275. DBLPALHIRESDPF2_KEY = $000a9440;
  1276. DBLPALHIRESDPF2FF_KEY = $000a9444;
  1277. DBLPALHIRESDPF2LACE_KEY = $000a9445;
  1278. DBLPALEXTRALORES_KEY = $000a1200;
  1279. DBLPALEXTRALORESHAM_KEY = $000a1a00;
  1280. DBLPALEXTRALORESEHB_KEY = $000a1280;
  1281. DBLPALEXTRALORESDPF_KEY = $000a1600;
  1282. DBLPALEXTRALORESDPF2_KEY = $000a1640;
  1283. DBLPALEXTRALORESFF_KEY = $000a1204;
  1284. DBLPALEXTRALORESHAMFF_KEY = $000a1a04;
  1285. DBLPALEXTRALORESEHBFF_KEY = $000a1284;
  1286. DBLPALEXTRALORESDPFFF_KEY = $000a1604;
  1287. DBLPALEXTRALORESDPF2FF_KEY = $000a1644;
  1288. DBLPALEXTRALORESLACE_KEY = $000a1205;
  1289. DBLPALEXTRALORESHAMLACE_KEY = $000a1a05;
  1290. DBLPALEXTRALORESEHBLACE_KEY = $000a1285;
  1291. DBLPALEXTRALORESDPFLACE_KEY = $000a1605;
  1292. DBLPALEXTRALORESDPF2LACE_KEY = $000a1645;
  1293. // availability
  1294. DI_AVAIL_NOCHIPS = $0001;
  1295. DI_AVAIL_NOMONITOR = $0002;
  1296. DI_AVAIL_NOTWITHGENLOCK = $0004;
  1297. // mode properties }
  1298. DIPF_IS_LACE = $00000001;
  1299. DIPF_IS_DUALPF = $00000002;
  1300. DIPF_IS_PF2PRI = $00000004;
  1301. DIPF_IS_HAM = $00000008;
  1302. DIPF_IS_ECS = $00000010; // ECS modes (SHIRES, VGA, PRODUCTIVITY) do not support attached sprites.
  1303. DIPF_IS_AA = $00010000; // AA modes - may only be available if machine has correct memory
  1304. // type to support required bandwidth - check availability. (V39)
  1305. DIPF_IS_PAL = $00000020;
  1306. DIPF_IS_SPRITES = $00000040;
  1307. DIPF_IS_GENLOCK = $00000080;
  1308. DIPF_IS_WB = $00000100;
  1309. DIPF_IS_DRAGGABLE = $00000200;
  1310. DIPF_IS_PANELLED = $00000400;
  1311. DIPF_IS_BEAMSYNC = $00000800;
  1312. DIPF_IS_EXTRAHALFBRITE = $00001000;
  1313. // The following DIPF_IS_... flags are new for V39
  1314. DIPF_IS_SPRITES_ATT = $00002000; // supports attached sprites
  1315. DIPF_IS_SPRITES_CHNG_RES = $00004000; // supports variable sprite resolution
  1316. DIPF_IS_SPRITES_BORDER = $00008000; // sprite can be displayed in the border
  1317. DIPF_IS_SCANDBL = $00020000; // scan doubled
  1318. DIPF_IS_SPRITES_CHNG_BASE = $00040000; // can change the sprite base colour
  1319. DIPF_IS_SPRITES_CHNG_PRI = $00080000; // can change the sprite priority with respect to the playfield(s).
  1320. DIPF_IS_DBUFFER = $00100000; // can support double buffering
  1321. DIPF_IS_PROGBEAM = $00200000; // is a programmed beam-sync mode
  1322. DIPF_IS_FOREIGN = $80000000; // this mode is not native to the Amiga
  1323. // Use these tags for passing to BestModeID() (V39)
  1324. SPECIAL_FLAGS = DIPF_IS_DUALPF or DIPF_IS_PF2PRI or DIPF_IS_HAM or DIPF_IS_EXTRAHALFBRITE;
  1325. BIDTAG_DIPFMustHave = $80000001; // mask of the DIPF_ flags the ModeID must have Default - nil
  1326. BIDTAG_DIPFMustNotHave = $80000002; // mask of the DIPF_ flags the ModeID must not have Default - SPECIAL_FLAGS
  1327. BIDTAG_ViewPort = $80000003; // ViewPort for which a ModeID is sought. Default - nil
  1328. BIDTAG_NominalWidth = $80000004; // \ together make the aspect ratio and
  1329. BIDTAG_NominalHeight = $80000005; // / override the vp->Width/Height.
  1330. // Default - SourceID NominalDimensionInfo,
  1331. // or vp->DWidth/Height, or (640 * 200), in that preferred order.
  1332. BIDTAG_DesiredWidth = $80000006; // \ Nominal Width and Height of the
  1333. BIDTAG_DesiredHeight = $80000007; // / returned ModeID. Default - same as Nominal
  1334. BIDTAG_Depth = $80000008; // ModeID must support this depth. Default - vp.^RasInfo^.BitMap^.Depth or 1 }
  1335. BIDTAG_MonitorID = $80000009; // ModeID must use this monitor. Default - use best monitor available
  1336. BIDTAG_SourceID = $8000000a; // instead of a ViewPort. Default - VPModeID(vp) if BIDTAG_ViewPort is specified, else leave the DIPFMustHave and DIPFMustNotHave values untouched.
  1337. BIDTAG_RedBits = $8000000b; // \
  1338. BIDTAG_BlueBits = $8000000c; // > Match up from the database. Default - 4
  1339. BIDTAG_GreenBits = $8000000d; // /
  1340. BIDTAG_GfxPrivate = $8000000e; // Private
  1341. // graphics display control register definitions
  1342. const
  1343. // bplcon0 defines }
  1344. MODE_640 = $8000;
  1345. PLNCNTMSK = $7; // how many bit planes? 0 = none, 1->6 = 1->6, 7 = reserved
  1346. PLNCNTSHFT = 12; // bits to shift for bplcon0
  1347. PF2PRI = $40; // bplcon2 bit
  1348. COLORON = $0200; // disable color burst
  1349. DBLPF = $400;
  1350. HOLDNMODIFY = $800;
  1351. INTERLACE = 4; // interlace mode for 400
  1352. // bplcon1 defines
  1353. PFA_FINE_SCROLL = $F;
  1354. PFB_FINE_SCROLL_SHIFT = 4;
  1355. PF_FINE_SCROLL_MASK = $F;
  1356. // display window start and stop defines
  1357. DIW_HORIZ_POS = $7F; // horizontal start/stop
  1358. DIW_VRTCL_POS = $1FF; // vertical start/stop
  1359. DIW_VRTCL_POS_SHIFT = $7;
  1360. // Data fetch start/stop horizontal position
  1361. DFTCH_MASK = $FF;
  1362. // vposr bits
  1363. VPOSRLOF = $8000;
  1364. // graphics displayinfo definitions
  1365. // the "public" handle to a DisplayInfoRecord
  1366. type
  1367. DisplayInfoHandle = APTR;
  1368. // datachunk type identifiers
  1369. const
  1370. DTAG_DISP = $80000000;
  1371. DTAG_DIMS = $80001000;
  1372. DTAG_MNTR = $80002000;
  1373. DTAG_NAME = $80003000;
  1374. DTAG_VEC = $80004000; // internal use only
  1375. type
  1376. PQueryHeader = ^TQueryHeader;
  1377. TQueryHeader = record
  1378. StructID, // datachunk type identifier
  1379. DisplayID, // copy of display record key
  1380. SkipID, // TAG_SKIP
  1381. Length: LongWord; // length of local data in double-longwords
  1382. end;
  1383. PDisplayInfo = ^TDisplayInfo;
  1384. TDisplayInfo = record
  1385. Header: TQueryHeader;
  1386. NotAvailable: Word; // If 0 DisplayInfo available, else not available -> see Constants DI_AVAIL_*
  1387. PropertyFlags: LongWord; // Properties of this mode (DIPF_*)
  1388. Resolution: TPoint; // ticks-per-pixel X/Y
  1389. PixelSpeed: Word; // approximation in nanoseconds
  1390. NumStdSprites: Word; // number of standard amiga sprites
  1391. PaletteRange: Word; // distinguishable shades available
  1392. SpriteResolution: TPoint; // std sprite ticks-per-pixel X/Y
  1393. pad: array[0..3] of Byte;
  1394. RedBits: Byte;
  1395. GreenBits: Byte;
  1396. BlueBits: Byte;
  1397. pad2: array[0..4] of Byte;
  1398. Reserved: array[0..1] of LongWord; // terminator
  1399. end;
  1400. Type
  1401. PDimensionInfo = ^TDimensionInfo;
  1402. TDimensionInfo = record
  1403. Header: TQueryHeader;
  1404. MaxDepth, // log2(max number of colors)
  1405. MinRasterWidth, // minimum width in pixels
  1406. MinRasterHeight, // minimum height in pixels
  1407. MaxRasterWidth, // maximum width in pixels
  1408. MaxRasterHeight: Word; // maximum height in pixels
  1409. Nominal, // "standard" dimensions
  1410. MaxOScan, // fixed, hardware dependant
  1411. VideoOScan, // fixed, hardware dependant
  1412. TxtOScan, // editable via preferences
  1413. StdOScan: TRectangle; // editable via preferences
  1414. Pad: array[0..13] of Byte;
  1415. Reserved: array[0..1] of LongWord; // terminator
  1416. end;
  1417. PMonitorInfo = ^TMonitorInfo;
  1418. TMonitorInfo = record
  1419. Header: TQueryHeader;
  1420. Mspc: PMonitorSpec; // pointer to monitor specification
  1421. ViewPosition, // editable via preferences
  1422. ViewResolution: TPoint; // standard monitor ticks-per-pixel
  1423. ViewPositionRange: TRectangle; // fixed, hardware dependant
  1424. TotalRows, // display height in scanlines
  1425. TotalColorClocks, // scanline width in 280 ns units
  1426. MinRow: Word; // absolute minimum active scanline
  1427. Compatibility: SmallInt; // how this coexists with others (MCOMPAT_*)
  1428. Pad: array[0..31] of Byte;
  1429. MouseTicks: TPoint;
  1430. DefaultViewPosition: TPoint;
  1431. PreferredModeID: LongWord;
  1432. Reserved: array[0..1] of LongWord; // terminator
  1433. end;
  1434. const
  1435. // monitor compatibility
  1436. MCOMPAT_MIXED = 0; // can share display with other MCOMPAT_MIXED
  1437. MCOMPAT_SELF = 1; // can share only within same monitor
  1438. MCOMPAT_NOBODY= -1; // only one viewport at a time
  1439. DISPLAYNAMELEN = 32;
  1440. type
  1441. PNameInfo = ^TNameInfo;
  1442. TNameInfo = record
  1443. Header: TQueryHeader;
  1444. Name: array[0..DISPLAYNAMELEN - 1] of AnsiChar;
  1445. Reserved: array[0..1] of LongWord; // terminator
  1446. end;
  1447. // The following VecInfo structure is PRIVATE, for our use only Touch these, and burn!
  1448. PVecInfo = ^TVecInfo;
  1449. TVecInfo = record
  1450. Header: TQueryHeader;
  1451. Vec: APTR;
  1452. Data: APTR;
  1453. Type_: Word; // original "Type" in C Includes
  1454. pad: array[0..2] of Word;
  1455. Reserved: array[0..1] of LongWord;
  1456. end;
  1457. const
  1458. VTAG_END_CM = $00000000;
  1459. VTAG_CHROMAKEY_CLR = $80000000;
  1460. VTAG_CHROMAKEY_SET = $80000001;
  1461. VTAG_BITPLANEKEY_CLR = $80000002;
  1462. VTAG_BITPLANEKEY_SET = $80000003;
  1463. VTAG_BORDERBLANK_CLR = $80000004;
  1464. VTAG_BORDERBLANK_SET = $80000005;
  1465. VTAG_BORDERNOTRANS_CLR = $80000006;
  1466. VTAG_BORDERNOTRANS_SET = $80000007;
  1467. VTAG_CHROMA_PEN_CLR = $80000008;
  1468. VTAG_CHROMA_PEN_SET = $80000009;
  1469. VTAG_CHROMA_PLANE_SET = $8000000A;
  1470. VTAG_ATTACH_CM_SET = $8000000B;
  1471. VTAG_NEXTBUF_CM = $8000000C;
  1472. VTAG_BATCH_CM_CLR = $8000000D;
  1473. VTAG_BATCH_CM_SET = $8000000E;
  1474. VTAG_NORMAL_DISP_GET = $8000000F;
  1475. VTAG_NORMAL_DISP_SET = $80000010;
  1476. VTAG_COERCE_DISP_GET = $80000011;
  1477. VTAG_COERCE_DISP_SET = $80000012;
  1478. VTAG_VIEWPORTEXTRA_GET = $80000013;
  1479. VTAG_VIEWPORTEXTRA_SET = $80000014;
  1480. VTAG_CHROMAKEY_GET = $80000015;
  1481. VTAG_BITPLANEKEY_GET = $80000016;
  1482. VTAG_BORDERBLANK_GET = $80000017;
  1483. VTAG_BORDERNOTRANS_GET = $80000018;
  1484. VTAG_CHROMA_PEN_GET = $80000019;
  1485. VTAG_CHROMA_PLANE_GET = $8000001A;
  1486. VTAG_ATTACH_CM_GET = $8000001B;
  1487. VTAG_BATCH_CM_GET = $8000001C;
  1488. VTAG_BATCH_ITEMS_GET = $8000001D;
  1489. VTAG_BATCH_ITEMS_SET = $8000001E;
  1490. VTAG_BATCH_ITEMS_ADD = $8000001F;
  1491. VTAG_VPMODEID_GET = $80000020;
  1492. VTAG_VPMODEID_SET = $80000021;
  1493. VTAG_VPMODEID_CLR = $80000022;
  1494. VTAG_USERCLIP_GET = $80000023;
  1495. VTAG_USERCLIP_SET = $80000024;
  1496. VTAG_USERCLIP_CLR = $80000025;
  1497. // The following tags are V39 specific. They will be ignored (returing error -3) by earlier versions
  1498. VTAG_PF1_BASE_GET = $80000026;
  1499. VTAG_PF2_BASE_GET = $80000027;
  1500. VTAG_SPEVEN_BASE_GET = $80000028;
  1501. VTAG_SPODD_BASE_GET = $80000029;
  1502. VTAG_PF1_BASE_SET = $8000002a;
  1503. VTAG_PF2_BASE_SET = $8000002b;
  1504. VTAG_SPEVEN_BASE_SET = $8000002c;
  1505. VTAG_SPODD_BASE_SET = $8000002d;
  1506. VTAG_BORDERSPRITE_GET = $8000002e;
  1507. VTAG_BORDERSPRITE_SET = $8000002f;
  1508. VTAG_BORDERSPRITE_CLR = $80000030;
  1509. VTAG_SPRITERESN_SET = $80000031;
  1510. VTAG_SPRITERESN_GET = $80000032;
  1511. VTAG_PF1_TO_SPRITEPRI_SET = $80000033;
  1512. VTAG_PF1_TO_SPRITEPRI_GET = $80000034;
  1513. VTAG_PF2_TO_SPRITEPRI_SET = $80000035;
  1514. VTAG_PF2_TO_SPRITEPRI_GET = $80000036;
  1515. VTAG_IMMEDIATE = $80000037;
  1516. VTAG_FULLPALETTE_SET = $80000038;
  1517. VTAG_FULLPALETTE_GET = $80000039;
  1518. VTAG_FULLPALETTE_CLR = $8000003A;
  1519. VTAG_DEFSPRITERESN_SET = $8000003B;
  1520. VTAG_DEFSPRITERESN_GET = $8000003C;
  1521. { all the following tags follow the new, rational standard for videocontrol tags:
  1522. * VC_xxx,state set the state of attribute 'xxx' to value 'state'
  1523. * VC_xxx_QUERY,&var get the state of attribute 'xxx' and store it into the longword
  1524. * pointed to by &var.
  1525. *
  1526. * The following are new for V40:
  1527. }
  1528. VC_IntermediateCLUpdate = $80000080; // default=true. When set graphics will update the intermediate copper lists on color changes, etc. When false, it won't, and will be faster.
  1529. VC_IntermediateCLUpdate_Query = $80000081;
  1530. VC_NoColorPaletteLoad = $80000082; // default = false. When set, graphics will only load color 0 for this ViewPort, and so the ViewPort's colors will come
  1531. // from the previous ViewPort's. NB - Using this tag and VTAG_FULLPALETTE_SET together is undefined.
  1532. VC_NoColorPaletteLoad_Query = $80000083;
  1533. VC_DUALPF_Disable = $80000084;
  1534. { default = false. When this flag is set, the dual-pf bit
  1535. in Dual-Playfield screens will be turned off. Even bitplanes
  1536. will still come from the first BitMap and odd bitplanes
  1537. from the second BitMap, and both R[xy]Offsets will be
  1538. considered. This can be used (with appropriate palette
  1539. selection) for cross-fades between differently scrolling
  1540. images.
  1541. When this flag is turned on, colors will be loaded for
  1542. the viewport as if it were a single viewport of depth
  1543. depth1+depth2 }
  1544. VC_DUALPF_Disable_Query = $80000085;
  1545. const
  1546. SPRITE_ATTACHED = $80;
  1547. type
  1548. PPSimpleSprite = ^PSimpleSprite;
  1549. PSimpleSprite = ^TSimpleSprite;
  1550. TSimpleSprite = record
  1551. PosCtlData: PWord;
  1552. Height: Word;
  1553. x, y: Word; // current position
  1554. Num: Word;
  1555. end;
  1556. PExtSprite = ^TExtSprite;
  1557. TExtSprite = record
  1558. es_SimpleSprite: TSimpleSprite; // conventional simple sprite structure
  1559. es_WordWidth: Word; // graphics use only, subject to change
  1560. es_Flags: Word; // graphics use only, subject to change
  1561. end;
  1562. const
  1563. // tags for AllocSpriteData()
  1564. SPRITEA_Width = $81000000;
  1565. SPRITEA_XReplication = $81000002;
  1566. SPRITEA_YReplication = $81000004;
  1567. SPRITEA_OutputHeight = $81000006;
  1568. SPRITEA_Attached = $81000008;
  1569. SPRITEA_OldDataFormat = $8100000a; // MUST pass in outputheight if using this tag
  1570. // new v50 defines
  1571. SPRITEA_ViewPort = $81000020; // viewport this sprite is going to be used with
  1572. // tags for GetExtSprite()
  1573. GSTAG_SPRITE_NUM = $82000020;
  1574. GSTAG_ATTACHED = $82000022;
  1575. GSTAG_SOFTSPRITE = $82000024;
  1576. // tags valid for either GetExtSprite or ChangeExtSprite
  1577. GSTAG_SCANDOUBLED = $83000000; // request "NTSC-Like" height if possible
  1578. type
  1579. // BitScaleArgs structure used by BitMapScale()
  1580. PBitScaleArgs = ^TBitScaleArgs;
  1581. TBitScaleArgs = record
  1582. bsa_SrcX, bsa_SrcY, // source origin
  1583. bsa_SrcWidth, bsa_SrcHeight, // source size
  1584. bsa_XSrcFactor, bsa_YSrcFactor, // scale factor denominators
  1585. bsa_DestX, bsa_DestY, // destination origin
  1586. bsa_DestWidth, bsa_DestHeight, // destination size result
  1587. bsa_XDestFactor, // scale factor numerators
  1588. bsa_YDestFactor: Word;
  1589. bsa_SrcBitMap, // source BitMap
  1590. bsa_DestBitMap: PBitMap; // destination BitMap
  1591. bsa_Flags: LongWord; // reserved. Must be zero!
  1592. bsa_XDDA, bsa_YDDA: Word; // reserved
  1593. bsa_Reserved1,
  1594. bsa_Reserved2: Longint;
  1595. end;
  1596. { tag definitions for GetRPAttr, SetRPAttr }
  1597. const
  1598. RPTAG_Font = $80000000; // get/set font
  1599. RPTAG_APen = $80000002; // get/set apen
  1600. RPTAG_BPen = $80000003; // get/set bpen
  1601. RPTAG_DrMd = $80000004; // get/set draw mode
  1602. RPTAG_OutlinePen = $80000005; // get/set outline pen. corrected case.
  1603. RPTAG_WriteMask = $80000006; // get/set WriteMask
  1604. RPTAG_MaxPen = $80000007; // get/set maxpen
  1605. RPTAG_DrawBounds = $80000008; // get only rastport draw bounds. pass @rect
  1606. // V50
  1607. RPTAG_PenMode = $80000080; // Enable/Disable PenMode (Defaults to True)
  1608. RPTAG_FgColor = $80000081; // 32bit Foreground Color used when PenMode is False
  1609. RPTAG_BgColor = $80000082; // 32bit Background Color used when PenMode is False
  1610. RPTAG_AlphaMode = $80000083; // (NYI) Enable/Disable AlphaMode (Defaults to False) Can only work when PenMode is disabled
  1611. RPTAG_RetainAlpha = $80000084; // (NYI) Retain target Alpha channel if True (Defaults to False) Only makes sense for target formats with alpha channel
  1612. // V51.13 (MorphOS 3)
  1613. RPTAG_XPos = $80000085; // Graphics pen X position
  1614. RPTAG_YPos = $80000086; // Graphics pen Y position
  1615. type
  1616. PGfxBase = ^tGfxBase;
  1617. TGfxBase = record
  1618. LibNode: TLibrary;
  1619. ActiView: PView; // ViewPtr
  1620. CopInit: PCopInit; // ptr to copper start up list
  1621. Cia: PLongInt; // for 8520 resource use
  1622. blitter: PLongInt; // for future blitter resource use
  1623. LOFlist: PWord;
  1624. SHFlist: PWord;
  1625. blthd,
  1626. blttl: PBltNode;
  1627. bsblthd,
  1628. bsblttl: PBltNode;
  1629. vbsrv,
  1630. timsrv,
  1631. bltsrv: TInterrupt;
  1632. TextFonts: TList; // Fonts
  1633. DefaultFont: PTextFont;
  1634. Modes: Word; // copy of current first bplcon0
  1635. VBlank: Shortint;
  1636. Debug: Shortint;
  1637. BeamSync: SmallInt;
  1638. system_bplcon0: SmallInt; // it is ored into each bplcon0 for display
  1639. SpriteReserved: Byte;
  1640. bytereserved: Byte;
  1641. Flags: Word;
  1642. BlitLock: SmallInt;
  1643. BlitNest: SmallInt;
  1644. BlitWaitQ: TList;
  1645. BlitOwner: PTask;
  1646. TOF_WaitQ: TList;
  1647. DisplayFlags: Word; // NTSC PAL GENLOC etc. Display flags are determined at power on
  1648. SimpleSprites: PPSimpleSprite; // SimpleSpritePtr ptr
  1649. MaxDisplayRow: Word; // hardware stuff, do not use
  1650. MaxDisplayColumn: Word; // hardware stuff, do not use
  1651. NormalDisplayRows: Word;
  1652. NormalDisplayColumns: Word;
  1653. // the following are for standard non interlace, 1/2 wb width
  1654. NormalDPMX: Word; // Dots per meter on display
  1655. NormalDPMY: Word; // Dots per meter on display
  1656. LastChanceMemory: PSignalSemaphore;
  1657. LCMptr: PWord;
  1658. MicrosPerLine: Word; // 256 time usec/line
  1659. MinDisplayColumn: Word;
  1660. ChipRevBits0: Byte;
  1661. MemType: Byte;
  1662. crb_reserved: array[0..3] of Byte;
  1663. monitor_id: Word; // normally 0
  1664. hedley: array[0..7] of LongWord;
  1665. hedley_sprites: array[0..7] of LongWord; // sprite ptrs for intuition mouse
  1666. hedley_sprites1: array[0..7] of LongWord; // sprite ptrs for intuition mouse
  1667. hedley_count: SmallInt;
  1668. hedley_flags: Word;
  1669. hedley_tmp: SmallInt;
  1670. hash_table: PLongInt; // Hashtable used for GfxAssociate() and GfxLookup() (private!)
  1671. current_tot_rows: Word;
  1672. current_tot_cclks: Word;
  1673. hedley_hint: Byte;
  1674. hedley_hint2: Byte;
  1675. nreserved: array[0..3] of LongWord;
  1676. a2024_sync_raster: PLongInt;
  1677. control_delta_pal: Word;
  1678. control_delta_ntsc: Word;
  1679. Current_Monitor: PMonitorSpec; // MonitorSpec used for current display
  1680. MonitorList: TList; // List of all MonitorSpecs in the system
  1681. Default_Monitor: PMonitorSpec; // MonitorSpec of "default.monitor"
  1682. MonitorListSemaphore: PSignalSemaphore; // Semaphore for MonitorList access
  1683. DisplayInfoDataBase: APTR;
  1684. TopLine: Word;
  1685. ActiViewCprSemaphore: PSignalSemaphore; // Semaphore for active view access
  1686. UtilityBase: PLongWord; // for hook AND tag utilities
  1687. ExecBase: PLongWord; // to link with rom.lib
  1688. bwshifts: PShortInt;
  1689. StrtFetchMasks,
  1690. StopFetchMasks,
  1691. Overrun: PWord;
  1692. RealStops: PSmallInt;
  1693. SpriteWidth, // current width (in words) of sprites
  1694. SpriteFMode: Word; // current sprite fmode bits
  1695. SoftSprites, // bit mask of size change knowledgeable sprites
  1696. arraywidth: ShortInt;
  1697. DefaultSpriteWidth: Word; // what width intuition wants
  1698. SprMoveDisable: ShortInt;
  1699. WantChips,
  1700. BoardMemType,
  1701. Bugs: Byte;
  1702. gb_LayersBase: PLongWord; // layers.library base
  1703. ColorMask: LongWord;
  1704. IVector,
  1705. IData: APTR;
  1706. SpecialCounter: LongWord; // special for double buffering
  1707. DBList: APTR;
  1708. MonitorFlags: Word;
  1709. ScanDoubledSprites,
  1710. BP3Bits: Byte;
  1711. MonitorVBlank: TAnalogSignalInterval;
  1712. Natural_Monitor: PMonitorSpec; // Default MonitorSpec for view without explicit MonitorSpec in ViewExtra
  1713. ProgData: APTR;
  1714. ExtSprites: Byte;
  1715. pad3: Byte;
  1716. GfxFlags: Word;
  1717. VBCounter: LongWord;
  1718. HashTableSemaphore: PSignalSemaphore; // Semaphore for hash_table access, private in fact
  1719. case boolean of
  1720. true: ( ChunkyToPlanarPtr: PLongWord;); // HWEmul[0];
  1721. false: (HWEmul: array[0..8] of PLongWord;);
  1722. end;
  1723. const
  1724. NTSC = 1;
  1725. GENLOC = 2;
  1726. PAL = 4;
  1727. TODA_SAFE = 8;
  1728. REALLY_PAL = 16;
  1729. LPEN_SWAP_FRAMES = 32;
  1730. BLITMSG_FAULT = 4;
  1731. // bits defs for ChipRevBits
  1732. GFXB_BIG_BLITS = 0 ;
  1733. GFXB_HR_AGNUS = 0 ;
  1734. GFXB_HR_DENISE = 1 ;
  1735. GFXB_AA_ALICE = 2 ;
  1736. GFXB_AA_LISA = 3 ;
  1737. GFXB_AA_MLISA = 4 ;
  1738. // Bit Values for ChipRevBits
  1739. GFXF_BIG_BLITS = 1 shl GFXB_BIG_BLITS;
  1740. GFXF_HR_AGNUS = 1 shl GFXB_HR_AGNUS;
  1741. GFXF_HR_DENISE = 1 shl GFXB_HR_DENISE;
  1742. GFXF_AA_ALICE = 1 shl GFXB_AA_ALICE;
  1743. GFXF_AA_LISA = 1 shl GFXB_AA_LISA;
  1744. GFXF_AA_MLISA = 1 shl GFXB_AA_MLISA;
  1745. // Pass ONE of these to SetChipRev()
  1746. SETCHIPREV_A = GFXF_HR_AGNUS;
  1747. SETCHIPREV_ECS = GFXF_HR_AGNUS or GFXF_HR_DENISE;
  1748. SETCHIPREV_AA = GFXF_AA_ALICE or GFXF_AA_LISA or SETCHIPREV_ECS;
  1749. SETCHIPREV_BEST = $ffffffff;
  1750. // memory type }
  1751. BUS_16 = 0;
  1752. NML_CAS = 0;
  1753. BUS_32 = 1;
  1754. DBL_CAS = 2;
  1755. BANDWIDTH_1X = BUS_16 or NML_CAS;
  1756. BANDWIDTH_2XNML = BUS_32;
  1757. BANDWIDTH_2XDBL = DBL_CAS;
  1758. BANDWIDTH_4X = BUS_32 or DBL_CAS;
  1759. // GfxFlags (private)
  1760. NEW_DATABASE = 1;
  1761. GRAPHICSNAME: PAnsiChar = 'graphics.library';
  1762. var
  1763. GfxBase : PGfxBase = nil;
  1764. function BltBitMap(srcBitMap: PBitMap location 'a0'; XSrc: LongInt location 'd0'; YSrc: LongInt location 'd1'; DestBitMap: PBitMap location 'a1'; XDest: LongInt location 'd2'; YDest: LongInt location 'd3'; XSize: LongInt location 'd4'; YSize: LongInt location 'd5'; MinTerm: LongWord location 'd6'; Mask: LongWord location 'd7'; TempA: TPlanePtr location 'a2'): LongInt; SysCall GfxBase 030;
  1765. procedure BltTemplate(Source: TPlanePtr location 'a0'; XSrc: LongInt location 'd0'; SrcMod: LongInt location 'd1'; DestRP: PRastPort location 'a1'; XDest: LongInt location 'd2'; YDest: LongInt location 'd3'; XSize: LongInt location 'd4'; YSize: LongInt location 'd5'); SysCall GfxBase 036;
  1766. procedure ClearEOL(Rp: PRastPort location 'a1'); SysCall GfxBase 042;
  1767. procedure ClearScreen(Rp: PRastPort location 'a1'); SysCall GfxBase 048;
  1768. function TextLength(Rp: PRastPort location 'a1'; String1: STRPTR location 'a0'; Count: LongWord location 'd0'): LongInt; SysCall GfxBase 054;
  1769. function GfxText(Rp: PRastPort location 'a1'; String1: STRPTR location 'a0'; Count: LongWord location 'd0') : LongInt; SysCall GfxBase 060;
  1770. function SetFont(Rp: PRastPort location 'a1'; TextFont: PTextFont location 'a0'): LongInt; SysCall GfxBase 066;
  1771. function OpenFont(TextAttr: PTextAttr location 'a0'): PTextFont; SysCall GfxBase 072;
  1772. procedure CloseFont(TextFont: PTextFont location 'a1'); SysCall GfxBase 078;
  1773. function AskSoftStyle(Rp: PRastPort location 'a1'): LongWord; SysCall GfxBase 084;
  1774. function SetSoftStyle(Rp: PRastPort location 'a1'; Style: LongWord location 'd0'; Enable: LongWord location 'd1'): LongWord; SysCall GfxBase 090;
  1775. procedure AddBob(Bob: PBob location 'a0'; Rp: PRastPort location 'a1'); SysCall GfxBase 096;
  1776. procedure AddVSprite(VSprite: PVSprite location 'a0'; Rp: PRastPort location 'a1'); SysCall GfxBase 102;
  1777. procedure DoCollision(Rp: PRastPort location 'a1'); SysCall GfxBase 108;
  1778. procedure DrawGList(Rp: PRastPort location 'a1'; Vp: PViewPort location 'a0'); SysCall GfxBase 114;
  1779. procedure InitGels(Head: PVSprite location 'a0'; Tail: PVSprite location 'a1'; GelsInfo: PGelsInfo location 'a2'); SysCall GfxBase 120;
  1780. procedure InitMasks(VSprite: PVSprite location 'a0'); SysCall GfxBase 126;
  1781. procedure RemIBob(Bob: PBob location 'a0'; Rp: PRastPort location 'a1'; Vp: PViewPort location 'a2'); SysCall GfxBase 132;
  1782. procedure RemVSprite(VSprite: PVSprite location 'a0'); SysCall GfxBase 138;
  1783. procedure SetCollision(Num: LongWord location 'd0'; Routine: TProcedure location 'a0'; GInfo: PGelsInfo location 'a1'); syscall GfxBase 144;
  1784. procedure SortGList(Rp: PRastPort location 'a1'); SysCall GfxBase 150;
  1785. procedure AddAnimOb(AnOb: PAnimOb location 'a0'; AnKey : PPAnimOb location 'a1'; Rp: PRastPort location 'a2'); SysCall GfxBase 156;
  1786. procedure Animate(AnKey: PPAnimOb location 'a0'; Rp: PRastPort location 'a1'); SysCall GfxBase 162;
  1787. function GetGBuffers(AnOb: PAnimOb location 'a0'; Rp: PRastPort location 'a1'; Flag: LongInt location 'd0'): LongBool; SysCall GfxBase 168;
  1788. procedure InitGMasks(AnOb: PAnimOb location 'a0'); SysCall GfxBase 174;
  1789. procedure DrawEllipse(Rp: PRastPort location 'a1'; XCenter: LongInt location 'd0'; YCenter: LongInt location 'd1'; a: LongInt location 'd2'; b: LongInt location 'd3'); SysCall GfxBase 180;
  1790. function AreaEllipse(Rp: PRastPort location 'a1'; XCenter : LongInt location 'd0'; YCenter : LongInt location 'd1'; a : LongInt location 'd2'; b : LongInt location 'd3'): LongInt; SysCall GfxBase 186;
  1791. procedure LoadRGB4(Vp: PViewPort location 'a0'; Colors: PWord location 'a1'; Count: LongInt location 'd0'); SysCall GfxBase 192;
  1792. procedure InitRastPort(Rp: PRastPort location 'a1'); SysCall GfxBase 198;
  1793. procedure InitVPort(Vp: PViewPort location 'a0'); SysCall GfxBase 204;
  1794. function MrgCop(View: PView location 'a1'): LongWord; SysCall GfxBase 210;
  1795. function MakeVPort(View: PView location 'a0'; Vp: PViewPort location 'a1'): LongWord; SysCall GfxBase 216;
  1796. procedure LoadView(View: PView location 'a1'); SysCall GfxBase 222;
  1797. procedure WaitBlit; SysCall GfxBase 228;
  1798. procedure SetRast(Rp: PRastPort location 'a1'; Pen: LongWord location 'd0'); SysCall GfxBase 234;
  1799. procedure GfxMove(Rp: PRastPort location 'a1'; X: LongInt location 'd0'; Y: LongInt location 'd1'); SysCall GfxBase 240;
  1800. procedure Draw(Rp: PRastPort location 'a1'; X: LongInt location 'd0'; Y: LongInt location 'd1'); SysCall GfxBase 246;
  1801. function AreaMove(Rp: PRastPort location 'a1'; X: LongInt location 'd0'; Y: LongInt location 'd1'): LongInt; SysCall GfxBase 252;
  1802. function AreaDraw(Rp: PRastPort location 'a1'; X: LongInt location 'd0'; Y: LongInt location 'd1'): LongInt; SysCall GfxBase 258;
  1803. function AreaEnd(Rp: PRastPort location 'a1'): LongInt; SysCall GfxBase 264;
  1804. procedure WaitTOF; SysCall GfxBase 270;
  1805. procedure QBlit(Blit: PBltNode location 'a1'); SysCall GfxBase 276;
  1806. procedure InitArea(AreaInfo: PAreaInfo location 'a0'; VectorBuffer: APTR location 'a1'; MaxVectors: LongInt location 'd0'); SysCall GfxBase 282;
  1807. procedure SetRGB4(Vp: PViewPort location 'a0'; Index: LongInt location 'd0'; Red: LongWord location 'd1'; Green: LongWord location 'd2'; Blue: LongWord location 'd3'); SysCall GfxBase 288;
  1808. procedure QBSBlit(Blit: PBltNode location 'a1'); SysCall GfxBase 294;
  1809. procedure BltClear(MemBlock: TPlanePtr location 'a1'; ByteCount: LongWord location 'd0'; Flags: LongWord location 'd1'); SysCall GfxBase 300;
  1810. procedure RectFill(Rp: PRastPort location 'a1'; XMin: LongInt location 'd0'; YMin: LongInt location 'd1'; XMax: LongInt location 'd2'; YMax: LongInt location 'd3'); SysCall GfxBase 306;
  1811. procedure BltPattern(Rp: PRastPort location 'a1'; Mask: TPlanePtr location 'a0'; XMin: LongInt location 'd0'; YMin: LongInt location 'd1'; XMax: LongInt location 'd2'; YMax: LongInt location 'd3'; MaskBPR: LongWord location 'd4'); SysCall GfxBase 312;
  1812. function ReadPixel(Rp: PRastPort location 'a1'; X: LongInt location 'd0'; Y: LongInt location 'd1'): LongWord; SysCall GfxBase 318;
  1813. function WritePixel(Rp: PRastPort location 'a1'; X: LongInt location 'd0'; Y: LongInt location 'd1'): LongInt; SysCall GfxBase 324;
  1814. function Flood(Rp: PRastPort location 'a1'; Mode: LongWord location 'd2'; X: LongInt location 'd0'; Y: LongInt location 'd1'): LongBool; SysCall GfxBase 330;
  1815. procedure PolyDraw(Rp: PRastPort location 'a1'; Count: LongInt location 'd0'; PolyTable: PSmallInt location 'a0'); SysCall GfxBase 336;
  1816. procedure SetAPen(Rp: PRastPort location 'a1'; Pen: LongWord location 'd0'); SysCall GfxBase 342;
  1817. procedure SetBPen(Rp: PRastPort location 'a1'; Pen: LongWord location 'd0'); SysCall GfxBase 348;
  1818. procedure SetDrMd(Rp: PRastPort location 'a1'; DrawMode: LongWord location 'd0'); SysCall GfxBase 354;
  1819. procedure InitView(View: PView location 'a1'); SysCall GfxBase 360;
  1820. procedure CBump(CopList: PUCopList location 'a1'); SysCall GfxBase 366;
  1821. procedure CMove(CopList: PUCopList location 'a1'; Destination: APTR location 'd0'; Data: LongInt location 'd1'); SysCall GfxBase 372;
  1822. procedure CWait(CopList: PUCopList location 'a1'; V: LongInt location 'd0'; H : LongInt location 'd1'); SysCall GfxBase 378;
  1823. function VBeamPos: LongInt; SysCall GfxBase 384;
  1824. procedure InitBitMap(BitMap: PBitMap location 'a0'; Depth: LongInt location 'd0'; Width: LongInt location 'd1'; Height: LongInt location 'd2'); SysCall GfxBase 390;
  1825. procedure ScrollRaster(Rp: PRastPort location 'a1'; Dx: LongInt location 'd0'; Dy: LongInt location 'd1'; XMin: LongInt location 'd2'; YMin: LongInt location 'd3'; XMax: LongInt location 'd4'; YMax: LongInt location 'd5'); SysCall GfxBase 396;
  1826. procedure WaitBOVP(Vp: PViewPort location 'a0'); SysCall GfxBase 402;
  1827. function GetSprite(Sprite: PSimpleSprite location 'a0'; Num: LongInt location 'd0'): LongInt; SysCall GfxBase 408;
  1828. procedure FreeSprite(Num: LongInt location 'd0'); SysCall GfxBase 414;
  1829. procedure ChangeSprite(Vp: PViewPort location 'a0'; Sprite: PSimpleSprite location 'a1'; NewData: PWord location 'a2'); SysCall GfxBase 420;
  1830. procedure MoveSprite(Vp: PViewPort location 'a0'; Sprite: PSimpleSprite location 'a1'; X: LongInt location 'd0'; Y: LongInt location 'd1'); SysCall GfxBase 426;
  1831. procedure LockLayerRom(Layer: PLayer location 'a5'); SysCall GfxBase 432;
  1832. procedure UnlockLayerRom(Layer: PLayer location 'a5'); SysCall GfxBase 438;
  1833. procedure SyncSBitMap(Layer: PLayer location 'a0'); SysCall GfxBase 444;
  1834. procedure CopySBitMap(Layer: PLayer location 'a0'); SysCall GfxBase 450;
  1835. procedure OwnBlitter; SysCall GfxBase 456;
  1836. procedure DisownBlitter; SysCall GfxBase 462;
  1837. function InitTmpRas(TmpRas: PTmpRas location 'a0'; Buffer: TPlanePtr location 'a1'; Size: LongInt location 'd0'): PTmpRas; SysCall GfxBase 468;
  1838. procedure AskFont(Rp: PRastPort location 'a1'; TextAttr: PTextAttr location 'a0'); SysCall GfxBase 474;
  1839. procedure AddFont(TextFont: PTextFont location 'a1'); SysCall GfxBase 480;
  1840. procedure RemFont(TextFont: PTextFont location 'a1'); SysCall GfxBase 486;
  1841. function AllocRaster(Width: LongWord location 'd0'; Height: LongWord location 'd1'): TPlanePtr; SysCall GfxBase 492;
  1842. procedure FreeRaster(P: TPlanePtr location 'a0'; Width: LongWord location 'd0'; Height: LongWord location 'd1'); SysCall GfxBase 498;
  1843. procedure AndRectRegion(Region: PRegion location 'a0'; Rectangle: PRectangle location 'a1'); SysCall GfxBase 504;
  1844. function OrRectRegion(Region: PRegion location 'a0'; Rectangle: PRectangle location 'a1'): LongBool; SysCall GfxBase 510;
  1845. function NewRegion: PRegion; SysCall GfxBase 516;
  1846. function ClearRectRegion(Region: PRegion location 'a0'; Rectangle: PRectangle location 'a1'): LongBool; SysCall GfxBase 522;
  1847. procedure ClearRegion(Region: PRegion location 'a0'); SysCall GfxBase 528;
  1848. procedure DisposeRegion(Region: PRegion location 'a0'); SysCall GfxBase 534;
  1849. procedure FreeVPortCopLists(Vp: PViewPort location 'a0'); SysCall GfxBase 540;
  1850. procedure FreeCopList(CopList: PCopList location 'a0'); SysCall GfxBase 546;
  1851. procedure ClipBlit(SrcRp: PRastPort location 'a0'; XSrc: LongInt location 'd0'; YSrc: LongInt location 'd1'; DestRp: PRastPort location 'a1'; XDest: LongInt location 'd2'; YDest: LongInt location 'd3'; XSize: LongInt location 'd4'; YSize: LongInt location 'd5'; MinTerm: LongWord location 'd6'); SysCall GfxBase 552;
  1852. function XorRectRegion(Region: PRegion location 'a0'; Rectangle: PRectangle location 'a1'): LongBool; SysCall GfxBase 558;
  1853. procedure FreeCprList(CprList: PCprList location 'a0'); SysCall GfxBase 564;
  1854. function GetColorMap(Entries: LongInt location 'd0'): PColorMap; SysCall GfxBase 570;
  1855. procedure FreeColorMap(ColorMap: PColorMap location 'a0'); SysCall GfxBase 576;
  1856. function GetRGB4(ColorMap: PColorMap location 'a0'; Entry: LongInt location 'd0'): LongWord; SysCall GfxBase 582;
  1857. procedure ScrollVPort(Vp: PViewPort location 'a0'); SysCall GfxBase 588;
  1858. function UCopperListInit(UCopList: PUCopList location 'a0'; N: LongInt location 'd0'): PCopList; SysCall GfxBase 594;
  1859. procedure FreeGBuffers(AnOb: PAnimOb location 'a0'; Rp: PRastPort location 'a1'; Flag: LongInt location 'd0'); SysCall GfxBase 600;
  1860. procedure BltBitMapRastPort(SrcBitMap: PBitMap location 'a0'; XSrc: LongInt location 'd0'; YSrc: LongInt location 'd1'; DestRp: PRastPort location 'a1'; XDest: LongInt location 'd2'; YDest: LongInt location 'd3'; XSize: LongInt location 'd4'; YSize: LongInt location 'd5'; MinTerm: LongWord location 'd6'); SysCall GfxBase 606;
  1861. function OrRegionRegion(SrcRegion: PRegion location 'a0'; DestRegion: PRegion location 'a1'): LongBool; SysCall GfxBase 612;
  1862. function XorRegionRegion(SrcRegion: PRegion location 'a0'; DestRegion: PRegion location 'a1'): LongBool; SysCall GfxBase 618;
  1863. function AndRegionRegion(SrcRegion: PRegion location 'a0'; DestRegion: PRegion location 'a1'): LongBool; SysCall GfxBase 624;
  1864. procedure SetRGB4CM(ColorMap: PColorMap location 'a0'; Index: LongInt location 'd0'; Red: LongWord location 'd1'; Green: LongWord location 'd2'; Blue: LongWord location 'd3'); SysCall GfxBase 630;
  1865. procedure BltMaskBitMapRastPort(SrcBitMap: PBitMap location 'a0'; XSrc: LongInt location 'd0'; YSrc: LongInt location 'd1'; DestRp: PRastPort location 'a1'; XDest: LongInt location 'd2'; YDest: LongInt location 'd3'; XSize: LongInt location 'd4'; YSize: LongInt location 'd5'; MinTerm: LongWord location 'd6'; BltMask: TPlanePtr location 'a2'); SysCall GfxBase 636;
  1866. function AttemptLockLayerRom(Layer: PLayer location 'a5'): LongBool; SysCall GfxBase 654;
  1867. function GfxNew(GfxNodeType: LongWord location 'd0'): APTR; SysCall GfxBase 660;
  1868. procedure GfxFree(GfxNodePtr: APTR location 'a0'); SysCall GfxBase 666;
  1869. procedure GfxAssociate(AssociateNode: APTR location 'a0'; GfxNodePtr: APTR location 'a1'); SysCall GfxBase 672;
  1870. procedure BitMapScale(BitScaleArgs: PBitScaleArgs location 'a0'); SysCall GfxBase 678;
  1871. function ScalerDiv(Factor: LongWord location 'd0'; Numerator: LongWord location 'd1'; Denominator: LongWord location 'd2'): LongWord; SysCall GfxBase 684;
  1872. function TextExtent(Rp: PRastPort location 'a1'; String1: STRPTR location 'a0'; Count: LongInt location 'd0'; TextExtent: PTextExtent location 'a2'): LongInt; SysCall GfxBase 690;
  1873. function TextFit(Rp: PRastPort location 'a1'; String1: STRPTR location 'a0'; StrLen: LongWord location 'd0'; TextExtent: PTextExtent location 'a2'; ConstrainingExtent: PTextExtent location 'a3'; StrDirection: LongInt location 'd1'; ConstrainingBitWidth: LongWord location 'd2'; constrainingBitHeight: LongWord location 'd3'): LongWord; SysCall GfxBase 696;
  1874. function GfxLookUp(associateNode: APTR location 'a0'): APTR; SysCall GfxBase 702;
  1875. function VideoControl(ColorMap: PColorMap location 'a0'; TagArray: PTagItem location 'a1'): LongBool; SysCall GfxBase 708;
  1876. function OpenMonitor(MonitorName: PAnsiChar location 'a1'; DisplayID: LongWord location 'd0'): PMonitorSpec; SysCall GfxBase 714;
  1877. function CloseMonitor(MonitorSpec: PMonitorSpec location 'a0'): LongBool; SysCall GfxBase 720;
  1878. function FindDisplayInfo(DisplayID: LongWord location 'd0'): DisplayInfoHandle; SysCall GfxBase 726;
  1879. function NextDisplayInfo(DisplayID: LongWord location 'd0'): LongWord; SysCall GfxBase 732;
  1880. function GetDisplayInfoData(Handle: DisplayInfoHandle location 'a0'; buf: APTR location 'a1'; Size: LongWord location 'd0'; TagID: LongWord location 'd1'; DisplayID: LongWord location 'd2'): LongWord; SysCall GfxBase 756;
  1881. procedure FontExtent(Font: PTextFont location 'a0'; FontExtent: PTextExtent location 'a1'); SysCall GfxBase 762;
  1882. function ReadPixelLine8(Rp: PRastPort location 'a0'; XStart: LongWord location 'd0'; YStart: LongWord location 'd1'; Width: LongWord location 'd2'; Array1: PByte location 'a2'; TempRp: PRastPort location 'a1'): LongInt; SysCall GfxBase 768;
  1883. function WritePixelLine8(Rp: PRastPort location 'a0'; XStart: LongWord location 'd0'; YStart: LongWord location 'd1'; Width: LongWord location 'd2'; Array1: PByte location 'a2'; TempRp: PRastPort location 'a1'): LongInt; SysCall GfxBase 774;
  1884. function ReadPixelArray8(Rp: PRastPort location 'a0'; XStart: LongWord location 'd0'; YStart: LongWord location 'd1'; XStop: LongWord location 'd2'; YStop: LongWord location 'd3'; Array1: PByte location 'a2'; TempRp: PRastPort location 'a1'): LongInt; SysCall GfxBase 780;
  1885. function WritePixelArray8(Rp: PRastPort location 'a0'; XStart: LongWord location 'd0'; YStart: LongWord location 'd1'; XStop: LongWord location 'd2'; YStop: LongWord location 'd3'; Array1: PByte location 'a2'; TempRp: PRastPort location 'a1'): LongInt; SysCall GfxBase 786;
  1886. function GetVPModeID(Vp: PViewPort location 'a0'): LongInt; SysCall GfxBase 792;
  1887. function ModeNotAvailable(ModeID: LongWord location 'd0'): LongInt; SysCall GfxBase 798;
  1888. function WeighTAMatch(ReqTextAttr: PTTextAttr location 'a0'; TargetTextAttr: PTextAttr location 'a1'; TargetTags: PTagItem location 'a2'): LongInt; SysCall GfxBase 804;
  1889. procedure EraseRect(Rp: PRastPort location 'a1'; XMin: LongInt location 'd0'; YMin: LongInt location 'd1'; XMax: LongInt location 'd2'; YMax: LongInt location 'd3'); SysCall GfxBase 810;
  1890. function ExtendFont(Font: PTextFont location 'a0'; FontTags: PTagItem location 'a1'): LongWord; SysCall GfxBase 816;
  1891. procedure StripFont(Font: PTextFont location 'a0'); SysCall GfxBase 822;
  1892. function CalcIVG(V: PView location 'a0'; Vp: PViewPort location 'a1'): LongWord; SysCall GfxBase 828;
  1893. function AttachPalExtra(Cm: PColorMap location 'a0'; Vp: PViewPort location 'a1'): LongInt; SysCall GfxBase 834;
  1894. function ObtainBestPenA(Cm: PColorMap location 'a0'; R: LongWord location 'd1'; G: LongWord location 'd2'; B: LongWord location 'd3'; Tags: PTagItem location 'a1'): LongInt; SysCall GfxBase 840;
  1895. procedure SetRGB32(Vp: PViewPort location 'a0'; N: LongWord location 'd0'; R: LongWord location 'd1'; G: LongWord location 'd2'; B: LongWord location 'd3'); SysCall GfxBase 852;
  1896. function GetAPen(Rp: PRastPort location 'a0'): LongWord; SysCall GfxBase 858;
  1897. function GetBPen(Rp: PRastPort location 'a0'): LongWord; SysCall GfxBase 864;
  1898. function GetDrMd(Rp: PRastPort location 'a0'): LongWord; SysCall GfxBase 870;
  1899. function GetOutlinePen(Rp: PRastPort location 'a0'): LongWord; SysCall GfxBase 876;
  1900. procedure LoadRGB32(Vp: PViewPort location 'a0'; var Table: LongWord location 'a1'); SysCall GfxBase 882; overload;
  1901. procedure LoadRGB32(Vp: PViewPort location 'a0'; Table: PLongWord location 'a1'); SysCall GfxBase 882; overload;
  1902. function SetChipRev(Want: LongWord location 'd0'): LongWord; SysCall GfxBase 888;
  1903. procedure SetABPenDrMd(Rp: PRastPort location 'a1'; APen: LongWord location 'd0'; BPen: LongWord location 'd1'; DrawMode: LongWord location 'd2'); SysCall GfxBase 894;
  1904. procedure GetRGB32(Cm: PColorMap location 'a0'; FirstColor: LongWord location 'd0'; NColors: LongWord location 'd1'; var Table: LongWord location 'a1'); SysCall GfxBase 900; overload;
  1905. procedure GetRGB32(Cm: PColorMap location 'a0'; FirstColor: LongWord location 'd0'; NColors: LongWord location 'd1'; Table: PLongWord location 'a1'); SysCall GfxBase 900; overload;
  1906. function AllocBitMap(SizeX: LongWord location 'd0'; SizeY: LongWord location 'd1'; Depth: LongWord location 'd2'; Flags: LongWord location 'd3'; Friend_Bitmap: PBitMap location 'a0'): PBitMap; SysCall GfxBase 918;
  1907. procedure FreeBitMap(Bm: PBitMap location 'a0'); SysCall GfxBase 924;
  1908. function GetExtSpriteA(Ss: PExtSprite location 'a2'; Tags: PTagItem location 'a1'): LongInt; SysCall GfxBase 930;
  1909. function CoerceMode(Vp: PViewPort location 'a0'; MonitorID: LongWord location 'd0'; Flags: LongWord location 'd1'): LongWord; SysCall GfxBase 936;
  1910. procedure ChangeVPBitMap(Vp: PViewPort location 'a0'; Bm: PBitMap location 'a1'; Db: PDBufInfo location 'a2'); SysCall GfxBase 942;
  1911. procedure ReleasePen(Cm: PColorMap location 'a0'; N: LongWord location 'd0'); SysCall GfxBase 948;
  1912. function ObtainPen(Cm: PColorMap location 'a0'; N: LongInt location 'd0'; R: LongWord location 'd1'; G: LongWord location 'd2'; B: LongWord location 'd3'; F: LongInt location 'd4'): LongWord; SysCall GfxBase 954;
  1913. function GetBitMapAttr(Bm: PBitMap location 'a0'; AttrNum: LongWord location 'd1'): LongWord; SysCall GfxBase 960;
  1914. function AllocDBufInfo(Vp: pViewPort location 'a0'): PDBufInfo; SysCall GfxBase 966;
  1915. procedure FreeDBufInfo(Dbi: PDBufInfo location 'a1'); SysCall GfxBase 972;
  1916. function SetOutlinePen(Rp: PRastPort location 'a0'; Pen: LongWord location 'd0'): LongWord; SysCall GfxBase 978;
  1917. function SetWriteMask(Rp: PRastPort location 'a0'; Msk: LongWord location 'd0'): LongWord; SysCall GfxBase 984;
  1918. procedure SetMaxPen(Rp: PRastPort location 'a0'; MaxPen: LongWord location 'd0'); SysCall GfxBase 990;
  1919. procedure SetRGB32CM(Cm: PColorMap location 'a0'; N: LongWord location 'd0'; R: LongWord location 'd1'; G: LongWord location 'd2'; B: LongWord location 'd3'); SysCall GfxBase 996;
  1920. procedure ScrollRasterBF(Rp: PRastPort location 'a1'; Dx: LongInt location 'd0'; Dy: LongInt location 'd1'; XMin: LongInt location 'd2'; YMin: LongInt location 'd3'; XMax: LongInt location 'd4'; YMax: LongInt location 'd5'); SysCall GfxBase 1002;
  1921. function FindColor(Cm: PColorMap location 'a3'; R: LongWord location 'd1'; G: LongWord location 'd2'; B: LongWord location 'd3'; MaxColor: LongInt location 'd4'): LongInt; SysCall GfxBase 1008;
  1922. function AllocSpriteDataA(Bm: PBitMap location 'a2'; Tags: PTagItem location 'a1'): PExtSprite; SysCall GfxBase 1020;
  1923. function ChangeExtSpriteA(Vp: PViewPort location 'a0'; OldSprite: PExtSprite location 'a1'; NewSprite: PExtSprite location 'a2'; Tags: PTagItem location 'a3'): LongInt; SysCall GfxBase 1026;
  1924. procedure FreeSpriteData(Sp: PExtSprite location 'a2'); SysCall GfxBase 1032;
  1925. procedure SetRPAttrsA(Rp: PRastPort location 'a0'; Tags: PTagItem location 'a1'); SysCall GfxBase 1038;
  1926. procedure GetRPAttrsA(Rp: PRastPort location 'a0'; Tags: PTagItem location 'a1'); SysCall GfxBase 1044;
  1927. function BestModeIDA(Tags: PTagItem location 'a0'): LongWord; SysCall GfxBase 1050;
  1928. procedure WriteChunkyPixels(Rp: PRastPort location 'a0'; XStart: LongWord location 'd0'; YStart: LongWord location 'd1'; XStop: LongWord location 'd2'; YStop: LongWord location 'd3'; Array1: PByte location 'a2'; BytesPerRow: LongInt location 'd4'); SysCall GfxBase 1056;
  1929. function OpenFontTagList(Textattr: PTextAttr location 'a0'; Tags: PTagItem location 'a1'): PTextFont; SysCall GfxBase 1062;
  1930. // varargs
  1931. function VideoControlTags(ColorMap: PColorMap; const Tags: array of PtrUInt): LongBool; inline;
  1932. function WeighTAMatchTags(ReqTextAttr: PTTextAttr; TargetTextAttr: PTextAttr; const TargetTags: array of PtrUInt): LongInt; inline;
  1933. function ExtendFontTags(Font: PTextFont; const FontTags: array of PtrUInt): LongWord; inline;
  1934. function ObtainBestPen(Cm: PColorMap; r, g, b: LongWord; const Tags: array of PtrUInt): LongInt; inline;
  1935. function GetExtSprite(Ss: PExtSprite; const Tags: array of PtrUInt): LongInt; inline;
  1936. function AllocSpriteData(Bm: PBitMap; const Tags: array of PtrUInt): PExtSprite; inline;
  1937. function ChangeExtSprite(Vp: PViewPort; OldSprite, NewSprite: PExtSprite; const Tags: array of PtrUInt): LongInt; inline;
  1938. procedure SetRPAttrs(Rp: PRastPort; const Tags: array of PtrUInt); inline;
  1939. procedure GetRPAttrs(Rp: PRastPort; const Tags: array of PtrUInt); inline;
  1940. function BestModeID(const Tags: array of PtrUInt): LongWord; inline;
  1941. function OpenFontTags(Textattr: PTextAttr; const Tags: array of PtrUInt): PTextFont; inline;
  1942. { gfxmacros }
  1943. procedure BNDRYOFF (w: pRastPort);
  1944. procedure InitAnimate (animkey: ppAnimOb);
  1945. procedure SetAfPt(w: pRastPort;p: Pointer; n: Byte);
  1946. procedure SetDrPt(w: pRastPort;p: Word);
  1947. procedure SetOPen(w: pRastPort;c: Byte);
  1948. procedure SetWrMsk(w: pRastPort; m: Byte);
  1949. procedure RemBob(Bob: PBob); inline;
  1950. procedure SafeSetOutlinePen(w: pRastPort; c: byte);
  1951. procedure SafeSetWriteMask( w: pRastPort ; m: smallint ) ;
  1952. procedure OFF_DISPLAY (cust: pCustom);
  1953. procedure ON_DISPLAY (cust: pCustom);
  1954. procedure OFF_SPRITE (cust: pCustom);
  1955. procedure ON_SPRITE (cust: pCustom);
  1956. procedure OFF_VBLANK (cust: pCustom);
  1957. procedure ON_VBLANK (cust: pCustom);
  1958. procedure DrawCircle(Rp: PRastPort; xCenter, yCenter, r: LongInt); inline;
  1959. function AreaCircle(Rp: PRastPort; xCenter, yCenter, r: SmallInt): LongWord; inline;
  1960. function RasSize(w, h: Word): Integer;
  1961. { unit/library initialization }
  1962. function InitGraphicsLibrary: boolean;
  1963. implementation
  1964. procedure RemBob(Bob: PBob);
  1965. begin
  1966. Bob^.Flags := Bob^.Flags or BOBSAWAY;
  1967. end;
  1968. function VideoControlTags(ColorMap: PColorMap; const Tags: array of PtrUInt): LongBool; inline;
  1969. begin
  1970. VideoControlTags := VideoControl(ColorMap, @Tags);
  1971. end;
  1972. function WeighTAMatchTags(ReqTextAttr: PTTextAttr; TargetTextAttr: PTextAttr; const TargetTags: array of PtrUInt): LongInt; inline;
  1973. begin
  1974. WeighTAMatchTags := WeighTAMatch(ReqTextAttr, TargetTextAttr, @TargetTags);
  1975. end;
  1976. function ExtendFontTags(Font: PTextFont; const FontTags: array of PtrUInt): LongWord; inline;
  1977. begin
  1978. ExtendFontTags := ExtendFont(Font, @FontTags);
  1979. end;
  1980. function ObtainBestPen(Cm: PColorMap; r, g, b: LongWord; const Tags: array of PtrUInt): LongInt; inline;
  1981. begin
  1982. ObtainBestPen := ObtainBestPenA(cm, r, g, b, @Tags);
  1983. end;
  1984. function GetExtSprite(Ss: PExtSprite; const Tags: array of PtrUInt): LongInt; inline;
  1985. begin
  1986. GetExtSprite := GetExtSpriteA(Ss, @Tags);
  1987. end;
  1988. function AllocSpriteData(Bm: PBitMap; const Tags: array of PtrUInt): PExtSprite; inline;
  1989. begin
  1990. AllocSpriteData := AllocSpriteDataA(Bm, @Tags);
  1991. end;
  1992. function ChangeExtSprite(Vp: PViewPort; OldSprite, NewSprite: PExtSprite; const Tags: array of PtrUInt): LongInt; inline;
  1993. begin
  1994. ChangeExtSprite := ChangeExtSpriteA(Vp, OldSprite, NewSprite, @Tags);
  1995. end;
  1996. procedure SetRPAttrs(Rp: PRastPort; const Tags: array of PtrUInt); inline;
  1997. begin
  1998. SetRPAttrsA(Rp, @Tags);
  1999. end;
  2000. procedure GetRPAttrs(Rp: PRastPort; const Tags: array of PtrUInt); inline;
  2001. begin
  2002. GetRPAttrsA(Rp, @Tags);
  2003. end;
  2004. function BestModeID(const Tags: array of PtrUInt): LongWord;
  2005. begin
  2006. BestModeID := BestModeIDA(@Tags);
  2007. end;
  2008. function OpenFontTags(Textattr: PTextAttr; const Tags: array of PtrUInt): PTextFont; inline;
  2009. begin
  2010. OpenFontTags := OpenFontTagList(TextAttr, @Tags);
  2011. end;
  2012. procedure BNDRYOFF (w: pRastPort);
  2013. begin
  2014. with w^ do Flags := Flags And (Not AREAOUTLINE);
  2015. end;
  2016. procedure InitAnimate (animkey: ppAnimOb);
  2017. begin
  2018. animkey^ := NIL;
  2019. end;
  2020. procedure SetAfPt(w: pRastPort;p: Pointer; n: Byte);
  2021. begin
  2022. with w^ do begin
  2023. AreaPtrn := p;
  2024. AreaPtSz := n;
  2025. end;
  2026. end;
  2027. procedure SetDrPt(w: pRastPort;p: Word);
  2028. begin
  2029. with w^ do begin
  2030. LinePtrn := p;
  2031. Flags := Flags or FRST_doT;
  2032. linpatcnt := 15;
  2033. end;
  2034. end;
  2035. procedure SetOPen(w: pRastPort;c: Byte);
  2036. begin
  2037. with w^ do begin
  2038. AOlPen := c;
  2039. Flags := Flags or AREAOUTLINE;
  2040. end;
  2041. end;
  2042. { This function is fine, but For OS39 the SetWriteMask() gfx function
  2043. should be prefered because it SHOULD operate with gfx boards as well.
  2044. At least I hope it does.... }
  2045. procedure SetWrMsk(w: pRastPort; m: Byte);
  2046. begin
  2047. w^.Mask := m;
  2048. end;
  2049. procedure SafeSetOutlinePen(w: pRastPort; c: byte);
  2050. begin
  2051. IF pGfxBase(GfxBase)^.LibNode.Lib_Version < 39 THEN begin
  2052. w^.AOlPen := c;
  2053. w^.Flags := w^.Flags or AREAOUTLINE;
  2054. end ELSE begin
  2055. c := SetOutlinePen(w,c);
  2056. end;
  2057. end;
  2058. procedure SafeSetWriteMask( w: pRastPort ; m: smallint ) ;
  2059. VAR x: smallint ;
  2060. begin
  2061. IF pGfxBase(GfxBase)^.LibNode.Lib_Version < 39 THEN w^.Mask := BYTE(m)
  2062. ELSE x := SetWriteMask( w, m );
  2063. end;
  2064. procedure OFF_DISPLAY (cust: pCustom);
  2065. begin
  2066. cust^.dmacon := BITCLR or DMAF_RASTER;
  2067. end;
  2068. procedure ON_DISPLAY (cust: pCustom);
  2069. begin
  2070. cust^.dmacon := BITSET or DMAF_RASTER;
  2071. end;
  2072. procedure OFF_SPRITE (cust: pCustom);
  2073. begin
  2074. cust^.dmacon := BITCLR or DMAF_SPRITE;
  2075. end;
  2076. procedure ON_SPRITE (cust: pCustom);
  2077. begin
  2078. cust^.dmacon := BITSET or DMAF_SPRITE;
  2079. end;
  2080. procedure OFF_VBLANK (cust: pCustom);
  2081. begin
  2082. cust^.intena := BITCLR or INTF_VERTB;
  2083. end;
  2084. procedure ON_VBLANK (cust: pCustom);
  2085. begin
  2086. cust^.intena := BITSET or INTF_VERTB;
  2087. end;
  2088. function RasSize(w, h: Word): Integer; inline;
  2089. begin
  2090. RasSize := h * (((w + 15) shr 3) and $FFFE);
  2091. end;
  2092. procedure DrawCircle(Rp: PRastPort; xCenter, yCenter, r: LongInt); inline;
  2093. begin
  2094. DrawEllipse(Rp, xCenter, yCenter, r, r);
  2095. end;
  2096. function AreaCircle(Rp: PRastPort; xCenter, yCenter, r: SmallInt): LongWord; inline;
  2097. begin
  2098. AreaCircle := AreaEllipse(Rp, xCenter, yCenter, r, r);
  2099. end;
  2100. const
  2101. { Change VERSION and LIBVERSION to proper values }
  2102. VERSION: string[2] = '50';
  2103. LIBVERSION: longword = 50;
  2104. function InitGraphicsLibrary: boolean;
  2105. begin
  2106. InitGraphicsLibrary := Assigned(GfxBase);
  2107. end;
  2108. initialization
  2109. GfxBase := PGfxBase(OpenLibrary(GRAPHICSNAME,LIBVERSION));
  2110. finalization
  2111. if Assigned(GfxBase) then
  2112. CloseLibrary(PLibrary(GfxBase));
  2113. end.