agraphics.pas 102 KB

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