|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
Data Structures | |
| struct | delta |
| struct | anim |
| struct | iffstuff |
Macros | |
| #define | HEADNODE(a) |
| #define | TOK_ilbminit ((LIB_ilbmifflib << 7) + 1) /* a0 = name -> a0 = info, d0 = 0: failed */ |
| #define | TOK_getpal ((LIB_palettelib << 7) + 3) /* a0 = name, a1 = palette */ |
| #define | TOK_iffclose ((LIB_iffiolib << 7) + 2) |
| #define | TOK_iffbyte ((LIB_iffiolib << 7) + 3) |
| #define | TOK_ifflong ((LIB_iffiolib << 7) + 5) |
| #define | TOK_ifffind ((LIB_iffiolib << 7) + 6) /* d0 = id -> d0 = length, NE: not found */ |
| #define | TOK_iffskip ((LIB_iffiolib << 7) + 7) /* d0 = number of bytes */ |
| #define | TOK_iffread ((LIB_iffiolib << 7) + 8) /* a0 = buffer, d0 = length */ |
| #define | ALIBJSR_Z(tok, r) |
| #define | OPAQUE(x) |
| #define | iffbyte() |
| #define | ifflong() |
| #define | iffskip(n) |
| #define | iffread(a, n) |
| #define | iffclose() |
Functions | |
| void | doframes (void) |
| Frames(Anim#): the number of frames (inline MOVE 8(a0),d0). | |
| void | freeanim (void) |
| Free Anim (the object's _free nullsub): free BODY and the delta nodes of the anim in a3. | |
| void | doanimload (struct anim *anim, ULONG name) |
| LoadAnim Anim#,Filename$: load an IFF ANIM (op 5) into the anim. | |
| void | doanimload2 (struct anim *anim, ULONG name, ULONG pal) |
| LoadAnim Anim#,Filename$,Palette#: LoadAnim, first the palette. | |
| void | doinitanim (void) |
| void | doinitanim2 (void) |
| void | donextframe (void) |
| void | animchk (void) |
| void | animchk2 (void) |
| void | animchk3 (void) |
| void | animchk4 (void) |
| static ULONG | mulu16 (UWORD a, UWORD b) |
| static ULONG | iffcall (UWORD tok, ULONG count, ULONG buf) |
| static ULONG | ifffind (ULONG id, int *found) |
| static ULONG | globalloc (ULONG size, ULONG flags) |
| static void | globfree (ULONG mem, ULONG size) |
| static void | freeanim_c (struct anim *anim) |
| static void | initanim (struct anim *anim, struct bb_bitmap *bm) |
| static void | doinitanim_c (struct anim *anim, struct bb_bitmap *bm) |
| InitAnim Anim#: decode BODY into the used bitmap. | |
| BLITZ_ALIAS (doinitanim, doinitanim_c) | |
| static void | doinitanim2_c (struct anim *anim, struct bb_bitmap *bm, struct bb_bitmap *bm2) |
| InitAnim Anim#,BitMap#: InitAnim, then the planes copied to the second bitmap (double buffering). | |
| BLITZ_ALIAS (doinitanim2, doinitanim2_c) | |
| static void | donextframe_c (struct anim *anim, struct bb_bitmap *bm) |
| NextFrame Anim#: apply the current delta to the used bitmap. | |
| BLITZ_ALIAS (donextframe, donextframe_c) | |
| BLITZ_ERRCHK_ASM (errors, "_err1: move.l #_mess1,d0\n trap #0\n" "_err2: move.l #_mess2,d0\n trap #0\n" "_err3: move.l #_mess3,d0\n trap #0\n" "_err4: move.l #_mess4,d0\n trap #0\n" "_err5: move.l #_mess5,d0\n trap #0\n") | |
| static void | animchk_c (struct anim *anim, struct bb_bitmap *bm) |
| static void | animchk2_c (struct anim *anim, struct bb_bitmap *bm2) |
| static void | animchk3_c (struct anim *anim, struct bb_bitmap *bm) |
| static void | animchk4_c (struct anim *anim) |
Variables | |
| static const char | mess6 [] = "Anim format not supported" |
| static const char | mess7 [] = "Can't Open Anim File" |
| #define ALIBJSR_Z | ( | tok, | |
| r ) |
| void iffbyte | ( | ) |
| void iffclose | ( | ) |
| void ifflong | ( | ) |
| #define iffread | ( | a, | |
| n ) |
| #define TOK_iffbyte ((LIB_iffiolib << 7) + 3) |
| #define TOK_iffclose ((LIB_iffiolib << 7) + 2) |
| #define TOK_ifffind ((LIB_iffiolib << 7) + 6) /* d0 = id -> d0 = length, NE: not found */ |
| #define TOK_ifflong ((LIB_iffiolib << 7) + 5) |
| void animchk | ( | void | ) |
| void animchk2 | ( | void | ) |
| void animchk3 | ( | void | ) |
| void animchk4 | ( | void | ) |
|
static |
| BLITZ_ALIAS | ( | doinitanim | , |
| doinitanim_c | ) |
| BLITZ_ALIAS | ( | doinitanim2 | , |
| doinitanim2_c | ) |
| BLITZ_ALIAS | ( | donextframe | , |
| donextframe_c | ) |
| BLITZ_ERRCHK_ASM | ( | errors | , |
| "_err1: move.l # | _mess1, | ||
| d0\n trap #0\n" "_err2:move.l # | _mess2, | ||
| d0\n trap #0\n" "_err3:move.l # | _mess3, | ||
| d0\n trap #0\n" "_err4:move.l # | _mess4, | ||
| d0\n trap #0\n" "_err5:move.l # | _mess5, | ||
| d0\n trap #0\n" | ) |
| void doanimload | ( | struct anim * | anim, |
| ULONG | name ) |
LoadAnim Anim#,Filename$: load an IFF ANIM (op 5) into the anim.
Amiga mode only (code+1). Frees the anim, opens the file with ilbmifflib ilbminit (BMHD -> width, height, depth, byte width), reads BODY, then ANHD (the operation byte must be 5; 19 bytes skipped, bit 1 of bits = EOR) and every following DLTA chunk into a delta node; frames = number of DLTAs - 1 (1 without ANHD). The file is read through iffiolib. a3 is left on the last delta node (or anim+18; not a bug). Errors: "Can't Open Anim File" (err7), "Anim format not supported" (err6), both in the normal code (fixed, #398: the original's err7 is in the error check area, err6's text too). Fixed (#400): a missing BODY is length 0 and nothing is allocated (the original took the "not found" -1 as the length).
| void doanimload2 | ( | struct anim * | anim, |
| ULONG | name, | ||
| ULONG | pal ) |
| void doframes | ( | void | ) |
Frames(Anim#): the number of frames (inline MOVE 8(a0),d0).
a0 = the anim (!libs {animlib,$1080}); d0.w = the number of DLTA chunks - 1 (1 without ANHD). Error (debugger, animchk4): "Uninitialized Anim".
| void doinitanim | ( | void | ) |
| void doinitanim2 | ( | void | ) |
InitAnim Anim#,BitMap#: InitAnim, then the planes copied to the second bitmap (double buffering).
a3 is left in the last plane of the second bitmap (not a bug). Errors (debugger, animchk2): as InitAnim, checked for the second bitmap.
InitAnim Anim#: decode BODY into the used bitmap.
BODY is decoded as ByteRun1, or copied row by row for the BMHD compression 0, and a run ends at the end of the row (fixed, #397: the original decoded every BODY as ByteRun1 and wrote a long run behind the row); the current delta becomes the first one; an anim without BODY data decodes nothing (fixed, #400, #402: a missing BODY or a dimension 0, the original ran its counters 65536 times). a3 is left behind the BODY data (not a bug). Errors (debugger, animchk): "Uninitialized Anim", "Uninitialized BitMap", "BitMap not large enough for ANIM".
| void donextframe | ( | void | ) |
NextFrame Anim#: apply the current delta to the used bitmap.
Per plane the column ops skip/uniq/same, written (MOVE) or EORed; then the next node, after the last one the SECOND node (not a bug: the ANIM op-5 double-buffer loop, the last two deltas lead back to frames 0/1). Fixed (#401): the first node if there is no second one (the original makes the current delta 0), and nothing at all without a current delta. a3 is left on the current (or first) node (not a bug). Errors (debugger, animchk3): "Anim has only 1 frame", "Anim not Initialized", then as InitAnim.
| void freeanim | ( | void | ) |
Free Anim (the object's _free nullsub): free BODY and the delta nodes of the anim in a3.
Only a loaded anim (width not 0); width is cleared. Fixed (#399): the next pointer of a delta node is read before the node is freed (the original read it after the FreeMem).
|
static |
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
|
static |
|
static |