BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
rimapeditorlib.c File Reference
#include "blitzlib.h"
#include "blitzobj.h"
#include "blitzexec.h"
#include <exec/memory.h>
#include <graphics/gfx.h>
#include <graphics/rastport.h>
#include <graphics/text.h>
#include <intuition/intuition.h>
#include <stddef.h>
#include <proto/graphics.h>

Data Structures

struct  mapobject

Macros

#define __NOLIBBASE__
#define GRAPHICS_BASE_NAME   gfx

Functions

void _shapetosquare (void)
void _shapemaskfill (void)
void _scanshapes (void)
void _scanmaxwidth (void)
void _scanmaxheight (void)
void _scanmaxdepth (void)
void _mapdatachanged (void)
 MapDataChanged: whether the used map has changed since the last load.
void _mapdatachanged2 (void)
void _fillbitplane (void)
void _newmap (void)
void _mapdataadr (void)
 MapDataAdr: the address of the used map's data (+10).
void _mapdataadr2 (void)
 MapDataAdr(x,y): the address of a map word.
void _mapdatasize (void)
 MapDataSize: the byte size of the used map's data.
void _mapobjwidth (void)
 MapObjWidth: the width of the used map.
void _mapobjheight (void)
 MapObjheight: the height of the used map.
void _mapgrab (void)
void _mapobjname (void)
void _setmapobjname (void)
void _mapobjviewx (void)
 MapObjViewX: the view x of the used map.
void _mapobjviewy (void)
 MapObjViewY: the view y of the used map.
void _OutText (void)
void _rubthroughmap1 (void)
 RubThroughMap: the rub-through map of the used map (+28).
