4 libbasetype struct GfxBase_intern
5 sysbase_field gfxbase.ExecBase
6 libbasetypeextern struct GfxBase
14 #include <graphics/gfx.h>
15 #include <graphics/displayinfo.h>
16 #include <graphics/gels.h>
17 #include <graphics/rastport.h>
18 #include <graphics/view.h>
19 #include <graphics/copper.h>
20 #include <graphics/clip.h>
21 #include <graphics/regions.h>
22 #include <graphics/sprite.h>
23 #include <graphics/text.h>
24 #include <graphics/scale.h>
25 #include <hardware/blit.h>
27 #include <utility/tagitem.h>
31 ULONG BestModeID(Tag, ...);
38 #define __aros_getoffsettable() ((char *)GfxBase)
39 #define __aros_setoffsettable(lh)
41 #include "graphics_intern.h"
45 LONG BltBitMap(struct BitMap *srcBitMap, WORD xSrc, WORD ySrc, struct BitMap *destBitMap, WORD xDest, WORD yDest, WORD xSize, WORD ySize, ULONG minterm, ULONG mask, PLANEPTR tempA) (A0, D0, D1, A1, D2, D3, D4, D5, D6, D7, A2)
46 void BltTemplate(PLANEPTR source, WORD xSrc, WORD srcMod, struct RastPort *destRP, WORD xDest, WORD yDest, WORD xSize, WORD ySize) (A0, D0, D1, A1, D2, D3, D4, D5)
47 void ClearEOL(struct RastPort *rp) (A1)
48 void ClearScreen(struct RastPort *rp) (A1)
49 WORD TextLength(struct RastPort *rp, CONST_STRPTR string, ULONG count) (A1, A0, D0)
50 void Text(struct RastPort *rp, CONST_STRPTR string, ULONG count) (A1, A0, D0)
51 void SetFont(struct RastPort *rp, struct TextFont *textFont) (A1, A0)
52 struct TextFont *OpenFont(const struct TextAttr *textAttr) (A0)
53 void CloseFont(struct TextFont *textFont) (A1)
54 ULONG AskSoftStyle(struct RastPort *rp) (A1)
55 ULONG SetSoftStyle(struct RastPort *rp, ULONG style, ULONG enable) (A1, D0, D1)
56 void AddBob(struct Bob *bob, struct RastPort *rp) (A0, A1)
57 void AddVSprite(struct VSprite *vs, struct RastPort *rp) (A0, A1)
58 void DoCollision(struct RastPort *rp) (A1)
59 void DrawGList(struct RastPort *rp, struct ViewPort *vp) (A1, A0)
60 void InitGels(struct VSprite *head, struct VSprite *tail, struct GelsInfo *GInfo) (A0, A1, A2)
61 void InitMasks(struct VSprite *vs) (A0)
62 void RemIBob(struct Bob *bob, struct RastPort *rp, struct ViewPort *vp) (A0, A1, A2)
63 void RemVSprite(struct VSprite *vs) (A0)
64 void SetCollision(ULONG num, VOID_FUNC routine, struct GelsInfo *GInfo) (D0, A0, A1)
65 void SortGList(struct RastPort *rp) (A1)
66 void AddAnimOb(struct AnimOb *anOb, struct AnimOb **anKey, struct RastPort *rp) (A0, A1, A2)
67 void Animate(struct AnimOb **anKey, struct RastPort *rp) (A0, A1)
68 BOOL GetGBuffers(struct AnimOb *anOb, struct RastPort *rp, BOOL db) (A0, A1, D0)
69 void InitGMasks(struct AnimOb *anOb) (A0)
70 void DrawEllipse(struct RastPort *rp, WORD xCenter, WORD yCenter, WORD a, WORD b) (A1, D0, D1, D2, D3)
71 ULONG AreaEllipse(struct RastPort *rp, WORD cx, WORD cy, WORD a, WORD b) (A1, D0, D1, D2, D3)
72 void LoadRGB4(struct ViewPort *vp, UWORD *colors, WORD count) (A0, A1, D0)
73 void InitRastPort(struct RastPort *rp) (A1)
74 void InitVPort(struct ViewPort *vp) (A0)
75 ULONG MrgCop(struct View *view) (A1)
76 ULONG MakeVPort(struct View *view, struct ViewPort *viewport) (A0, A1)
77 void LoadView(struct View *view) (A1)
79 void SetRast(struct RastPort *rp, ULONG pen) (A1, D0)
80 void Move(struct RastPort *rp, WORD x, WORD y) (A1, D0, D1)
81 void Draw(struct RastPort *rp, WORD x, WORD y) (A1, D0, D1)
82 ULONG AreaMove(struct RastPort *rp, WORD x, WORD y) (A1, D0, D1)
83 ULONG AreaDraw(struct RastPort *rp, WORD x, WORD y) (A1, D0, D1)
84 LONG AreaEnd(struct RastPort *rp) (A1)
86 void QBlit(struct bltnode *bn) (A1)
87 void InitArea(struct AreaInfo *areainfo, void *buffer, WORD maxvectors) (A0, A1, D0)
88 void SetRGB4(struct ViewPort *vp, ULONG n, ULONG r, ULONG g, ULONG b) (A0, D0, D1, D2, D3)
89 void QBSBlit(struct bltnode *bn) (A1)
90 void BltClear(void *memBlock, ULONG bytecount, ULONG flags) (A1, D0, D1)
91 void RectFill(struct RastPort *rp, WORD xMin, WORD yMin, WORD xMax, WORD yMax) (A1, D0, D1, D2, D3)
92 void BltPattern(struct RastPort *rp, PLANEPTR mask, WORD xMin, WORD yMin, WORD xMax, WORD yMax, ULONG byteCnt) (A1, A0, D0, D1, D2, D3, D4)
93 LONG ReadPixel(struct RastPort *rp, WORD x, WORD y) (A1, D0, D1)
94 LONG WritePixel(struct RastPort *rp, WORD x, WORD y) (A1, D0, D1)
95 BOOL Flood(struct RastPort *rp, ULONG mode, WORD x, WORD y) (A1, D2, D0, D1)
96 void PolyDraw(struct RastPort *rp, LONG count, WORD *polyTable) (A1, D0, A0)
97 void SetAPen(struct RastPort *rp, ULONG pen) (A1, D0)
98 void SetBPen(struct RastPort *rp, ULONG pen) (A1, D0)
99 void SetDrMd(struct RastPort *rp, ULONG drawMode) (A1, D0)
100 void InitView(struct View *view) (A1)
101 void CBump(struct UCopList *ucl) (A1)
102 void CMove(struct UCopList *ucl, void *reg, WORD value) (A1, D0, D1)
103 void CWait(struct UCopList *ucl, WORD v, WORD h) (A1, D0, D1)
105 void InitBitMap(struct BitMap *bm, BYTE depth, UWORD width, UWORD height) (A0, D0, D1, D2)
106 void ScrollRaster(struct RastPort *rp, WORD dx, WORD dy, WORD xMin, WORD yMin, WORD xMax, WORD yMax) (A1, D0, D1, D2, D3, D4, D5)
107 void WaitBOVP(struct ViewPort *vp) (A0)
108 WORD GetSprite(struct SimpleSprite *sprite, WORD pick) (A0, D0)
109 void FreeSprite(WORD pick) (D0)
110 void ChangeSprite(struct ViewPort *vp, struct SimpleSprite *s, void *newdata) (A0, A1, A2)
111 void MoveSprite(struct ViewPort *vp, struct SimpleSprite *sprite, WORD x, WORD y) (A0, A1, D0, D1)
112 void LockLayerRom(struct Layer *l) (A5)
113 void UnlockLayerRom(struct Layer *l) (A5)
114 void SyncSBitMap(struct Layer *l) (A0)
115 void CopySBitMap(struct Layer *l) (A0)
117 void DisownBlitter() ()
118 struct TmpRas *InitTmpRas(struct TmpRas *tmpras, void *buffer, ULONG size) (A0, A1, D0)
119 void AskFont(struct RastPort *rp, struct TextAttr *textAttr) (A1, A0)
120 void AddFont(struct TextFont *textFont) (A1)
121 void RemFont(struct TextFont *textFont) (A1)
122 PLANEPTR AllocRaster(UWORD width, UWORD height) (D0, D1)
123 void FreeRaster(PLANEPTR p, UWORD width, UWORD height) (A0, D0, D1)
124 void AndRectRegion(struct Region *Reg, struct Rectangle *Rect) (A0, A1)
125 BOOL OrRectRegion(struct Region *Reg, struct Rectangle *Rect) (A0, A1)
126 struct Region *NewRegion() ()
127 BOOL ClearRectRegion(struct Region *Reg, struct Rectangle *Rect) (A0, A1)
128 void ClearRegion(struct Region *region) (A0)
129 void DisposeRegion(struct Region *region) (A0)
130 void FreeVPortCopLists(struct ViewPort *vp) (A0)
131 void FreeCopList(struct CopList *coplist) (A0)
132 void ClipBlit(struct RastPort *srcRP, WORD xSrc, WORD ySrc, struct RastPort *destRP, WORD xDest, WORD yDest, WORD xSize, WORD ySize, UBYTE minterm) (A0, D0, D1, A1, D2, D3, D4, D5, D6)
133 BOOL XorRectRegion(struct Region *Reg, struct Rectangle *Rect) (A0, A1)
134 void FreeCprList(struct cprlist *cprList) (A0)
135 struct ColorMap *GetColorMap(ULONG entries) (D0)
136 void FreeColorMap(struct ColorMap *colormap) (A0)
137 ULONG GetRGB4(struct ColorMap *colormap, LONG entry) (A0, D0)
138 void ScrollVPort(struct ViewPort *vp) (A0)
139 struct CopList *UCopperListInit(struct UCopList *ucl, WORD n) (A0, D0)
140 void FreeGBuffers(struct AnimOb *anOb, struct RastPort *rp, BOOL db) (A0, A1, D0)
141 void BltBitMapRastPort(struct BitMap *srcBitMap, WORD xSrc, WORD ySrc, struct RastPort *destRP, WORD xDest, WORD yDest, WORD xSize, WORD ySize, ULONG minterm) (A0, D0, D1, A1, D2, D3, D4, D5, D6)
142 BOOL OrRegionRegion(struct Region *R1, struct Region *R2) (A0, A1)
143 BOOL XorRegionRegion(struct Region *R1, struct Region *R2) (A0, A1)
144 BOOL AndRegionRegion(struct Region *R1, struct Region *R2) (A0, A1)
145 void SetRGB4CM(struct ColorMap *cm, WORD n, UBYTE r, UBYTE g, UBYTE b) (A0, D0, D1, D2, D3)
146 void BltMaskBitMapRastPort(struct BitMap *srcBitMap, WORD xSrc, WORD ySrc, struct RastPort *destRP, WORD xDest, WORD yDest, WORD xSize, WORD ySize, ULONG minterm, PLANEPTR bltMask) (A0, D0, D1, A1, D2, D3, D4, D5, D6, A2)
147 # *** Two AROS-specific functions, placed in never used area ***
148 LONG AddDisplayDriverA(APTR gfxhidd, struct TagItem *attrs, struct TagItem *tags) (A0, A1, A2)
149 void SetDisplayDriverCallback(APTR callback, APTR userdata) (A0, A1)
150 BOOL AttemptLockLayerRom(struct Layer *l) (A5)
152 struct ExtendedNode *GfxNew(ULONG node_type) (D0)
153 void GfxFree(struct ExtendedNode *node) (A0)
154 void GfxAssociate(void *pointer, struct ExtendedNode *node) (A0, A1)
155 void BitMapScale(struct BitScaleArgs *bitScaleArgs) (A0)
156 UWORD ScalerDiv(UWORD factor, UWORD numerator, UWORD denominator) (D0, D1, D2)
157 void TextExtent(struct RastPort *rp, CONST_STRPTR string, ULONG count, struct TextExtent *textExtent) (A1, A0, D0, A2)
158 ULONG TextFit(struct RastPort *rp, CONST_STRPTR string, ULONG strLen, struct TextExtent *textExtent, struct TextExtent *constrainingExtent, LONG strDirection, ULONG constrainingBitWidth, ULONG constrainingBitHeight) (A1, A0, D0, A2, A3, D1, D2, D3)
159 struct ExtendedNode *GfxLookUp(void *pointer) (A0)
160 ULONG VideoControl(struct ColorMap *cm, struct TagItem *tags) (A0, A1)
161 struct MonitorSpec *OpenMonitor(STRPTR monitor_name, ULONG display_id) (A1, D0)
162 LONG CloseMonitor(struct MonitorSpec *monitor_spec) (A0)
163 DisplayInfoHandle FindDisplayInfo(ULONG ID) (D0)
164 ULONG NextDisplayInfo(ULONG last_ID) (D0)
165 ULONG AddDisplayData(APTR displayInfoRecord) (A0)
167 ULONG AddDisplayInfoData(DisplayInfoHandle handle, UBYTE *buf, ULONG size, ULONG tagID, ULONG ID) (A0, A1, D0, D1, D2)
169 ULONG SetDisplayInfoData(DisplayInfoHandle handle, UBYTE *buf, ULONG size, ULONG tagID, ULONG ID) (A0, A1, D0, D1, D2)
171 ULONG GetDisplayInfoData(DisplayInfoHandle handle, UBYTE *buf, ULONG size, ULONG tagID, ULONG ID) (A0, A1, D0, D1, D2)
172 void FontExtent(struct TextFont *font, struct TextExtent *fontExtent) (A0, A1)
173 LONG ReadPixelLine8(struct RastPort *rp, WORD xstart, WORD ystart, WORD width, UBYTE *array, struct RastPort *tempRP) (A0, D0, D1, D2, A2, A1)
174 LONG WritePixelLine8(struct RastPort *rp, WORD xstart, WORD ystart, WORD width, UBYTE *array, struct RastPort *tempRP) (A0, D0, D1, D2, A2, A1)
175 WORD ReadPixelArray8(struct RastPort *rp, WORD xstart, WORD ystart, WORD xstop, WORD ystop, UBYTE *array, struct RastPort *temprp) (A0, D0, D1, D2, D3, A2, A1)
176 LONG WritePixelArray8(struct RastPort *rp, WORD xstart, WORD ystart, WORD xstop, WORD ystop, UBYTE *array, struct RastPort *temprp) (A0, D0, D1, D2, D3, A2, A1)
177 ULONG GetVPModeID(struct ViewPort *vp) (A0)
178 ULONG ModeNotAvailable(ULONG modeID) (D0)
179 WORD WeighTAMatch(const struct TextAttr *reqTextAttr, const struct TextAttr *targetTextAttr, struct TagItem *targetTags) (A0, A1, A2)
180 void EraseRect(struct RastPort *rp, WORD xMin, WORD yMin, WORD xMax, WORD yMax) (A1, D0, D1, D2, D3)
181 ULONG ExtendFont(struct TextFont *font, struct TagItem *fontTags) (A0, A1)
182 void StripFont(struct TextFont *font) (A0)
184 UWORD CalcIVG(struct View *View, struct ViewPort *ViewPort) (A0, A1)
185 LONG AttachPalExtra(struct ColorMap *cm, struct ViewPort *vp) (A0, A1)
186 LONG ObtainBestPenA(struct ColorMap *cm, ULONG r, ULONG g, ULONG b, struct TagItem *tags) (A0, D1, D2, D3, A1)
188 void SetRGB32(struct ViewPort *vp, ULONG n, ULONG r, ULONG g, ULONG b) (A0, D0, D1, D2, D3)
189 ULONG GetAPen(struct RastPort *rp) (A0)
190 ULONG GetBPen(struct RastPort *rp) (A0)
191 ULONG GetDrMd(struct RastPort *rp) (A0)
192 ULONG GetOutlinePen(struct RastPort *rp) (A0)
193 void LoadRGB32(struct ViewPort *vp, const ULONG *table) (A0, A1)
194 ULONG SetChipRev(ULONG ChipRev) (D0)
195 void SetABPenDrMd(struct RastPort *rp, ULONG apen, ULONG bpen, ULONG drawMode) (A1, D0, D1, D2)
196 void GetRGB32(struct ColorMap *cm, ULONG firstcolor, ULONG ncolors, ULONG *table) (A0, D0, D1, A1)
197 .skip 1 # v39 internal GfxSpare1()
198 .skip 1 # v39 internal SetDefaultMonitor()
199 struct BitMap *AllocBitMap(UWORD sizex, UWORD sizey, ULONG depth, ULONG flags, struct BitMap *friend_bitmap) (D0, D1, D2, D3, A0)
200 void FreeBitMap(struct BitMap *bm) (A0)
201 LONG GetExtSpriteA(struct ExtSprite *sprite, struct TagItem *tags) (A2, A1)
202 ULONG CoerceMode(struct ViewPort *RealViewPort, ULONG MonitorID, ULONG Flags) (A0, D0, D1)
203 void ChangeVPBitMap(struct ViewPort *vp, struct BitMap *bm, struct DBufInfo *db) (A0, A1, A2)
204 void ReleasePen(struct ColorMap *cm, ULONG n) (A0, D0)
205 LONG ObtainPen(struct ColorMap *cm, ULONG n, ULONG r, ULONG g, ULONG b, ULONG flags) (A0, D0, D1, D2, D3, D4)
206 IPTR GetBitMapAttr(struct BitMap *bitmap, ULONG attribute) (A0, D1)
207 struct DBufInfo *AllocDBufInfo(struct ViewPort *vp) (A0)
208 void FreeDBufInfo(struct DBufInfo *db) (A1)
209 ULONG SetOutlinePen(struct RastPort *rp, ULONG pen) (A0, D0)
210 ULONG SetWriteMask(struct RastPort *rp, ULONG mask) (A0, D0)
211 void SetMaxPen(struct RastPort *rp, ULONG maxpen) (A0, D0)
212 void SetRGB32CM(struct ColorMap *cm, ULONG n, ULONG r, ULONG g, ULONG b) (A0, D0, D1, D2, D3)
213 void ScrollRasterBF(struct RastPort *rp, WORD dx, WORD dy, WORD xMin, WORD yMin, WORD xMax, WORD yMax) (A1, D0, D1, D2, D3, D4, D5)
214 ULONG FindColor(struct ColorMap *cm, ULONG r, ULONG g, ULONG b, ULONG maxpen) (A3, D1, D2, D3, D4)
215 .skip 1 # v39 internal GfxSpare2()
216 struct ExtSprite *AllocSpriteDataA(struct BitMap *bitmap, struct TagItem *tagList) (A2, A1)
217 LONG ChangeExtSpriteA(struct ViewPort *vp, struct ExtSprite *oldsprite, struct ExtSprite *newsprite, struct TagItem *tags) (A0, A1, A2, A3)
218 void FreeSpriteData(struct ExtSprite *extsp) (A2)
219 void SetRPAttrsA(struct RastPort *rp, struct TagItem *tags) (A0, A1)
220 void GetRPAttrsA(struct RastPort *rp, struct TagItem *tags) (A0, A1)
221 ULONG BestModeIDA(struct TagItem *TagItems) (A0)
223 void WriteChunkyPixels(struct RastPort *rp, WORD xstart, WORD ystart, WORD xstop, WORD ystop, UBYTE *array, LONG bytesperrow) (A0, D0, D1, D2, D3, A2, D4)
224 .skip 1 # MorphOS: OpenFontTagList(struct TextAttr *textAttr, struct TagItem *tags) (A0, A1)
225 # *** AROS-specific extensions follow. Placed in MorphOS private space (20 slots). We use 13 of them. ###
227 BOOL SetRegion(struct Region *src, struct Region *dest) (A0, A1)
228 BOOL ClearRegionRegion(struct Region *R1, struct Region *R2) (A0, A1)
229 BOOL AreRegionsEqual(struct Region *R1, struct Region *R2) (A0, A1)
230 BOOL IsPointInRegion(struct Region *Reg, WORD x, WORD y) (A0, D0, D1)
231 BOOL ScrollRegion(struct Region *region, struct Rectangle *rect, WORD dx, WORD dy) (A0, A1, D0, D1)
232 struct Region *AndRectRegionND(struct Region *Reg, struct Rectangle *Rect) (A0, A1)
233 struct Region *AndRegionRegionND(struct Region *R1, struct Region *R2) (A0, A1)
234 struct Region *OrRectRegionND(struct Region *Reg, struct Rectangle *Rect) (A0, A1)
235 struct Region *OrRegionRegionND(struct Region *R1, struct Region *R2) (A0, A1)
236 struct Region *XorRectRegionND(struct Region *Reg, struct Rectangle *Rect) (A0, A1)
237 struct Region *XorRegionRegionND(struct Region *R1, struct Region *R2) (A0, A1)
238 struct Region *ClearRectRegionND(struct Region *Reg, struct Rectangle *Rect) (A0, A1)
239 struct Region *ClearRegionRegionND(struct Region *R1, struct Region *R2) (A0, A1)
241 # The following are private low-level support functions for cybergraphics.library.
242 # Do not use, can be moved at any moment!
243 LONG WritePixels8(struct RastPort *rp, UBYTE *array, ULONG modulo, WORD xstart, WORD ystart, WORD xstop, WORD ystop, APTR pixlut, BOOL do_update) (A0, A1, D0, D1, D2, D3, D4, A2, D5)
244 LONG FillRectPenDrMd(struct RastPort *rp, WORD x1, WORD y1, WORD x2, WORD y2, ULONG pix, IPTR drmd, BOOL do_update) (A0, D0, D1, D2, D3, D4, D5, D6)
245 LONG DoRenderFunc(struct RastPort *rp, Point *src, struct Rectangle *rr, APTR render_func, APTR funcdata, BOOL do_update) (A0, A1, A2, A3, A4, D0)
246 LONG DoPixelFunc(struct RastPort *rp, WORD x, WORD y, APTR render_func, APTR funcdata, BOOL do_update) (A0, D0, D1, A1, A2, D2)
247 void UpdateBitMap(struct BitMap *bitmap, UWORD x, UWORD y, UWORD width, UWORD height) (A0, D0, D1, D2, D3)