BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
shapeslib.c File Reference
#include "blitzlib.h"
#include "blitzobj.h"
#include <stddef.h>
#include <proto/dos.h>
#include <proto/graphics.h>

Data Structures

struct  xregs

Macros

#define __NOLIBBASE__
#define AMIGAONLY(entry)
#define XJSR(tok, r)
#define TOK_extbitmap   ((LIB_bitmaplib << 7) + 4)
#define TOK_scroll   ((LIB_scrolllib << 7) + 2)
#define TOK_palload   ((LIB_palettelib << 7) + 3)
#define TOK_ilbminit   ((LIB_ilbmifflib << 7) + 1)
#define TOK_ilbmgetbyte   ((LIB_ilbmifflib << 7) + 2)
#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)
#define TOK_iffskip   ((LIB_iffiolib << 7) + 7)
#define SW(s, o)
#define SL(s, o)
#define SP(s, o)
#define HANDLES(s)
#define DOSBase   dosbase /* for proto/dos.h */
#define IJSRZ(tok, d0v, a0v, zp)
#define IJSR(tok, d0v, a0v)

Functions

void doshload (void)
void doshload2 (void)
void docookie (void)
void doshapew (void)
 ShapeWidth(Shape#) - the shape's pixel width.
void doshapeh (void)
 ShapeHeight(Shape#) - the shape's pixel height (only the low word of d0, as ShapeWidth).
void dohandle (void)
 Handle Shape#,X,Y - set the shape's handle; a3 = the shape.
void doautocookie (void)
void docopyshape (void)
void dogetashape (void)
void b_getashape (void)
void dosaveshapes (void)
void doloadshapes (void)
void doloadshapes2 (void)
void domidhandle (void)
void _cludgeshapes (void)
void _cludgeshapes2 (void)
void _initshape (void)
void shapeslib_codeinit (void)
void freeashape (void)
void cookiechk (void)
void initchk (void)
void funcchk (void)
void gschk (void)
void schkz (void)
static void * globalloc (ULONG size, ULONG flags)
static void globfree (void *mem, ULONG size)
static void codeinit_c (void)
 Library init: AutoCookie on.
static ULONG shsize (const struct bb_shape *s)
static void freeashape_ (struct bb_shape *s)
static void freeashape_c (void)
 Object free routine (_free) of a Shape: free its data and cookie.
static void cookie_ (struct bb_shape *s)
static void docookie_c (void)
 MakeCookie Shape# - make the shape's cookie, also nullsub +11 docookie for other libraries (shapetrixlib).
static void doautocookie_c (ULONG v)
 AutoCookie On|Off - make cookies automatically for the shapes of LoadShape(s), GetaShape, InitShape and DecodeShapes.
 BLITZ_ALIAS (doautocookie, doautocookie_c)
static void domidhandle_c (void)
 MidHandle Shape# - put the handle in the middle (width/2, height/2); a3 = the shape.
 BLITZ_ALIAS (domidhandle, domidhandle_c)
static void nall (struct bb_shape *from, struct bb_shape *to, UWORD ptroff, ULONG size)
static void copyshape2 (struct bb_shape *from, struct bb_shape *to)
static void docopyshape_c (struct bb_shape *dst)
 CopyShape Shape#,Shape# - copy the first shape (a3) into the second.
 BLITZ_ALIAS (docopyshape, docopyshape_c)
static void initshape_c (ULONG w, ULONG h, ULONG d)
 InitShape Shape#,Width,Height,Depth - create an empty shape.
 BLITZ_ALIAS (_initshape, initshape_c)
static void getashape (struct bb_shape *shape, struct bb_bitmap *bm, UWORD x, UWORD y, UWORD w, UWORD h)
void b_getashape_c (ULONG x, ULONG y, ULONG w, ULONG h, struct bb_bitmap *bm)
 GetaShape Shape#,X,Y,Width,Height - make a shape from an area of the used bitmap (Blitz mode; also nullsub +14 b_getashape).
void a_getashape_c (ULONG x, ULONG y, ULONG w, ULONG h, struct bb_bitmap *bm, struct GfxBase *gfx)
 GetaShape in Amiga mode: OwnBlitter, the Blitz mode routine, wait, DisownBlitter.
static void dosaveshapes_c (struct bb_shape *last, const char *name, struct DosLibrary *dos)
 SaveShapes Shape#,Shape#,Filename$ - save the shapes a3..a2.
 BLITZ_ALIAS (dosaveshapes, dosaveshapes_c)
static void loadshapes (struct bb_shape *s, struct bb_shape *last, const char *name, struct DosLibrary *dos)
static void doloadshapes_c (struct bb_shape *last, const char *name, struct DosLibrary *dos)
 LoadShapes Shape#,Shape#,Filename$ - load the shapes a3..a2 from a SaveShapes file.
 BLITZ_ALIAS (doloadshapes, doloadshapes_c)
static void doloadshapes2_c (UBYTE *base, ULONG max, const char *name, struct DosLibrary *dos)
 LoadShapes Shape#,Filename$ - load shapes from a3 on up to the last shape object (as doloadshapes_c).
 BLITZ_ALIAS (doloadshapes2, doloadshapes2_c)
static void cludge (struct bb_shape *shape, struct bb_shape *last, UBYTE *mem)
static void cludgeshapes_c (struct bb_shape *last, UBYTE *mem)
 DecodeShapes Shape#,Shape#,MemoryLocation - the shapes a3..a2 from a SaveShapes file in memory.
 BLITZ_ALIAS (_cludgeshapes, cludgeshapes_c)
static void cludgeshapes2_c (UBYTE *base, ULONG max, UBYTE *mem)
 DecodeShapes Shape#,MemoryLocation - as cludgeshapes_c from a3 on up to the last shape object.
 BLITZ_ALIAS (_cludgeshapes2, cludgeshapes2_c)
static void doshload_ (struct bb_shape *shape, const char *name, const struct bb_shape *last)
static void doshload_c (struct bb_shape *shape, const char *name, UBYTE *base, ULONG max)
 LoadShape Shape#,Filename$ - load an ILBM (or ANIM) as a shape.
 BLITZ_ALIAS (doshload, doshload_c)
static void doshload2_c (struct bb_shape *shape, const char *name, void *pal, UBYTE *base, ULONG max)
 LoadShape Shape#,Filename$,Palette# - load the file's palette (palettelib +3: a0 = file name, a1 = palette), then as doshload_c.
 BLITZ_ALIAS (doshload2, doshload2_c)
static void schkz_c (struct bb_shape *last)
static void funcchk_c (const struct bb_shape *s)
static void cookiechk_c (void)
static int toobig (UWORD w, UWORD h)
static void initchk_c (ULONG w, ULONG h, ULONG d)
static void gschk_c (ULONG x, ULONG y, ULONG w, ULONG h, struct bb_bitmap *bm)

Variables

static UWORD autocook = 0xffff
struct { 
   struct bb_bitmap   bm 
   UWORD   h 
   UWORD   w 
} tb
static const char mess10 [] = "Shapes file at memory location 0? NOWAY!"
static const char mess2 [] = "Can't open Shapes File"
static const char mess3 [] = "Can't Read/Write Shapes File"
static const char mess14 [] = "Illegal Shape Depth"
static const char mess15 [] = "Illegal Shape Size"
static const char mess7 [] = "ANIM format not supported"
static struct DosLibrary * dosbase
static UWORD xordelta
static ULONG planeoffs [8]

Macro Definition Documentation

◆ __NOLIBBASE__

#define __NOLIBBASE__

◆ AMIGAONLY

#define AMIGAONLY ( entry)
Value:
((char *)(entry) + 1)
static struct snowfield * entry(ULONG n)
Definition risnowlib.c:205

◆ DOSBase

#define DOSBase   dosbase /* for proto/dos.h */

◆ HANDLES

#define HANDLES ( s)
Value:
(*(ULONG *)&(s)->handlex)

◆ IJSR

#define IJSR ( tok,
d0v,
a0v )
Value:
({ struct xregs r_ = { .d0 = (d0v), .a0 = (ULONG)(a0v), \
.a3 = (ULONG)blitz_string }; XJSR(tok, r_); r_.d0; })
register UBYTE * blitz_string
Definition blitzlib.h:270
#define XJSR(tok, r)
Definition shapeslib.c:287
Definition shapeslib.c:280
ULONG d0
Definition shapeslib.c:281

◆ IJSRZ

#define IJSRZ ( tok,
d0v,
a0v,
zp )
Value:
({ struct xregs r_ = { .d0 = (d0v), .a0 = (ULONG)(a0v), \
.a3 = (ULONG)blitz_string }; XJSR(tok, r_); *(zp) = r_.z; r_.d0; })
UBYTE z
Definition shapeslib.c:282

