|
| void | _InitAnim2 (void) |
| void | _InitAnim (void) |
| void | _InitAnim3 (void) |
| void | _NextAnimFrame (void) |
| void | _AnimLoop (void) |
| void | _CountFrames (void) |
| void | _AnimDepth (void) |
| void | _AnimWidth (void) |
| void | _AnimHeight (void) |
| void | xychk (void) |
| void | nextchk (void) |
| static void | codeinit (void) |
| | init: no animation, AnimLoop on.
|
| static LONG | initfindchunk (UBYTE *chunk, ULONG id) |
| static ULONG | padded (const UBYTE *data, ULONG len) |
| static UBYTE * | nextchunk (UBYTE *p, UBYTE *end) |
| static LONG | fcloop (UBYTE *p, ULONG id, UBYTE **data) |
| static LONG | findchunk (ULONG id, UBYTE **data) |
| static LONG | findnextchunk (ULONG id, UBYTE **data) |
| static int | oddchunk (UBYTE *form) |
| static LONG | findbmhd (ULONG address, struct BitMapHeader **data) |
| ULONG | c_AnimDepth (ULONG address) |
| | RIAnimDepth address: the depth (bmh_Depth) of the ANIM's first frame.
|
| ULONG | c_AnimWidth (ULONG address) |
| | RIAnimWidth address: the width (bmh_Width) of the ANIM's first frame.
|
| ULONG | c_AnimHeight (ULONG address) |
| | RIAnimHeight address: the height (bmh_Height) of the ANIM's first frame.
|
| void | c_AnimLoop (UBYTE on) |
| | AnimLoop On|Off: go on with the third frame at the end of the ANIM (default On).
|
| BB_BOOL | c_InitAnim (ULONG address, ULONG bm, ULONG pal, ULONG offset) |
| | RIAnimInit address,bitmap#,palette#,xy_offset: show the first frame of an ANIM.
|
| BB_BOOL | c_InitAnim2 (ULONG address, ULONG bm, ULONG pal) |
| | RIAnimInit address,bitmap#,palette#: c_InitAnim() with offset 0.
|
| BB_BOOL | c_InitAnim3 (ULONG address, ULONG bm, ULONG pal, ULONG x, ULONG y, const struct BitMap *bitmap) |
| | RIAnimInit address,bitmap#,palette#,x,y: c_InitAnim() at the pixel position x,y.
|
| ULONG | c_CountFrames (void) |
| | RIAnimFrameCount: the number of frames of the ANIM of the last RIAnimInit.
|
| static void | plane5 (const UBYTE *ops, UBYTE *column, ULONG mod) |
| static void | plane7 (const UBYTE *ops, UBYTE *column, const ULONG *data, ULONG mod) |
| static void | plane7short (const UBYTE *ops, UBYTE *column, const UWORD *data, ULONG mod) |
| static void | planes7 (UBYTE *body, int kind, ULONG mod) |
| static int | unpackanim (UBYTE *dlta, int kind) |
| static UBYTE * | otherchunks (UBYTE *chunk) |
| static UBYTE * | framestep (UBYTE *p) |
| static UBYTE * | nextform (UBYTE *chunk) |
| ULONG | c_NextAnimFrame (struct BitMap *bitmap) |
| | RINextAnimFrame bitmap#: apply the DLTA of the next frame to the bitmap.
|
| static void | xychk_c (ULONG x, ULONG y, const struct BitMap *bitmap) |
| | The error check of RIAnimInit's x,y form (debugger only).
|
| static void | nextchk_c (const struct BitMap *bitmap) |
| | The error check of RINextAnimFrame (debugger only).
|
| BB_BOOL c_InitAnim |
( |
ULONG | address, |
|
|
ULONG | bm, |
|
|
ULONG | pal, |
|
|
ULONG | offset ) |
RIAnimInit address,bitmap#,palette#,xy_offset: show the first frame of an ANIM.
Finds the first frame (FORM ILBM in the FORM ANIM) and its BMHD (in that frame; fixed #511: the original searched up to the end of the ANIM), unpacks it into the bitmap with RIPackLib's UnpackIFF (form 1: d0 source, d1 bitmap#, d2 -1 lines, d3 offset) and sets the palette with ILBMPalette (d0 source, d1 palette#), both through ALibJsr; then remembers the second and third frame (the first if there are none). RIAnimInit fails when UnpackIFF refuses the bitmap (fixed #1106: the original dropped its result): too narrow (fewer bytes per row than the frame's word-aligned row), too shallow or without plane 0; the height is not checked (UnpackIFF unpacks as many rows as the bitmap has). ILBMPalette's result is not looked at, as in the original. A failed RIAnimInit leaves no animation: RIAnimFrameCount and RINextAnimFrame return 0 (fixed #512: the original kept the ANIM's address and end, and the frame pointers of the animation before). The original returns to the caller's a1 for a chunk "pointed at directly" (#513, DIFF: -1 here).
- Parameters
-
| address | d0: the ANIM file in memory |
| bm | d1: bitmap# (its low byte is kept) |
| pal | d2: palette# (its low byte is kept) |
| offset | d3: the byte offset into each plane |
- Returns
- d0: BB_TRUE, BB_FALSE if there is no ANIM with an ILBM and BMHD, the BMHD depth is 0 or above 8 (fixed #509) or its width 0 (fixed #507), UnpackIFF refuses the bitmap (fixed #1106), or a chunk of the ANIM or of a frame starts at an odd address (fixed #1119)
| BB_BOOL c_InitAnim3 |
( |
ULONG | address, |
|
|
ULONG | bm, |
|
|
ULONG | pal, |
|
|
ULONG | x, |
|
|
ULONG | y, |
|
|
const struct BitMap * | bitmap ) |
RIAnimInit address,bitmap#,palette#,x,y: c_InitAnim() at the pixel position x,y.
The offset is BytesPerRow * y (MULU.w: the low words) + x >> 3 (ASR.l); the bitmap# is d1 / 64 with DIVU.w, which overflows (no change) for numbers of 64 * 65536 and above. A position outside the bitmap is the programmer's: with runtime error checking xychk refuses it (fixed #514); an odd byte offset for an ANIM7 frame is refused by RINextAnimFrame's check, nextchk (fixed #1122).
- Parameters
-
| address | d0: the ANIM file in memory |
| bm | d1: bitmap# * 64 (pd1) |
| pal | d2: palette# |
| x | d3: the x position in pixels |
| y | d4: the y position in lines |
| bitmap | a0: the bitmap object (!bmap {0,1}) |
- Returns
- d0: as c_InitAnim()
| ULONG c_NextAnimFrame |
( |
struct BitMap * | bitmap | ) |
|
RINextAnimFrame bitmap#: apply the DLTA of the next frame to the bitmap.
ANHD operation 5 or 65 (byte vertical delta) or 7 (short or long vertical delta by bit 0 of the ANHD bits; fixed #504: the original always took the long form) on the planes (+ the offset of RIAnimInit); a CMAP of the frame goes through ILBMPalette. Chunks of the ANIM that are no FORM are skipped (fixed #1116: the original took one between two frames as the end). At the end of the ANIM it goes on with the third frame if AnimLoop is on, else returns 0. ANIM5 has the byte columns of the word-aligned row (fixed #507), ANIM7's short form the words of the row (fixed #504), its long form the long columns of that row, none up to 16 pixels (fixed #1115: the original took width >> 5 with ASR.w, dropping the rest of the row and giving 65536 columns below 32 pixels; the last word of a row with an odd number of words is not updated). BUG(orig): a run or copy count of 0 is 256 (#508). The depth is 1 to 8 (fixed #509: RIAnimInit refuses 0 and above 8). Other chunks between ANHD (and CMAP) and the DLTA are skipped inside the frame, a CMAP among them goes through ILBMPalette; a frame without DLTA returns 0 (fixed #515: the original returned without restoring its 14 saved registers, through the saved d1). The steps over ANHD and CMAP stay inside the frame: a frame too short for its ILBM and ANHD fields, or an ANHD or CMAP whose length leaves no chunk header in the frame, returns 0 (fixed #1117: the original stepped by the length and read the next chunk anywhere). A DLTA whose plane offsets leave it returns 0 (fixed #1120; the ops inside the columns stay unchecked, BUG(orig) (#1120)), so does an ANIM7 DLTA with an odd data list offset (fixed #1121). With runtime error checking nextchk refuses an ANIM7 frame at an odd plane address (fixed #1122).
- Parameters
-
| bitmap | a0: the bitmap object (!bmap {0,0}) |
- Returns
- d0: -1 if a delta was applied, else 0
init: no animation, AnimLoop on.
Fixed (#1107): the original has no init, so a second run of a program with the library still loaded (from the editor) started with the animation of the run before: RIAnimFrameCount and RINextAnimFrame before an RIAnimInit walked it (perhaps freed memory), and an AnimLoop Off of the run before stayed off (the manual's default is on). Clears with CLR.l/ST on absolute addresses: no register changes.
| void nextchk_c |
( |
const struct BitMap * | bitmap | ) |
|
|
static |
The error check of RINextAnimFrame (debugger only).
Fixed (#1122), not in the original: RIAnimInit adds its offset (the x,y form: BytesPerRow * y + x >> 3; the xy_offset form: the offset as given) to the plane pointers, and the ANIM7 decoders write words and longs through them: an odd address was an address error on a 68000. ANIM5 writes bytes and plays at any offset. The check finds the coming frame as RINextAnimFrame does (nextanimframe, a chunk that is no FORM skipped, at the end the third frame with AnimLoop on) and looks at the operation of its ANHD; a frame RINextAnimFrame refuses before its DLTA (no frame, too short, no ANHD) passes. The release code is unchanged (an invalid argument, D-005).
Errors: "Animation position on an odd byte for ANIM7" (the coming frame is ANIM7 and a plane pointer of the bitmap plus the offset is odd, for a plane of the animation's depth).
- Parameters
-
| bitmap | a0: the bitmap object (!bmap {0,0}) |
| void xychk_c |
( |
ULONG | x, |
|
|
ULONG | y, |
|
|
const struct BitMap * | bitmap ) |
|
static |
The error check of RIAnimInit's x,y form (debugger only).
Fixed (#514), not in the original (rianimlib had no error check area): the position becomes the byte offset BytesPerRow * y (MULU.w of the low words) + x >> 3 into every plane, without a look at the bitmap; a negative y or one of 65536 and above gave an offset of up to 65535 rows, and UnpackIFF and every RINextAnimFrame wrote there. The release code is unchanged (an invalid argument, D-005).
Errors: "Animation position outside the bitmap" (x not in 0 to the bitmap's width in pixels - 1, or y not in 0 to its rows - 1).
- Parameters
-
| x | d3: the x position in pixels |
| y | d4: the y position in lines |
| bitmap | a0: the bitmap object (!bmap {0,1}) |