agraphics.pas 100 KB

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