agraphics.pas 118 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2016 by Free Pascal development team
  4. graphics.library functions for Amiga OS 4.x
  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. {$PACKRECORDS 2}
  12. {$IFNDEF FPC_DOTTEDUNITS}
  13. unit agraphics;
  14. {$ENDIF FPC_DOTTEDUNITS}
  15. interface
  16. {$IFDEF FPC_DOTTEDUNITS}
  17. uses
  18. Amiga.Core.Exec, Amiga.Core.Utility;
  19. {$ELSE FPC_DOTTEDUNITS}
  20. uses
  21. exec, utility;
  22. {$ENDIF FPC_DOTTEDUNITS}
  23. const
  24. // tag definitions for BltBitMapTagList, BltBitMapTags
  25. BLTBMTAGS_BASE = TAG_USER; // attributes specifying the source and destination coordinates of the blit operation. Default is 0 (WORD). */
  26. BLITA_SrcX = BLTBMTAGS_BASE + 1;
  27. BLITA_SrcY = BLTBMTAGS_BASE + 2;
  28. BLITA_DestX = BLTBMTAGS_BASE + 3;
  29. BLITA_DestY = BLTBMTAGS_BASE + 4; // size of blit operation, default is 0 (WORD)
  30. BLITA_Width = BLTBMTAGS_BASE + 5;
  31. BLITA_Height = BLTBMTAGS_BASE + 6; // source and destination object, also see BLITT definitions below default is NULL (APTR)
  32. BLITA_Source = BLTBMTAGS_BASE + 7;
  33. BLITA_Dest = BLTBMTAGS_BASE + 8; // minterm of blit, default is 0xc0 (copy blit, UBYTE)
  34. BLITA_Minterm = BLTBMTAGS_BASE + 9; // blit mask, default is $ff (Byte) if BLITA_Dest is not a rastport otherwise the rp^.Mask value of the destination rastport is used.
  35. BLITA_Mask = BLTBMTAGS_BASE + 10; // see BltMaskBitMapRastPort()
  36. BLITA_MaskPlane = BLTBMTAGS_BASE + 11; // 8bit alpha mask, default is nil (APTR). Mask and source bitmap must have the same dimension
  37. BLITA_AlphaMask = BLTBMTAGS_BASE + 12; // specifies the bytes per row value of the source object, if source is neither a rastport nor a bitmap (UWORD)
  38. BLITA_SrcBytesPerRow = BLTBMTAGS_BASE + 13; // type of source object, default is BLITT_BITMAP
  39. BLITA_SrcType = BLTBMTAGS_BASE + 14; // specifies the bytes per row value of the destination object, if destination is neither a rastport nor a bitmap (UWORD)
  40. BLITA_DestBytesPerRow = BLTBMTAGS_BASE + 15; // type of destination object, default is BLITT_BITMAP
  41. BLITA_DestType = BLTBMTAGS_BASE + 16; // use alpha data stored in the source object for transparent blits, default is FALSE (BOOL). BLITA_UseSrcAlpha and BLITA_AlphaMask are mutually-exclusive.
  42. BLITA_UseSrcAlpha = BLTBMTAGS_BASE + 17; // not implemented yet
  43. BLITA_UseDestAlpha = BLTBMTAGS_BASE + 18; // global alpha value applied to each pixel, default is $ffffffff (LongWord, 32 bit left justified fraction). A value of ULONG_MAX means non-opaque blit unless
  44. // BLIT_UseSrcAlpha is TRUE or BLITA_AlphaMask is used. To convert an 8bit alpha value to 32bit one multiply it by $01010101. BLITA_Alpha can be used in combination with the two tags mentioned above.
  45. BLITA_Alpha = BLTBMTAGS_BASE + 19; // color lookuptable (256 entries each 4bytes large, format $00RRGGBB) to use when blitting chunky bitmaps to
  46. // directmapped bitmaps. Default is NULL (APTR), means palette of destination bitmap is used (if available). Currently not supported by alpha blits.
  47. BLITA_CLUT = BLTBMTAGS_BASE + 20;
  48. // possible types for BLITA_SrcType / BLITA_DestType
  49. BLITT_BITMAP = 0; // a bitmap (default)
  50. BLITT_RASTPORT = 1; // a rastport
  51. BLITT_TEMPLATE = 2; // 1bit template, source only!
  52. BLITT_ALPHATEMPLATE = 3; // 8bit alpha template, source only!
  53. BLITT_CHUNKY = 4; // 8bit chunky buffer
  54. BLITT_RGB24 = 5; // 24bit RGB buffer
  55. BLITT_ARGB32 = 6; // 32bit ARGB buffer
  56. BLITT_RGB16 = 7; // 16bit RGB buffer (same as RGBFB_R5G6B5)
  57. // graphics board definitions
  58. GBD_TagBase = TAG_USER;
  59. GBD_BoardName = GBD_TagBase + 1;
  60. GBD_TotalMemory = GBD_TagBase + 2;
  61. GBD_FreeMemory = GBD_TagBase + 3;
  62. GBD_LargestFreeMemory = GBD_TagBase + 4;
  63. GBD_InternalMemorySize = GBD_TagBase + 5;
  64. GBD_PCIVendorID = GBD_TagBase + 6;
  65. GBD_PCIProductID = GBD_TagBase + 7;
  66. GBD_BoardDriver = GBD_TagBase + 8;
  67. GBD_ChipDriver = GBD_TagBase + 9;
  68. BITSET = $8000;
  69. BITCLR = 0;
  70. type
  71. PRectangle = ^TRectangle;
  72. TRectangle = record
  73. MinX, MinY: SmallInt;
  74. MaxX, MaxY: SmallInt;
  75. end;
  76. PRect32 = ^TRect32;
  77. TRect32 = record
  78. MinX, MinY: LongInt;
  79. MaxX, MaxY: LongInt;
  80. end;
  81. PPoint = ^TPoint;
  82. TPoint = record
  83. x, y: SmallInt;
  84. end;
  85. TPLANEPTR = PByte;
  86. PBitMap = ^TBitMap;
  87. TBitMap = record
  88. BytesPerRow: Word;
  89. Rows: Word;
  90. Flags: Byte;
  91. Depth: Byte;
  92. pad: Word;
  93. Planes: array[0..7] of TPLANEPTR;
  94. end;
  95. PRegionRectangle = ^TRegionRectangle;
  96. TRegionRectangle = record
  97. Next, Prev: PRegionRectangle;
  98. bounds: TRectangle;
  99. end;
  100. PRegion = ^tRegion;
  101. tRegion = record
  102. bounds: TRectangle;
  103. RegionRectangle: PRegionRectangle;
  104. end;
  105. PExtendedNode = ^TExtendedNode;
  106. TExtendedNode = record
  107. xln_Succ: PNode;
  108. xln_Pred: PNode;
  109. xln_Type: Byte;
  110. xln_Pri: ShortInt;
  111. xln_Name: STRPTR;
  112. xln_Subsystem: Byte;
  113. xln_Subtype: Byte;
  114. xln_Library: LongInt;
  115. xln_Init: Pointer; // only used if MONITOR_SPEC_TYPE
  116. end;
  117. const
  118. // flags for AllocBitMap, etc.
  119. BMB_CLEAR = 0;
  120. BMB_DISPLAYABLE = 1;
  121. BMB_INTERLEAVED = 2;
  122. BMB_STANDARD = 3;
  123. BMB_MINPLANES = 4;
  124. // New V45 flags follow. If this bit combination is set,
  125. // the AllocBitMap() friends pointer points to a tag
  126. // list describing further data
  127. BMB_HIJACKED = 7; // must be clear
  128. BMB_RTGTAGS = 8; // must be one for tag extension
  129. BMB_RTGCHECK = 9; // must be one for tag extension
  130. BMB_FRIENDISTAG = 10; // must be one as well
  131. BMB_INVALID = 11; // must be clear
  132. // Flags introduced in V51 of graphics.library
  133. BMB_LOCKED = 12; // private
  134. BMF_CLEAR = 1 shl BMB_CLEAR;
  135. BMF_DISPLAYABLE = 1 shl BMB_DISPLAYABLE;
  136. BMF_INTERLEAVED = 1 shl BMB_INTERLEAVED;
  137. BMF_STANDARD = 1 shl BMB_STANDARD;
  138. BMF_MINPLANES = 1 shl BMB_MINPLANES;
  139. BMF_HIJACKED = 1 shl BMB_HIJACKED; // aka BMF_SPECIALFMT
  140. BMF_RTGTAGS = 1 shl BMB_RTGTAGS;
  141. BMF_RTGCHECK = 1 shl BMB_RTGCHECK;
  142. BMF_FRIENDISTAG = 1 shl BMB_FRIENDISTAG;
  143. BMF_INVALID = 1 shl BMB_INVALID;
  144. BMF_LOCKED = 1 shl BMB_LOCKED;
  145. BMF_CHECKMASK = BMF_HIJACKED or BMF_RTGTAGS or BMF_RTGCHECK or BMF_FRIENDISTAG or BMF_INVALID;
  146. BMF_CHECKVALUE = BMF_RTGTAGS or BMF_RTGCHECK or BMF_FRIENDISTAG;
  147. // tags for AllocBitMap
  148. BMATags_Friend = TAG_USER + 0; // Specify a friend-bitmap by tags Default is no friend bitmap
  149. BMATags_Depth = TAG_USER + 1; // depth of the bitmap. Default is the depth parameter of AllocBitMap
  150. BMATags_PixelFormat = TAG_USER + 2; // bitmap data format (see enPixelFormat)
  151. BMATags_Clear = TAG_USER + 3; // clear bitmap? Default is the BMF_CLEAR flag specified value.
  152. BMATags_Displayable = TAG_USER + 4; // bitmap usable for hardware? Default is the BMF_DISPLAYABLE flag.
  153. BMATags_Private1 = TAG_USER + 5; // internal use only!
  154. BMATags_NoMemory = TAG_USER + 6; // do not provide memory for the bitmap, just allocate the structure Default is false.
  155. BMATags_NoSprite = TAG_USER + 7; // disallow generation of a sprite default is sprite enabled.
  156. BMATags_Private2 = TAG_USER + 8; // internal use only!
  157. BMATags_Private3 = TAG_USER + 9; // internal use only!
  158. BMATags_ModeWidth = TAG_USER + 10; // width of the display mode in pixels. Default is the width of the displayID in the monitor database.
  159. BMATags_ModeHeight = TAG_USER + 11; // height of the display mode in pixels. Default is the height of the displayID in the monitor database.
  160. BMATags_RenderFunc = TAG_USER + 12; // Private. Do not use in new code.
  161. BMATags_SaveFunc = TAG_USER + 13; // Pivate. Do not use in new code.
  162. BMATags_UserData = TAG_USER + 14; // Private. Do not use in new code.
  163. BMATags_Alignment = TAG_USER + 15; // specify additional alignment (power of two; for the bitmap rows. If this tag is set,
  164. // then bitplane rows are aligned to this boundary. Otherwise, the native alignment restriction is provided.
  165. BMATags_ConstantBytesPerRow = TAG_USER + 16; // set with the above to enforce alignment for displayable screens
  166. BMATags_UserPrivate = TAG_USER + 17; // user bitmap which will never be in video memory
  167. BMATags_Private4 = TAG_USER + 18; // internal use only!
  168. BMATags_Private5 = TAG_USER + 19; // internal use only!
  169. BMATags_Private6 = TAG_USER + 20; // internal use only!
  170. BMATags_Private7 = TAG_USER + 21; // internal use only!
  171. BMATags_DisplayID = TAG_USER +$32; // a display ID from the monitor data base the system tries then to extract all necessary information
  172. // to build a suitable bitmap This is intentionally identical to intuition SA_DisplayID
  173. BMATags_BitmapInvisible = TAG_USER + $37; // if set to TRUE, the bitmap is not allocated on the graphics board directly, but may remain in an off-hardware location
  174. // if the screen is invisible. This is intentionally identically to SA_Behind. Default is FALSE
  175. BMATags_BitmapColors = TAG_USER + $29; // ti_Data is an array of struct ColorSpec, terminated by ColorIndex = -1. Specifies
  176. // initial screen palette colors. This is intentionally identically to SA_Colors
  177. BMATags_BitmapColors32 = TAG_USER + $43; // Tag to set the bitmaps's initial palette colors at 32 bits-per-gun. ti_Data is a pointer
  178. // to a table to be passed to the graphics.library/LoadRGB32(; function. This format supports both runs of color
  179. // registers and sparse registers. See the autodoc for that function for full details.
  180. // Any color set here has precedence over the same register set by ABMA_BitmapColors. Intentionally identical to SA_Colors32
  181. // the following are for GetBitMapAttr()
  182. BMA_HEIGHT = 0;
  183. BMA_DEPTH = 4;
  184. BMA_WIDTH = 8;
  185. BMA_FLAGS = 12;
  186. BMA_ISRTG = 16; // (V54)
  187. BMA_BYTESPERPIXEL = 17; // (V54)
  188. BMA_BITSPERPIXEL = 18; // (V54)
  189. BMA_PIXELFORMAT = 19; // (V54)
  190. BMA_ACTUALWIDTH = 20; // (V54)
  191. // Supported pixel formats (V54)
  192. // enPixelFormat = TPIX_FMT
  193. PIXF_NONE = 0; // no valid RGB format (error condition)
  194. PIXF_CLUT = 1; // palette mode, set colors when opening screen using tags or use SetRGB32/LoadRGB32(...)
  195. PIXF_R8G8B8 = 2; // TrueColor RGB (8 bit each)
  196. PIXF_B8G8R8 = 3; // TrueColor BGR (8 bit each)
  197. PIXF_R5G6B5PC = 4; // HiColor16 (5 bit R, 6 bit G, 5 bit B), format: gggbbbbbrrrrrggg
  198. PIXF_R5G5B5PC = 5; // HiColor15 (5 bit each) format: gggbbbbb0rrrrrgg
  199. PIXF_A8R8G8B8 = 6; // 4 Byte TrueColor ARGB (A unused alpha channel)
  200. PIXF_A8B8G8R8 = 7; // 4 Byte TrueColor ABGR (A unused alpha channel)
  201. PIXF_R8G8B8A8 = 8; // 4 Byte TrueColor RGBA (A unused alpha channel)
  202. PIXF_B8G8R8A8 = 9; // 4 Byte TrueColor BGRA (A unused alpha channel)
  203. PIXF_R5G6B5 = 10; // HiColor16 (5 bit R, 6 bit G, 5 bit B) format: rrrrrggggggbbbbb
  204. PIXF_R5G5B5 = 11; // HiColor15 (5 bit each) format: 0rrrrrgggggbbbbb
  205. PIXF_B5G6R5PC = 12; // HiColor16 (5 bit R, 6 bit G, 5 bit B) format: gggrrrrrbbbbbggg
  206. PIXF_B5G5R5PC = 13; // HiColor15 (5 bit each) format: gggrrrrr0bbbbbbgg
  207. PIXF_YUV422CGX = 14; // 2 Byte TrueColor YUV (CCIR recommendation CCIR601). Each two-pixel unit is stored as one longword
  208. // containing luminance (Y) for each of the two pixels, and chrominance (U,V) for alternate pixels.
  209. // The missing chrominance values are generated by interpolation. (Y0-U0-Y1-V0)
  210. PIXF_YUV411 = 15; // 1 Byte TrueColor ACCUPAK. Four adjacent pixels form a packet of 5 bits Y (luminance) each pixel and
  211. // 6 bits U and V (chrominance) shared by the four pixels
  212. PIXF_YUV422PA = 16; // 2 Byte TrueColor CCIR601 for use with YUV12 planar assist mode on Cirrus Logic base graphics chips. (Y0-Y1-V0-U0)
  213. PIXF_YUV422 = 17; // 2 Byte TrueColor YUV (CCIR recommendation CCIR601). Each two-pixel unit is stored as one longword
  214. // containing luminance (Y) for each of the two pixels, and chrominance (U,V) for alternate pixels.
  215. // The missing chrominance values are generated by interpolation. (Y1-U0-Y0-V0)
  216. PIXF_YUV422PC = 18; // 2 Byte TrueColor CCIR601 byte swapped (V0-Y0-U0-Y1)
  217. PIXF_YUV420P = 19; // 12 Bit TrueColor 3-plane YUV
  218. PIXF_YUV410P = 20; // 9 Bit TrueColor 3-plane YUV
  219. PIXF_ALPHA8 = 21; // 8 bit alpha
  220. // Tags for LockBitMapTagList() (V54)
  221. LBM_TagBase = TAG_USER;
  222. LBM_BaseAddress = LBM_TagBase + 1;
  223. LBM_BytesPerRow = LBM_TagBase + 2;
  224. LBM_PixelFormat = LBM_TagBase + 3;
  225. LBM_PlanarYUVInfo = LBM_TagBase + 4;
  226. LBM_IsOnBoard = LBM_TagBase + 5;
  227. // Basic minterm value.
  228. // enMinterm
  229. MINTERM_ABC = $80;
  230. MINTERM_ABNC = $40;
  231. MINTERM_ANBC = $20;
  232. MINTERM_ANBNC = $10;
  233. MINTERM_NABC = $08;
  234. MINTERM_NABNC = $04;
  235. MINTERM_NANBC = $02;
  236. MINTERM_NANBNC = $01;
  237. // enMintermOperations
  238. // Copy source and blit thru mask
  239. MINTERM_SRCMASK = MINTERM_ABC or MINTERM_ABNC or MINTERM_ANBC;
  240. // Invert source and blit thru mask
  241. MINTERM_NOTSRCMASK = MINTERM_ANBC;
  242. // Copy source and blit thru mask
  243. MINTERM_B_EQUALS_C = MINTERM_ABC or MINTERM_ANBNC or MINTERM_NABC or MINTERM_NANBNC;
  244. MINTERM_B_OR_C = MINTERM_ABC or MINTERM_ABNC or MINTERM_NABC or MINTERM_NABNC or MINTERM_ANBC or MINTERM_NANBC;
  245. MINTERM_A_OR_B = MINTERM_ABC or MINTERM_ANBC or MINTERM_NABC or MINTERM_ABNC or MINTERM_ANBNC or MINTERM_NABNC;
  246. MINTERM_A_OR_C = MINTERM_ABC or MINTERM_NABC or MINTERM_ABNC or MINTERM_ANBC or MINTERM_NANBC or MINTERM_ANBNC;
  247. MINTERM_A_XOR_C = MINTERM_NABC or MINTERM_ABNC or MINTERM_NANBC or MINTERM_ANBNC;
  248. MINTERM_A_TO_D = MINTERM_ABC or MINTERM_ANBC or MINTERM_ABNC or MINTERM_ANBNC;
  249. type
  250. TPIX_FMT = LongWord;
  251. PPlanarYUVInfo = ^TPlanarYUVInfo;
  252. TPlanarYUVInfo = record
  253. YMemory: APTR;
  254. UMemory: APTR;
  255. VMemory: APTR;
  256. YBytesPerRow: LongWord;
  257. UBytesPerRow: LongWord;
  258. VBytesPerRow: LongWord;
  259. end;
  260. const
  261. // defines for code values for getcode this really belongs to graphics, and is of no
  262. // use for layers. It's here only for traditional reasons.
  263. ISLESSX = 1;
  264. ISLESSY = 2;
  265. ISGRTRX = 4;
  266. ISGRTRY = 8;
  267. //------ Font Styles
  268. FS_NORMAL = 0; // normal text (no style bits set)
  269. FSB_UNDERLINED = 0; // underlined (under baseline)
  270. FSF_UNDERLINED = $01;
  271. FSB_BOLD = 1; // bold face text (ORed w/ shifted)
  272. FSF_BOLD = $02;
  273. FSB_ITALIC = 2; // italic (slanted 1:2 right)
  274. FSF_ITALIC = $04;
  275. FSB_EXTENDED = 3; // extended face (wider than normal)
  276. FSF_EXTENDED = $08;
  277. FSB_ANTIALIASED = 4; // this uses AATextFont structure (V48)
  278. FSF_ANTIALIASED = $10;
  279. FSB_COLORFONT = 6; // this uses ColorTextFont structure
  280. FSF_COLORFONT = $40;
  281. FSB_TAGGED = 7; // the TextAttr is really an TTextAttr,
  282. FSF_TAGGED = $80;
  283. //------ Font Flags
  284. FPB_ROMFONT = 0; // font is in rom
  285. FPF_ROMFONT = $01;
  286. FPB_DISKFONT = 1; // font is from diskfont.library
  287. FPF_DISKFONT = $02;
  288. FPB_REVPATH = 2; // designed path is reversed (e.g. left)
  289. FPF_REVPATH = $04;
  290. FPB_TALLDOT = 3; // designed for hires non-interlaced
  291. FPF_TALLDOT = $08;
  292. FPB_WIDEDOT = 4; // designed for lores interlaced
  293. FPF_WIDEDOT = $10;
  294. FPB_PROPORTIONAL = 5; // character sizes can vary from nominal
  295. FPF_PROPORTIONAL = $20;
  296. FPB_DESIGNED = 6; // size is "designed", not constructed
  297. FPF_DESIGNED = $40;
  298. FPB_REMOVED = 7; // the font has been removed
  299. FPF_REMOVED = 1 shl 7;
  300. const
  301. // ****** Text Tags ****************************************************
  302. TA_DeviceDPI = 1 or TAG_USER; // Tag value is Point union: Hi LongInt XDPI, Lo LongInt YDPI
  303. TA_CharSet = 3 or TAG_USER; // New in V46: IANA Charset number
  304. TA_Rebuild = 4 or TAG_USER; // V50: boolean flag for OpenDiskFont() to force rebuilding a font
  305. MAXFONTMATCHWEIGHT = 32767; // perfect match from WeighTAMatch
  306. //----- tfe_Flags0 (partial definition) ----------------------------
  307. TE0B_NOREMFONT = 0; // disallow RemFont for this font
  308. TE0F_NOREMFONT = $01;
  309. //----- tfe_Flags1 (private) ---------------------------------------
  310. TE1F_NOUNDERLINING = $01; // Cant make this font underlined
  311. TE1F_NOEMBOLDENING = $02; // Cant make this font bold
  312. TE1F_NOSHEARING = $04; // Cant make this font italic
  313. TE1F_NODEUNDERLINING = $08; // Cant make this font non-underlined
  314. TE1F_NODEEMBOLDENING = $10; // Cant make this font non-bold
  315. TE1F_NODESHEARING = $20; // Cant make this font non-italic
  316. TE1F_NOANTIALIASING = $40; // Cant make this font antialiased
  317. TE1F_GENFONT = $80; // This font was generated via bullet API
  318. //----- ctf_Flags --------------------------------------------------
  319. const
  320. CT_COLORMASK = $000F; // mask to get to following color styles
  321. CT_COLORFONT = $0001; // color map contains designer's colors
  322. CT_GREYFONT = $0002; // color map describes even-stepped brightnesses from low to high
  323. CT_ANTIALIAS = $0004; // zero background thru fully saturated AnsiChar
  324. CTB_MAPCOLOR = 8; // map ctf_FgColor to the rp_FgPen if it's
  325. CTF_MAPCOLOR = $0100; // is a valid color within ctf_Low..ctf_High
  326. // drawing modes
  327. JAM1 = 0; // jam 1 color into raster
  328. JAM2 = 1; // jam 2 colors into raster
  329. COMPLEMENT = 2; // XOR bits into raster
  330. INVERSVID = 4; // inverse video for drawing modes
  331. BGBACKFILL = 8; // use backfill instead of BgPen
  332. FILLALPHA = 16; // draw background under alpha pixels
  333. LEVELS = 32; // fill text extent with alpha levels
  334. // these are the flag bits for RastPort flags
  335. FRST_DOT = $01; // draw the first dot of this line ?
  336. ONE_DOT = $02; // use one dot mode for drawing lines
  337. DBUFFER = $04; // flag set when RastPorts are double-buffered
  338. // only used for bobs
  339. AREAOUTLINE = $08; // used by areafiller
  340. NOCROSSFILL = $20; // areafills have no crossovers
  341. // graphics.library V51 extensions
  342. RPF_USE_FGCOLOR = $80; // draw with rp->FGPenColor
  343. RPF_USE_BGCOLOR = $100; // draw with rp->BGPenColor
  344. RPF_USE_OCOLOR = $200; // draw with rp->OPenColor
  345. RPF_FG_BLEND = $800; // private for now
  346. RPF_REMAP_COLORFONTS = $2000; // use ctf->ctf_ColorFontTable
  347. // there is only one style of clipping: raster clipping
  348. // this preserves the continuity of jaggies regardless of clip window
  349. // When drawing into a RastPort, if the ptr to ClipRect is nil then there
  350. // is no clipping done, this is dangerous but useful for speed
  351. // graphics copper list intstruction definitions
  352. COPPER_MOVE = 0; // pseude opcode for move #XXXX,dir
  353. COPPER_WAIT = 1; // pseudo opcode for wait y,x
  354. CPRNXTBUF = 2; // continue processing with next buffer
  355. CPR_NT_LOF = $8000; // copper instruction only for short frames
  356. CPR_NT_SHT = $4000; // copper instruction only for long frames
  357. CPR_NT_SYS = $2000; // copper user instruction only
  358. // mode coercion definitions
  359. PRESERVE_COLORS = 1; // Ensure that the mode coerced to can display just as many colours as the ViewPort being coerced.
  360. AVOID_FLICKER = 2; // Ensure that the mode coerced to is not interlaced.
  361. IGNORE_MCOMPAT = 4; // Coercion should ignore monitor compatibility issues.
  362. BIDTAG_COERCE = 1; // Private
  363. // VSprite flags
  364. // user-set VSprite flags:
  365. SUSERFLAGS = $00FF; // mask of all user-settable VSprite-flags
  366. VSPRITE_f = $0001; // set if VSprite, clear if Bob
  367. SAVEBACK = $0002; // set if background is to be saved/restored
  368. OVERLAY = $0004; // set to mask image of Bob onto background
  369. MUSTDRAW = $0008; // set if VSprite absolutely must be drawn
  370. // system-set VSprite flags:
  371. BACKSAVED = $0100; // this Bob's background has been saved
  372. BOBUPDATE = $0200; // temporary flag, useless to outside world
  373. GELGONE = $0400; // set if gel is completely clipped (offscreen)
  374. VSOVERFLOW = $0800; // VSprite overflow (if MUSTDRAW set we draw!)
  375. // Bob flags
  376. // these are the user flag bits
  377. BUSERFLAGS = $00FF; // mask of all user-settable Bob-flags
  378. SAVEBOB = $0001; // set to not erase Bob
  379. BOBISCOMP = $0002; // set to identify Bob as AnimComp
  380. // these are the system flag bits
  381. BWAITING = $0100; // set while Bob is waiting on 'after'
  382. BDRAWN = $0200; // set when Bob is drawn this DrawG pass
  383. BOBSAWAY = $0400; // set to initiate removal of Bob
  384. BOBNIX = $0800; // set when Bob is completely removed
  385. SAVEPRESERVE = $1000;// for back-restore during double-buffer
  386. OUTSTEP = $2000; // for double-clearing if double-buffer
  387. // defines for the animation procedures
  388. ANFRACSIZE = 6;
  389. ANIMHALF = $0020;
  390. RINGTRIGGER = $0001;
  391. type
  392. PBob = ^TBob;
  393. PAnimComp = ^TAnimComp;
  394. PVSprite = ^TVSprite;
  395. PDBufPacket = ^TDBufPacket;
  396. PAnimOb = ^TAnimOb;
  397. PRastPort = ^TRastPort;
  398. PLayer = ^TLayer;
  399. // a structure to contain the 16 collision procedure addresses
  400. CollTable = array[0..15] of Pointer;
  401. PCollTable = ^CollTable;
  402. PClipRect = ^TClipRect;
  403. TClipRect = record
  404. Next: PClipRect; // roms used to find next ClipRect
  405. OffX: SmallInt; // offsets of cliprect into bitmap (V52)
  406. OffY: SmallInt;
  407. lobs: PLayer; // In V45, this is no longer a valid pointer since a cliprect can be obscured by more than one
  408. // layer. Just test for NULL or non-nil, do *NOT* dereference.
  409. BitMap: PBitMap; // backing store bitmap if lobs <> nil
  410. bounds: TRectangle; // bounds of this cliprect
  411. vlink: PClipRect; // Layers private use!!!
  412. home: Pointer; // PLayer_Info where this cliprect belongs to.
  413. Flags: LongInt; // Layers private field for cliprects
  414. end;
  415. TLayer = record
  416. front,
  417. back: PLayer;
  418. ClipRect: PClipRect; // singly linked list of active cliprects
  419. rp: PRastPort; // rastport to draw into. Its layer is me
  420. bounds: TRectangle; // screen bounds of this layer
  421. nlink: PLayer; // new in V45: next back layer for display reorganization
  422. priority: Word; // internal use: on layer front/back move, relative priority of the layers. Topmost layer has lowest priority.
  423. Flags: Word; // flags: LAYER*
  424. SuperBitMap: PBitMap; // if non-nil, superbitmap layer
  425. SuperClipRect: PClipRect; // super bitmap cliprects if VBitMap <> nil else damage cliprect list for refresh
  426. Window: APTR; // Intuition keeps its window here
  427. Scroll_X: Word; // layer displacement
  428. Scroll_Y: Word;
  429. cr: PClipRect; // used by moveinfrontof
  430. cr2: PClipRect; // the new on- and off-screen cliprects to combine.
  431. cr3: PClipRect; // keeps the new templates that are not clipped by user/damage list
  432. SuperSaveClipRects: PClipRect; // five preallocated super cr's
  433. _Cliprects: PClipRect; // templates that are not clipped by damage list or user clip rect
  434. LayerInfo: Pointer; // PLayer_Info points to head of the list
  435. Lock: TSignalSemaphore; // access to this layer
  436. BackFill: PHook; // backfill hook
  437. ShapeRegion: PRegion; // the region that comprises the shape of this layer
  438. ClipRegion: PRegion; // user InstallClipRegion()'d region
  439. Clipped: PClipRect; // clipped away by damage list or user clip rect
  440. Width: SmallInt; // system use
  441. Height: SmallInt; // system use
  442. ShapeHook: PHook; // hook used to generate the shaperegion
  443. reserved2: array [0..3] of Byte; // more reserved fields
  444. BitMap: PBitMap; // layer's own off-screen bitmap
  445. Extension: APTR; // layer extension (system private)
  446. Reserved3: Byte; // another reserved field
  447. Opaqueness: Byte; // layer opaqueness
  448. DamageList: PRegion; // list of rectangles to refresh
  449. end;
  450. //****** TextAttr node, matches text attributes in RastPort
  451. PTextAttr = ^TTextAttr;
  452. TTextAttr = record
  453. ta_Name: STRPTR; // name of the font
  454. ta_YSize: Word; // height of the font
  455. ta_Style: Byte; // intrinsic font style
  456. ta_Flags: Byte; // font preferences and flags
  457. end;
  458. PTTextAttr = ^TTTextAttr;
  459. TTTextAttr = record
  460. tta_Name: STRPTR; // name of the font
  461. tta_YSize: Word; // height of the font
  462. tta_Style: Byte; // intrinsic font style
  463. tta_Flags: Byte; // font preferences AND flags
  464. tta_Tags: PTagItem; // extended attributes
  465. end;
  466. // ***** TextFonts node ************************************************
  467. PTextFont = ^TTextFont;
  468. TTextFont = record
  469. tf_Message: TMessage; // reply message for font removal
  470. // font name in LN \ used in this
  471. tf_YSize: Word; // font height | order to best
  472. tf_Style: Byte; // font style | match a font
  473. tf_Flags: Byte; // preferences and flags / request.
  474. tf_XSize: Word; // nominal font width
  475. tf_Baseline: Word; // distance from the top of AnsiChar to baseline
  476. tf_BoldSmear: Word; // smear to affect a bold enhancement
  477. tf_Accessors: Word; // access count
  478. tf_LoChar: Byte; // the first character described here
  479. tf_HiChar: Byte; // the last character described here
  480. tf_CharData: APTR; // the bit character data
  481. tf_Modulo: Word; // the row modulo for the strike font data
  482. tf_CharLoc: APTR; // ptr todata for the strike font
  483. // 2 words: bit offset then size
  484. tf_CharSpace: APTR; // ptr to words of proportional spacing data
  485. tf_CharKern: APTR; // ptr to words of kerning data
  486. end;
  487. PTextFontExtension = ^TTextFontExtension; // this structure is read-only
  488. TTextFontExtension = record // this structure is read-only
  489. tfe_MatchWord: Word; // a magic cookie for the extension
  490. tfe_Flags0: Byte; // (system private flags)
  491. tfe_Flags1: Byte; // (system private flags)
  492. tfe_BackPtr: PTextFont; // validation of compilation
  493. tfe_OrigReplyPort: PMsgPort; // original value in tf_Extension
  494. tfe_Tags: PTagItem; // Text Tags for the font
  495. tfe_OFontPatchS, // (system private use)
  496. tfe_OFontPatchK: APTR; // (system private use)
  497. tfe_Private0: APTR; // (guess what)
  498. // this space is reserved for future expansion
  499. end;
  500. //----- ColorFontColors --------------------------------------------
  501. PColorFontColors = ^TColorFontColors;
  502. TColorFontColors = record
  503. cfc_Reserved: Word; // *must* be zero
  504. cfc_Count: Word; // number of entries in cfc_ColorTable
  505. cfc_ColorTable: PWord; // 4 bit per component color map packed xRGB
  506. end;
  507. //----- ColorTextFont ----------------------------------------------
  508. PColorTextFont = ^TColorTextFont;
  509. TColorTextFont = record
  510. ctf_TF: TTextFont;
  511. ctf_Flags: Word; // extended flags
  512. ctf_Depth, // number of bit planes
  513. ctf_FgColor, // color that is remapped to FgPen
  514. ctf_Low, // lowest color represented here
  515. ctf_High, // highest color represented here
  516. ctf_PlanePick, // PlanePick ala Images
  517. ctf_PlaneOnOff: Byte; // PlaneOnOff ala Images
  518. ctf_ColorFontColors: PColorFontColors; // colors for font
  519. ctf_CharData: array[0..7] of APTR; //Pointers to bit planes ala tf_CharData
  520. end;
  521. //----- AATextFont -------------------------------------------------
  522. PAATextFont = ^TAATextFont;
  523. TAATextFont = record
  524. aatf_CTF: TColorTextFont;
  525. aatf_Modulo: Word; // Row modulo for the strike font data
  526. aatf_FreeMe: Word; // Private, defaults to 0 */
  527. aatf_CharData: APTR; // Chunky alpha maps for characters */
  528. aatf_CharLoc: APTR; // Pointer to location data for the strike font. Two words: pixel offset then size
  529. aatf_SelfPtr: PAATextFont; // Pointer to the structure itself to be able to detect modified
  530. // TextFont copies that are no real AATextFonts
  531. aatf_Reserved: array[0..1] of LongWord; // For future expansion, default to 0
  532. end;
  533. // ***** TextExtent node ***********************************************
  534. PTextExtent = ^TTextExtent;
  535. TTextExtent = record
  536. te_Width: Word; // same as TextLength
  537. te_Height: Word; // same as tf_YSize
  538. te_Extent: TRectangle; // relative to CP
  539. end;
  540. PCopIns = ^TCopIns;
  541. TCopIns = record
  542. OpCode: SmallInt; // 0 = move, 1 = wait
  543. VWaitAddr: SmallInt; // vertical or horizontal wait position
  544. HWaitData: SmallInt; // destination Pointer or data to send
  545. end;
  546. // structure of cprlist that points to list that hardware actually executes }
  547. PCprList = ^TCprList;
  548. TCprList = record
  549. Next: PCprList;
  550. Start: PSmallInt; // start of copper list
  551. MaxCount: SmallInt; // number of long instructions
  552. end;
  553. PCopList = ^TCopList;
  554. TCopList = record
  555. Next: PCopList; // next block for this copper list
  556. CopList: PCopList; // system use
  557. ViewPort : Pointer; // system use
  558. CopIns: PCopIns; // start of this block
  559. CopPtr: PCopIns; // intermediate ptr
  560. CopLStart: PWord; // mrgcop fills this in for Long Frame
  561. CopSStart: PWord; // mrgcop fills this in for Short Frame
  562. Count: SmallInt; // intermediate counter
  563. MaxCount: SmallInt; // max # of copins for this block
  564. DyOffset: SmallInt; // offset this copper list vertical waits
  565. SLRepeat: Word;
  566. Flags: Word;
  567. end;
  568. PUCopList = ^TUCopList;
  569. TUCopList = record
  570. Next: PUCopList;
  571. FirstCopList: PCopList; // head node of this copper list
  572. CopList: PCopList; // node in use
  573. end;
  574. // Private graphics data structure. This structure has changed in the past,
  575. // and will continue to change in the future. Do Not Touch!
  576. PCopInit = ^TCopInit;
  577. TCopInit = record
  578. vsync_hblank: array[0..1] of word;
  579. diagstrt: array[0..11] of word; // copper list for first bitplane
  580. fm0: array[0..1] of word;
  581. diwstart: array[0..9] of word;
  582. bplcon2: array[0..1] of word;
  583. sprfix: array[0..(2*8) - 1] of word;
  584. sprstrtup: array[0..(2*8*2) - 1] of Word;
  585. wait14: array[0..1] of word;
  586. norm_hblank: array[0..1] of word;
  587. jump: array[0..1] of word;
  588. wait_forever: array[0..5] of word;
  589. sprstop: array[0..7] of Word;
  590. end;
  591. PAreaInfo = ^TAreaInfo;
  592. TAreaInfo = record
  593. VctrTbl: PSmallInt; // ptr to start of vector table
  594. VctrPtr: PSmallInt; // ptr to current vertex
  595. FlagTbl: PByte; // ptr to start of vector flag table
  596. FlagPtr: PByte; // ptrs to areafill flags
  597. Count: SmallInt; // number of vertices in list
  598. MaxCount: SmallInt; // AreaMove/Draw will not allow Count>MaxCount
  599. FirstX: SmallInt;
  600. FirstY: SmallInt; // first point for this polygon
  601. end;
  602. PTmpRas = ^TTmpRas;
  603. TTmpRas = record
  604. RasPtr: TPlanePtr;
  605. Size: LongInt;
  606. end;
  607. // unoptimized for 32bit alignment of Pointers
  608. PGelsInfo = ^TGelsInfo;
  609. TGelsInfo = record
  610. sprRsrvd: Shortint; // flag of which sprites to reserve from vsprite system
  611. Flags: Byte; // system use
  612. gelHead: PVSprite;
  613. gelTail: PVSprite; // dummy vSprites for list management
  614. // Pointer to array of 8 WORDS for sprite available lines
  615. nextLine: PWord;
  616. // Pointer to array of 8 Pointers for color-last-assigned to vSprites
  617. lastColor: Pointer;
  618. collHandler: PCollTable; // addresses of collision routines
  619. leftmost: SmallInt;
  620. rightmost: SmallInt;
  621. topmost: SmallInt;
  622. bottommost: SmallInt;
  623. firstBlissObj: APTR;
  624. lastBlissObj: APTR; // system use only
  625. end;
  626. TRastPort = record
  627. Layer: PLayer;
  628. BitMap: PBitMap;
  629. AreaPtrn: PWord; // ptr to areafill pattern
  630. TmpRas: PTmpRas;
  631. AreaInfo: PAreaInfo;
  632. GelsInfo: PGelsInfo;
  633. Mask: Byte; // write mask for this raster
  634. FgPen: Shortint; // foreground pen for this raster
  635. BgPen: Shortint; // background pen
  636. AOlPen: Shortint; // areafill outline pen
  637. DrawMode: Shortint; // drawing mode for fill, lines, and text
  638. AreaPtSz: Shortint; // 2^n words for areafill pattern
  639. linpatcnt: Shortint; // current line drawing pattern preshift
  640. dummy: Shortint;
  641. Flags: Word; // miscellaneous control bits
  642. LinePtrn: Word; // 16 bits for textured lines
  643. cp_x, cp_y: SmallInt; // current pen position
  644. minterms: array[0..7] of Byte;
  645. PenWidth: SmallInt;
  646. PenHeight: SmallInt;
  647. Font: PTextFont; // current font Pointer
  648. AlgoStyle: Byte; // the algorithmically generated style
  649. TxFlags: Byte; // text specific flags
  650. TxHeight: Word; // text height
  651. TxWidth: Word; // text nominal width
  652. TxBaseline: Word; // text baseline
  653. TxSpacing: SmallInt; // text spacing (per character)
  654. RP_User: Pointer;
  655. LongFlags: LongWord; // V51: private
  656. ExtensionData: APTR; // V51: private rastport extension pointer
  657. RenderDomain: TRectangle; // V51: private
  658. FGColor: LongWord; // V51: foreground color, don't peek or poke directly!
  659. BGColor: LongWord; // V51: background color, don't peek or poke directly!
  660. OColor: LongWord; // V51: outline color, don't peek or poke directly!
  661. wordreserved: Word; // for future use
  662. end;
  663. // Extended RastPort data, new for v52.2. GfxNew() must be used to
  664. // allocate this structure! Currently unused, reserved for future use.
  665. PRastPortExtra = ^TRastPortExtra;
  666. TRastPortExtra = record
  667. Node: TExtendedNode; // graphics extended node
  668. RastPort: PRastPort; // backlink
  669. Reserved: array[0..15] of LongWord; // avoid recompilation ;-)
  670. end;
  671. // UserStuff definitions
  672. // the user can define these to be a single variable or a sub-structure
  673. // if undefined by the user, the system turns these into innocuous variables
  674. // see the manual for a thorough definition of the UserStuff definitions
  675. VUserStuff = SmallInt; // Sprite user stuff
  676. BUserStuff = SmallInt; // Bob user stuff
  677. AUserStuff = SmallInt; // AnimOb user stuff
  678. // ********************** GEL STRUCTURES *******************************
  679. TVSprite = record
  680. //-- SYSTEM VARIABLES
  681. NextVSprite: PVSprite; // GEL linked list forward/backward Pointers sorted by y,x value
  682. PrevVSprite: PVSprite;
  683. // GEL draw list constructed in the order the Bobs are actually drawn, then list is copied to clear list must be here in VSprite for system boundary detection
  684. DrawPath: PVSprite; // Pointer of overlay drawing
  685. ClearPath: PVSprite; // Pointer for overlay clearing
  686. // the VSprite positions are defined in (y,x) order to make sorting sorting easier, since (y,x) as a long LongInt
  687. OldY, OldX: SmallInt; // previous position
  688. //-- COMMON VARIABLES
  689. Flags: SmallInt; // VSprite flags
  690. //-- USER VARIABLES
  691. // the VSprite positions are defined in (y,x) order to make sorting sorting easier, since (y,x) as a long LongInt
  692. Y, X: SmallInt; // screen position
  693. Height: SmallInt;
  694. Width: SmallInt; // number of words per row of image data
  695. Depth: SmallInt; // number of planes of data
  696. MeMask: SmallInt; // which types can collide with this VSprite
  697. HitMask: SmallInt; // which types this VSprite can collide with
  698. ImageData: PSmallInt; // Pointer to VSprite image
  699. // borderLine is the one-dimensional logical OR of all the VSprite bits, used for fast collision detection of edge
  700. BorderLine: PSmallInt; // logical OR of all VSprite bits
  701. CollMask: PSmallInt; // similar to above except this is a matrix
  702. // Pointer to this VSprite's color definitions (not used by Bobs)
  703. SprColors: PSmallInt;
  704. VSBob: PBob; // points home if this VSprite is part of a Bob
  705. { planePick flag: set bit selects a plane from image, clear bit selects
  706. use of shadow mask for that plane
  707. OnOff flag: if using shadow mask to fill plane, this bit (corresponding
  708. to bit in planePick) describes whether to fill with 0's or 1's
  709. There are two uses for these flags:
  710. - if this is the VSprite of a Bob, these flags describe how the Bob
  711. is to be drawn into memory
  712. - if this is a simple VSprite and the user intends on setting the
  713. MUSTDRAW flag of the VSprite, these flags must be set too to describe
  714. which color registers the user wants for the image}
  715. PlanePick: Shortint;
  716. PlaneOnOff: Shortint;
  717. VUserExt: VUserStuff; // user definable: see note above
  718. end;
  719. // blitter-objects
  720. TBob = record
  721. //-- SYSTEM VARIABLES
  722. //-- COMMON VARIABLES
  723. Flags: SmallInt; // general purpose flags (see definitions below)
  724. //-- USER VARIABLES
  725. SaveBuffer: PSmallInt; // Pointer to the buffer for background save
  726. // used by Bobs for "cookie-cutting" and multi-plane masking
  727. ImageShadow : PSmallInt;
  728. // Pointer to BOBs for sequenced drawing of Bobs for correct overlaying of multiple component animations
  729. Before: PBob; // draw this Bob before Bob pointed to by before
  730. After: PBob; // draw this Bob after Bob pointed to by after
  731. BobVSprite: PVSprite; // this Bob's VSprite definition
  732. BobComp: PAnimComp; // Pointer to this Bob's AnimComp def
  733. DBuffer: PDBufPacket; // Pointer to this Bob's dBuf packet
  734. BUserExt: BUserStuff; // Bob user extension
  735. end;
  736. TAnimComp = record
  737. //-- SYSTEM VARIABLES
  738. //-- COMMON VARIABLES
  739. Flags: SmallInt; // AnimComp flags for system & user
  740. // timer defines how long to keep this component active:
  741. // if set non-zero, timer decrements to zero then switches to nextSeq
  742. // if set to zero, AnimComp never switches
  743. Timer: SmallInt;
  744. //-- USER VARIABLES
  745. // initial value for timer when the AnimComp is activated by the system
  746. TimeSet: SmallInt;
  747. // Pointer to next and previous components of animation object
  748. NextComp: PAnimComp;
  749. PrevComp: PAnimComp;
  750. // Pointer to component component definition of next image in sequence
  751. NextSeq: PAnimComp;
  752. PrevSeq: PAnimComp;
  753. // address of special animation procedure
  754. AnimCRoutine: Pointer;
  755. YTrans: SmallInt; // initial y translation (if this is a component)
  756. XTrans: SmallInt; // initial x translation (if this is a component)
  757. HeadOb: PAnimOb;
  758. AnimBob: pBob;
  759. end;
  760. PPAnimOb = ^PAnimOb;
  761. TAnimOb = record
  762. //-- SYSTEM VARIABLES
  763. NextOb: PAnimOb;
  764. PrevOb: PAnimOb;
  765. Clock: LongInt; // number of calls to Animate this AnimOb has endured
  766. AnOldY, AnOldX: SmallInt; // old y,x coordinates
  767. //-- COMMON VARIABLES
  768. AnY, AnX: SmallInt; // y,x coordinates of the AnimOb
  769. //-- USER VARIABLES
  770. YVel, XVel: SmallInt; // velocities of this object
  771. YAccel, XAccel: SmallInt; // accelerations of this object
  772. RingYTrans,
  773. RingXTrans: SmallInt; // ring translation values
  774. AnimORoutine: Pointer; // Pointer of special animation procedure
  775. HeadComp: PAnimComp; // Pointer to first component
  776. AUserExt: AUserStuff; // AnimOb user extension
  777. end;
  778. // dBufPacket defines the values needed to be saved across buffer to buffer
  779. // when in double-buffer mode
  780. tDBufPacket = record
  781. BufY, BufX: SmallInt; // save other buffers screen coordinates
  782. BufPath: PVSprite; // carry the draw path over the gap
  783. // these Pointers must be filled in by the user
  784. // Pointer to other buffer's background save buffer
  785. BufBuffer: PSmallInt;
  786. end;
  787. const
  788. B2NORM = 0;
  789. B2SWAP = 1;
  790. B2BOBBER = 2;
  791. { ************************************************************************ }
  792. const
  793. // internal TClipRect.flags
  794. CR_USERCLIPPED = 16; // out of user clip rectangle
  795. CR_DAMAGECLIPPED = 32; // out of damage cliprects
  796. CR_LAYERBITMAP = 64; // don't free the BitMap
  797. CR_ALPHATYPE = 128; // not opaque, or covered by same
  798. CR_INVISIBLE = 256; // fully obscured, no own BitMap
  799. CR_INTUITION = 1024; // internal system use
  800. // defines for shape hooks
  801. SHAPEHOOKACTION_CREATELAYER = 0;
  802. SHAPEHOOKACTION_MOVELAYER = 1; // Only sent if LAYERMOVECHANGESSHAPE is set
  803. SHAPEHOOKACTION_SIZELAYER = 2;
  804. SHAPEHOOKACTION_MOVESIZELAYER = 3;
  805. SHAPEHOOKACTION_CHANGELAYERSHAPE = 4;
  806. SHAPEHOOKACTION_DELETELAYER = 5;
  807. SHAPEHOOKACTION_GETHOOKACTIONS = 6;
  808. type
  809. PShapeHookMsg = ^TShapeHookMsg;
  810. TShapeHookMsg = record
  811. Action: LongWord;
  812. NewShape: PRegion;
  813. OldShape: PRegion;
  814. NewBounds: PRectangle;
  815. OldBounds: PRectangle;
  816. end;
  817. // defines for alpha hooks
  818. const
  819. ALPHAHOOKACTION_CREATELAYER = 0;
  820. ALPHAHOOKACTION_MOVELAYER = 1; // Only sent if LAYERMOVECHANGESSHAPE is set
  821. ALPHAHOOKACTION_SIZELAYER = 2;
  822. ALPHAHOOKACTION_MOVESIZELAYER = 3;
  823. ALPHAHOOKACTION_CHANGELAYERALPHA = 4;
  824. ALPHAHOOKACTION_DELETELAYER = 5;
  825. ALPHAHOOKACTION_GETHOOKACTIONS = 6;
  826. type
  827. PAlphaHookMsg = ^TAlphaHookMsg;
  828. TAlphaHookMsg = record
  829. Action: LongWord;
  830. NewAlphaCR: PClipRect;
  831. OldAlphaCR: PClipRect;
  832. NewBounds: PRectangle;
  833. OldBounds: PRectangle;
  834. end;
  835. const
  836. { These bit descriptors are used by the GEL collide routines.
  837. * These bits are set in the hitMask and meMask variables of
  838. * a GEL to describe whether or not these types of collisions
  839. * can affect the GEL. BNDRY_HIT is described further below;
  840. * this bit is permanently assigned as the boundary-hit flag.
  841. * The other bit GEL_HIT is meant only as a default to cover
  842. * any GEL hitting any other; the user may redefine this bit.}
  843. BORDERHIT = 0;
  844. { These bit descriptors are used by the GEL boundry hit routines.
  845. * When the user's boundry-hit routine is called (via the argument
  846. * set by a call to SetCollision) the first argument passed to
  847. * the user's routine is the Pointer of the GEL involved in the
  848. * boundry-hit, and the second argument has the appropriate bit(s)
  849. * set to describe which boundry was surpassed }
  850. TOPHIT = 1;
  851. BOTTOMHIT = 2;
  852. LEFTHIT = 4;
  853. RIGHTHIT = 8;
  854. // Porter/Duff Image Composition
  855. COMPOSITE_Clear = 0;
  856. COMPOSITE_Src = 1;
  857. COMPOSITE_Dest = 2;
  858. COMPOSITE_Src_Over_Dest = 3;
  859. COMPOSITE_Dest_Over_Src = 4;
  860. COMPOSITE_Src_In_Dest = 5;
  861. COMPOSITE_Dest_In_Src = 6;
  862. COMPOSITE_Src_Out_Dest = 7;
  863. COMPOSITE_Dest_Out_Src = 8;
  864. COMPOSITE_Src_Atop_Dest = 9;
  865. COMPOSITE_Dest_Atop_Src = 10;
  866. COMPOSITE_Src_Xor_Dest = 11;
  867. COMPOSITE_Plus = 12;
  868. COMPOSITE_Maximum = 13;
  869. COMPOSITE_Minimum = 14;
  870. COMPOSITE_NumOperators = 15;
  871. // Tag items for the Composite call
  872. COMPTAG_Base = TAG_USER;
  873. COMPTAG_SrcX = COMPTAG_Base + 0; // (uint32) X clip coordinate on source bitmap (defaults to 0)
  874. COMPTAG_SrcY = COMPTAG_Base + 1; // (uint32) Y clip coordinate on source bitmap (defaults to 0)
  875. COMPTAG_SrcWidth = COMPTAG_Base + 2; // (uint32) Width of clip rectangle on source (defaults to full width)
  876. COMPTAG_SrcHeight = COMPTAG_Base + 3; // (uint32) Height of clip rectangle on source (defaults to full height)
  877. COMPTAG_DestX = COMPTAG_Base + 4; // (uint32) X clip coordinate on dest bitmap (defaults to 0)
  878. COMPTAG_DestY = COMPTAG_Base + 5; // (uint32) Y clip coordinate on dest bitmap (defaults to 0)
  879. COMPTAG_DestWidth = COMPTAG_Base + 6; // (uint32) Width of clip rectangle on dest (defaults to full width)
  880. COMPTAG_DestHeight = COMPTAG_Base + 7; // (uint32) Height of clip rectangle on dest (defaults to full height)
  881. COMPTAG_SrcAlpha = COMPTAG_Base + 8; // (fixpoint) (additional) Alpha for source bitmap (no default)
  882. COMPTAG_DestAlpha = COMPTAG_Base + 9; // (fixpoint) (additional) Alpha for destination bitmap (no default)
  883. COMPTAG_ScaleX = COMPTAG_Base + 10; // (fixpoint) X scale factor for source bitmap (defaults to 1.0)
  884. COMPTAG_ScaleY = COMPTAG_Base + 11; // (fixpoint) Y scale factor for source bitmap (defaults to 1.0)
  885. COMPTAG_SrcAlphaMask = COMPTAG_Base + 12; // (struct Bitmap *; Alpha mask for source. Specifying this tag overrides any alpha that might be present in the source bitmap.
  886. COMPTAG_DestAlphaMask = COMPTAG_Base + 13; // (struct Bitmap *; Alpha mask for the destination. Specifying this tag overrides any alpha that might be present in the destination bitmap.
  887. COMPTAG_Flags = COMPTAG_Base + 18; // (uint32, see defines below; Specifies a set of flags that may modify the operation. See the defines below
  888. COMPTAG_OffsetX = COMPTAG_Base + 20; // (int32; X Coordinate on the destination bitmap that the operation should be applied to. Defaults to zero.
  889. COMPTAG_OffsetY = COMPTAG_Base + 21; // (int32; Y Coordinate on the destination bitmap that the operation should be applied to. Defaults to zero.
  890. COMPTAG_FriendBitMap = COMPTAG_Base + 22; // (struct BitMap *; when the source and/or destination bitmaps are located in main memory, this tag tells the graphics system to upload the bitmaps to the same board the friend bitmap is located on.
  891. COMPTAG_DisplayID = COMPTAG_Base + 23; // (uint32; the same as above, but a DisplayID is used as reference to the board and not a bitmap.
  892. COMPTAG_SrcAlphaX = COMPTAG_Base + 14; // (uint32; the X/Y coordinates on the src alpha map to use for compositing. If not specified, use the same as the SrcX and SrcY
  893. COMPTAG_SrcAlphaY = COMPTAG_Base + 15;
  894. COMPTAG_DestAlphaX = COMPTAG_Base + 16; // (uint32; the X/Y coordinates on the destination alpha map to use. If not specified, use the DestX and DestY
  895. COMPTAG_DestAlphaY = COMPTAG_Base + 17;
  896. // The following group of tag items deals with direct triangle mapping. Read the autodoc for a detailed explanation
  897. COMPTAG_VertexArray = COMPTAG_Base + 30;
  898. COMPTAG_IndexArray = COMPTAG_Base + 31;
  899. COMPTAG_VertexFormat = COMPTAG_Base + 32;
  900. COMPTAG_NumTriangles = COMPTAG_Base + 33;
  901. // This group of tag items can be used to specify up to four colors, either as an 32 bit ARGB value, or as a set of discreet fixpoint numbers.
  902. // The fixpoint numbers range is 0 to 1. Specifying a fixpoint component overrides the ARGB value completely.
  903. COMPTAG_Color0 = COMPTAG_Base + 40;
  904. COMPTAG_Color1 = COMPTAG_Base + 41;
  905. COMPTAG_Color2 = COMPTAG_Base + 42;
  906. COMPTAG_Color3 = COMPTAG_Base + 43;
  907. COMPTAG_Color0_Red = COMPTAG_Base + 44;
  908. COMPTAG_Color0_Green = COMPTAG_Base + 45;
  909. COMPTAG_Color0_Blue = COMPTAG_Base + 46;
  910. COMPTAG_Color0_Alpha = COMPTAG_Base + 47;
  911. COMPTAG_Color1_Red = COMPTAG_Base + 48;
  912. COMPTAG_Color1_Green = COMPTAG_Base + 49;
  913. COMPTAG_Color1_Blue = COMPTAG_Base + 50;
  914. COMPTAG_Color1_Alpha = COMPTAG_Base + 51;
  915. COMPTAG_Color2_Red = COMPTAG_Base + 52;
  916. COMPTAG_Color2_Green = COMPTAG_Base + 53;
  917. COMPTAG_Color2_Blue = COMPTAG_Base + 54;
  918. COMPTAG_Color2_Alpha = COMPTAG_Base + 55;
  919. COMPTAG_Color3_Red = COMPTAG_Base + 56;
  920. COMPTAG_Color3_Green = COMPTAG_Base + 57;
  921. COMPTAG_Color3_Blue = COMPTAG_Base + 58;
  922. COMPTAG_Color3_Alpha = COMPTAG_Base + 59;
  923. { Specifies the YUV to RGB conversion standard to use for YUV source bitmaps.
  924. The options are:
  925. - COMPYUV_BT601 - SD video standard ITU-R BT.601
  926. - COMPYUV_BT709 - HD video standard ITU-R BT.709
  927. NOTE: This is only relevant if the source bitmap is in one of the YUV formats
  928. (e.g., RGBFB_YUV420P).}
  929. COMPTAG_SrcYUVStandard = COMPTAG_Base + 60;
  930. COMPYUV_BT601 = 0;
  931. COMPYUV_BT709 = 1;
  932. COMPTAG_SrcYUVMatrix = COMPTAG_Base + 61; // (PSingle) Provide a custom YUV to RGB conversion matrix
  933. //Reserved
  934. COMPTAG_Private = COMPTAG_Base + 34;
  935. COMPTAG_Private2 = COMPTAG_Base + 35;
  936. // Vertex Array format flags
  937. COMPVF_STW0_Present = $02;
  938. COMPVF_STW1_Present = $04;
  939. COMPFLAG_SrcAlphaOverride = 1 shl 0; // If set, the value specified in SrcAlpha overrides the value in the source bitmap, which means that the source bitmap is
  940. // assumed to have a constant alpha over the entire image. If not set, the SrcAlpha value is used to modulate/scale any other alpha channel.
  941. COMPFLAG_DestAlphaOverride = 1 shl 1; // Like COMPFLAG_SrcAlphaOverride, for the destination bitmap.
  942. COMPFLAG_SrcFilter = 1 shl 2; // If set, enables bilinear filtering of the source bitmap while scaling. While this can improve the quality of scaled images,
  943. // it might cause a dramatic slowdown when the operation is emulated in software.
  944. COMPFLAG_HardwareOnly = 1 shl 3; // If set, the call will fail with an error code if the operation cannot be performed in hardware. Reasons for this include software-only bitmaps, unsupported color formats, etc.
  945. COMPFLAG_IgnoreDestAlpha = 1 shl 4;
  946. COMPFLAG_ForceSoftware = 1 shl 7; // If set, the operation will be emulated in software even if it could be performed in hardware. This is mostly useful for testing purposes. Setting this overrides COMPFLAG_HardwareOnly.
  947. COMPFLAG_Color1Modulate = 1 shl 8; // If set, then Color 1 is used as a modulate color for the src bitmap. That is, each color component of each pixel in the source bitmap is multiplied with the color 1 (including its
  948. // alpha). All other effects stay in effect. This flag can essentially be used to "tint" a bitmap in the given color
  949. // Tags for GraphicsControlTagList()
  950. GCTRL_GetForceSWComposite = TAG_USER + 1;
  951. GCTRL_SetForceSWComposite = TAG_USER + 2;
  952. GCTRL_GetUseDMA = TAG_USER + 3;
  953. GCTRL_SetUseDMA = TAG_USER + 4;
  954. GCTRL_GetUseAltiVec = TAG_USER + 5;
  955. GCTRL_SetUseAltiVec = TAG_USER + 6;
  956. GCTRL_GetDisableAmigaBlitter = TAG_USER + 7;
  957. GCTRL_SetDisableAmigaBlitter = TAG_USER + 8;
  958. GCTRL_GetPlanesToFast = TAG_USER + 9;
  959. GCTRL_SetPlanesToFast = TAG_USER + 10;
  960. GCTRL_Get31KHzScanRate = TAG_USER + 11;
  961. GCTRL_Set31KHzScanRate = TAG_USER + 12;
  962. // enCompositeError
  963. COMPERR_Success = 0;
  964. COMPERR_Incompatible = 1; // Incompatible bitmaps for operation
  965. COMPERR_Value = 2; // An input value is out of range
  966. COMPERR_SoftwareFallback = 3; // Operation would fall back to software emulation and hardware only was requested
  967. COMPERR_OutOfMemory = 4; // The operation tried to allocate memory but failed
  968. COMPERR_Generic = 5; // Some generic error has occurred
  969. COMPERR_UnknownOperator = 6; // Unknown operator specified
  970. COMPERR_MissingInput = 7; // Missing a mandatory tag item
  971. GMD_TagBase = TAG_USER;
  972. GMD_VendorID = GMD_TagBase + 1;
  973. GMD_Product = GMD_TagBase + 2;
  974. GMD_ProductID = GMD_TagBase + 3;
  975. GMD_HSyncMin = GMD_TagBase + 4;
  976. GMD_HSyncMax = GMD_TagBase + 5;
  977. GMD_VSyncMin = GMD_TagBase + 6;
  978. GMD_VSyncMax = GMD_TagBase + 7;
  979. GMD_DotClockMin = GMD_TagBase + 8;
  980. GMD_DotClockMax = GMD_TagBase + 9;
  981. GMD_DisplayWidth = GMD_TagBase + 10;
  982. GMD_DisplayHeight = GMD_TagBase + 11;
  983. GMD_InputType = GMD_TagBase + 12;
  984. GMD_EDIDVersion = GMD_TagBase + 13;
  985. GMD_EDIDRevision = GMD_TagBase + 14;
  986. GMD_BasicAudio = GMD_TagBase + 15;
  987. // enMonitorInputType
  988. INPUTTYPE_VGA = 0;
  989. INPUTTYPE_DVI = 1;
  990. const
  991. SS_GRAPHICS = $02;
  992. VIEW_EXTRA_TYPE = 1;
  993. VIEWPORT_EXTRA_TYPE = 2;
  994. SPECIAL_MONITOR_TYPE = 3;
  995. MONITOR_SPEC_TYPE = 4;
  996. type
  997. // structure used by AddTOFTask
  998. PIsrvstr = ^TIsrvstr;
  999. TIsrvstr = record
  1000. is_Node: TNode;
  1001. Iptr: PIsrvstr; // passed to srvr by os
  1002. code: Pointer;
  1003. ccode: Pointer;
  1004. Carg: APTR;
  1005. end;
  1006. PAnalogSignalInterval = ^TAnalogSignalInterval;
  1007. TAnalogSignalInterval = record
  1008. asi_Start: Word;
  1009. asi_Stop: Word;
  1010. end;
  1011. PSpecialMonitor = ^TSpecialMonitor;
  1012. TSpecialMonitor = record
  1013. spm_Node: TExtendedNode;
  1014. spm_Flags: Word;
  1015. do_monitor: Pointer;
  1016. reserved1: Pointer;
  1017. reserved2: Pointer;
  1018. reserved3: Pointer;
  1019. hblank: TAnalogSignalInterval;
  1020. vblank: TAnalogSignalInterval;
  1021. hsync: TAnalogSignalInterval;
  1022. vsync: TAnalogSignalInterval;
  1023. end;
  1024. PMonitorSpec = ^TMonitorSpec;
  1025. TMonitorSpec = record
  1026. ms_Node: TExtendedNode;
  1027. ms_Flags: Word;
  1028. ratioh: LongInt;
  1029. ratiov: LongInt;
  1030. total_rows: Word;
  1031. total_colorclocks: Word;
  1032. DeniseMaxDisplayColumn: Word;
  1033. BeamCon0: Word;
  1034. min_row: Word;
  1035. ms_Special: PSpecialMonitor;
  1036. ms_OpenCount: Word;
  1037. ms_transform: Pointer;
  1038. ms_translate: Pointer;
  1039. ms_scale: Pointer;
  1040. ms_xoffset: Word;
  1041. ms_yoffset: Word;
  1042. ms_LegalView: TRectangle;
  1043. ms_maxoscan: Pointer; // maximum legal overscan
  1044. ms_videoscan: Pointer; // video display overscan
  1045. DeniseMinDisplayColumn: Word;
  1046. DisplayCompatible: LongWord;
  1047. DisplayInfoDataBase: TList;
  1048. DisplayInfoDataBaseSemaphore: TSignalSemaphore;
  1049. ms_MrgCop: Pointer;
  1050. ms_LoadView: Pointer;
  1051. ms_KillView: Pointer;
  1052. end;
  1053. const
  1054. TO_MONITOR = 0;
  1055. FROM_MONITOR = 1;
  1056. STANDARD_XOFFSET = 9;
  1057. STANDARD_YOFFSET = 0;
  1058. MSB_REQUEST_NTSC = 0;
  1059. MSB_REQUEST_PAL = 1;
  1060. MSB_REQUEST_SPECIAL = 2;
  1061. MSB_REQUEST_A2024 = 3;
  1062. MSB_DOUBLE_SPRITES = 4;
  1063. MSF_REQUEST_NTSC = 1 shl MSB_REQUEST_NTSC;
  1064. MSF_REQUEST_PAL = 1 shl MSB_REQUEST_PAL;
  1065. MSF_REQUEST_SPECIAL = 1 shl MSB_REQUEST_SPECIAL;
  1066. MSF_REQUEST_A2024 = 1 shl MSB_REQUEST_A2024;
  1067. MSF_DOUBLE_SPRITES = 1 shl MSB_DOUBLE_SPRITES;
  1068. // obsolete, v37 compatible definitions follow
  1069. REQUEST_NTSC = 1 shl MSB_REQUEST_NTSC;
  1070. REQUEST_PAL = 1 shl MSB_REQUEST_PAL;
  1071. REQUEST_SPECIAL = 1 shl MSB_REQUEST_SPECIAL;
  1072. REQUEST_A2024 = 1 shl MSB_REQUEST_A2024;
  1073. DEFAULT_MONITOR_NAME: PAnsiChar = 'default.monitor';
  1074. NTSC_MONITOR_NAME: PAnsiChar = 'ntsc.monitor';
  1075. PAL_MONITOR_NAME: PAnsiChar = 'pal.monitor';
  1076. STANDARD_MONITOR_MASK = REQUEST_NTSC or REQUEST_PAL;
  1077. STANDARD_NTSC_ROWS = 262;
  1078. STANDARD_PAL_ROWS = 312;
  1079. STANDARD_COLORCLOCKS = 226;
  1080. STANDARD_DENISE_MAX = 455;
  1081. STANDARD_DENISE_MIN = 93 ;
  1082. STANDARD_NTSC_BEAMCON = $0000;
  1083. STANDARD_PAL_BEAMCON = $0020;
  1084. //SPECIAL_BEAMCON = VARVBLANK or LOLDIS or VARVSYNC or VARHSYNC or VARBEAM or CSBLANK or VSYNCTRUE;
  1085. MIN_NTSC_ROW = 21;
  1086. MIN_PAL_ROW = 29;
  1087. STANDARD_VIEW_X = $81;
  1088. STANDARD_VIEW_Y = $2C;
  1089. STANDARD_HBSTRT = $06;
  1090. STANDARD_HSSTRT = $0B;
  1091. STANDARD_HSSTOP = $1C;
  1092. STANDARD_HBSTOP = $2C;
  1093. STANDARD_VBSTRT = $0122;
  1094. STANDARD_VSSTRT = $02A6;
  1095. STANDARD_VSSTOP = $03AA;
  1096. STANDARD_VBSTOP = $1066;
  1097. VGA_COLORCLOCKS = STANDARD_COLORCLOCKS / 2;
  1098. VGA_TOTAL_ROWS = STANDARD_NTSC_ROWS * 2;
  1099. VGA_DENISE_MIN = 59;
  1100. MIN_VGA_ROW = 29;
  1101. VGA_HBSTRT = $08;
  1102. VGA_HSSTRT = $0E;
  1103. VGA_HSSTOP = $1C;
  1104. VGA_HBSTOP = $1E;
  1105. VGA_VBSTRT = $0000;
  1106. VGA_VSSTRT = $0153;
  1107. VGA_VSSTOP = $0235;
  1108. VGA_VBSTOP = $0CCD;
  1109. VGA_MONITOR_NAME: PAnsiChar = 'vga.monitor';
  1110. // NOTE: VGA70 definitions are obsolete - a VGA70 monitor has never been implemented.
  1111. VGA70_COLORCLOCKS = STANDARD_COLORCLOCKS / 2;
  1112. VGA70_TOTAL_ROWS = 449;
  1113. VGA70_DENISE_MIN = 59;
  1114. MIN_VGA70_ROW = 35;
  1115. VGA70_HBSTRT = $08;
  1116. VGA70_HSSTRT = $0E;
  1117. VGA70_HSSTOP = $1C;
  1118. VGA70_HBSTOP = $1E;
  1119. VGA70_VBSTRT = $0000;
  1120. VGA70_VSSTRT = $02A6;
  1121. VGA70_VSSTOP = $0388;
  1122. VGA70_VBSTOP = $0F73;
  1123. //VGA70_BEAMCON = SPECIAL_BEAMCON xor VSYNCTRUE;
  1124. VGA70_MONITOR_NAME: PAnsiChar = 'vga70.monitor';
  1125. BROADCAST_HBSTRT = $01;
  1126. BROADCAST_HSSTRT = $06;
  1127. BROADCAST_HSSTOP = $17;
  1128. BROADCAST_HBSTOP = $27;
  1129. BROADCAST_VBSTRT = $0000;
  1130. BROADCAST_VSSTRT = $02A6;
  1131. BROADCAST_VSSTOP = $054C;
  1132. BROADCAST_VBSTOP = $1C40;
  1133. //BROADCAST_BEAMCON = LOLDIS or CSBLANK;
  1134. RATIO_FIXEDPART = 4;
  1135. RATIO_UNITY = 1 shl RATIO_FIXEDPART;
  1136. Type
  1137. PColorMap = ^TColorMap;
  1138. PViewPort = ^TViewPort;
  1139. PRasInfo = ^TRasInfo;
  1140. TRasInfo = record // used by callers to and InitDspC()
  1141. Next: PRasInfo; // used for dualpf
  1142. BitMap: PBitMap;
  1143. RxOffset: SmallInt; // scroll offsets in this BitMap
  1144. RyOffset: SmallInt;
  1145. end;
  1146. PView = ^TView;
  1147. TView = record
  1148. ViewPort: PViewPort;
  1149. LOFCprList: PCprList; // used for interlaced and noninterlaced
  1150. SHFCprList: PCprList; // only used during interlace
  1151. DyOffset: SmallInt; // for complete View positioning
  1152. DxOffset: SmallInt; // offsets are +- adjustments to standard #s
  1153. Modes: Word; // such as INTERLACE, GENLOC
  1154. end;
  1155. // these structures are obtained via GfxNew and disposed by GfxFree
  1156. PViewExtra = ^TViewExtra;
  1157. TViewExtra = record
  1158. n: TExtendedNode;
  1159. View: PView; // backwards link
  1160. Monitor: PMonitorSpec; // monitors for this view
  1161. TopLine: Word;
  1162. end;
  1163. TViewPort = record
  1164. Next: PViewPort;
  1165. ColorMap: PColorMap; // table of colors for this viewport if this is nil, MakeVPort assumes default values
  1166. DspIns: pCopList; // user by MakeView()
  1167. SprIns: pCopList; // used by sprite stuff
  1168. ClrIns: pCopList; // used by sprite stuff
  1169. UCopIns: PUCopList; // User copper list
  1170. DWidth, DHeight: SmallInt;
  1171. DxOffset, DyOffset: SmallInt;
  1172. Modes: Word;
  1173. SpritePriorities: Byte;
  1174. ExtendedModes: Byte;
  1175. RasInfo: PRasInfo;
  1176. end;
  1177. // private structure
  1178. PVecTable = ^TVecTable;
  1179. TVecTable = record
  1180. end;
  1181. // this structure is obtained via GfxNew and disposed by GfxFree
  1182. PViewPortExtra = ^tViewPortExtra;
  1183. tViewPortExtra = record
  1184. n: TExtendedNode;
  1185. ViewPort: PViewPort; // backwards link
  1186. DisplayClip: TRectangle; // makevp display clipping information
  1187. // These are added for V39
  1188. VecTable: Pointer; // Private
  1189. DriverData: array[0..1] of APTR;
  1190. Flags: Word;
  1191. Origin: array[0..1] of TPoint; // First visible point relative to the DClip. One for each possible playfield.
  1192. cop1ptr: LongWord; // private
  1193. cop2ptr: LongWord; // private
  1194. MonitorData: APTR; // private
  1195. end;
  1196. TColorMap = record
  1197. Flags: Byte;
  1198. Type_: Byte;
  1199. Count: Word;
  1200. ColorTable: APTR;
  1201. cm_vpe: PViewPortExtra;
  1202. LowColorBits: APTR;
  1203. TransparencyPlane: Byte;
  1204. SpriteResolution: Byte;
  1205. SpriteResDefault: Byte;
  1206. AuxFlags: Byte;
  1207. cm_vp: PViewPort;
  1208. NormalDisplayInfo: APTR;
  1209. CoerceDisplayInfo: APTR;
  1210. cm_batch_items: PTagItem;
  1211. VPModeID: LongWord;
  1212. PalExtra: Pointer; // PPaletteExtra
  1213. SpriteBase_Even: Word;
  1214. SpriteBase_Odd: Word;
  1215. Bp_0_base: Word;
  1216. Bp_1_base: Word;
  1217. end;
  1218. const
  1219. // if Type = 0 then ColorMap is V1.2/V1.3 compatible
  1220. // if Type <> 0 then ColorMap is V36 compatible
  1221. // the system will never create other than V39 type colormaps when running V39
  1222. COLORMAP_TYPE_V1_2 = $00;
  1223. COLORMAP_TYPE_V1_4 = $01;
  1224. COLORMAP_TYPE_V36 = COLORMAP_TYPE_V1_4; // use this definition
  1225. COLORMAP_TYPE_V39 = $02;
  1226. // Flags variable
  1227. COLORMAP_TRANSPARENCY = $01;
  1228. COLORPLANE_TRANSPARENCY = $02;
  1229. BORDER_BLANKING = $04;
  1230. BORDER_NOTRANSPARENCY = $08;
  1231. VIDEOCONTROL_BATCH = $10;
  1232. USER_COPPER_CLIP = $20;
  1233. CMF_CMTRANS = 0;
  1234. CMF_CPTRANS = 1;
  1235. CMF_BRDRBLNK = 2;
  1236. CMF_BRDNTRAN = 3;
  1237. CMF_BRDRSPRT = 6;
  1238. // All these VPXF_ flags are private
  1239. VPXB_FREE_ME = 0;
  1240. VPXF_FREE_ME = 1 shl VPXB_FREE_ME;
  1241. VPXB_LAST = 1;
  1242. VPXF_LAST = 1 shl VPXB_LAST;
  1243. VPXB_STRADDLES_256 = 4;
  1244. VPXF_STRADDLES_256 = 1 shl VPXB_STRADDLES_256;
  1245. VPXB_STRADDLES_512 = 5;
  1246. VPXF_STRADDLES_512 = 1 shl VPXB_STRADDLES_512;
  1247. EXTEND_VSTRUCT = $1000; // unused bit in Modes field of View
  1248. // defines used for Modes in IVPargs
  1249. GENLOCK_VIDEO = $0002;
  1250. LACE = $0004;
  1251. SUPERHIRES = $0020;
  1252. PFBA = $0040;
  1253. EXTRA_HALFBRITE= $0080;
  1254. GENLOCK_AUDIO = $0100;
  1255. DUALPF = $0400;
  1256. HAM = $0800;
  1257. EXTENDED_MODE = $1000;
  1258. VP_HIDE = $2000;
  1259. SPRITES = $4000;
  1260. HIRES = $8000;
  1261. VPF_A2024 = $40;
  1262. VPF_AGNUS = $20;
  1263. VPF_TENHZ = $20;
  1264. BORDERSPRITES = $40;
  1265. SPRITERESN_ECS = 0;
  1266. // ^140ns, except in 35ns viewport, where it is 70ns.
  1267. SPRITERESN_140NS = 1;
  1268. SPRITERESN_70NS = 2;
  1269. SPRITERESN_35NS = 3;
  1270. SPRITERESN_DEFAULT = -1;
  1271. // AuxFlags :
  1272. CMAB_FULLPALETTE = 0;
  1273. CMAF_FULLPALETTE = 1 shl CMAB_FULLPALETTE;
  1274. CMAB_NO_INTERMED_UPDATE = 1;
  1275. CMAF_NO_INTERMED_UPDATE = 1 shl CMAB_NO_INTERMED_UPDATE;
  1276. CMAB_NO_COLOR_LOAD = 2;
  1277. CMAF_NO_COLOR_LOAD = 1 shl CMAB_NO_COLOR_LOAD;
  1278. CMAB_DUALPF_DISABLE = 3;
  1279. CMAF_DUALPF_DISABLE = 1 shl CMAB_DUALPF_DISABLE;
  1280. type
  1281. PPaletteExtra = ^TPaletteExtra;
  1282. TPaletteExtra = record // structure may be extended so watch out!
  1283. pe_Semaphore: TSignalSemaphore; // shared semaphore for arbitration
  1284. pe_FirstFree: Word; // *private*
  1285. pe_NFree: Word; // number of free colors
  1286. pe_FirstShared: Word; // *private*
  1287. pe_NShared: Word; // *private*
  1288. pe_RefCnt: PByte; // *private*
  1289. pe_AllocList: PByte; // *private*
  1290. pe_ViewPort: PViewPort; // back Pointer to viewport
  1291. pe_SharableColors: Word; // the number of sharable colors.
  1292. end;
  1293. // flags values for ObtainPen
  1294. const
  1295. PENB_EXCLUSIVE = 0;
  1296. PENB_NO_SETCOLOR = 1;
  1297. PENF_EXCLUSIVE = 1 shl PENB_EXCLUSIVE;
  1298. PENF_NO_SETCOLOR = 1 shl PENB_NO_SETCOLOR;
  1299. // obsolete names for PENF_xxx flags:
  1300. PEN_EXCLUSIVE = PENF_EXCLUSIVE;
  1301. PEN_NO_SETCOLOR = PENF_NO_SETCOLOR;
  1302. // precision values for ObtainBestPen:
  1303. PRECISION_EXACT = -1;
  1304. PRECISION_IMAGE = 0;
  1305. PRECISION_ICON = 16;
  1306. PRECISION_GUI = 32;
  1307. // tags for ObtainBestPen:
  1308. OBP_Precision = $84000000;
  1309. OBP_FailIfBad = $84000001;
  1310. // From V39, MakeVPort() will return an error if there is not enough memory,
  1311. // or the requested mode cannot be opened with the requested depth with the
  1312. // given bitmap (for higher bandwidth alignments).
  1313. MVP_OK = 0; // you want to see this one
  1314. MVP_NO_MEM = 1; // insufficient memory for intermediate workspace
  1315. MVP_NO_VPE = 2; // ViewPort does not have a ViewPortExtra, and insufficient memory to allocate a temporary one.
  1316. MVP_NO_DSPINS = 3; // insufficient memory for intermidiate copper instructions.
  1317. MVP_NO_DISPLAY = 4; // BitMap data is misaligned for this viewport's mode and depth - see AllocBitMap().
  1318. MVP_OFF_BOTTOM = 5; // PRIVATE - you will never see this.
  1319. // From V39, MrgCop() will return an error if there is not enough memory,
  1320. // or for some reason MrgCop() did not need to make any copper lists.
  1321. MCOP_OK = 0; // you want to see this one
  1322. MCOP_NO_MEM = 1; // insufficient memory to allocate the system copper lists.
  1323. MCOP_NOP = 2; // MrgCop() did not merge any copper lists (eg, no ViewPorts in the list, or all marked as hidden).
  1324. type
  1325. PDBufInfo = ^TDBufInfo;
  1326. TDBufInfo = record
  1327. dbi_Link1: APTR;
  1328. dbi_Count1: LongWord;
  1329. dbi_SafeMessage: TMessage; // replied to when safe to write to old bitmap
  1330. dbi_UserData1: Pointer; { first user data }
  1331. dbi_Link2: Pointer;
  1332. dbi_Count2: LongWord;
  1333. dbi_DispMessage: tMessage; { replied to when new bitmap has been displayed at least
  1334. once }
  1335. dbi_UserData2: Pointer; { second user data }
  1336. dbi_MatchLong: LongWord;
  1337. dbi_CopPtr1,
  1338. dbi_CopPtr2,
  1339. dbi_CopPtr3: Pointer;
  1340. dbi_BeamPos1,
  1341. dbi_BeamPos2: WORD;
  1342. end;
  1343. const
  1344. INVALID_ID = not 0;
  1345. { With all the new modes that are available under V38 and V39, it is highly
  1346. recommended that you use either the asl.library screenmode requester,
  1347. and/or the V39 graphics.library function BestModeIDA().
  1348. DO NOT interpret the any of the bits in the ModeID for its meaning. For
  1349. example, do not interpret bit 3 ($4) as meaning the ModeID is interlaced.
  1350. Instead, use GetDisplayInfoData() with DTAG_DISP, and examine the DIPF_...
  1351. flags to determine a ModeID's characteristics. The only exception to
  1352. this rule is that bit 7 ($80) will always mean the ModeID is
  1353. ExtraHalfBright, and bit 11 ($800) will always mean the ModeID is HAM.}
  1354. // normal identifiers
  1355. MONITOR_ID_MASK = $FFFF1000;
  1356. DEFAULT_MONITOR_ID = $00000000;
  1357. NTSC_MONITOR_ID = $00011000;
  1358. PAL_MONITOR_ID = $00021000;
  1359. { the following 22 composite keys are for Modes on the default Monitor.
  1360. NTSC & PAL "flavors" of these particular keys may be made by or'ing
  1361. the NTSC or PAL MONITOR_ID with the desired MODE_KEY...
  1362. For example, to specifically open a PAL HAM interlaced ViewPort
  1363. (or intuition screen), you would use the modeid of
  1364. (PAL_MONITOR_ID OR HAMLACE_KEY)}
  1365. LORES_KEY = $00000000;
  1366. HIRES_KEY = $00008000;
  1367. SUPER_KEY = $00008020;
  1368. HAM_KEY = $00000800;
  1369. LORESLACE_KEY = $00000004;
  1370. HIRESLACE_KEY = $00008004;
  1371. SUPERLACE_KEY = $00008024;
  1372. HAMLACE_KEY = $00000804;
  1373. LORESDPF_KEY = $00000400;
  1374. HIRESDPF_KEY = $00008400;
  1375. SUPERDPF_KEY = $00008420;
  1376. LORESLACEDPF_KEY = $00000404;
  1377. HIRESLACEDPF_KEY = $00008404;
  1378. SUPERLACEDPF_KEY = $00008424;
  1379. LORESDPF2_KEY = $00000440;
  1380. HIRESDPF2_KEY = $00008440;
  1381. SUPERDPF2_KEY = $00008460;
  1382. LORESLACEDPF2_KEY = $00000444;
  1383. HIRESLACEDPF2_KEY = $00008444;
  1384. SUPERLACEDPF2_KEY = $00008464;
  1385. EXTRAHALFBRITE_KEY = $00000080;
  1386. EXTRAHALFBRITELACE_KEY = $00000084;
  1387. // New for AA ChipSet (V39)
  1388. HIRESHAM_KEY = $00008800;
  1389. SUPERHAM_KEY = $00008820;
  1390. HIRESEHB_KEY = $00008080;
  1391. SUPEREHB_KEY = $000080a0;
  1392. HIRESHAMLACE_KEY = $00008804;
  1393. SUPERHAMLACE_KEY = $00008824;
  1394. HIRESEHBLACE_KEY = $00008084;
  1395. SUPEREHBLACE_KEY = $000080a4;
  1396. // Added for V40 - may be useful modes for some games or animations.
  1397. LORESSDBL_KEY = $00000008;
  1398. LORESHAMSDBL_KEY = $00000808;
  1399. LORESEHBSDBL_KEY = $00000088;
  1400. HIRESHAMSDBL_KEY = $00008808;
  1401. // VGA identifiers
  1402. VGA_MONITOR_ID = $00031000;
  1403. VGAEXTRALORES_KEY = $00031004;
  1404. VGALORES_KEY = $00039004;
  1405. VGAPRODUCT_KEY = $00039024;
  1406. VGAHAM_KEY = $00031804;
  1407. VGAEXTRALORESLACE_KEY = $00031005;
  1408. VGALORESLACE_KEY = $00039005;
  1409. VGAPRODUCTLACE_KEY = $00039025;
  1410. VGAHAMLACE_KEY = $00031805;
  1411. VGAEXTRALORESDPF_KEY = $00031404;
  1412. VGALORESDPF_KEY = $00039404;
  1413. VGAPRODUCTDPF_KEY = $00039424;
  1414. VGAEXTRALORESLACEDPF_KEY = $00031405;
  1415. VGALORESLACEDPF_KEY = $00039405;
  1416. VGAPRODUCTLACEDPF_KEY = $00039425;
  1417. VGAEXTRALORESDPF2_KEY = $00031444;
  1418. VGALORESDPF2_KEY = $00039444;
  1419. VGAPRODUCTDPF2_KEY = $00039464;
  1420. VGAEXTRALORESLACEDPF2_KEY = $00031445;
  1421. VGALORESLACEDPF2_KEY = $00039445;
  1422. VGAPRODUCTLACEDPF2_KEY = $00039465;
  1423. VGAEXTRAHALFBRITE_KEY = $00031084;
  1424. VGAEXTRAHALFBRITELACE_KEY = $00031085;
  1425. // New for AA ChipSet (V39)
  1426. VGAPRODUCTHAM_KEY = $00039824;
  1427. VGALORESHAM_KEY = $00039804;
  1428. VGAEXTRALORESHAM_KEY = VGAHAM_KEY;
  1429. VGAPRODUCTHAMLACE_KEY = $00039825;
  1430. VGALORESHAMLACE_KEY = $00039805;
  1431. VGAEXTRALORESHAMLACE_KEY = VGAHAMLACE_KEY;
  1432. VGAEXTRALORESEHB_KEY = VGAEXTRAHALFBRITE_KEY;
  1433. VGAEXTRALORESEHBLACE_KEY = VGAEXTRAHALFBRITELACE_KEY;
  1434. VGALORESEHB_KEY = $00039084;
  1435. VGALORESEHBLACE_KEY = $00039085;
  1436. VGAEHB_KEY = $000390a4;
  1437. VGAEHBLACE_KEY = $000390a5;
  1438. // These ModeIDs are the scandoubled equivalents of the above, with the
  1439. // exception of the DualPlayfield modes, as AA does not allow for scandoubling dualplayfield.
  1440. VGAEXTRALORESDBL_KEY = $00031000;
  1441. VGALORESDBL_KEY = $00039000;
  1442. VGAPRODUCTDBL_KEY = $00039020;
  1443. VGAEXTRALORESHAMDBL_KEY = $00031800;
  1444. VGALORESHAMDBL_KEY = $00039800;
  1445. VGAPRODUCTHAMDBL_KEY = $00039820;
  1446. VGAEXTRALORESEHBDBL_KEY = $00031080;
  1447. VGALORESEHBDBL_KEY = $00039080;
  1448. VGAPRODUCTEHBDBL_KEY = $000390a0;
  1449. // a2024 identifiers
  1450. A2024_MONITOR_ID = $00041000;
  1451. A2024TENHERTZ_KEY = $00041000;
  1452. A2024FIFTEENHERTZ_KEY = $00049000;
  1453. // prototype identifiers (private)
  1454. PROTO_MONITOR_ID = $00051000;
  1455. // These monitors and modes were added for the V38 release.
  1456. EURO72_MONITOR_ID = $00061000;
  1457. EURO72EXTRALORES_KEY = $00061004;
  1458. EURO72LORES_KEY = $00069004;
  1459. EURO72PRODUCT_KEY = $00069024;
  1460. EURO72HAM_KEY = $00061804;
  1461. EURO72EXTRALORESLACE_KEY = $00061005;
  1462. EURO72LORESLACE_KEY = $00069005;
  1463. EURO72PRODUCTLACE_KEY = $00069025;
  1464. EURO72HAMLACE_KEY = $00061805;
  1465. EURO72EXTRALORESDPF_KEY = $00061404;
  1466. EURO72LORESDPF_KEY = $00069404;
  1467. EURO72PRODUCTDPF_KEY = $00069424;
  1468. EURO72EXTRALORESLACEDPF_KEY = $00061405;
  1469. EURO72LORESLACEDPF_KEY = $00069405;
  1470. EURO72PRODUCTLACEDPF_KEY = $00069425;
  1471. EURO72EXTRALORESDPF2_KEY = $00061444;
  1472. EURO72LORESDPF2_KEY = $00069444;
  1473. EURO72PRODUCTDPF2_KEY = $00069464;
  1474. EURO72EXTRALORESLACEDPF2_KEY = $00061445;
  1475. EURO72LORESLACEDPF2_KEY = $00069445;
  1476. EURO72PRODUCTLACEDPF2_KEY = $00069465;
  1477. EURO72EXTRAHALFBRITE_KEY = $00061084;
  1478. EURO72EXTRAHALFBRITELACE_KEY = $00061085;
  1479. // New AA modes (V39)
  1480. EURO72PRODUCTHAM_KEY = $00069824;
  1481. EURO72PRODUCTHAMLACE_KEY = $00069825;
  1482. EURO72LORESHAM_KEY = $00069804;
  1483. EURO72LORESHAMLACE_KEY = $00069805;
  1484. EURO72EXTRALORESHAM_KEY = EURO72HAM_KEY;
  1485. EURO72EXTRALORESHAMLACE_KEY = EURO72HAMLACE_KEY ;
  1486. EURO72EXTRALORESEHB_KEY = EURO72EXTRAHALFBRITE_KEY;
  1487. EURO72EXTRALORESEHBLACE_KEY = EURO72EXTRAHALFBRITELACE_KEY;
  1488. EURO72LORESEHB_KEY = $00069084;
  1489. EURO72LORESEHBLACE_KEY = $00069085;
  1490. EURO72EHB_KEY = $000690a4;
  1491. EURO72EHBLACE_KEY = $000690a5;
  1492. // These ModeIDs are the scandoubled equivalents of the above, with the
  1493. // exception of the DualPlayfield modes, as AA does not allow for scandoubling dualplayfield.
  1494. EURO72EXTRALORESDBL_KEY = $00061000;
  1495. EURO72LORESDBL_KEY = $00069000;
  1496. EURO72PRODUCTDBL_KEY = $00069020;
  1497. EURO72EXTRALORESHAMDBL_KEY = $00061800;
  1498. EURO72LORESHAMDBL_KEY = $00069800;
  1499. EURO72PRODUCTHAMDBL_KEY = $00069820;
  1500. EURO72EXTRALORESEHBDBL_KEY = $00061080;
  1501. EURO72LORESEHBDBL_KEY = $00069080;
  1502. EURO72PRODUCTEHBDBL_KEY = $000690a0;
  1503. EURO36_MONITOR_ID = $00071000;
  1504. // Euro36 modeids can be ORed with the default modeids a la NTSC and PAL.
  1505. // For example, Euro36 SuperHires is (EURO36_MONITOR_ID OR SUPER_KEY)
  1506. SUPER72_MONITOR_ID = $00081000;
  1507. // Super72 modeids can be ORed with the default modeids a la NTSC and PAL. For example, Super72 SuperHiresLace (80$600) is
  1508. // (SUPER72_MONITOR_ID OR SUPERLACE_KEY). The following scandoubled Modes are the exception:
  1509. SUPER72LORESDBL_KEY = $00081008;
  1510. SUPER72HIRESDBL_KEY = $00089008;
  1511. SUPER72SUPERDBL_KEY = $00089028;
  1512. SUPER72LORESHAMDBL_KEY = $00081808;
  1513. SUPER72HIRESHAMDBL_KEY = $00089808;
  1514. SUPER72SUPERHAMDBL_KEY = $00089828;
  1515. SUPER72LORESEHBDBL_KEY = $00081088;
  1516. SUPER72HIRESEHBDBL_KEY = $00089088;
  1517. SUPER72SUPEREHBDBL_KEY = $000890a8;
  1518. // These monitors and modes were added for the V39 release.
  1519. DBLNTSC_MONITOR_ID = $00091000;
  1520. DBLNTSCLORES_KEY = $00091000;
  1521. DBLNTSCLORESFF_KEY = $00091004;
  1522. DBLNTSCLORESHAM_KEY = $00091800;
  1523. DBLNTSCLORESHAMFF_KEY = $00091804;
  1524. DBLNTSCLORESEHB_KEY = $00091080;
  1525. DBLNTSCLORESEHBFF_KEY = $00091084;
  1526. DBLNTSCLORESLACE_KEY = $00091005;
  1527. DBLNTSCLORESHAMLACE_KEY = $00091805;
  1528. DBLNTSCLORESEHBLACE_KEY = $00091085;
  1529. DBLNTSCLORESDPF_KEY = $00091400;
  1530. DBLNTSCLORESDPFFF_KEY = $00091404;
  1531. DBLNTSCLORESDPFLACE_KEY = $00091405;
  1532. DBLNTSCLORESDPF2_KEY = $00091440;
  1533. DBLNTSCLORESDPF2FF_KEY = $00091444;
  1534. DBLNTSCLORESDPF2LACE_KEY = $00091445;
  1535. DBLNTSCHIRES_KEY = $00099000;
  1536. DBLNTSCHIRESFF_KEY = $00099004;
  1537. DBLNTSCHIRESHAM_KEY = $00099800;
  1538. DBLNTSCHIRESHAMFF_KEY = $00099804;
  1539. DBLNTSCHIRESLACE_KEY = $00099005;
  1540. DBLNTSCHIRESHAMLACE_KEY = $00099805;
  1541. DBLNTSCHIRESEHB_KEY = $00099080;
  1542. DBLNTSCHIRESEHBFF_KEY = $00099084;
  1543. DBLNTSCHIRESEHBLACE_KEY = $00099085;
  1544. DBLNTSCHIRESDPF_KEY = $00099400;
  1545. DBLNTSCHIRESDPFFF_KEY = $00099404;
  1546. DBLNTSCHIRESDPFLACE_KEY = $00099405;
  1547. DBLNTSCHIRESDPF2_KEY = $00099440;
  1548. DBLNTSCHIRESDPF2FF_KEY = $00099444;
  1549. DBLNTSCHIRESDPF2LACE_KEY = $00099445;
  1550. DBLNTSCEXTRALORES_KEY = $00091200;
  1551. DBLNTSCEXTRALORESHAM_KEY = $00091a00;
  1552. DBLNTSCEXTRALORESEHB_KEY = $00091280;
  1553. DBLNTSCEXTRALORESDPF_KEY = $00091600;
  1554. DBLNTSCEXTRALORESDPF2_KEY = $00091640;
  1555. DBLNTSCEXTRALORESFF_KEY = $00091204;
  1556. DBLNTSCEXTRALORESHAMFF_KEY = $00091a04;
  1557. DBLNTSCEXTRALORESEHBFF_KEY = $00091284;
  1558. DBLNTSCEXTRALORESDPFFF_KEY = $00091604;
  1559. DBLNTSCEXTRALORESDPF2FF_KEY = $00091644;
  1560. DBLNTSCEXTRALORESLACE_KEY = $00091205;
  1561. DBLNTSCEXTRALORESHAMLACE_KEY = $00091a05;
  1562. DBLNTSCEXTRALORESEHBLACE_KEY = $00091285;
  1563. DBLNTSCEXTRALORESDPFLACE_KEY = $00091605;
  1564. DBLNTSCEXTRALORESDPF2LACE_KEY = $00091645;
  1565. DBLPAL_MONITOR_ID = $000a1000;
  1566. DBLPALLORES_KEY = $000a1000;
  1567. DBLPALLORESFF_KEY = $000a1004;
  1568. DBLPALLORESHAM_KEY = $000a1800;
  1569. DBLPALLORESHAMFF_KEY = $000a1804;
  1570. DBLPALLORESEHB_KEY = $000a1080;
  1571. DBLPALLORESEHBFF_KEY = $000a1084;
  1572. DBLPALLORESLACE_KEY = $000a1005;
  1573. DBLPALLORESHAMLACE_KEY = $000a1805;
  1574. DBLPALLORESEHBLACE_KEY = $000a1085;
  1575. DBLPALLORESDPF_KEY = $000a1400;
  1576. DBLPALLORESDPFFF_KEY = $000a1404;
  1577. DBLPALLORESDPFLACE_KEY = $000a1405;
  1578. DBLPALLORESDPF2_KEY = $000a1440;
  1579. DBLPALLORESDPF2FF_KEY = $000a1444;
  1580. DBLPALLORESDPF2LACE_KEY = $000a1445;
  1581. DBLPALHIRES_KEY = $000a9000;
  1582. DBLPALHIRESFF_KEY = $000a9004;
  1583. DBLPALHIRESHAM_KEY = $000a9800;
  1584. DBLPALHIRESHAMFF_KEY = $000a9804;
  1585. DBLPALHIRESLACE_KEY = $000a9005;
  1586. DBLPALHIRESHAMLACE_KEY = $000a9805;
  1587. DBLPALHIRESEHB_KEY = $000a9080;
  1588. DBLPALHIRESEHBFF_KEY = $000a9084;
  1589. DBLPALHIRESEHBLACE_KEY = $000a9085;
  1590. DBLPALHIRESDPF_KEY = $000a9400;
  1591. DBLPALHIRESDPFFF_KEY = $000a9404;
  1592. DBLPALHIRESDPFLACE_KEY = $000a9405;
  1593. DBLPALHIRESDPF2_KEY = $000a9440;
  1594. DBLPALHIRESDPF2FF_KEY = $000a9444;
  1595. DBLPALHIRESDPF2LACE_KEY = $000a9445;
  1596. DBLPALEXTRALORES_KEY = $000a1200;
  1597. DBLPALEXTRALORESHAM_KEY = $000a1a00;
  1598. DBLPALEXTRALORESEHB_KEY = $000a1280;
  1599. DBLPALEXTRALORESDPF_KEY = $000a1600;
  1600. DBLPALEXTRALORESDPF2_KEY = $000a1640;
  1601. DBLPALEXTRALORESFF_KEY = $000a1204;
  1602. DBLPALEXTRALORESHAMFF_KEY = $000a1a04;
  1603. DBLPALEXTRALORESEHBFF_KEY = $000a1284;
  1604. DBLPALEXTRALORESDPFFF_KEY = $000a1604;
  1605. DBLPALEXTRALORESDPF2FF_KEY = $000a1644;
  1606. DBLPALEXTRALORESLACE_KEY = $000a1205;
  1607. DBLPALEXTRALORESHAMLACE_KEY = $000a1a05;
  1608. DBLPALEXTRALORESEHBLACE_KEY = $000a1285;
  1609. DBLPALEXTRALORESDPFLACE_KEY = $000a1605;
  1610. DBLPALEXTRALORESDPF2LACE_KEY = $000a1645;
  1611. // Use these tags for passing to BestModeID() (V39)
  1612. //SPECIAL_FLAGS = DIPF_IS_DUALPF or DIPF_IS_PF2PRI or DIPF_IS_HAM or DIPF_IS_EXTRAHALFBRITE;
  1613. BIDTAG_DIPFMustHave = $80000001; // mask of the DIPF_ flags the ModeID must have Default - nil
  1614. BIDTAG_DIPFMustNotHave = $80000002; // mask of the DIPF_ flags the ModeID must not have Default - SPECIAL_FLAGS
  1615. BIDTAG_ViewPort = $80000003; // ViewPort for which a ModeID is sought. Default - nil
  1616. BIDTAG_NominalWidth = $80000004; // \ together make the aspect ratio and | Default - SourceID NominalDimensionInfo,
  1617. BIDTAG_NominalHeight = $80000005; // / override the vp->Width/Height. | or vp->DWidth/Height, or (640 * 200), in that preferred order.
  1618. BIDTAG_DesiredWidth = $80000006; // \ Nominal Width and Height of the
  1619. BIDTAG_DesiredHeight = $80000007; // / returned ModeID. Default - same as Nominal
  1620. BIDTAG_Depth = $80000008; // ModeID must support this depth. Default - vp->RasInfo->BitMap->Depth or 1
  1621. BIDTAG_MonitorID = $80000009; // ModeID must use this monitor. Default - use best monitor available
  1622. BIDTAG_SourceID = $8000000a; // instead of a ViewPort. Default - VPModeID(vp) if BIDTAG_ViewPort is specified, else leave the DIPFMustHave and DIPFMustNotHave values untouched.
  1623. BIDTAG_RedBits = $8000000b; // \
  1624. BIDTAG_BlueBits = $8000000c; // > Match up from the database Default - 4
  1625. BIDTAG_GreenBits = $8000000d; // /
  1626. BIDTAG_GfxPrivate = $8000000e; // Private
  1627. BIDTAG_MaxDepth = $8000000f; // Maximum depth ModeID must have.
  1628. const
  1629. // bplcon0 defines
  1630. MODE_640 = $8000;
  1631. PLNCNTMSK = $7; // how many bit planes? 0 = none, 1->6 = 1->6, 7 = reserved
  1632. PLNCNTSHFT = 12; // bits to shift for bplcon0
  1633. PF2PRI = $40; // bplcon2 bit
  1634. COLORON = $0200; // disable color burst
  1635. DBLPF = $400;
  1636. HOLDNMODIFY = $800;
  1637. INTERLACE = 4; // interlace mode for 400
  1638. // bplcon1 defines
  1639. PFA_FINE_SCROLL = $F;
  1640. PFB_FINE_SCROLL_SHIFT = 4;
  1641. PF_FINE_SCROLL_MASK = $F;
  1642. // display window start and stop defines
  1643. DIW_HORIZ_POS = $7F; // horizontal start/stop
  1644. DIW_VRTCL_POS = $1FF; // vertical start/stop
  1645. DIW_VRTCL_POS_SHIFT = $7;
  1646. // Data fetch start/stop horizontal position
  1647. DFTCH_MASK = $FF;
  1648. // vposr bits
  1649. VPOSRLOF = $8000;
  1650. // for displayinfo database
  1651. // datachunk type identifiers
  1652. DTAG_DISP = $80000000;
  1653. DTAG_DIMS = $80001000;
  1654. DTAG_MNTR = $80002000;
  1655. DTAG_NAME = $80003000;
  1656. DTAG_VEC = $80004000; // internal use only
  1657. type
  1658. // the "public" handle to a DisplayInfoRecord
  1659. DisplayInfoHandle = APTR;
  1660. PQueryHeader = ^TQueryHeader;
  1661. TQueryHeader = record
  1662. StructID: LongWord; // datachunk type identifier
  1663. DisplayID: LongWord; // copy of display record key
  1664. SkipID: LongWord; // TAG_SKIP -- see tagitems.h
  1665. Length: LongWord; // length of local data in double-longwords
  1666. end;
  1667. PDisplayInfo = ^TDisplayInfo;
  1668. TDisplayInfo = record
  1669. Header: TQueryHeader;
  1670. NotAvailable: Word; // if 0 available, else see defines
  1671. PropertyFlags: LongWord; // Properties of this mode see defines
  1672. Resolution: TPoint; // ticks-per-pixel X/Y
  1673. PixelSpeed: Word; // aproximation in nanoseconds
  1674. NumStdSprites: Word; // number of standard amiga sprites
  1675. PaletteRange: Word; // OBSOLETE - use Red/Green/Blue bits instead
  1676. SpriteResolution: TPoint; // std sprite ticks-per-pixel X/Y
  1677. Pad: array[0..3] of Byte; // used internally
  1678. RedBits: Byte; // number of Red bits display supports (V39)
  1679. GreenBits: Byte; // number of Green bits display supports (V39)
  1680. BlueBits: Byte; // number of Blue bits display supports (V39)
  1681. Pad2: array[0..4] of Byte; // find some use for this.
  1682. RTGBoardNum: Byte; // RTG board number this mode belongs to (V53)
  1683. PixelFormat: LongWord; // Pixel format (enPixelFormat) (V54)
  1684. Reserved: Array[0..1] of LongWord; // terminator
  1685. end;
  1686. const
  1687. // availability
  1688. DI_AVAIL_NOCHIPS = $0001; // No custom chips
  1689. DI_AVAIL_NOMONITOR = $0002; // No suitable monitor
  1690. DI_AVAIL_NOTWITHGENLOCK = $0004; // Not allowed with genlock
  1691. DI_AVAIL_INVALID = $1000; // Mode is invalid (V54)
  1692. DI_AVAIL_MONITOOL = $2000; // Reserved; do not use (V54)
  1693. // mode properties
  1694. DIPF_IS_LACE = $00000001;
  1695. DIPF_IS_DUALPF = $00000002;
  1696. DIPF_IS_PF2PRI = $00000004;
  1697. DIPF_IS_HAM = $00000008;
  1698. DIPF_IS_ECS = $00000010; // note: ECS modes (SHIRES, VGA, AND PRODUCTIVITY) do not support attached sprites.
  1699. DIPF_IS_AA = $00010000; // AA modes - may only be available if machine has correct memory type to support required
  1700. // bandwidth - check availability. (V39)
  1701. DIPF_IS_PAL = $00000020;
  1702. DIPF_IS_SPRITES = $00000040;
  1703. DIPF_IS_GENLOCK = $00000080;
  1704. DIPF_IS_WB = $00000100;
  1705. DIPF_IS_DRAGGABLE = $00000200;
  1706. DIPF_IS_PANELLED = $00000400;
  1707. DIPF_IS_BEAMSYNC = $00000800;
  1708. DIPF_IS_EXTRAHALFBRITE = $00001000;
  1709. DIPF_IS_SPRITES_ATT = $00002000; // supports attached sprites (V39)
  1710. DIPF_IS_SPRITES_CHNG_RES = $00004000; // supports variable sprite resolution (V39)
  1711. DIPF_IS_SPRITES_BORDER = $00008000; // sprite can be displayed in the border (V39)
  1712. DIPF_IS_SCANDBL = $00020000; // scan doubled (V39)
  1713. DIPF_IS_SPRITES_CHNG_BASE = $00040000; // can change the sprite base colour (V39)
  1714. DIPF_IS_SPRITES_CHNG_PRI = $00080000; // can change the sprite priority with respect to the playfield(s). (V39)
  1715. DIPF_IS_DBUFFER = $00100000; // can support double buffering (V39)
  1716. DIPF_IS_PROGBEAM = $00200000; // is a programmed beam-sync mode (V39)
  1717. DIPF_IS_HWCOMPOSITE = $00400000; // can support hardware compositing (V53)
  1718. DIPF_IS_PREFERREDMODE = $00800000; // preferred/native resolution of monitor (V53)
  1719. DIPF_IS_RTG = $80000000; // mode is RTG and does not use the native chip set
  1720. DIPF_IS_FOREIGN = DIPF_IS_RTG; // Old synonym not to be used in any new code.
  1721. Type
  1722. PDimensionInfo =^TDimensionInfo;
  1723. TDimensionInfo = record
  1724. Header: TQueryHeader;
  1725. MaxDepth: Word; // log2(max number of colors)
  1726. MinRasterWidth: Word; // minimum width in pixels
  1727. MinRasterHeight: Word; // minimum height in pixels
  1728. MaxRasterWidth: Word; // maximum width in pixels
  1729. MaxRasterHeight: Word; // maximum height in pixels
  1730. Nominal: TRectangle; // "standard" dimensions
  1731. MaxOScan: TRectangle; // fixed, hardware dependant
  1732. VideoOScan: TRectangle; // fixed, hardware dependant
  1733. TxtOScan: TRectangle; // editable via preferences
  1734. StdOScan: TRectangle; // editable via preferences
  1735. Pad: array[0..13] of Byte;
  1736. Reserved: array[0..1] of LongWord; // terminator
  1737. end;
  1738. PMonitorInfo = ^TMonitorInfo;
  1739. TMonitorInfo = record
  1740. Header: TQueryHeader;
  1741. Mspc: PMonitorSpec; // pointer to monitor spec.
  1742. ViewPosition: TPoint; // editable via preferences
  1743. ViewResolution: TPoint; // standard monitor ticks-per-pixel
  1744. ViewPositionRange: TRectangle; // fixed, hardware dependent
  1745. TotalRows: Word; // display height in scanlines
  1746. TotalColorClocks: Word; // scanline width in 280 ns units
  1747. MinRow: Word; // absolute min. active scanline
  1748. Compatibility: SmallInt; // how this coexists with others
  1749. Pad: Array[0..31] of Byte;
  1750. MouseTicks: TPoint;
  1751. DefaultViewPosition: TPoint; // original, never changes
  1752. PreferredModeID: LongWord; // for Preferences
  1753. Reserved: array[0..1] of LongWord; // terminator
  1754. end;
  1755. // monitor compatibility
  1756. const
  1757. MCOMPAT_MIXED = 0; // can share display with other MCOMPAT_MIXED
  1758. MCOMPAT_SELF = 1; // can share only within same monitor
  1759. MCOMPAT_NOBODY = -1; // only one viewport at a time
  1760. DISPLAYNAMELEN = 32;
  1761. type
  1762. PNameInfo = ^TNameInfo;
  1763. TNameInfo = record
  1764. Header: tQueryHeader;
  1765. Name: array[0..DISPLAYNAMELEN-1] of AnsiChar;
  1766. Reserved: array[0..1] of LongWord; // terminator
  1767. end;
  1768. // *********************************************************************
  1769. // The following VecInfo structure is PRIVATE, for our use only
  1770. // Touch these, and burn! (V39)
  1771. PVecInfo = ^TVecInfo;
  1772. TVecInfo = record
  1773. Header: TQueryHeader;
  1774. Vec: APTR;
  1775. Data: APTR;
  1776. vi_Type: Word;
  1777. Pad: array[0..2] of Word;
  1778. Reserved: array[0..1] of LongWord;
  1779. end;
  1780. const
  1781. VTAG_END_CM = $00000000;
  1782. VTAG_CHROMAKEY_CLR = $80000000;
  1783. VTAG_CHROMAKEY_SET = $80000001;
  1784. VTAG_BITPLANEKEY_CLR = $80000002;
  1785. VTAG_BITPLANEKEY_SET = $80000003;
  1786. VTAG_BORDERBLANK_CLR = $80000004;
  1787. VTAG_BORDERBLANK_SET = $80000005;
  1788. VTAG_BORDERNOTRANS_CLR = $80000006;
  1789. VTAG_BORDERNOTRANS_SET = $80000007;
  1790. VTAG_CHROMA_PEN_CLR = $80000008;
  1791. VTAG_CHROMA_PEN_SET = $80000009;
  1792. VTAG_CHROMA_PLANE_SET = $8000000A;
  1793. VTAG_ATTACH_CM_SET = $8000000B;
  1794. VTAG_NEXTBUF_CM = $8000000C;
  1795. VTAG_BATCH_CM_CLR = $8000000D;
  1796. VTAG_BATCH_CM_SET = $8000000E;
  1797. VTAG_NORMAL_DISP_GET = $8000000F;
  1798. VTAG_NORMAL_DISP_SET = $80000010;
  1799. VTAG_COERCE_DISP_GET = $80000011;
  1800. VTAG_COERCE_DISP_SET = $80000012;
  1801. VTAG_VIEWPORTEXTRA_GET = $80000013;
  1802. VTAG_VIEWPORTEXTRA_SET = $80000014;
  1803. VTAG_CHROMAKEY_GET = $80000015;
  1804. VTAG_BITPLANEKEY_GET = $80000016;
  1805. VTAG_BORDERBLANK_GET = $80000017;
  1806. VTAG_BORDERNOTRANS_GET = $80000018;
  1807. VTAG_CHROMA_PEN_GET = $80000019;
  1808. VTAG_CHROMA_PLANE_GET = $8000001A;
  1809. VTAG_ATTACH_CM_GET = $8000001B;
  1810. VTAG_BATCH_CM_GET = $8000001C;
  1811. VTAG_BATCH_ITEMS_GET = $8000001D;
  1812. VTAG_BATCH_ITEMS_SET = $8000001E;
  1813. VTAG_BATCH_ITEMS_ADD = $8000001F;
  1814. VTAG_VPMODEID_GET = $80000020;
  1815. VTAG_VPMODEID_SET = $80000021;
  1816. VTAG_VPMODEID_CLR = $80000022;
  1817. VTAG_USERCLIP_GET = $80000023;
  1818. VTAG_USERCLIP_SET = $80000024;
  1819. VTAG_USERCLIP_CLR = $80000025;
  1820. //The following tags are V39 specific. They will be ignored (returing error -3) by earlier versions
  1821. VTAG_PF1_BASE_GET = $80000026;
  1822. VTAG_PF2_BASE_GET = $80000027;
  1823. VTAG_SPEVEN_BASE_GET = $80000028;
  1824. VTAG_SPODD_BASE_GET = $80000029;
  1825. VTAG_PF1_BASE_SET = $8000002a;
  1826. VTAG_PF2_BASE_SET = $8000002b;
  1827. VTAG_SPEVEN_BASE_SET = $8000002c;
  1828. VTAG_SPODD_BASE_SET = $8000002d;
  1829. VTAG_BORDERSPRITE_GET = $8000002e;
  1830. VTAG_BORDERSPRITE_SET = $8000002f;
  1831. VTAG_BORDERSPRITE_CLR = $80000030;
  1832. VTAG_SPRITERESN_SET = $80000031;
  1833. VTAG_SPRITERESN_GET = $80000032;
  1834. VTAG_PF1_TO_SPRITEPRI_SET = $80000033;
  1835. VTAG_PF1_TO_SPRITEPRI_GET = $80000034;
  1836. VTAG_PF2_TO_SPRITEPRI_SET = $80000035;
  1837. VTAG_PF2_TO_SPRITEPRI_GET = $80000036;
  1838. VTAG_IMMEDIATE = $80000037;
  1839. VTAG_FULLPALETTE_SET = $80000038;
  1840. VTAG_FULLPALETTE_GET = $80000039;
  1841. VTAG_FULLPALETTE_CLR = $8000003A;
  1842. VTAG_DEFSPRITERESN_SET = $8000003B;
  1843. VTAG_DEFSPRITERESN_GET = $8000003C;
  1844. {all the following tags follow the new, rational standard for videocontrol tags:
  1845. VC_xxx,state set the state of attribute 'xxx' to value 'state'
  1846. VC_xxx_QUERY,&var get the state of attribute 'xxx' and store it into the longword
  1847. pointed to by &var.
  1848. The following are new for V40:}
  1849. VC_IntermediateCLUpdate = $80000080; // default=true. When set graphics will update the intermediate copper
  1850. // lists on color changes, etc. When false, it won't, and will be faster.
  1851. VC_IntermediateCLUpdate_Query = $80000081;
  1852. VC_NoColorPaletteLoad = $80000082; // default = false. When set, graphics will only load color 0 for this ViewPort, and so the ViewPort's colors will come
  1853. // from the previous ViewPort's. NB - Using this tag and VTAG_FULLPALETTE_SET together is undefined.
  1854. VC_NoColorPaletteLoad_Query = $80000083;
  1855. VC_DUALPF_Disable = $80000084;
  1856. { default = false. When this flag is set, the dual-pf bit
  1857. in Dual-Playfield screens will be turned off. Even bitplanes
  1858. will still come from the first BitMap and odd bitplanes
  1859. from the second BitMap, and both R[xy]Offsets will be
  1860. considered. This can be used (with appropriate palette
  1861. selection) for cross-fades between differently scrolling
  1862. images.
  1863. When this flag is turned on, colors will be loaded for
  1864. the viewport as if it were a single viewport of depth
  1865. depth1+depth2 }
  1866. VC_DUALPF_Disable_Query = $80000085;
  1867. VC_DPMSLevel = $80000086; //default = DPMSLEVEL_ON Sets the DPMS level for the associated viewport. See enDPMSLevel for values. (V54)
  1868. // enDPMSLevel
  1869. DPMSLEVEL_ON = 0; // Full operation (no power saving)
  1870. DPMSLEVEL_STANDBY = 1; // Optional state of minimal power reduction
  1871. DPMSLEVEL_SUSPEND = 2; // Significant reduction of power consumption
  1872. DPMSLEVEL_OFF = 3; // Lowest level of power consumption
  1873. SPRITE_ATTACHED = $80;
  1874. type
  1875. PSimpleSprite = ^TSimpleSprite;
  1876. TSimpleSprite = record
  1877. posctldata: PWord;
  1878. height: Word;
  1879. x, y: Word; // current position
  1880. num: Word;
  1881. end;
  1882. PExtSprite = ^TExtSprite;
  1883. TExtSprite = record
  1884. es_SimpleSprite: TSimpleSprite; // conventional simple sprite structure
  1885. es_wordwidth: Word; // graphics use only, subject to change
  1886. es_flags: Word; // graphics use only, subject to change
  1887. end;
  1888. const
  1889. // tags for AllocSpriteData()
  1890. SPRITEA_Width = $81000000;
  1891. SPRITEA_XReplication = $81000002;
  1892. SPRITEA_YReplication = $81000004;
  1893. SPRITEA_OutputHeight = $81000006;
  1894. SPRITEA_Attached = $81000008;
  1895. SPRITEA_OldDataFormat = $8100000a; // MUST pass in outputheight if using this tag
  1896. // tags for GetExtSprite()
  1897. GSTAG_SPRITE_NUM = $82000020;
  1898. GSTAG_ATTACHED = $82000022;
  1899. GSTAG_SOFTSPRITE = $82000024;
  1900. // tags valid for either GetExtSprite or ChangeExtSprite
  1901. GSTAG_SCANDOUBLED = $83000000; // request "NTSC-Like" height if possible.
  1902. type
  1903. PBitScaleArgs = ^TBitScaleArgs;
  1904. TBitScaleArgs = record
  1905. bsa_SrcX, bsa_SrcY, // source origin
  1906. bsa_SrcWidth, bsa_SrcHeight, // source size
  1907. bsa_XSrcFactor, bsa_YSrcFactor, // scale factor denominators
  1908. bsa_DestX, bsa_DestY, // destination origin
  1909. bsa_DestWidth, bsa_DestHeight, // destination size result
  1910. bsa_XDestFactor, bsa_YDestFactor: Word; // scale factor numerators
  1911. bsa_SrcBitMap, // source BitMap
  1912. bsa_DestBitMap: PBitMap; // destination BitMap
  1913. bsa_Flags: LongWord; // reserved. Must be zero!
  1914. bsa_XDDA, bsa_YDDA: Word; // reserved
  1915. bsa_Reserved1, // "
  1916. bsa_Reserved2: LongInt; // "
  1917. end;
  1918. const
  1919. BSAF_RESERVED1 = 1;
  1920. BSAF_RESERVED2 = 2;
  1921. BSAF_AVERAGE = 4;
  1922. BSAF_BILINEAR = 8;
  1923. // tag definitions for GetRPAttr, SetRPAttr
  1924. const
  1925. RPTAG_Font = $80000000; // get/set font
  1926. RPTAG_APen = $80000002; // get/set apen
  1927. RPTAG_BPen = $80000003; // get/set bpen
  1928. RPTAG_DrMd = $80000004; // get/set draw mode
  1929. RPTAG_OutlinePen = $80000005; // get/set outline pen
  1930. RPTAG_OPen = $80000005; // get/set outline pen, short alias
  1931. RPTAG_WriteMask = $80000006; // get/set WriteMask
  1932. RPTAG_MaxPen = $80000007; // get/set maxpen
  1933. RPTAG_DrawBounds = $80000008; // get only rastport draw bounds. pass @rect
  1934. // V51 extensions
  1935. RPTAG_APenColor = $80000009; // get/set apen color = $aarrggbb
  1936. RPTAG_BPenColor = $8000000A; // get/set bpen color = $aarrggbb
  1937. RPTAG_OPenColor = $8000000B; // get/set open color = $aarrggbb
  1938. RPTAG_OutlinePenColor = $8000000B; // get/set open color = $aarrggbb. alias.
  1939. RPTAG_RemapColorFonts = $8000000C; // get/set
  1940. RPTAG_BitMap = $8000000D; // get/set bitmap of rastport
  1941. // V54 extensions
  1942. RPTAG_XPos = $8000000E; // get/set x position
  1943. RPTAG_YPos = $8000000F; // get/set y position
  1944. type
  1945. PBltNode= Pointer; // in Hardware
  1946. PGfxBase = ^TGfxBase;
  1947. TGfxBase = record
  1948. LibNode: TLibrary;
  1949. ActiView: PView;
  1950. copinit: PCopInit; // ptr to copper start up list
  1951. cia: PLongInt; // for 8520 resource use
  1952. blitter: PLongInt; // for future blitter resource use
  1953. LOFlist: PWord;
  1954. SHFlist: PWord;
  1955. blthd: PBltNode;
  1956. blttl: PBltNode;
  1957. bsblthd: PBltNode;
  1958. bsblttl: PBltNode;
  1959. vbsrv: TInterrupt;
  1960. timsrv: TInterrupt;
  1961. bltsrv: TInterrupt;
  1962. TextFonts: TList;
  1963. DefaultFont: PTextFont;
  1964. Modes: Word; // copy of current first bplcon0
  1965. VBlank: Shortint;
  1966. Debug: Shortint;
  1967. BeamSync: SmallInt;
  1968. system_bplcon0: SmallInt; // it is ored into each bplcon0 for display
  1969. SpriteReserved: Byte;
  1970. bytereserved: Byte;
  1971. Flags: Word;
  1972. BlitLock: SmallInt;
  1973. BlitNest: SmallInt;
  1974. BlitWaitQ: TList;
  1975. BlitOwner: PTask;
  1976. TOF_WaitQ: TList;
  1977. DisplayFlags: Word; // NTSC PAL GENLOC etc. flags initialized at power on
  1978. SimpleSprites: Pointer; // PPSimpleSprite
  1979. MaxDisplayRow: Word; // hardware stuff, do not use
  1980. MaxDisplayColumn: Word; // hardware stuff, do not use
  1981. NormalDisplayRows: Word;
  1982. NormalDisplayColumns: Word;
  1983. // the following are for standard non interlace, 1/2 wb width
  1984. NormalDPMX: Word; // Dots per meter on display
  1985. NormalDPMY: Word; // Dots per meter on display
  1986. LastChanceMemory: PSignalSemaphore;
  1987. LCMptr: Pointer;
  1988. MicrosPerLine: Word; // 256 time usec/line
  1989. MinDisplayColumn: Word;
  1990. ChipRevBits0: Byte;
  1991. MemType: Byte;
  1992. crb_reserved: array[0..3] of Byte;
  1993. monitor_id: Word;
  1994. hedley: array[0..7] of LongWord;
  1995. hedley_sprites: array[0..7] of LongWord; // sprite ptrs for intuition mouse
  1996. hedley_sprites1: array[0..7] of LongWord; // sprite ptrs for intuition mouse
  1997. hedley_count: SmallInt;
  1998. hedley_flags: Word;
  1999. hedley_tmp: smallint;
  2000. hash_table: PLongInt;
  2001. current_tot_rows: Word;
  2002. current_tot_cclks: Word;
  2003. hedley_hint: Byte;
  2004. hedley_hint2: Byte;
  2005. nreserved: array[0..3] of LongWord;
  2006. a2024_sync_raster: PLongInt;
  2007. control_delta_pal: Word;
  2008. control_delta_ntsc: Word;
  2009. current_monitor: PMonitorSpec;
  2010. MonitorList: TList;
  2011. default_monitor: PMonitorSpec;
  2012. MonitorListSemaphore: PSignalSemaphore;
  2013. DisplayInfoDataBase: Pointer;
  2014. TopLine: Word;
  2015. ActiViewCprSemaphore: PSignalSemaphore;
  2016. UtilityBase: Pointer; // for hook AND tag utilities
  2017. ExecBase: Pointer; // to link with rom.lib
  2018. bwshifts: PByte;
  2019. StrtFetchMasks: PWord;
  2020. StopFetchMasks: PWord;
  2021. Overrun: PWord;
  2022. RealStops: PSmallInt;
  2023. SpriteWidth: Word; // current width (in words) of sprites
  2024. SpriteFMode: Word; // current sprite fmode bits
  2025. SoftSprites: SHortInt; // bit mask of size change knowledgeable sprites
  2026. arraywidth: Shortint;
  2027. DefaultSpriteWidth: Word; // what width intuition wants
  2028. SprMoveDisable: Shortint;
  2029. WantChips: Byte;
  2030. BoardMemType: Byte;
  2031. Bugs: Byte;
  2032. gb_LayersBase: Pointer;
  2033. ColorMask: LongWord;
  2034. IVector: APTR;
  2035. IData: APTR;
  2036. SpecialCounter: LongWord; // special for double buffering
  2037. DBList: APTR;
  2038. MonitorFlags: Word;
  2039. ScanDoubledSprites: Byte;
  2040. BP3Bits: Byte;
  2041. MonitorVBlank: TAnalogSignalInterval;
  2042. natural_monitor: PMonitorSpec;
  2043. ProgData: APTR;
  2044. ExtSprites: Byte;
  2045. ClassicAmiga: Byte; // Private - dont use
  2046. GfxFlags: Word;
  2047. VBCounter: LongWord;
  2048. HashTableSemaphore: PSignalSemaphore;
  2049. HWEmul: array[0..8] of PLongWord;
  2050. // Added in V46
  2051. DefaultCharSet: LongWord; // Private - for diskfont.library
  2052. RegionPool: APTR; // Private
  2053. RegionPoolSemaphore: PSignalSemaphore; // private
  2054. // Added in V47
  2055. DiskfontBase: PLibrary; // Private - for diskfont.library
  2056. // Added in V48
  2057. Antialiasing: LongWord; // Private - for diskfont.library
  2058. // There are more fields beyond here and they are all private.
  2059. end;
  2060. const
  2061. // Values for GfxBase^.DisplayFlags
  2062. NTSC = 1;
  2063. GENLOC = 2;
  2064. PAL = 4;
  2065. TODA_SAFE = 8;
  2066. REALLY_PAL = 16; // what is actual crystal frequency (as opposed to what bootmenu set the agnus to)? (V39)
  2067. LPEN_SWAP_FRAMES = 32; // for LightpenSoftware (V40)
  2068. // bits for dalestuff, which may go away when blitter becomes a resource
  2069. QBOWNERn = 1; // blitter owned by blit queuer
  2070. BLITMSG_FAULTn = 2;
  2071. QBOWNER = 1 shl QBOWNERn;
  2072. BLITMSG_FAULT = 1 shl BLITMSG_FAULTn;
  2073. // bits defs for ChipRevBits
  2074. GFXB_BIG_BLITS = 0;
  2075. GFXB_HR_AGNUS = 0;
  2076. GFXB_HR_DENISE = 1;
  2077. GFXB_AA_ALICE = 2;
  2078. GFXB_AA_LISA = 3;
  2079. GFXB_AA_MLISA = 4; // internal use only.
  2080. GFXF_BIG_BLITS = 1;
  2081. GFXF_HR_AGNUS = 1;
  2082. GFXF_HR_DENISE = 2;
  2083. GFXF_AA_ALICE = 4;
  2084. GFXF_AA_LISA = 8;
  2085. GFXF_AA_MLISA = 16; // internal use only
  2086. // Pass ONE of these to SetChipRev()
  2087. SETCHIPREV_A = GFXF_HR_AGNUS;
  2088. SETCHIPREV_ECS = GFXF_HR_AGNUS or GFXF_HR_DENISE;
  2089. SETCHIPREV_AA = GFXF_AA_ALICE or GFXF_AA_LISA or SETCHIPREV_ECS;
  2090. SETCHIPREV_BEST= $ffffffff;
  2091. // memory type
  2092. BUS_16 = 0;
  2093. NML_CAS = 0;
  2094. BUS_32 = 1;
  2095. DBL_CAS = 2;
  2096. BANDWIDTH_1X = BUS_16 or NML_CAS;
  2097. BANDWIDTH_2XNML = BUS_32;
  2098. BANDWIDTH_2XDBL = DBL_CAS;
  2099. BANDWIDTH_4X = BUS_32 or DBL_CAS;
  2100. // Values for GfxBase->GfxFlags
  2101. GFXF_NEW_DATABASE = $0001; // New display database
  2102. GFXF_HAVECOMPOSITE = $0002; // CompositeTagList() is available
  2103. GRAPHICSNAME: PAnsiChar = 'graphics.library';
  2104. var
  2105. GfxBase: PLibrary = nil;
  2106. IGfx: PInterface = nil;
  2107. function GfxObtain(): LongWord; syscall IGfx 60;
  2108. function GfxRelease(): LongWord; syscall IGfx 64;
  2109. procedure GfxExpunge(); syscall IGfx 68;
  2110. function GfxClone(): PInterface; syscall IGfx 72;
  2111. function BltBitMap(const SrcBitMap: PBitMap; XSrc, YSrc: LongInt; DestBitMap: PBitMap; XDest, YDest, XSize, YSize: LongInt; MinTerm, Mask: LongWord; TempA: PAnsiChar): LongInt; syscall IGfx 76;
  2112. procedure BltTemplate(const Source: TPlanePtr; XSrc, SrcMod: LongInt; DestRP: PRastPort; XDest, YDest, XSize, YSize: LongInt); syscall IGfx 80;
  2113. procedure ClearEOL(Rp: PRastPort); syscall IGfx 84;
  2114. procedure ClearScreen(Rp: PRastPort); syscall IGfx 88;
  2115. function TextLength(Rp: PRastPort; const String_: PAnsiChar; Count: LongWord): LongInt; syscall IGfx 92;
  2116. procedure GfxText(Rp: PRastPort; const String_: PAnsiChar; Count: LongWord); syscall IGfx 96;
  2117. procedure SetFont(Rp: PRastPort; const TextFont: PTextFont); syscall IGfx 100;
  2118. function OpenFont(TextAttr: PTextAttr): PTextFont; syscall IGfx 104;
  2119. procedure CloseFont(TextFont: PTextFont); syscall IGfx 108;
  2120. function AskSoftStyle(Rp: PRastPort): LongWord; syscall IGfx 112;
  2121. function SetSoftStyle(Rp: PRastPort; Style: LongWord; Enable: LongWord): LongWord; syscall IGfx 116;
  2122. procedure AddBob(Bob: PBob; Rp: PRastPort); syscall IGfx 120;
  2123. procedure AddVSprite(VSprite: PVSprite; Rp: PRastPort); syscall IGfx 124;
  2124. procedure DoCollision(Rp: PRastPort); syscall IGfx 128;
  2125. procedure DrawGList(Rp: PRastPort; Vp: PViewPort); syscall IGfx 132;
  2126. procedure InitGels(Head: PVSprite; Tail: PVSprite; GelsInfo: PGelsInfo); syscall IGfx 136;
  2127. procedure InitMasks(VSprite: PVSprite); syscall IGfx 140;
  2128. procedure RemIBob(Bob: PBob; Rp: PRastPort; Vp: PViewPort); syscall IGfx 144;
  2129. procedure RemVSprite(VSprite: PVSprite); syscall IGfx 148;
  2130. procedure SetCollision(Num: LongWord; Routine: Pointer; GelsInfo: PGelsInfo); syscall IGfx 152;
  2131. procedure SortGList(Rp: PRastPort); syscall IGfx 156;
  2132. procedure AddAnimOb(AnOb: PAnimOb; AnKey: PPAnimOb; Rp: PRastPort); syscall IGfx 160;
  2133. procedure Animate(AnKey: PPAnimOb; Rp: PRastPort); syscall IGfx 164;
  2134. function GetGBuffers(AnOb: PAnimOb; Rp: PRastPort; Flag: LongInt): LongBool; syscall IGfx 168;
  2135. procedure InitGMasks(AnOb: PAnimOb); syscall IGfx 172;
  2136. procedure DrawEllipse(Rp: PRastPort; XCenter, YCenter, A, B: LongInt); syscall IGfx 176;
  2137. function AreaEllipse(Rp: PRastPort; XCenter, YCenter, A, B: LongInt): LongInt; syscall IGfx 180;
  2138. procedure LoadRGB4(Vp: PViewPort; const Colors: PWord; Count: LongWord); syscall IGfx 184;
  2139. procedure InitRastPort(Rp: PRastPort); syscall IGfx 188;
  2140. procedure InitVPort(Vp: PViewPort); syscall IGfx 192;
  2141. function MrgCop(View: PView): LongWord; syscall IGfx 196;
  2142. function MakeVPort(View: PView; Vp: PViewPort): LongWord; syscall IGfx 200;
  2143. procedure LoadView(View: PView); syscall IGfx 204;
  2144. procedure WaitBlit; syscall IGfx 208;
  2145. procedure SetRast(Rp: PRastPort; Pen: LongWord); syscall IGfx 212;
  2146. procedure GfxMove(Rp: PRastPort; X, Y: LongInt); syscall IGfx 216;
  2147. procedure Draw(Rp: PRastPort; X, Y: LongInt); syscall IGfx 220;
  2148. function AreaMove(Rp: PRastPort; X, Y: LongInt): LongInt; syscall IGfx 224;
  2149. function AreaDraw(Rp: PRastPort; X, Y: LongInt): LongInt; syscall IGfx 228;
  2150. function AreaEnd(Rp: PRastPort): LongInt; syscall IGfx 232;
  2151. procedure WaitTOF; syscall IGfx 236;
  2152. procedure QBlit(blit: PBltNode); syscall IGfx 240;
  2153. procedure InitArea(AreaInfo: PAreaInfo; VectorBuffer: APTR; MaxVectors: LongInt); syscall IGfx 244;
  2154. procedure SetRGB4(Vp: PViewPort; ColIndex: LongWord; Red, Green, Blue: LongWord); syscall IGfx 248;
  2155. procedure QBSBlit(Blit: PBltNode); syscall IGfx 252;
  2156. procedure BltClear(MemBlock: TPlanePtr; ByteCount, Flags: LongWord); syscall IGfx 256;
  2157. procedure RectFill(Rp: PRastPort; XMin, YMin, XMax, YMax: LongInt); syscall IGfx 260;
  2158. procedure BltPattern(Rp: PRastPort; const Mask: TPlanePtr; XMin, YMin, XMax, YMax: LongInt; MaskBPR: LongWord); syscall IGfx 264;
  2159. function ReadPixel(Rp: PRastPort; X, Y: LongInt): LongInt; syscall IGfx 268;
  2160. function WritePixel(Rp: PRastPort; X, Y: LongInt): LongInt; syscall IGfx 272;
  2161. function Flood(Rp: PRastPort; Mode: LongWord; X, Y: LongInt): LongBool; syscall IGfx 276;
  2162. procedure PolyDraw(Rp: PRastPort; Count: LongInt; const PolyTable: PSmallInt); syscall IGfx 280;
  2163. procedure SetAPen(Rp: PRastPort; Pen: LongWord); syscall IGfx 284;
  2164. procedure SetBPen(Rp: PRastPort; Pen: LongWord); syscall IGfx 288;
  2165. procedure SetDrMd(Rp: PRastPort; DrawMode: LongWord); syscall IGfx 292;
  2166. procedure InitView(View: PView); syscall IGfx 296;
  2167. procedure CBump(CopList: PUCopList); syscall IGfx 300;
  2168. procedure CMove(CopList: PUCopList; DestOffset: LongInt; data: LongInt); syscall IGfx 304;
  2169. procedure CWait(CopList: PUCopList; V, H: LongInt); syscall IGfx 308;
  2170. function VBeamPos: LongInt; syscall IGfx 312;
  2171. procedure InitBitMap(BitMap: PBitMap; Depth: LongInt; Width, Height: LongWord); syscall IGfx 316;
  2172. procedure ScrollRaster(Rp: PRastPort; Dx, Dy, XMin, YMin, XMax, YMax: LongInt); syscall IGfx 320;
  2173. procedure WaitBOVP(Vp: PViewPort); syscall IGfx 324;
  2174. function GetSprite(Sprite: PSimpleSprite; Num: LongInt): LongInt; syscall IGfx 328;
  2175. procedure FreeSprite(Num: LongInt); syscall IGfx 332;
  2176. procedure ChangeSprite(Vp: PViewPort; Sprite: PSimpleSprite; NewData: APTR); syscall IGfx 336;
  2177. procedure MoveSprite(Vp: PViewPort; Sprite: PSimpleSprite; X, Y: LongInt); syscall IGfx 340;
  2178. procedure LockLayerRom(Layer: PLayer); syscall IGfx 344;
  2179. procedure UnlockLayerRom(Layer: PLayer); syscall IGfx 348;
  2180. procedure SyncSBitMap(Layer: PLayer); syscall IGfx 352;
  2181. procedure CopySBitMap(Layer: PLayer); syscall IGfx 356;
  2182. procedure OwnBlitter; syscall IGfx 360;
  2183. procedure DisownBlitter; syscall IGfx 364;
  2184. function InitTmpRas(TmpRas: PTmpRas; Buffer: TPlanePtr; Size: LongInt): PTmpRas; syscall IGfx 368;
  2185. procedure AskFont(Rp: PRastPort; TextAttr: PTextAttr); syscall IGfx 372;
  2186. procedure AddFont(TextFont: PTextFont); syscall IGfx 376;
  2187. procedure RemFont(TextFont: PTextFont); syscall IGfx 380;
  2188. function AllocRaster(Width, Height: LongWord): TPlanePtr; syscall IGfx 384;
  2189. procedure FreeRaster(P: TPlanePtr; Width, Height: LongWord); syscall IGfx 388;
  2190. procedure AndRectRegion(Region: PRegion; const Rectangle: PRectangle); syscall IGfx 392;
  2191. function OrRectRegion(Region: PRegion; const Rectangle: PRectangle): LongBool; syscall IGfx 396;
  2192. function NewRegion: PRegion; syscall IGfx 400;
  2193. function ClearRectRegion(Region: PRegion; const Rectangle: PRectangle): LongBool; syscall IGfx 404;
  2194. procedure ClearRegion(Region: PRegion); syscall IGfx 408;
  2195. procedure DisposeRegion(Region: PRegion); syscall IGfx 412;
  2196. procedure FreeVPortCopLists(Vp: PViewPort); syscall IGfx 416;
  2197. procedure FreeCopList(CopList: PCopList); syscall IGfx 420;
  2198. procedure ClipBlit(SrcRP: PRastPort; XSrc, ySrc: LongInt; DestRP: PRastPort; XDest, YDest, XSize, YSize: LongWord; MinTerm: LongWord); syscall IGfx 424;
  2199. function XorRectRegion(Region: PRegion; const Rectangle: PRectangle): LongBool; syscall IGfx 428;
  2200. procedure FreeCprList(CprList: PCprList); syscall IGfx 432;
  2201. function GetColorMap(Entries: LongWord): PColorMap; syscall IGfx 436;
  2202. procedure FreeColorMap(ColorMap: PColorMap); syscall IGfx 440;
  2203. function GetRGB4(ColorMap: PColorMap; Entry: LongWord): LongInt; syscall IGfx 444;
  2204. procedure ScrollVPort(Vp: PViewPort); syscall IGfx 448;
  2205. function UCopperListInit(UCopList: PUCopList; N: LongInt): PCopList; syscall IGfx 452;
  2206. procedure FreeGBuffers(AnOb: PAnimOb; Rp: PRastPort; Flag: LongInt); syscall IGfx 456;
  2207. function BltBitMaPRastPort(const SrcBitMap: PBitMap; XSrc, YSrc: LongInt; DestRP: PRastPort; XDest, YDest, XSize, YSize: LongInt; Minterm: LongWord): LongBool; syscall IGfx 460;
  2208. function OrRegionRegion(const SrcRegion: PRegion; DestRegion: PRegion): LongBool; syscall IGfx 464;
  2209. function XorRegionRegion(const SrcRegion: PRegion; DestRegion: PRegion): LongBool; syscall IGfx 468;
  2210. function AndRegionRegion(const SrcRegion: PRegion; DestRegion: PRegion): LongBool; syscall IGfx 472;
  2211. procedure SetRGB4CM(ColorMap: PColorMap; ColIndex: LongWord; Red, Green, Blue: LongWord); syscall IGfx 476;
  2212. procedure BltMaskBitMapRastPort(const SrcBitMap: PBitMap; XSrc, YSrc: LongInt; DestRP: PRastPort; XDest, YDest, XSize, YSize: LongInt; MinTerm: LongWord; const BltMask: TPlanePtr); syscall IGfx 480;
  2213. // 484 private
  2214. // 488 private
  2215. function AttemptLockLayerRom(Layer: PLayer): LongBool; syscall IGfx 492;
  2216. function GfxNew(GfxNodeType: LongWord): APTR; syscall IGfx 496;
  2217. procedure GfxFree(GfxNodePtr: PExtendedNode); syscall IGfx 500;
  2218. procedure GfxAssociate(const AssociateNode: APTR; GfxNodePtr: PExtendedNode); syscall IGfx 504;
  2219. procedure BitMapScale(BitScaleArgs: PBitScaleArgs); syscall IGfx 508;
  2220. function ScalerDiv(Factor, Numerator, Denominator: LongWord): LongWord; syscall IGfx 512;
  2221. procedure TextExtent(Rp: PRastPort; const String_: STRPTR; Count: LongWord; TextExtent: PTextExtent); syscall IGfx 516;
  2222. function TextFit(Rp: PRastPort; const String_: STRPTR; StrLen: LongWord; TextExtent: PTextExtent; ConstrainingExtent: PTextExtent; StrDirection: LongInt; ConstrainingBitWidth, ConstrainingBitHeight: LongWord): LongWord; syscall IGfx 520;
  2223. function GfxLookUp(const AssociateNode: APTR): APTR; syscall IGfx 524;
  2224. function VideoControl(ColorMap: PColorMap; TagArray: PTagItem): LongWord; syscall IGfx 528;
  2225. // 532 VideoControlTags
  2226. function OpenMonitor(const MonitorName: STRPTR; DisplayID: LongWord): PMonitorSpec; syscall IGfx 536;
  2227. function CloseMonitor(MonitorSpec: PMonitorSpec): LongBool; syscall IGfx 540;
  2228. function FindDisplayInfo(DisplayID: LongWord): Pointer; syscall IGfx 544;
  2229. function NextDisplayInfo(DisplayID: LongWord): LongWord; syscall IGfx 548;
  2230. // 552 private
  2231. // 556 private
  2232. // 560 private
  2233. function GetDisplayInfoData(const Handle: Pointer; Buf: APTR; Size: LongWord; TagID: LongWord; DisplayID: LongWord): LongWord; syscall IGfx 564;
  2234. procedure FontExtent(const Font: PTextFont; FontExtent: PTextExtent); syscall IGfx 568;
  2235. function ReadPixelLine8(Rp: PRastPort; XStart, YStart, Width: LongWord; Array_: PByte; TempRP: PRastPort): LongInt; syscall IGfx 572;
  2236. function WritePixelLine8(Rp: PRastPort; XStart, YStart, Width: LongWord; Array_: PByte; TempRP: PRastPort): LongInt; syscall IGfx 576;
  2237. function ReadPixelArray8(Rp: PRastPort; XStart, YStart, XStop, YStop: LongWord; Array_: PByte; TempRP: PRastPort): LongInt; syscall IGfx 580;
  2238. function WritePixelArray8(Rp: PRastPort; XStart, YStart, XStop, YStop: LongWord; Array_: PByte; TempRP: PRastPort): LongInt; syscall IGfx 584;
  2239. function GetVPModeID(const Vp: PViewPort): LongWord; syscall IGfx 588;
  2240. function ModeNotAvailable(ModeID: LongWord): LongWord; syscall IGfx 592;
  2241. // 596 private
  2242. // 600 private
  2243. procedure EraseRect(Rp: PRastPort; XMin, YMin, XMax, YMax: LongInt); syscall IGfx 604;
  2244. function ExtendFont(Font: PTextFont; const FontTags: PTagItem): LongWord; syscall IGfx 608;
  2245. // 612 ExtendFontTags
  2246. procedure StripFont(Font: PTextFont); syscall IGfx 616;
  2247. function CalcIVG(V: PView; Cp: PViewPort): LongWord; syscall IGfx 620;
  2248. function AttachPalExtra(Cm: PColorMap; Vp: PViewPort): LongInt; syscall IGfx 624;
  2249. function ObtainBestPenA(Cm: PColorMap; R, G, B: LongWord;const Tags: PTagItem): LongInt; syscall IGfx 628;
  2250. // 632 ObtainBestPen
  2251. // 636 private
  2252. procedure SetRGB32(Vp: PViewPort; N, R, G, B: LongWord); syscall IGfx 640;
  2253. function GetAPen(Rp: PRastPort): LongWord; syscall IGfx 644;
  2254. function GetBPen(Rp: PRastPort): LongWord; syscall IGfx 648;
  2255. function GetDrMd(Rp: PRastPort): LongWord; syscall IGfx 652;
  2256. function GetOutlinePen(Rp: PRastPort): LongWord; syscall IGfx 656;
  2257. procedure LoadRGB32(Vp: PViewPort; const Table: PLongWord); syscall IGfx 660;
  2258. function SetChipRev(Want: LongWord): LongWord; syscall IGfx 664;
  2259. procedure SetABPenDrMd(Rp: PRastPort; APen, BPen, DrawMode: LongWord); syscall IGfx 668;
  2260. procedure GetRGB32(const Cm: pColorMap; Firstcolor, NColors: LongWord; Table: PLongWord); syscall IGfx 672;
  2261. function BltBitMapTagList(const Tags: PTagItem): LongInt; syscall IGfx 676;
  2262. // 680 private
  2263. function AllocBitMap(SizeX, SizeY, Depth, Flags: LongWord; const FriendBitmap: PBitMap): PBitMap; syscall IGfx 684;
  2264. procedure FreeBitMap(Bm: PBitMap); syscall IGfx 688;
  2265. function GetExtSpriteA(Ss: PExtSprite; const Tags: PTagItem): LongInt; syscall IGfx 692;
  2266. // 696 GetExtSprite
  2267. function CoerceMode(Vp: PViewPort; MonitorID, Flags: LongWord): LongWord; syscall IGfx 700;
  2268. procedure ChangeVPBitMap(Vp: PViewPort; Bm: PBitMap; Db: PDBufInfo); syscall IGfx 704;
  2269. procedure ReleasePen(Cm: PColorMap; N: LongWord); syscall IGfx 708;
  2270. function ObtainPen(Cm: PColorMap; N, R, G, B: LongWord; F: LongInt): LongInt; syscall IGfx 712;
  2271. function GetBitMapAttr(const Bm: PBitMap; AttrNum: LongWord): LongWord; syscall IGfx 716;
  2272. function AllocDBufInfo(Vp: PViewPort): PDBufInfo; syscall IGfx 720;
  2273. procedure FreeDBufInfo(Dbi: PDBufInfo); syscall IGfx 724;
  2274. function SetOutlinePen(Rp: PRastPort; Pen: LongWord): LongWord; syscall IGfx 728;
  2275. function SetWriteMask(Rp: PRastPort; Msk: LongWord): LongWord; syscall IGfx 732;
  2276. procedure SetMaxPen(Rp: PRastPort; MaxPen: LongWord); syscall IGfx 736;
  2277. procedure SetRGB32CM(Cm: pColorMap; N, R, G, B: LongWord); syscall IGfx 740;
  2278. procedure ScrollRasterBF(Rp: PRastPort; Dx, Dy, XMin, YMin, XMax, yMax: LongWord); syscall IGfx 744;
  2279. function FindColor(Cm: pColorMap; R, G, B: LongWord; MaxColor: LongInt): LongWord; syscall IGfx 748;
  2280. // 752 BltBitMapTags
  2281. function AllocSpriteDataA(const Bm: PBitMap; const Tags: PTagItem): PExtSprite; syscall IGfx 756;
  2282. // 758 AllocSpriteData
  2283. function ChangeExtSpriteA(Vp: PViewPort; OldSprite: PExtSprite; NewSprite: PExtSprite; const Tags: PTagItem): LongInt; syscall IGfx 764;
  2284. // 768 ChangeExtSprite
  2285. procedure FreeSpriteData(Sp: PExtSprite); syscall IGfx 772;
  2286. function SetRPAttrsA(Rp: PRastPort; const Tags: PTagItem): LongWord; syscall IGfx 776;
  2287. // 780 SetRPAttrs
  2288. function GetRPAttrsA(const Rp: PRastPort; const Tags: PTagItem): LongWord; syscall IGfx 784;
  2289. // 788 GetRPAttrs
  2290. function BestModeIDA(const Tags: pTagItem): LongWord; syscall IGfx 1050;
  2291. // 796 BestModeID
  2292. procedure WriteChunkyPixels(Rp: PRastPort; XStart, YStart, XStop, YStop: LongWord; Array_: PByte; BytesPerRow: LongInt); syscall IGfx 800;
  2293. function CompositeTagList(const Operator_: LongWord; const Source: PBitMap; const Destination: PBitMap; const Tags: PTagItem): LongWord; syscall IGfx 804;
  2294. // 808 CompositeTags
  2295. function AllocBitMapTagList(SizeX, SizeY, Depth: LongWord; const Tags: PTagItem): PBitMap; syscall IGfx 812;
  2296. // 812 AllocBitMapTags
  2297. function GetMonitorDataTagList(BoardNum, MonitorNum: LongWord; Tags: PTagItem): LongInt; syscall IGfx 820;
  2298. // 824 GetMonitorDataTags
  2299. function GetBoardDataTagList(BoardNum: LongWord; const Tags: PTagItem): LongInt; syscall IGfx 828;
  2300. // 832 GetBoardDataTags
  2301. function LockBitMapTagList(BitMap: PBitMap; Tags: PTagItem): APTR; syscall IGfx 836;
  2302. // 840 LockBitMapTags
  2303. procedure UnlockBitMap(Lock: APTR); syscall IGfx 844;
  2304. procedure RectFillColor(Rp: PRastPort; XMin, YMin, XMax, YMax, Color: LongWord); syscall IGfx 848;
  2305. function WritePixelColor(Rp: PRastPort; X, Y, Color: LongWord): LongInt; syscall IGfx 852;
  2306. function ReadPixelColor(Rp: PRastPort; X, Y: LongWord): LongWord; syscall IGfx 856;
  2307. procedure ReadPixelArray(Src: PRastPort; SrcX, SrcY: LongWord; Dst: PByte; DstX, DstY, DstBytesPerRow: LongWord; DstPixelFormat: LongWord; SizeX, SizeY: LongWord); syscall IGfx 860;
  2308. procedure WritePixelArray(Src: PByte; SrcX, SrcY, SrcBytesPerRow: LongWord; SrcPixelFormat: LongWord; Dst: PRastPort; DstX, DstY, SizeX, SizeY: LongWord); syscall IGfx 864;
  2309. function GraphicsControlTagList(const Tags: PTagItem): LongWord; syscall IGfx 868;
  2310. // 872 GraphicsControlTags
  2311. function LockBitMapToBoardTagList(BitMap: PBitMap; BoardNum: LongWord; Tags: PTagItem): APTR; syscall IGfx 876;
  2312. // 880 LockBitMapToBoardTags
  2313. procedure UnlockBitMapFromBoard(Lock: APTR; Modified: LongInt); syscall IGfx 884;
  2314. function GetBoardBytesPerRow(BoardNum: LongWord; PixelFormat: LongWord; Width: LongWord): LongWord; syscall IGfx 888;
  2315. // 892 private
  2316. // 896 private
  2317. // 900 private
  2318. function AllocSpriteData(bm: PBitMap; const argv: array of PtrUInt): pExtSprite;
  2319. function BestModeID(const argv: array of PtrUInt): LongWord;
  2320. function ChangeExtSprite(vp: PViewPort; oldsprite: PExtSprite; newsprite: PExtSprite; const argv: array of PtrUInt): LongInt;
  2321. function ExtendFontTags(font: PTextFont; const argv: array of PtrUInt): LongWord;
  2322. function GetExtSprite(ss: pExtSprite; const argv: array of PtrUInt): LongInt;
  2323. procedure GetRPAttrs(rp: PRastPort; const argv: array of PtrUInt);
  2324. function ObtainBestPen(cm: pColorMap; r: LongWord; g: LongWord; b: LongWord; const argv: array of PtrUInt): LongInt;
  2325. procedure SetRPAttrs(rp: PRastPort; const argv: array of PtrUInt);
  2326. function VideoControlTags(colorMap: PColorMap; const argv: array of PtrUInt): LongWord;
  2327. // gfxmacros
  2328. procedure BNDRYOFF(w: PRastPort);
  2329. procedure InitAnimate(animkey: PPAnimOb);
  2330. procedure SetAfPt(w: PRastPort; p: Pointer; n: Byte);
  2331. procedure SetDrPt(w: PRastPort; p: Word);
  2332. procedure SetOPen(w: PRastPort; c: Byte);
  2333. procedure SetWrMsk(w: PRastPort; m: Byte);
  2334. procedure RemBob(Bob: PBob); inline;
  2335. procedure SafeSetOutlinePen(w: PRastPort; c: Byte);
  2336. procedure SafeSetWriteMask(w: PRastPort; m: SmallInt) ;
  2337. {procedure OFF_DISPLAY (cust: pCustom);
  2338. procedure ON_DISPLAY (cust: pCustom);
  2339. procedure OFF_SPRITE (cust: pCustom);
  2340. procedure ON_SPRITE (cust: pCustom);
  2341. procedure OFF_VBLANK (cust: pCustom);
  2342. procedure ON_VBLANK (cust: pCustom);}
  2343. procedure DrawCircle(Rp: PRastPort; xCenter, yCenter, r: LongInt); inline;
  2344. function AreaCircle(Rp: PRastPort; xCenter, yCenter, r: SmallInt): LongWord; inline;
  2345. function RasSize(w, h: Word): Integer;
  2346. implementation
  2347. procedure RemBob(Bob: PBob);
  2348. begin
  2349. Bob^.Flags := Bob^.Flags or BOBSAWAY;
  2350. end;
  2351. function AllocSpriteData(bm: PBitMap; const argv: array of PtrUInt): PExtSprite;
  2352. begin
  2353. AllocSpriteData := AllocSpriteDataA(bm, @argv);
  2354. end;
  2355. function BestModeID(const argv: array of PtrUInt): LongWord;
  2356. begin
  2357. BestModeID := BestModeIDA(@argv);
  2358. end;
  2359. function ChangeExtSprite(vp: PViewPort; oldsprite: pExtSprite; newsprite: pExtSprite; const argv: array of PtrUInt): LongInt;
  2360. begin
  2361. ChangeExtSprite := ChangeExtSpriteA(vp, oldsprite, newsprite, @argv);
  2362. end;
  2363. function ExtendFontTags(font: PTextFont; const argv: array of PtrUInt): LongWord;
  2364. begin
  2365. ExtendFontTags := ExtendFont(font, @argv);
  2366. end;
  2367. function GetExtSprite(ss: pExtSprite; const argv: array of PtrUInt): LongInt;
  2368. begin
  2369. GetExtSprite := GetExtSpriteA(ss, @argv);
  2370. end;
  2371. procedure GetRPAttrs(rp: PRastPort; const argv: array of PtrUInt);
  2372. begin
  2373. GetRPAttrsA(rp, @argv);
  2374. end;
  2375. function ObtainBestPen(cm: pColorMap; r: LongWord; g: LongWord; b: LongWord; const argv: array of PtrUInt): LongInt;
  2376. begin
  2377. ObtainBestPen := ObtainBestPenA(cm, r, g, b, @argv);
  2378. end;
  2379. procedure SetRPAttrs(rp: PRastPort; const argv: array of PtrUInt);
  2380. begin
  2381. SetRPAttrsA(rp, @argv);
  2382. end;
  2383. function VideoControlTags(colorMap: pColorMap; Const argv: array of PtrUInt): LongWord;
  2384. begin
  2385. VideoControlTags := VideoControl(colorMap, @argv);
  2386. end;
  2387. procedure BNDRYOFF(w: PRastPort);
  2388. begin
  2389. with w^ do
  2390. Flags := Flags and (not AREAOUTLINE);
  2391. end;
  2392. procedure InitAnimate(animkey: PPAnimOb);
  2393. begin
  2394. animkey^ := nil;
  2395. end;
  2396. procedure SetAfPt(w: PRastPort;p: Pointer; n: Byte);
  2397. begin
  2398. with w^ do
  2399. begin
  2400. AreaPtrn := p;
  2401. AreaPtSz := n;
  2402. end;
  2403. end;
  2404. procedure SetDrPt(w: PRastPort; p: Word);
  2405. begin
  2406. with w^ do
  2407. begin
  2408. LinePtrn := p;
  2409. Flags := Flags or FRST_DOT;
  2410. linpatcnt := 15;
  2411. end;
  2412. end;
  2413. procedure SetOPen(w: PRastPort; c: Byte);
  2414. begin
  2415. WITH w^ DO
  2416. begin
  2417. AOlPen := c;
  2418. Flags := Flags or AREAOUTLINE;
  2419. end;
  2420. end;
  2421. procedure SetWrMsk(w: PRastPort; m: Byte);
  2422. begin
  2423. w^.Mask := m;
  2424. end;
  2425. procedure SafeSetOutlinePen(w: PRastPort; c: byte);
  2426. begin
  2427. if pGfxBase(GfxBase)^.LibNode.Lib_Version < 39 then
  2428. begin
  2429. w^.AOlPen := c;
  2430. w^.Flags := w^.Flags or AREAOUTLINE;
  2431. end
  2432. else
  2433. c := SetOutlinePen(w,c);
  2434. end;
  2435. procedure SafeSetWriteMask(w: PRastPort; m: SmallInt) ;
  2436. begin
  2437. if PGfxBase(GfxBase)^.LibNode.Lib_Version < 39 then
  2438. w^.Mask := Byte(m)
  2439. else
  2440. SetWriteMask(w, m);
  2441. end;
  2442. {
  2443. procedure OFF_DISPLAY (cust: pCustom);
  2444. begin
  2445. cust^.dmacon := BITCLR OR DMAF_RASTER;
  2446. end;
  2447. procedure ON_DISPLAY (cust: pCustom);
  2448. begin
  2449. cust^.dmacon := BITSET OR DMAF_RASTER;
  2450. end;
  2451. procedure OFF_SPRITE (cust: pCustom);
  2452. begin
  2453. cust^.dmacon := BITCLR OR DMAF_SPRITE;
  2454. end;
  2455. procedure ON_SPRITE (cust: pCustom);
  2456. begin
  2457. cust^.dmacon := BITSET OR DMAF_SPRITE;
  2458. end;
  2459. procedure OFF_VBLANK (cust: pCustom);
  2460. begin
  2461. cust^.intena := BITCLR OR INTF_VERTB;
  2462. end;
  2463. procedure ON_VBLANK (cust: pCustom);
  2464. begin
  2465. cust^.intena := BITSET OR INTF_VERTB;
  2466. end;}
  2467. function RasSize(w, h: Word): Integer; inline;
  2468. begin
  2469. RasSize := h * (((w + 15) shr 3) and $FFFE);
  2470. end;
  2471. procedure DrawCircle(Rp: PRastPort; xCenter, yCenter, r: LongInt); inline;
  2472. begin
  2473. DrawEllipse(Rp, xCenter, yCenter, r, r);
  2474. end;
  2475. function AreaCircle(Rp: PRastPort; xCenter, yCenter, r: SmallInt): LongWord; inline;
  2476. begin
  2477. AreaCircle := AreaEllipse(Rp, xCenter, yCenter, r, r);
  2478. end;
  2479. const
  2480. // Change VERSION and LIBVERSION to proper values
  2481. VERSION: string[2] = '0';
  2482. LIBVERSION: LongWord = 0;
  2483. initialization
  2484. GfxBase := OpenLibrary(GRAPHICSNAME,LIBVERSION);
  2485. if Assigned(GfxBase) then
  2486. IGfx := GetInterface(GfxBase, 'main', 1, nil);
  2487. finalization
  2488. if Assigned(IGfx) then
  2489. DropInterface(IGfx);
  2490. if Assigned(GfxBase) then
  2491. CloseLibrary(GfxBase);
  2492. end.