◆ SL

#define SL ( s,
o )
Value:
(*(ULONG *)((UBYTE *)(s) + (o)))

◆ SP

#define SP ( s,
o )
Value:
(*(UBYTE **)((UBYTE *)(s) + (o)))

◆ SW

#define SW ( s,
o )
Value:
(*(UWORD *)((UBYTE *)(s) + (o)))

◆ TOK_extbitmap

#define TOK_extbitmap   ((LIB_bitmaplib << 7) + 4)

◆ TOK_iffbyte

#define TOK_iffbyte   ((LIB_iffiolib << 7) + 3)

◆ TOK_iffclose

#define TOK_iffclose   ((LIB_iffiolib << 7) + 2)

◆ TOK_ifffind

#define TOK_ifffind   ((LIB_iffiolib << 7) + 6)

◆ TOK_ifflong

#define TOK_ifflong   ((LIB_iffiolib << 7) + 5)

◆ TOK_iffskip

#define TOK_iffskip   ((LIB_iffiolib << 7) + 7)

◆ TOK_ilbmgetbyte

#define TOK_ilbmgetbyte   ((LIB_ilbmifflib << 7) + 2)

◆ TOK_ilbminit

#define TOK_ilbminit   ((LIB_ilbmifflib << 7) + 1)

◆ TOK_palload

