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