|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
Data Structures | |
| struct | blitstate |
Macros | |
| #define | __NOLIBBASE__ |
| #define | GRAPHICS_BASE_NAME gfx |
| #define | BLIT_LIBS |
| #define | MODE_FN(code, name) |
| #define | SHIFT(x) |
| #define | REG_ARGS |
Functions | |
| void | blitlib_doblit (void) |
| void | blitlib_doblitex (void) |
| void | b_doblitex (void) |
| void | doblock (void) |
| void | doblitcoll (void) |
| void | blitlib_doblitmode (void) |
| void | docookiemode (void) |
| CookieMode, EraseMode, InvMode, SolidMode: the BlitMode values $FCA (cookie cut), $B0A (erase), $B5A (invert), $BFA (solid). | |
| void | doerasemode (void) |
| void | doinvmode (void) |
| void | dosolidmode (void) |
| void | blitlib_codeinit (void) |
| void | blitchk (void) |
| void | blitchknc (void) |
| void | blitchk3 (void) |
| MODE_FN (docookiemode, "CookieMode") | |
| MODE_FN (doerasemode, "EraseMode") | |
| MODE_FN (doinvmode, "InvMode") | |
| MODE_FN (dosolidmode, "SolidMode") | |
| BL_ALWAYS_INLINE ULONG | offset (const struct bb_bitmap *bm, WORD x, WORD y) |
| BL_ALWAYS_INLINE void | setmods (const struct bb_shape *shape, const struct bb_bitmap *bm, UBYTE *cb) |
| BL_ALWAYS_INLINE void | blitsetup (const struct bb_shape *shape, const struct bb_bitmap *bm, UBYTE *cb, WORD x, WORD y, struct blitstate *st) |
| BL_ALWAYS_INLINE UBYTE ** | blitplanes (UBYTE *cb, UBYTE **plane, UWORD n, ULONG cookie, ULONG off, UWORD size) |
| BL_ALWAYS_INLINE void | blit (const struct bb_shape *shape, const struct bb_bitmap *bm, UBYTE *cb, WORD x, WORD y) |
| BL_ALWAYS_INLINE void | blitex (const struct bb_shape *shape, const struct bb_bitmap *bm, UBYTE *cb, WORD x, WORD y, UWORD bits) |
| BL_ALWAYS_INLINE void | block (const struct bb_shape *shape, const struct bb_bitmap *bm, UBYTE *cb, WORD x, WORD y) |
| BL_ALWAYS_INLINE LONG | blitcoll (const struct bb_shape *shape, const struct bb_bitmap *bm, UBYTE *cb, WORD x, WORD y) |
| static BLITZ_ENTRYPOINT void | b_doblit_c (WORD x, WORD y, UBYTE *cb, const struct bb_bitmap *bm) |
| Blit Shape#,X,Y: blit the shape into the used bitmap (Blitz mode). | |
| BLITZ_EP_MARK (b_doblit_c) | |
| static void | a_doblit_c (WORD x, WORD y, UBYTE *cb, const struct bb_bitmap *bm, struct Library *gfx) |
| Blit Shape#,X,Y (Amiga mode). | |
| static BLITZ_ENTRYPOINT void | b_doblitex_c (WORD x, WORD y, UBYTE *cb, const struct bb_bitmap *bm, UWORD bits) |
| Blit Shape#,X,Y,Excessonoff (Blitz mode; the nullsub b_doblitex for other libraries is the same code as a normal C function). | |
| BLITZ_EP_MARK (b_doblitex_c) | |
| static void | n_doblitex_c (WORD x, WORD y, UBYTE *cb, const struct bb_bitmap *bm, UWORD bits) |
| static void | a_doblitex_c (WORD x, WORD y, UBYTE *cb, const struct bb_bitmap *bm, UWORD bits, struct Library *gfx) |
| Blit Shape#,X,Y,Excessonoff (Amiga mode). | |
| static BLITZ_ENTRYPOINT void | b_doblock_c (WORD x, WORD y, UBYTE *cb, const struct bb_bitmap *bm) |
| Block Shape#,X,Y: copy the shape into the used bitmap (Blitz mode). | |
| BLITZ_EP_MARK (b_doblock_c) | |
| void | a_doblock_c (WORD x, WORD y, UBYTE *cb, const struct bb_bitmap *bm, struct Library *gfx) |
| Block Shape#,X,Y (Amiga mode). | |
| static BLITZ_ENTRYPOINT BB_BOOL | b_doblitcoll_c (WORD x, WORD y, UBYTE *cb, const struct bb_bitmap *bm) |
| BlitColl(Shape#,x,y): does the shape's cookie hit a set pixel of the used bitmap (Blitz mode)? | |
| BLITZ_EP_MARK (b_doblitcoll_c) | |
| ULONG | a_doblitcoll_c (WORD x, WORD y, UBYTE *cb, const struct bb_bitmap *bm, struct Library *gfx) |
| BlitColl(Shape#,x,y) (Amiga mode). | |
| static void | doblitmode_c (UWORD m) |
| BlitMode BLTCON0: the minterm/channel bits of Blit's BLTCON0 (ORed with the shift; CookieMode ... give the usual values). | |
| BLITZ_ALIAS (blitlib_doblitmode, doblitmode_c) | |
| static ULONG | codeinit_c (ULONG caller_d0) |
| init: BlitMode $FCA (cookie cut) - MOVE $fca,d0 and on into doblitmode. | |
| static int | maxchk2 (const struct bb_shape *shape, const struct bb_bitmap *bm) |
| static int | maxchk (const struct bb_shape *shape, const struct bb_bitmap *bm) |
| static void | poschk2 (const struct bb_shape *shape, const struct bb_bitmap *bm, WORD x, WORD y) |
| static void | poschk (const struct bb_shape *shape, const struct bb_bitmap *bm, WORD x, WORD y) |
| static void | blitchk_c (WORD x, WORD y, const struct bb_bitmap *bm) |
| static void | blitchknc_c (WORD x, WORD y, const struct bb_bitmap *bm) |
| static void | blitchk3_c (WORD x, WORD y, const struct bb_bitmap *bm) |
Variables | |
| BLIT_LIBS | |
| static UWORD | bcon0 = 0xfca |
| #define __NOLIBBASE__ |
| #define BLIT_LIBS |
| #define GRAPHICS_BASE_NAME gfx |
| #define REG_ARGS |
|
static |
Blit Shape#,X,Y (Amiga mode).
Amiga mode: OwnBlitter, the blit, wait for the blitter, DisownBlitter. Per shape plane A = cookie, B = shape data (one pointer for all planes), C = D = bitmap plane; BLTCON0 = shift | the BlitMode (default $FCA, cookie cut). Errors (debugger, blitchk): "Shape does not have a cookie cut", "Unitialized BitMap", "Uninialized Shape", "Shape has too many BitPlanes", "Coords outside of BitMap". The shape comes in a3 (!libs {shapeslib,$1380}, from Shape# in d0).
| ULONG a_doblitcoll_c | ( | WORD | x, |
| WORD | y, | ||
| UBYTE * | cb, | ||
| const struct bb_bitmap * | bm, | ||
| struct Library * | gfx ) |
BlitColl(Shape#,x,y) (Amiga mode).
OwnBlitter, the test, DisownBlitter (MOVE d0,-(a7):DisownBlitter:MOVE (a7)+,d0 - only the low word of the result is set, the upper word is what DisownBlitter left in d0; DIFF: here 0; BlitColl is a word function). A = cookie, C = bitmap plane, no D, for every plane of the bitmap (not a bug: of the bitmap, not of the shape). Errors (debugger, blitchk3): as Blit without the depth check. The shape comes in a3 (!libs {shapeslib,$1380}, from Shape# in d0).
| x | d1.w: x (the shape's handle is subtracted) |
| y | d2.w: y |
| cb | a1: the custom chip base $DFF000 (chipbaselib) |
| bm | a2: the used bitmap (!libs {bitmaplib,$1202}) |
| gfx | a6: graphics.library (!libs {graphicslib,$5600}) |
|
static |
Blit Shape#,X,Y,Excessonoff (Amiga mode).
Amiga mode: OwnBlitter, the blit, wait for the blitter, DisownBlitter. Blit, then the bitmap planes beyond the shape's depth get A = cookie, minterm $0A (cleared where the cookie is) or $FA (set), one bit of Excessonoff per plane. Errors (debugger, blitchk): as Blit. The shape comes in a3 (!libs {shapeslib,$1380}, from Shape# in d0).
| void a_doblock_c | ( | WORD | x, |
| WORD | y, | ||
| UBYTE * | cb, | ||
| const struct bb_bitmap * | bm, | ||
| struct Library * | gfx ) |
Block Shape#,X,Y (Amiga mode).
Amiga mode: OwnBlitter, the blit, wait for the blitter, DisownBlitter. A -> D copy of the shape data: no shift, x / 8 bytes, bltsize - 1 (without the extra word). Not a bug: byte positions (the blitter ignores bit 0 of the address; Block is documented as word boundary blitting). Errors (debugger, blitchknc): as Blit, but no cookie needed. The shape comes in a3 (!libs {shapeslib,$1380}, from Shape# in d0).
|
static |
Blit Shape#,X,Y: blit the shape into the used bitmap (Blitz mode).
Per shape plane A = cookie, B = shape data (one pointer for all planes), C = D = bitmap plane; BLTCON0 = shift | the BlitMode (default $FCA, cookie cut). Errors (debugger, blitchk): "Shape does not have a cookie cut", "Unitialized BitMap", "Uninialized Shape", "Shape has too many BitPlanes", "Coords outside of BitMap". The shape comes in a3 (!libs {shapeslib,$1380}, from Shape# in d0).
|
static |
BlitColl(Shape#,x,y): does the shape's cookie hit a set pixel of the used bitmap (Blitz mode)?
A = cookie, C = bitmap plane, no D, for every plane of the bitmap (not a bug: of the bitmap, not of the shape). Errors (debugger, blitchk3): as Blit without the depth check. The shape comes in a3 (!libs {shapeslib,$1380}, from Shape# in d0).
| x | d1.w: x (the shape's handle is subtracted) |
| y | d2.w: y |
| cb | a1: the custom chip base $DFF000 (chipbaselib) |
| bm | a2: the used bitmap (!libs {bitmaplib,$1202}) |
| void b_doblitex | ( | void | ) |
|
static |
Blit Shape#,X,Y,Excessonoff (Blitz mode; the nullsub b_doblitex for other libraries is the same code as a normal C function).
Blit, then the bitmap planes beyond the shape's depth get A = cookie, minterm $0A (cleared where the cookie is) or $FA (set), one bit of Excessonoff per plane. Errors (debugger, blitchk): as Blit. The shape comes in a3 (!libs {shapeslib,$1380}, from Shape# in d0).
|
static |
Block Shape#,X,Y: copy the shape into the used bitmap (Blitz mode).
A -> D copy of the shape data: no shift, x / 8 bytes, bltsize - 1 (without the extra word). Not a bug: byte positions (the blitter ignores bit 0 of the address; Block is documented as word boundary blitting). Errors (debugger, blitchknc): as Blit, but no cookie needed. The shape comes in a3 (!libs {shapeslib,$1380}, from Shape# in d0).
| BL_ALWAYS_INLINE void blit | ( | const struct bb_shape * | shape, |
| const struct bb_bitmap * | bm, | ||
| UBYTE * | cb, | ||
| WORD | x, | ||
| WORD | y ) |
| void blitchk | ( | void | ) |
| void blitchk3 | ( | void | ) |
|
static |
|
static |
| void blitchknc | ( | void | ) |
|
static |
| BL_ALWAYS_INLINE LONG blitcoll | ( | const struct bb_shape * | shape, |
| const struct bb_bitmap * | bm, | ||
| UBYTE * | cb, | ||
| WORD | x, | ||
| WORD | y ) |
| BL_ALWAYS_INLINE void blitex | ( | const struct bb_shape * | shape, |
| const struct bb_bitmap * | bm, | ||
| UBYTE * | cb, | ||
| WORD | x, | ||
| WORD | y, | ||
| UWORD | bits ) |
| void blitlib_codeinit | ( | void | ) |
| void blitlib_doblit | ( | void | ) |
| void blitlib_doblitex | ( | void | ) |
| void blitlib_doblitmode | ( | void | ) |
| BL_ALWAYS_INLINE UBYTE ** blitplanes | ( | UBYTE * | cb, |
| UBYTE ** | plane, | ||
| UWORD | n, | ||
| ULONG | cookie, | ||
| ULONG | off, | ||
| UWORD | size ) |
| BL_ALWAYS_INLINE void blitsetup | ( | const struct bb_shape * | shape, |
| const struct bb_bitmap * | bm, | ||
| UBYTE * | cb, | ||
| WORD | x, | ||
| WORD | y, | ||
| struct blitstate * | st ) |
| BLITZ_ALIAS | ( | blitlib_doblitmode | , |
| doblitmode_c | ) |
| BLITZ_EP_MARK | ( | b_doblit_c | ) |
| BLITZ_EP_MARK | ( | b_doblitcoll_c | ) |
| BLITZ_EP_MARK | ( | b_doblitex_c | ) |
| BLITZ_EP_MARK | ( | b_doblock_c | ) |
| BL_ALWAYS_INLINE void block | ( | const struct bb_shape * | shape, |
| const struct bb_bitmap * | bm, | ||
| UBYTE * | cb, | ||
| WORD | x, | ||
| WORD | y ) |
|
static |
init: BlitMode $FCA (cookie cut) - MOVE $fca,d0 and on into doblitmode.
| caller_d0 | d0: what the caller had in d0 |
| void doblitcoll | ( | void | ) |
|
static |
BlitMode BLTCON0: the minterm/channel bits of Blit's BLTCON0 (ORed with the shift; CookieMode ... give the usual values).
| m | d0.w: the BLTCON0 value without the shift |
| void doblock | ( | void | ) |
| void docookiemode | ( | void | ) |
CookieMode, EraseMode, InvMode, SolidMode: the BlitMode values $FCA (cookie cut), $B0A (erase), $B5A (invert), $BFA (solid).
Inline MOVE.w mode,d0 (not a bug: the upper word of d0 stays; word results, the compiler uses only d0.w).
Speed: the helpers are inline (BL_ALWAYS_INLINE), so the blit state is in registers as in the original, and the Blitz mode code of Blit, Block and BlitColl saves no register (BLITZ_ENTRYPOINT; the original changes d0-d7 and a0 too, the register rule keeps a3-a7).
| void doerasemode | ( | void | ) |
| void doinvmode | ( | void | ) |
| void dosolidmode | ( | void | ) |
| MODE_FN | ( | docookiemode | , |
| "CookieMode" | ) |
| MODE_FN | ( | doerasemode | , |
| "EraseMode" | ) |
| MODE_FN | ( | doinvmode | , |
| "InvMode" | ) |
| MODE_FN | ( | dosolidmode | , |
| "SolidMode" | ) |
|
static |
| BL_ALWAYS_INLINE ULONG offset | ( | const struct bb_bitmap * | bm, |
| WORD | x, | ||
| WORD | y ) |
| BL_ALWAYS_INLINE void setmods | ( | const struct bb_shape * | shape, |
| const struct bb_bitmap * | bm, | ||
| UBYTE * | cb ) |
|
static |
| BLIT_LIBS |