#define TOK_palload   ((LIB_palettelib << 7) + 3)

◆ TOK_scroll

#define TOK_scroll   ((LIB_scrolllib << 7) + 2)

◆ XJSR

#define XJSR ( tok,
r )
Value:
do { \
register struct xregs *_r __asm("a6") = &(r); \
__asm volatile("movem.l a3-a4/a6,-(sp)\n\t" \
"movem.l (a6),d0-d3/a0-a3\n\t" \
"jsr _blitz_tok+%c1\n\t" \
"move.l 8(sp),a6\n\t" \
"seq 32(a6)\n\t" \
"move.l d0,(a6)\n\t" \
"move.l d1,4(a6)\n\t" \
"move.l a0,16(a6)\n\t" \
"move.l a1,20(a6)\n\t" \
"movem.l (sp)+,a3-a4/a6" \
: : "a"(_r), "i"(BL_TOKVAL(tok, 0)) \
: "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "a0", "a1", "a2", \
"cc", "memory"); \
} while (0)
#define BL_TOKVAL(tok, form)
Definition blitzlib.h:526

Function Documentation

◆ _cludgeshapes()

void _cludgeshapes ( void )

◆ _cludgeshapes2()

void _cludgeshapes2 ( void )

◆ _initshape()

void _initshape ( void )

◆ a_getashape_c()

void a_getashape_c ( ULONG x,
ULONG y,
ULONG w,
ULONG h,
struct bb_bitmap * bm,
struct GfxBase * gfx )

GetaShape in Amiga mode: OwnBlitter, the Blitz mode routine, wait, DisownBlitter.

Parameters
gfxa6: graphics.library

◆ b_getashape()

void b_getashape ( void )

◆ b_getashape_c()

void b_getashape_c ( ULONG x,
ULONG y,
ULONG w,
ULONG h,
struct bb_bitmap * bm )

GetaShape Shape#,X,Y,Width,Height - make a shape from an area of the used bitmap (Blitz mode; also nullsub +14 b_getashape).

a3 = the shape; the old one is freed. bitmaplib +4 (extbitmap) creates a bitmap of the area's size in tbmap, scrolllib Scroll copies the area into it, and its planes become the shape's data; then a blitter wait ("20/8/93 waitblit after getashape b4 makecookie") and the cookie with AutoCookie on.

Errors (gschk, debugger only): "Uninitialized BitMap", "Cannot GetaShape from an interleaved Bitmap", "Illegal area for GetaShape", "Shape too Big" (a plane of 64K or more with the extra word per row, more than 1023 rows or 62 words; fixed, #1047, #1046: the original has no check).

Parameters
xd1.w: x
yd2.w: y
wd3.w: the width
hd4.w: the height
bma2: the used bitmap

◆ BLITZ_ALIAS() [1/11]

BLITZ_ALIAS ( _cludgeshapes ,
cludgeshapes_c  )

◆ BLITZ_ALIAS() [2/11]

BLITZ_ALIAS ( _cludgeshapes2 ,
cludgeshapes2_c  )

◆ BLITZ_ALIAS() [3/11]

BLITZ_ALIAS ( _initshape ,
initshape_c  )

◆ BLITZ_ALIAS() [4/11]

BLITZ_ALIAS ( doautocookie ,
doautocookie_c  )

◆ BLITZ_ALIAS() [5/11]

BLITZ_ALIAS ( docopyshape ,
docopyshape_c  )

◆ BLITZ_ALIAS() [6/11]

BLITZ_ALIAS ( doloadshapes ,
doloadshapes_c  )

◆ BLITZ_ALIAS() [7/11]

BLITZ_ALIAS ( doloadshapes2 ,
doloadshapes2_c  )

◆ BLITZ_ALIAS() [8/11]

BLITZ_ALIAS ( domidhandle ,
domidhandle_c  )

◆ BLITZ_ALIAS() [9/11]

BLITZ_ALIAS ( dosaveshapes ,
dosaveshapes_c  )

◆ BLITZ_ALIAS() [10/11]

BLITZ_ALIAS ( doshload ,
doshload_c  )

◆ BLITZ_ALIAS() [11/11]

BLITZ_ALIAS ( doshload2 ,
doshload2_c  )

◆ cludge()

void cludge ( struct bb_shape * shape,
struct bb_shape * last,
UBYTE * mem )
static

◆ cludgeshapes2_c()

void cludgeshapes2_c ( UBYTE * base,
ULONG max,
UBYTE * mem )
static

DecodeShapes Shape#,MemoryLocation - as cludgeshapes_c from a3 on up to the last shape object.

Fixed (#999): the last shape is a2 + (max - 1) << 5 as a long, as in doloadshapes2_c. Address 0: runtime error, as cludgeshapes_c (#270).

Parameters
basea2: shape 0
maxd2: the maximum
memd1: the address of the data

◆ cludgeshapes_c()

void cludgeshapes_c ( struct bb_shape * last,
UBYTE * mem )
static

DecodeShapes Shape#,Shape#,MemoryLocation - the shapes a3..a2 from a SaveShapes file in memory.

Stops silently at the first block that does not match (not a bug: the end of the sequence). Memory below 2 MB ($FFE00000 clear, chip RAM) is used in place and marked "cL" (never freed), above it is copied to CHIP memory. Cookie with AutoCookie on. Fixed (#267): +30 of a block is not taken over (a copied shape owns its data).

Address 0: runtime error "Shapes file at memory location 0? NOWAY!" (err10, in the normal code; the original branches into the error check area, fixed: #270).

Parameters
lasta2: the last shape
memd2: the address of the data

◆ codeinit_c()

void codeinit_c ( void )
static

Library init: AutoCookie on.

◆ cookie_()

void cookie_ ( struct bb_shape * s)
static

◆ cookiechk()

void cookiechk ( void )

◆ cookiechk_c()

void cookiechk_c ( void )
static

◆ copyshape2()

void copyshape2 ( struct bb_shape * from,
struct bb_shape * to )
static

◆ doautocookie()

void doautocookie ( void )

◆ doautocookie_c()

void doautocookie_c ( ULONG v)
static

AutoCookie On|Off - make cookies automatically for the shapes of LoadShape(s), GetaShape, InitShape and DecodeShapes.

Parameters
vd0.w: <> 0 = on

◆ docookie()

void docookie ( void )

◆ docookie_c()

void docookie_c ( void )
static

MakeCookie Shape# - make the shape's cookie, also nullsub +11 docookie for other libraries (shapetrixlib).

a3 = the shape. An old cookie is freed; the new one (bytes per plane, CHIP, cleared, not checked) is the OR of all planes.

Errors: "Uninitialized Shape" (cookiechk, debugger only).

◆ docopyshape()

void docopyshape ( void )

◆ docopyshape_c()

void docopyshape_c ( struct bb_shape * dst)
static

CopyShape Shape#,Shape# - copy the first shape (a3) into the second.

The destination is freed, the 32 byte block copied, then the data and the cookie are copied into new CHIP memory (not checked).

Fixed (#268): +30 of the copy is cleared (the original copied "cL" of a DecodeShapes shape along, and the copy was never freed). Errors: "Uninitialized Shape" (cookiechk, debugger only).

Parameters
dsta2: the destination shape

◆ dogetashape()

void dogetashape ( void )

◆ dohandle()

void dohandle ( void )

Handle Shape#,X,Y - set the shape's handle; a3 = the shape.

Errors: "Uninitialized Shape" (cookiechk, debugger only).

In: a3 the shape, d1.w the handle x, d2.w the handle y

◆ doloadshapes()

void doloadshapes ( void )

◆ doloadshapes2()

void doloadshapes2 ( void )

◆ doloadshapes2_c()

void doloadshapes2_c ( UBYTE * base,
ULONG max,
const char * name,
struct DosLibrary * dos )
static

LoadShapes Shape#,Filename$ - load shapes from a3 on up to the last shape object (as doloadshapes_c).

Fixed (#999): the last shape is a2 + (max - 1) << 5 as a long (the maximum is the low word of d2); the original adds the offset as a word (from a maximum of 1025 on the last shape lies before the table).

Parameters
basea2: shape 0
maxd2: the maximum
named1: the file name
dosa6: dos.library

◆ doloadshapes_c()

void doloadshapes_c ( struct bb_shape * last,
const char * name,
struct DosLibrary * dos )
static

LoadShapes Shape#,Shape#,Filename$ - load the shapes a3..a2 from a SaveShapes file.

Every block is checked (planesize, size), the data loaded into CHIP memory (not checked), the cookie made with AutoCookie on; the end of the file ends the loading.

Fixed (#267): +30 of the block is cleared (the original kept "cL" of a saved DecodeShapes shape, and the data was never freed). Errors: "Can't open Shapes File", "Can't Read/Write Shapes File" (in the normal code); "First shape must be lower than second" (schkz, debugger only).

Parameters
lasta2: the last shape
named2: the file name
dosa6: dos.library

◆ domidhandle()

void domidhandle ( void )

◆ domidhandle_c()

void domidhandle_c ( void )
static

MidHandle Shape# - put the handle in the middle (width/2, height/2); a3 = the shape.

Errors: "Uninitialized Shape" (cookiechk, debugger only).

◆ dosaveshapes()

void dosaveshapes ( void )

◆ dosaveshapes_c()

void dosaveshapes_c ( struct bb_shape * last,
const char * name,
struct DosLibrary * dos )
static

SaveShapes Shape#,Shape#,Filename$ - save the shapes a3..a2.

Every shape's 32 byte block, followed by its data (+26 bytes) for a used shape.

Errors: "Can't open Shapes File", "Can't Read/Write Shapes File" (in the normal code with their texts, fixed: #953); "First shape must be lower than second" (schkz, debugger only).

Parameters
lasta2: the last shape
named2: the file name
dosa6: dos.library

◆ doshapeh()

void doshapeh ( void )

ShapeHeight(Shape#) - the shape's pixel height (only the low word of d0, as ShapeWidth).

Errors: "Uninitialized Shape" (funcchk, debugger only).

In: a0 the shape Out: d0.w the height

◆ doshapew()

void doshapew ( void )

ShapeWidth(Shape#) - the shape's pixel width.

MOVE (a0),d0 - only the low word (not a bug: a word function, the compiler uses only d0.w).

Errors: "Uninitialized Shape" (funcchk, debugger only).

In: a0 the shape Out: d0.w the width

◆ doshload()

void doshload ( void )

◆ doshload2()

void doshload2 ( void )

◆ doshload2_c()

void doshload2_c ( struct bb_shape * shape,
const char * name,
void * pal,
UBYTE * base,
ULONG max )
static

LoadShape Shape#,Filename$,Palette# - load the file's palette (palettelib +3: a0 = file name, a1 = palette), then as doshload_c.

Parameters
shapea0: the shape
named1: the file name
pala1: the palette object
basea2: the shape table (object 0)
maxd3: the maximum number of shapes

◆ doshload_()

void doshload_ ( struct bb_shape * shape,
const char * name,
const struct bb_shape * last )
static

◆ doshload_c()

void doshload_c ( struct bb_shape * shape,
const char * name,
UBYTE * base,
ULONG max )
static

LoadShape Shape#,Filename$ - load an ILBM (or ANIM) as a shape.

Through ilbmifflib (ilbminit, ilbmgetbyte) and iffiolib; data in CHIP memory (not checked), cookie with AutoCookie on. After the first frame every "ANHD" (ANIM op 5) gives a delta frame in the NEXT shape object (a copy of the frame its interleave names with the DLTA applied, XOR or set per the bits of its ANHD; the operation is checked in the first ANHD). Extension (#1166): the interleave of each ANHD is taken as the ANIM specification defines it, n frames back (0 = 2, double buffering); a frame with fewer frames before it is made from the first frame. The original took only 1 ("Illegal ANIM interleave value"). Fixed (#266): each frame takes the XOR bit of its own ANHD; the original read only the first ANHD's. Fixed (#265): the frames stop at the last shape object (the rest of the file is not read); the original wrote them behind the shape table.

Fixed (#263): the plane steps are unsigned (the original's word steps went backwards for planes of 32K and more); an ILBM with a plane of 64K or more is refused with "Can't Read/Write Shapes File" (the shape keeps the bytes per plane in a word). Fixed (#1055): the plane with the extra word of every row ((bytes per row + 2) x height, +24) is tested, as by the error checks of InitShape and GetaShape.

BUG(orig): "BODY" is not checked, the decoder reads whatever follows (#264). Errors (in the normal code, their texts in the error area): "Can't open Shapes File", "ANIM format not supported" (op <> 5 in the first ANHD; it closes the file first and keeps the first frame loaded, fixed #1072: the original left the file open), "Can't Read/Write Shapes File" (a plane with the extra word of every row of 64K or more, fixed #263, #1055; more than 1023 rows or 62 words, fixed #1046), "Illegal Shape Depth" (0 planes, fixed #1052: the original wrote 65536 planes of every row behind a block of 0 bytes), "Illegal Shape Size" (a width or height of 0, fixed #1054: the original ran its row or byte loop 65536 times behind a block of 0 bytes); "Can't Read File" of ilbmifflib's ilbmgetbyte (a file that ends inside the BODY; it closes the file first, fixed #1065: the original left it open).

Parameters
shapea0: the shape (a3 for the IFF calls)
named1: the file name
basea2: the shape table (object 0)
maxd3: the maximum number of shapes

◆ freeashape()

void freeashape ( void )

◆ freeashape_()

void freeashape_ ( struct bb_shape * s)
static

◆ freeashape_c()

void freeashape_c ( void )
static

Object free routine (_free) of a Shape: free its data and cookie.

a3 = the shape. The width is cleared; the data is freed unless +30 is "cL" (DecodeShapes data in place), the cookie if there is one.

Fixed (#269): +30 is cleared for a "cL" shape too (the original left the mark, so a later shape in this object was never freed either).

◆ funcchk()

void funcchk ( void )

◆ funcchk_c()

void funcchk_c ( const struct bb_shape * s)
static

◆ getashape()

void getashape ( struct bb_shape * shape,
struct bb_bitmap * bm,
UWORD x,
UWORD y,
UWORD w,
UWORD h )
static

◆ globalloc()

void * globalloc ( ULONG size,
ULONG flags )
static

◆ globfree()

void globfree ( void * mem,
ULONG size )
static

◆ gschk()

void gschk ( void )

◆ gschk_c()

void gschk_c ( ULONG x,
ULONG y,
ULONG w,
ULONG h,
struct bb_bitmap * bm )
static

◆ initchk()

void initchk ( void )

◆ initchk_c()

void initchk_c ( ULONG w,
ULONG h,
ULONG d )
static

◆ initshape_c()

void initshape_c ( ULONG w,
ULONG h,
ULONG d )
static

InitShape Shape#,Width,Height,Depth - create an empty shape.

a3 = the shape; the old one is freed. Data cleared (CHIP, not checked), handle 0, a cleared cookie with AutoCookie on.

The sizes +22/+26 are the low words of MULU; the data is allocated with the long product. Errors (debugger, initchk): "Illegal Shape Depth" for a depth of 0 (fixed, #243 #74: the original had no check; a shape of depth 0 made the plane loops of the blit commands run 65536 times); "Illegal Shape Size" for a width or height of 0 and "Shape too Big" for a plane of 64K or more with the extra word per row (fixed, #1047: not checked in the original, the word sizes +22/+24 were wrong) or a shape taller than 1023 rows or wider than 62 words (992 pixels; fixed, #1046: the blit size word +8 overflowed).

Parameters
wd1.w: the width in pixels
hd2.w: the height
dd3.w: the depth

◆ loadshapes()

void loadshapes ( struct bb_shape * s,
struct bb_shape * last,
const char * name,
struct DosLibrary * dos )
static

◆ nall()

void nall ( struct bb_shape * from,
struct bb_shape * to,
UWORD ptroff,
ULONG size )
static

◆ schkz()

void schkz ( void )

◆ schkz_c()

void schkz_c ( struct bb_shape * last)
static

◆ shapeslib_codeinit()

void shapeslib_codeinit ( void )

◆ shsize()

ULONG shsize ( const struct bb_shape * s)
static

◆ toobig()

int toobig ( UWORD w,
UWORD h )
static

Variable Documentation

◆ autocook

UWORD autocook = 0xffff
static

◆ bm

struct bb_bitmap bm

◆ dosbase

struct DosLibrary* dosbase
static

◆ h

UWORD h

◆ mess10

const char mess10[] = "Shapes file at memory location 0? NOWAY!"
static

◆ mess14

const char mess14[] = "Illegal Shape Depth"
static

◆ mess15

const char mess15[] = "Illegal Shape Size"
static

◆ mess2

const char mess2[] = "Can't open Shapes File"
static

◆ mess3

const char mess3[] = "Can't Read/Write Shapes File"
static

◆ mess7

const char mess7[] = "ANIM format not supported"
static

◆ planeoffs

ULONG planeoffs[8]
static

◆ [struct]

struct { ... } tb

◆ w

UWORD w

◆ xordelta

UWORD xordelta
static