graphics.pas 101 KB

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