void _rubthroughmap2 (void)
 RubThroughMap(mapobject#): sets the rub-through map of the used map.
void _setstencil (void)
void _candraw (void)
void _lastcandrawaddress (void)
 MapCanDrawAddr: the address of the map word of the last MapCanDraw (+24).
void _clearrubthroughmap (void)
 ClearRubThroughMap: removes the rub-through map of the used map.
void _OutTextPen (void)
void _OutTextCenter (void)
void _OutTextRight (void)
void rimapeditorlib_SetWindowDraw (void)
void _InitParse (void)
void rimapeditorlib_nextparsearg (void)
void _freemap (void)
void rimapeditorlib_libinit (void)
void rimapeditorlib_libfinit (void)
void candrawchk (void)
void mapgrabchk (void)
void mapdataadrchk (void)
void to1616chk (void)
void fillbpchk (void)
void newmapchk (void)
static ULONG rol1 (ULONG v)
static void libinit_c (void)
 init: opens graphics.library (any version).
static void libfinit_c (void)
 finit: closes graphics.library.
static void setstencil_c (const UBYTE *a)
 SetStencil array: the stencil of MapCanDraw.
static ULONG candraw_c (ULONG shapenum, UWORD x, UWORD y, struct mapobject *map)
 MapCanDraw(shape#,mapx,mapy): whether a shape can be drawn at a map position.
static ULONG scanshapes_c (ULONG shapenum, UWORD highest, const struct bb_shape *sh)
 ScanShapes(startnum,highest): the largest width/height/depth of a run of shapes.
static ULONG scanmaxwidth_c (ULONG incoming)
 ScanMaxWidth: the largest width of the last ScanShapes.
static ULONG scanmaxheight_c (ULONG incoming)
 ScanMaxheight: the largest height of the last ScanShapes.
static ULONG scanmaxdepth_c (ULONG incoming)
 ScanMaxdepth: the largest depth of the last ScanShapes.
static void shapetosquare_c (const struct bb_shape *src, struct bb_shape *dst)
 ShapeTo1616 source shape,dest shape: the left 16 pixels of a shape, 16 rows.
static void shapemaskfill_c (const struct bb_shape *sh)
 ShapeMaskFill shape#: sets the first 32 bytes (8 longs) of the shape's cookie.
static void fillbitplane_c (UWORD w, UWORD h, const struct BitMap *bm)
 FillBitplane bitmap#,width,height: a mesh in plane 0 of a bitmap.
static void freemap (struct mapobject *map)
static void freemap_c (struct mapobject *map)
 The MapObject's free routine (!libfin _free): frees a map.
static void newmap_c (UWORD w, UWORD h, UWORD bw, UWORD bh, ULONG name, UWORD used, const ULONG *lens, struct mapobject *map)
 CreateMap map#,width,height,bwidth,bheight,name$: creates a map and uses it.
static void mapgrab_c (const UBYTE *src, UWORD type, UWORD null, struct mapobject *map)
 MapDataGrab address,datasize,mapnull: fills the used map from memory.
static ULONG mapobjname_c (const struct mapobject *map)
 MapObjName$: the name of the used map.
static void setmapobjname_c (ULONG name, const ULONG *lens, struct mapobject *map)
 SetMapObjName$ name$: the name of the used map.
static ULONG mapdatachanged2_c (ULONG newstate, struct mapobject *map)
 MapDataChanged(newstate): sets the changed state of the used map.
static void outtext (struct Library *gfx, ULONG x, ULONG y, struct RastPort *rp, const UBYTE *s)
static UWORD textlength (struct Library *gfx, struct RastPort *rp, const UBYTE *s)
static void outtext_c (ULONG x, ULONG y, struct RastPort *rp, const UBYTE *s)
 MapOutText x,y,rastport,address/string: prints a text into a RastPort.
static void outtextcenter_c (ULONG x, ULONG y, struct RastPort *rp, const UBYTE *s)
 MapOutTextCenter x,y,rastport,address/string: as MapOutText, centred on x.
static void outtextright_c (ULONG x, ULONG y, struct RastPort *rp, const UBYTE *s)
 MapOutTextRight x,y,rastport,address/string: as MapOutText, ending at x.
static void outtextpen_c (ULONG rp, UWORD pen)
 MapOutTextPen rastport,pen: the pen of MapOutText.
static void setwindowdraw_c (UWORD mode, struct Window **win)
 SetWindowDraw window#,mode: the area pattern of the used window (0 normal, 1 meshed).
static void initparse_c (const UBYTE *s)
 M_InitParse string: the string for M_NextArg$.
static ULONG nextparsearg_c (void)
 M_NextArg$: the next comma separated argument of M_InitParse's string.
static void candrawchk_c (ULONG shapenum, UWORD x, UWORD y, const struct mapobject *map)
 The error check of MapCanDraw (debugger only).
static void mapgrabchk_c (const struct mapobject *map)
 The error check of MapDataGrab (debugger only).
static void mapdataadrchk_c (UWORD x, UWORD y, const struct mapobject *map)
 The error check of MapDataAdr(x,y) (debugger only).
static void to1616chk_c (const struct bb_shape *src, const struct bb_shape *dst)
 The error check of ShapeTo1616 (debugger only).
static void fillbpchk_c (UWORD w, UWORD h)
 The error check of FillBitplane (debugger only).
static void newmapchk_c (UWORD w)
 The error check of CreateMap (debugger only).

Variables

static struct Library * gfxbase
static const UBYTE * mapstencil
static UWORD maxwidth
static UWORD maxheight
static UWORD maxdepth
static const UWORD mypattern [2] = { 0xaaaa, 0x5555 }
struct { 
   UBYTE   parseadr [256] 
   UBYTE *   curadr 
} parse

Macro Definition Documentation

◆ __NOLIBBASE__

#define __NOLIBBASE__

◆ GRAPHICS_BASE_NAME

#define GRAPHICS_BASE_NAME   gfx

Function Documentation

◆ _candraw()

void _candraw ( void )

◆ _clearrubthroughmap()

void _clearrubthroughmap ( void )

ClearRubThroughMap: removes the rub-through map of the used map.

◆ _fillbitplane()

void _fillbitplane ( void )

◆ _freemap()

void _freemap ( void )

◆ _InitParse()

void _InitParse ( void )

◆ _lastcandrawaddress()

void _lastcandrawaddress ( void )

MapCanDrawAddr: the address of the map word of the last MapCanDraw (+24).

Result
d0: the address

◆ _mapdataadr()

void _mapdataadr ( void )

MapDataAdr: the address of the used map's data (+10).

Result
d0: the address

◆ _mapdataadr2()

void _mapdataadr2 ( void )

MapDataAdr(x,y): the address of a map word.

Inline: the data + (y*width)*2 + (x*2 as a word); no range check in the release code (a position outside the map is refused by mapdataadrchk with runtime error checking: fixed, under #892).

Result
d0: the address (d1 changed)

◆ _mapdatachanged()

void _mapdatachanged ( void )

MapDataChanged: whether the used map has changed since the last load.

Result
d0.w: the changed state

◆ _mapdatachanged2()

void _mapdatachanged2 ( void )

◆ _mapdatasize()

void _mapdatasize ( void )

MapDataSize: the byte size of the used map's data.

Inline: (width*2 as a word) * height (MULU.w).

Result
d0: the size

◆ _mapgrab()

void _mapgrab ( void )

◆ _mapobjheight()

void _mapobjheight ( void )

MapObjheight: the height of the used map.

Result
d0.w: the height

◆ _mapobjname()

void _mapobjname ( void )

◆ _mapobjviewx()

void _mapobjviewx ( void )

MapObjViewX: the view x of the used map.

Result
d0.w: viewx

◆ _mapobjviewy()

void _mapobjviewy ( void )

MapObjViewY: the view y of the used map.

Result
d0.w: viewy

◆ _mapobjwidth()

void _mapobjwidth ( void )

MapObjWidth: the width of the used map.

Result
d0.w: the width

◆ _newmap()

void _newmap ( void )

◆ _OutText()

void _OutText ( void )

◆ _OutTextCenter()

void _OutTextCenter ( void )

◆ _OutTextPen()

void _OutTextPen ( void )

◆ _OutTextRight()

void _OutTextRight ( void )

◆ _rubthroughmap1()

void _rubthroughmap1 ( void )

RubThroughMap: the rub-through map of the used map (+28).

Result
d0: the rub-through map, 0 if none

◆ _rubthroughmap2()

void _rubthroughmap2 ( void )

RubThroughMap(mapobject#): sets the rub-through map of the used map.

Inline: a0 = that map (ia0|pd0), a3 = the used one (ua3); the map's rubthrough (+28) = a0. MapCanDraw then tests that map too. Returns nothing (d0 unchanged).

◆ _scanmaxdepth()

void _scanmaxdepth ( void )

◆ _scanmaxheight()

void _scanmaxheight ( void )

◆ _scanmaxwidth()

void _scanmaxwidth ( void )

◆ _scanshapes()

void _scanshapes ( void )

◆ _setmapobjname()

void _setmapobjname ( void )

◆ _setstencil()

void _setstencil ( void )

◆ _shapemaskfill()

void _shapemaskfill ( void )

◆ _shapetosquare()

void _shapetosquare ( void )

◆ candraw_c()

ULONG candraw_c ( ULONG shapenum,
UWORD x,
UWORD y,
struct mapobject * map )
static

MapCanDraw(shape#,mapx,mapy): whether a shape can be drawn at a map position.

-1 if x/y lie outside the map (or the rub-through map), the map's word there is shape# + 1 (with a rub-through map: that map's word), or the stencil byte of the map's word is set; else shape# + 1 (resp. the rub-through map's word). The address of the map's word is kept at 24 (MapCanDrawAddr). d0's upper word stays (ADDQ.w). x/y are compared unsigned: fixed (#892), the original compared them signed, so negative values passed and indexed far behind the data (nothing is kept at 24 for them now). The stencil index is the map value as a signed word, and without SetStencil the stencil is at address 0: refused by candrawchk (fixed #893; the release code keeps both).

Parameters
shapenumd0: the shape number
xd1: the map x
yd2: the map y
mapa3: the used map (ua3)
Returns
d0.w: shape# + 1 (or the rub-through word) if it can, -1 if not

◆ candrawchk()

void candrawchk ( void )

◆ candrawchk_c()

void candrawchk_c ( ULONG shapenum,
UWORD x,
UWORD y,
const struct mapobject * map )
static

The error check of MapCanDraw (debugger only).

Fixed (#893), not in the original (rimapeditorlib had no error check area): MapCanDraw looked up the map word in the stencil of SetStencil without looking whether there is one - before the first SetStencil of a run (also after init, #1133) the stencil is at address 0 and the lookup read low memory - and used the map word as a signed index, so a value of $8000 or more read up to 32 KB before the stencil. Fixed (under #893): nor did it look whether the used map has a map (after Free MapObject, or a CreateMap that could not allocate the data, width, height and data are 0, and every position counts as outside). The value check follows the routine: only for a position inside the map (and the rub-through map) whose word the routine looks up in the stencil. The release code is unchanged (a command before its setup command, D-005, as #686 and #1131).

Errors: "MapObject has no map data", "MapCanDraw needs SetStencil", "Map value above 32767 for the stencil".

Parameters
shapenumd0: the shape number
xd1: the map x
yd2: the map y
mapa3: the used map (ua3)

◆ fillbitplane_c()

void fillbitplane_c ( UWORD w,
UWORD h,
const struct BitMap * bm )
static

FillBitplane bitmap#,width,height: a mesh in plane 0 of a bitmap.

Plane 0 of the bitmap object (a struct BitMap: its ebwidth at 0, planes at 8) gets width/16 words per row (65536 for a width below 16: DBRA from -1) of $5555/$AAAA, alternating per row; height 0 -> 65536 rows. Both refused by fillbpchk (fixed #895; the release code keeps them). DIFF: a2 unchanged (the original uses it as its pointer).

Parameters
wd1: the width in pixels
hd2: the height in rows
bma0: the bitmap object (ia0|pd0)

◆ fillbpchk()

void fillbpchk ( void )

◆ fillbpchk_c()

void fillbpchk_c ( UWORD w,
UWORD h )
static

The error check of FillBitplane (debugger only).

Fixed (#895), not in the original: the width / 16 - 1 words per row and the height - 1 rows were DBRA counts without a test: a width below 16 wrote 65536 words (128 KB) per row, a height of 0 65536 rows. Arguments the programmer controls (D-005); the release code is unchanged.

Errors: "FillBitplane width must be at least 16", "FillBitplane height must be at least 1".

Parameters
wd1: the width in pixels
hd2: the height in rows

◆ freemap()

void freemap ( struct mapobject * map)
static

◆ freemap_c()

void freemap_c ( struct mapobject * map)
static

The MapObject's free routine (!libfin _free): frees a map.

The data (FreeMem, width*2*height), the name (maxslib freest), the 32 bytes cleared.

Parameters
mapa3: the map object

◆ initparse_c()

void initparse_c ( const UBYTE * s)
static

M_InitParse string: the string for M_NextArg$.

Copied into the 256 byte buffer, at most 255 characters and a 0: fixed (#897), the original copied without a limit, so a longer string overwrote the pointer behind the buffer (and from 260 characters the code of M_NextArg$ behind it). A longer string is cut to its first 255 characters.

Parameters
sd0: the string

◆ libfinit_c()

void libfinit_c ( void )
static

finit: closes graphics.library.

BUG(orig) (#896): CloseLibrary also of a base 0.

◆ libinit_c()

void libinit_c ( void )
static

init: opens graphics.library (any version).

Then it clears the stencil of SetStencil, the ScanShapes results and the parse position of M_InitParse, as at the first load: fixed (#1133), the original kept those of the run before.

◆ mapdataadrchk()

void mapdataadrchk ( void )

◆ mapdataadrchk_c()

void mapdataadrchk_c ( UWORD x,
UWORD y,
const struct mapobject * map )
static

The error check of MapDataAdr(x,y) (debugger only).

Fixed (under #892), not in the original: the inline routine computes the address of the map word at x,y without a range check - x at or beyond the width gives a word of a later row, a y at or beyond the height (or a negative x or y) an address behind the map. x and y are compared unsigned with the width and height, as MapCanDraw does since #892 (a map without data has width and height 0: every position is refused). The release code is unchanged (D-005).

Errors: "Map position outside the map".

Parameters
xd0: the map x
yd1: the map y
mapa3: the used map (ua3)

◆ mapdatachanged2_c()

ULONG mapdatachanged2_c ( ULONG newstate,
struct mapobject * map )
static

MapDataChanged(newstate): sets the changed state of the used map.

Parameters
newstated0: the new state (a word)
mapa3: the used map (ua3)
Returns
d0.w: the old state (d0's upper word stays)

◆ mapgrab_c()

void mapgrab_c ( const UBYTE * src,
UWORD type,
UWORD null,
struct mapobject * map )
static

MapDataGrab address,datasize,mapnull: fills the used map from memory.

width*height values from address (datasize 0: bytes, else words) + mapnull into the data. Each byte is zero-extended: fixed (#898), in the original the upper byte of the previous value stayed in the register (MOVE.b), so a byte + mapnull beyond 255 carried into the following values. A map without data (its CreateMap could not allocate them, also for a width or height of 0) gets nothing: fixed (#895), the original's DBRA loops took its width and height 0 as 65536 each and wrote from address 0 over all memory.

Parameters
srcd0: the address
typed1: the data size (0 = bytes)
nulld2: mapnull, added to every value
mapa3: the used map (ua3)

◆ mapgrabchk()

void mapgrabchk ( void )

◆ mapgrabchk_c()

void mapgrabchk_c ( const struct mapobject * map)
static

The error check of MapDataGrab (debugger only).

Fixed (under #893), not in the original: MapDataGrab did not look whether the used map has a map; on one without data (after Free MapObject, or a CreateMap that could not allocate the data) the original wrote from address 0 over all memory, the release code fills nothing into it since #895.

Errors: "MapObject has no map data".

Parameters
mapa3: the used map (ua3)

◆ mapobjname_c()

ULONG mapobjname_c ( const struct mapobject * map)
static

MapObjName$: the name of the used map.

The name's characters at a3 (no 0). The length is counted as a long: fixed (#899), the original counted it as a byte (ADDQ.b), so a name of 256 characters or more came back with its length modulo 256.

Parameters
mapa1: the used map (ua1)
Returns
d0: the number of characters, 0 without a name

◆ newmap_c()

void newmap_c ( UWORD w,
UWORD h,
UWORD bw,
UWORD bh,
ULONG name,
UWORD used,
const ULONG * lens,
struct mapobject * map )
static

CreateMap map#,width,height,bwidth,bheight,name$: creates a map and uses it.

The map becomes the used one; an old map is freed; data: width*height words (MEMF_PUBLIC|MEMF_CLEAR), datasize 1, mapnull 0, view 0,0, the name a maxslib string. Without memory (also width or height 0) width, height, bwidth, bheight are cleared (datasize stays 1: not a defect). The size is (width * 2 as a word) * height, too small for a width above 32767, which the other commands take whole: refused by newmapchk (fixed #1152; the release code keeps it). a3 ends behind the last field written (24, or 10 if the data could not be allocated). The old map is freed by the free routine, which tests the data and the name itself: fixed (#894), the original freed it only if the long at 12 was set (data's low word and viewx), else it was lost and 24/28 were not cleared. DIFF: a2 unchanged (the original pops the length).

Parameters
wd1: the width
hd2: the height
bwd3: the block width
bhd4: the block height
named5: name$
usedd6: the offset of the used map in the globals
lensa2: the argument stack (the length of name$ below it)
mapa3: the map object (ia3|pd0)

◆ newmapchk()

void newmapchk ( void )

◆ newmapchk_c()

void newmapchk_c ( UWORD w)
static

The error check of CreateMap (debugger only).

Fixed (#1152), not in the original: CreateMap sizes the data as (width

  • 2 as a word) * height, so a width above 32767 lost the upper bit (a map 40000 wide got 14464 bytes per row instead of 80000), while MapDataGrab fills width x height words and MapCanDraw reads at x * 2: up to 64 KB per row behind the data. The width is the programmer's (D-005); the release code is unchanged.

Errors: "Map width above 32767".

Parameters
wd1: the width

◆ nextparsearg_c()

ULONG nextparsearg_c ( void )
static

M_NextArg$: the next comma separated argument of M_InitParse's string.

The characters up to the next ',' (skipped) or the end at a3; after the last one (and before M_InitParse) "". Leading spaces are not stripped (the source's comment says so; not a defect).

Returns
d0: the number of characters

◆ outtext()

void outtext ( struct Library * gfx,
ULONG x,
ULONG y,
struct RastPort * rp,
const UBYTE * s )
static

◆ outtext_c()

void outtext_c ( ULONG x,
ULONG y,
struct RastPort * rp,
const UBYTE * s )
static

MapOutText x,y,rastport,address/string: prints a text into a RastPort.

Move to x, y + the font's baseline (words), Text of the string (its length as a word).

Parameters
xd0: x
yd1: y
rpd2: the RastPort
sd3: the string (or its address)

◆ outtextcenter_c()

void outtextcenter_c ( ULONG x,
ULONG y,
struct RastPort * rp,
const UBYTE * s )
static

MapOutTextCenter x,y,rastport,address/string: as MapOutText, centred on x.

x - TextLength/2 (LSR.w), as a word.

Parameters
xd0: x
yd1: y
rpd2: the RastPort
sd3: the string

◆ outtextpen_c()

void outtextpen_c ( ULONG rp,
UWORD pen )
static

MapOutTextPen rastport,pen: the pen of MapOutText.

SetAPen with d0 = the rastport's upper word and the pen (MOVE.w d1,d0).

Parameters
rpd0: the RastPort
pend1: the pen (a word)

◆ outtextright_c()

void outtextright_c ( ULONG x,
ULONG y,
struct RastPort * rp,
const UBYTE * s )
static

MapOutTextRight x,y,rastport,address/string: as MapOutText, ending at x.

x - (TextLength - 1), as a word.

Parameters
xd0: x
yd1: y
rpd2: the RastPort
sd3: the string

◆ rimapeditorlib_libfinit()

void rimapeditorlib_libfinit ( void )

◆ rimapeditorlib_libinit()

void rimapeditorlib_libinit ( void )

◆ rimapeditorlib_nextparsearg()

void rimapeditorlib_nextparsearg ( void )

◆ rimapeditorlib_SetWindowDraw()

void rimapeditorlib_SetWindowDraw ( void )

◆ rol1()

ULONG rol1 ( ULONG v)
inlinestatic

◆ scanmaxdepth_c()

ULONG scanmaxdepth_c ( ULONG incoming)
static

ScanMaxdepth: the largest depth of the last ScanShapes.

Parameters
incomingd0: the caller's d0
Returns
d0.w: the depth

◆ scanmaxheight_c()

ULONG scanmaxheight_c ( ULONG incoming)
static

ScanMaxheight: the largest height of the last ScanShapes.

Parameters
incomingd0: the caller's d0
Returns
d0.w: the height

◆ scanmaxwidth_c()

ULONG scanmaxwidth_c ( ULONG incoming)
static

ScanMaxWidth: the largest width of the last ScanShapes.

MOVE.w: d0's upper word stays (also for ScanMaxheight/ScanMaxdepth).

Parameters
incomingd0: the caller's d0
Returns
d0.w: the width

◆ scanshapes_c()

ULONG scanshapes_c ( ULONG shapenum,
UWORD highest,
const struct bb_shape * sh )
static

ScanShapes(startnum,highest): the largest width/height/depth of a run of shapes.

From shape startnum to the first empty shape or highest, the largest width, height and depth (signed) for ScanMaxWidth/height/depth.

Parameters
shapenumd0: the offset of shape startnum (shape# << 5)
highestd1: the last shape number to scan
sha0: shape startnum (ia0|pd0)
Returns
d0.w: the last number scanned (the empty shape, or highest)

◆ setmapobjname_c()

void setmapobjname_c ( ULONG name,
const ULONG * lens,
struct mapobject * map )
static

SetMapObjName$ name$: the name of the used map.

The old name is freed (maxslib freest), the new one copied (allocst). DIFF: a2 unchanged (the original pops the length).

Parameters
named0: name$
lensa2: the argument stack (lens[-1] = the length of name$)
mapa3: the used map (ua3)

◆ setstencil_c()

void setstencil_c ( const UBYTE * a)
static

SetStencil array: the stencil of MapCanDraw.

A byte per map value; a set byte makes MapCanDraw fail for that value.

Parameters
ad0: the byte array

◆ setwindowdraw_c()

void setwindowdraw_c ( UWORD mode,
struct Window ** win )
static

SetWindowDraw window#,mode: the area pattern of the used window (0 normal, 1 meshed).

The window's RastPort gets the pattern $AAAA/$5555 (AreaPtSz 1) for a mode other than 0, none for 0.

Parameters
moded1: the mode
wina0: the used window object (ua0, its first long the Window)

◆ shapemaskfill_c()

void shapemaskfill_c ( const struct bb_shape * sh)
static

ShapeMaskFill shape#: sets the first 32 bytes (8 longs) of the shape's cookie.

Parameters
sha0: the shape (ia0|pd0)

◆ shapetosquare_c()

void shapetosquare_c ( const struct bb_shape * src,
struct bb_shape * dst )
static

ShapeTo1616 source shape,dest shape: the left 16 pixels of a shape, 16 rows.

The first word of every row of every plane of src into dest's data, 16 rows per plane (missing rows 0, more rows skipped). Height or depth 0 -> 65536 (DBRA): refused by to1616chk (fixed #895; the release code keeps it). 16 words per plane are written regardless of the destination's size: a destination that is not 16 x 16 with at least the source's depth is refused by to1616chk (fixed #900; the release code keeps it).

Parameters
srca0: the source shape (ia0|pd0)
dsta1: the destination shape (ia1|pd1)

◆ textlength()

UWORD textlength ( struct Library * gfx,
struct RastPort * rp,
const UBYTE * s )
static

◆ to1616chk()

void to1616chk ( void )

◆ to1616chk_c()

void to1616chk_c ( const struct bb_shape * src,
const struct bb_shape * dst )
static

The error check of ShapeTo1616 (debugger only).

Fixed (#895), not in the original: the source shape's depth and (for a shape lower than 16) its height were taken - 1 as DBRA counts without a test for 0: depth 0 copied 65536 planes, height 0 65536 rows into the destination. An invalid shape object (Blitz's own commands make none of depth or height 0); the release code is unchanged (as #429 and #947). Fixed (#900): nor was the destination looked at - ShapeTo1616 writes 16 words per plane of the source, one per row, into its data, so a destination with fewer planes or rows overflowed (another shape's data or memory list headers behind it) and a wider one got the words packed as if it were 16 wide. The destination is the programmer's (D-005); the release code is unchanged.

Errors: "ShapeTo1616 source of height or depth 0", "ShapeTo1616 needs a 16 x 16 destination as deep as the source" (width or height not 16, or fewer planes than the source).

Parameters
srca0: the source shape
dsta1: the destination shape

Variable Documentation

◆ curadr

UBYTE* curadr

◆ gfxbase

struct Library* gfxbase
static

◆ mapstencil

const UBYTE* mapstencil
static

◆ maxdepth

UWORD maxdepth
static

◆ maxheight

UWORD maxheight
static

◆ maxwidth

UWORD maxwidth
static

◆ mypattern

const UWORD mypattern[2] = { 0xaaaa, 0x5555 }
static

◆ [struct]

struct { ... } parse

◆ parseadr

UBYTE parseadr[256]