BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
ribbmaplib.c File Reference
#include "blitzlib.h"
#include "blitzobj.h"

Data Structures

struct  form
struct  mfrm

Macros

#define FN0(t, code, name, help)
#define ID(a, b, c, d)
#define LONGAT(p)
#define WORDAT(p)
#define HI   0xffff0000UL /* MOVEQ #-1,d0 of the chunk search */
#define PDATA(p)

Functions

void _setbbmaploc (void)
void _setbbscenarioloc (void)
void _bbscenarioname (void)
void _bbscenarioauthor (void)
void _bbscenariodepth (void)
void _bbscenarioshapes (void)
void _bbscenariosounds (void)
void _bbscenariobaddies (void)
void _bbscenariopalette (void)
void _bbscenariolowcol (void)
void _bbscenariohighcol (void)
void _bbscenariolevel (void)
void _bbnumbackground (void)
void _bbnumdestruct (void)
void _bbnumindestruct (void)
void _bbscenarioprefix (void)
void _bbnumtunnels (void)
void _bbshadowvalue (void)
void _bbtunnelholes (void)
void _bbtunnelsloc (void)
void _bbgetpalette (void)
void _bbdestructloc (void)
void _bbmapscenarioid (void)
void _bbmapwidth (void)
void _bbmapheight (void)
void _bbmappowerups (void)
void _bbmapdata (void)
void _bbmapstartpos (void)
void _bbmapname (void)
void _bbmapinfo (void)
void _bbmappumask (void)
void _bbmapdboverlay (void)
void _bbmaponeplayerinfo (void)
void _bbmapobjects (void)
void _bbnumbaddies (void)
void shadowchk (void)
static void codeinit (void)
 init: no map, no scenario, nothing cached.
static void codefinit (void)
 finit: does nothing (RTS).
 FN0 (BL_STRING, _bbscenarioname, "BBScenarioName", "")
 FN0 (BL_STRING, _bbscenarioauthor, "BBScenarioAuthor", "")
 FN0 (BL_WORD, _bbscenariodepth, "BBScenarioDepth", "")
 FN0 (BL_LONG, _bbscenarioshapes, "BBScenarioShapeLoc", "")
 FN0 (BL_LONG, _bbscenariosounds, "BBScenarioSounds", "")
 FN0 (BL_LONG, _bbscenariobaddies, "BBScenarioBaddiesLoc", "")
 FN0 (BL_LONG, _bbscenariopalette, "BBScenarioPalette", "")
 FN0 (BL_WORD, _bbscenariolowcol, "BBScenarioLowCol", "")
 FN0 (BL_WORD, _bbscenariohighcol, "BBScenarioHighCol", "")
 FN0 (BL_WORD, _bbscenariolevel, "BBScenarioLevel", "")
 FN0 (BL_WORD, _bbnumbackground, "BBNumBackGround", "")
 FN0 (BL_WORD, _bbnumdestruct, "BBNumDestruct", "")
 FN0 (BL_WORD, _bbnumindestruct, "BBNumIndestruct", "")
 FN0 (BL_LONG, _bbscenarioprefix, "BBScenarioPrefix", "")
 FN0 (BL_WORD, _bbnumtunnels, "BBNumTunnels", "")
 FN0 (BL_LONG, _bbtunnelholes, "BBTunnelHoles", "")
 FN0 (BL_LONG, _bbtunnelsloc, "BBTunnelsLoc", "")
 FN0 (BL_LONG, _bbdestructloc, "BBDestructLoc", "")
 FN0 (BL_LONG, _bbmapscenarioid, "BBMapScenarioID", "- returns scenarios of map")
 FN0 (BL_WORD, _bbmapwidth, "BBMapWidth", "- returns map width")
 FN0 (BL_WORD, _bbmapheight, "BBMapHeight", "- returns map height")
 FN0 (BL_LONG, _bbmappowerups, "BBMapPowerUps", "- returns location of custom powerups")
 FN0 (BL_LONG, _bbmapdata, "BBMapData", "- returns location of actual map data")
 FN0 (BL_LONG, _bbmapstartpos, "BBMapStartPos", "- returns location of start position data")
 FN0 (BL_STRING, _bbmapname, "BBMapName$", "- returns the name of the map")
 FN0 (BL_LONG, _bbmapinfo, "BBMapInfo", "- returns map information chunk")
 FN0 (BL_LONG, _bbmappumask, "BBMapPUMask", "- returns map powerup mask (or zero for none)")
 FN0 (BL_LONG, _bbmapdboverlay, "BBMapDBOverLay", "- returns map destructible block overlay (or zero for none)")
 FN0 (BL_LONG, _bbmaponeplayerinfo, "BBMapOnePlayerInfo", "- returns one player data chunk (or zero for none)")
 FN0 (BL_LONG, _bbmapobjects, "BBMapObjects", "- returns one player object chunk (or zero for none)")
 FN0 (BL_WORD, _bbnumbaddies, "BBNumBaddies", "- returns number of baddies")
static UBYTE * search (ULONG id, UBYTE *loc, UBYTE *end, ULONG *last, UBYTE **lastaddr)
static UBYTE * findchunk (ULONG id)
static UBYTE * findmapchunk (ULONG id)
static BB_BOOL setbbscenarioloc_c (struct form *form)
 SetBBScenarioLoc address: the scenario file ("FORM" .. "SCEN") in memory for the BBScenario.../BBNum.../BBTunnel... functions.
static BB_BOOL setbbmaploc_c (struct form *form)
 SetBBMapLoc address: the map file ("FORM" .. "BMAP") in memory for the BBMap... functions; finds its MFRM chunk.
static ULONG chunkword (ULONG id, int off)
static ULONG chunkaddr (ULONG id, int off)
static ULONG bbscenariolevel_c (void)
 BBScenarioLevel: the word of the LEVL chunk.
static ULONG bbscenariodepth_c (void)
 BBScenarioDepth: the word of the DEPF chunk.
static ULONG bbscenarioprefix_c (void)
 BBScenarioPrefix: the long of the PRFX chunk.
static ULONG bbscenariopalette_c (void)
 BBScenarioPalette: the colours of the COLR chunk (behind its low and high byte).
static ULONG bbscenariolowcol_c (void)
 BBScenarioLowCol: the first colour of the COLR chunk (its byte 0).
static ULONG bbscenariohighcol_c (void)
 BBScenarioHighCol: the last colour of the COLR chunk (its byte 1).
static ULONG bbnumbackground_c (void)
 BBNumBackGround: the word at +0 of the SHAP chunk.
static ULONG bbnumdestruct_c (void)
 BBNumDestruct: the word at +2 of the SHAP chunk.
static ULONG bbnumindestruct_c (void)
 BBNumIndestruct: the word at +4 of the SHAP chunk.
static ULONG bbnumtunnels_c (void)
 BBNumTunnels: the word at +0 of the TUNL chunk.
static ULONG bbnumbaddies_c (void)
 BBNumBaddies: the byte at +0 of the BAD! chunk.
static ULONG bbshadowvalue_c (ULONG set)
 BBShadowValue shadowset: the long number set of the SHDW chunk (ASL.w #2: a word index).
static ULONG bbtunnelsloc_c (void)
 BBTunnelsLoc: the data of the TUNL chunk from +8 on.
static ULONG bbtunnelholes_c (void)
 BBTunnelHoles: the long at +2 of the TUNL chunk.
static ULONG bbscenarioshapes_c (void)
 BBScenarioShapeLoc: the data of the GFX! chunk.
static ULONG bbscenariosounds_c (void)
 BBScenarioSounds: the data of the SFX! chunk.
static ULONG bbscenariobaddies_c (void)
 BBScenarioBaddiesLoc: the data of the BAD! chunk from +2 on.
static ULONG bbdestructloc_c (void)
 BBDestructLoc: the data of the DEST chunk.
static ULONG copystring (const UBYTE *text)
static ULONG bbscenarioname_c (void)
 BBScenarioName: the name in the ANNO chunk, at a3 (without its 0, a3 behind the last character).
static ULONG bbscenarioauthor_c (void)
 BBScenarioAuthor: the author in the ANNO chunk (the string behind the name's 0, at an even address), at a3 like BBScenarioName.
static void bbgetpalette_c (struct bb_palette *pal)
 BBGetPalette palette#: the colours of the COLR chunk into a palette object.
static ULONG mapchunkaddr (ULONG id)
static ULONG bbmapscenarioid_c (void)
 BBMapScenarioID: the scenario id of the map (+0 of its MFRM chunk).
static ULONG bbmapwidth_c (ULONG prev)
 BBMapWidth: the width of the map (+4 of its MFRM chunk).
static ULONG bbmapheight_c (ULONG prev)
 BBMapHeight: the height of the map (+6 of its MFRM chunk).
static ULONG bbmapinfo_c (void)
 BBMapInfo: the map's information chunk (the data of MFRM).
static ULONG bbmappowerups_c (void)
 BBMapPowerUps: the map's custom power-ups (PWUP chunk).
static ULONG bbmapstartpos_c (void)
 BBMapStartPos: the map's start positions (STRT chunk).
static ULONG bbmapdata_c (void)
 BBMapData: the map data (MDAT chunk).
static ULONG bbmapname_c (void)
 BBMapName$: the name of the map (NAME chunk), at a3 like BBScenarioName.
static ULONG bbmappumask_c (void)
 BBMapPUMask: the map's power-up mask (PWMK chunk).
static ULONG bbmapdboverlay_c (void)
 BBMapDBOverLay: the map's destructible block overlay (DBOL chunk).
static ULONG bbmaponeplayerinfo_c (void)
 BBMapOnePlayerInfo: the map's one player data (1PLY chunk).
static ULONG bbmapobjects_c (void)
 BBMapObjects: the map's one player objects (OBJS chunk).
static void shadowchk_c (ULONG set)
 The error check of BBShadowValue (debugger only).

Variables

static UBYTE * maploc
static UBYTE * mapend
static struct mfrm * mfrmchunk
static UBYTE * scenarioloc
static UBYTE * scenarioend
static ULONG lastchunk
static ULONG lastmapchunk
static UBYTE * lastchunkaddr
static UBYTE * lastmapchunkaddr

Macro Definition Documentation

◆ FN0

#define FN0 ( t,
code,
name,
help )
Value:
BLITZ_NAME(name, help)
char * name
Definition asllib.c:150
#define BLITZ_ARGS0()
Definition blitzlib.h:352
#define BLITZ_LIBS0()
Definition blitzlib.h:363
#define BLITZ_AFUNCTION(t)
Definition blitzlib.h:344
#define BLITZ_SUBS(code, err1, err2)
Definition blitzlib.h:366
UBYTE code[4]
Definition ridisasmlib.c:375

◆ HI

#define HI   0xffff0000UL /* MOVEQ #-1,d0 of the chunk search */

◆ ID

#define ID ( a,
b,
c,
d )
Value:
((ULONG)(a) << 24 | (ULONG)(b) << 16 | (ULONG)(c) << 8 | (ULONG)(d))
ULONG WORD UWORD c
Definition 2dlib.c:2491
static struct @065163037313156332013005143365272036211065172003 d

◆ LONGAT

#define LONGAT ( p)
Value:
(*(ULONG *)(p))

◆ PDATA

#define PDATA ( p)
Value:
(*(ULONG *)&(p)->pdata)
Definition ridatatypeslib.c:763

◆ WORDAT

#define WORDAT ( p)
Value:
(*(UWORD *)(p))

Function Documentation

◆ _bbdestructloc()

void _bbdestructloc ( void )

◆ _bbgetpalette()

void _bbgetpalette ( void )

◆ _bbmapdata()

void _bbmapdata ( void )

◆ _bbmapdboverlay()

void _bbmapdboverlay ( void )

◆ _bbmapheight()

void _bbmapheight ( void )

◆ _bbmapinfo()

void _bbmapinfo ( void )

◆ _bbmapname()

void _bbmapname ( void )

◆ _bbmapobjects()

void _bbmapobjects ( void )

◆ _bbmaponeplayerinfo()

void _bbmaponeplayerinfo ( void )

◆ _bbmappowerups()

void _bbmappowerups ( void )

◆ _bbmappumask()

void _bbmappumask ( void )

◆ _bbmapscenarioid()

void _bbmapscenarioid ( void )

◆ _bbmapstartpos()

void _bbmapstartpos ( void )

◆ _bbmapwidth()

void _bbmapwidth ( void )

◆ _bbnumbackground()

void _bbnumbackground ( void )

◆ _bbnumbaddies()

void _bbnumbaddies ( void )

◆ _bbnumdestruct()

void _bbnumdestruct ( void )

◆ _bbnumindestruct()

void _bbnumindestruct ( void )

◆ _bbnumtunnels()

void _bbnumtunnels ( void )

◆ _bbscenarioauthor()

void _bbscenarioauthor ( void )

◆ _bbscenariobaddies()

void _bbscenariobaddies ( void )

◆ _bbscenariodepth()

void _bbscenariodepth ( void )

◆ _bbscenariohighcol()

void _bbscenariohighcol ( void )

◆ _bbscenariolevel()

void _bbscenariolevel ( void )

◆ _bbscenariolowcol()

void _bbscenariolowcol ( void )

◆ _bbscenarioname()

void _bbscenarioname ( void )

◆ _bbscenariopalette()

void _bbscenariopalette ( void )

◆ _bbscenarioprefix()

void _bbscenarioprefix ( void )

◆ _bbscenarioshapes()

void _bbscenarioshapes ( void )

◆ _bbscenariosounds()

void _bbscenariosounds ( void )

◆ _bbshadowvalue()

void _bbshadowvalue ( void )

◆ _bbtunnelholes()

void _bbtunnelholes ( void )

◆ _bbtunnelsloc()

void _bbtunnelsloc ( void )

◆ _setbbmaploc()

void _setbbmaploc ( void )

◆ _setbbscenarioloc()

void _setbbscenarioloc ( void )

◆ bbdestructloc_c()

ULONG bbdestructloc_c ( void )
static

BBDestructLoc: the data of the DEST chunk.

Returns
d0: the address, 0 without the chunk

◆ bbgetpalette_c()

void bbgetpalette_c ( struct bb_palette * pal)
static

BBGetPalette palette#: the colours of the COLR chunk into a palette object.

The colours low..high (bytes r,g,b, each made a long $xxxxxxxx) at the object's colour low; a new colour block (the old colours copied, the old block freed with the size count*12) if high >= the colour count. The new block has high+1 colours and that count (fixed, #548: the original set it to high). Nothing without the chunk, nothing when low > high (fixed, #549: the original wrote the colour at low). Only the colours that lie inside the chunk and the file are read: high is cut to the last of them, nothing without one (fixed, #1113: the original read the colours behind the chunk).

Parameters
pala0: the palette object (palettelib)

◆ bbmapdata_c()

ULONG bbmapdata_c ( void )
static

BBMapData: the map data (MDAT chunk).

Returns
d0: the address, 0 without the chunk

◆ bbmapdboverlay_c()

ULONG bbmapdboverlay_c ( void )
static

BBMapDBOverLay: the map's destructible block overlay (DBOL chunk).

Returns
d0: the address, 0 without the chunk

◆ bbmapheight_c()

ULONG bbmapheight_c ( ULONG prev)
static

BBMapHeight: the height of the map (+6 of its MFRM chunk).

Parameters
prevd0: d0 at the call (its upper word stays)
Returns
d0: the height in the low word, 0 before a SetBBMapLoc or without MFRM

◆ bbmapinfo_c()

ULONG bbmapinfo_c ( void )
static

BBMapInfo: the map's information chunk (the data of MFRM).

Returns
d0: its address, 0 before a SetBBMapLoc or without MFRM

◆ bbmapname_c()

ULONG bbmapname_c ( void )
static

BBMapName$: the name of the map (NAME chunk), at a3 like BBScenarioName.

Returns
d0: its length, 0 without the chunk

◆ bbmapobjects_c()

ULONG bbmapobjects_c ( void )
static

BBMapObjects: the map's one player objects (OBJS chunk).

Returns
d0: the address, 0 without the chunk

◆ bbmaponeplayerinfo_c()

ULONG bbmaponeplayerinfo_c ( void )
static

BBMapOnePlayerInfo: the map's one player data (1PLY chunk).

Returns
d0: the address, 0 without the chunk

◆ bbmappowerups_c()

ULONG bbmappowerups_c ( void )
static

BBMapPowerUps: the map's custom power-ups (PWUP chunk).

Returns
d0: the address, 0 without the chunk

◆ bbmappumask_c()

ULONG bbmappumask_c ( void )
static

BBMapPUMask: the map's power-up mask (PWMK chunk).

Returns
d0: the address, 0 without the chunk

◆ bbmapscenarioid_c()

ULONG bbmapscenarioid_c ( void )
static

BBMapScenarioID: the scenario id of the map (+0 of its MFRM chunk).

Returns
d0: the id, 0 before a SetBBMapLoc or without MFRM

◆ bbmapstartpos_c()

ULONG bbmapstartpos_c ( void )
static

BBMapStartPos: the map's start positions (STRT chunk).

Returns
d0: the address, 0 without the chunk

◆ bbmapwidth_c()

ULONG bbmapwidth_c ( ULONG prev)
static

BBMapWidth: the width of the map (+4 of its MFRM chunk).

Parameters
prevd0: d0 at the call (its upper word stays)
Returns
d0: the width in the low word, 0 before a SetBBMapLoc or without MFRM

◆ bbnumbackground_c()

ULONG bbnumbackground_c ( void )
static

BBNumBackGround: the word at +0 of the SHAP chunk.

Returns
d0: $FFFF:word, 0 without the chunk

◆ bbnumbaddies_c()

ULONG bbnumbaddies_c ( void )
static

BBNumBaddies: the byte at +0 of the BAD! chunk.

Returns
d0: the byte, 0 without the chunk

◆ bbnumdestruct_c()

ULONG bbnumdestruct_c ( void )
static

BBNumDestruct: the word at +2 of the SHAP chunk.

Returns
d0: $FFFF:word, 0 without the chunk

◆ bbnumindestruct_c()

ULONG bbnumindestruct_c ( void )
static

BBNumIndestruct: the word at +4 of the SHAP chunk.

Returns
d0: $FFFF:word, 0 without the chunk

◆ bbnumtunnels_c()

ULONG bbnumtunnels_c ( void )
static

BBNumTunnels: the word at +0 of the TUNL chunk.

Returns
d0: $FFFF:word, 0 without the chunk

◆ bbscenarioauthor_c()

ULONG bbscenarioauthor_c ( void )
static

BBScenarioAuthor: the author in the ANNO chunk (the string behind the name's 0, at an even address), at a3 like BBScenarioName.

Returns
d0: its length, 0 without the chunk

◆ bbscenariobaddies_c()

ULONG bbscenariobaddies_c ( void )
static

BBScenarioBaddiesLoc: the data of the BAD! chunk from +2 on.

Returns
d0: the address, 0 without the chunk

◆ bbscenariodepth_c()

ULONG bbscenariodepth_c ( void )
static

BBScenarioDepth: the word of the DEPF chunk.

Returns
d0: $FFFF:word, 0 without the chunk

◆ bbscenariohighcol_c()

ULONG bbscenariohighcol_c ( void )
static

BBScenarioHighCol: the last colour of the COLR chunk (its byte 1).

Fixed (#550): the byte unsigned (the original: EXT.w).

Returns
d0: $FFFF:word, 0 without the chunk

◆ bbscenariolevel_c()

ULONG bbscenariolevel_c ( void )
static

BBScenarioLevel: the word of the LEVL chunk.

Returns
d0: $FFFF:word, 0 without the chunk

◆ bbscenariolowcol_c()

ULONG bbscenariolowcol_c ( void )
static

BBScenarioLowCol: the first colour of the COLR chunk (its byte 0).

Fixed (#550): the byte unsigned (the original: EXT.w).

Returns
d0: $FFFF:word, 0 without the chunk

◆ bbscenarioname_c()

ULONG bbscenarioname_c ( void )
static

BBScenarioName: the name in the ANNO chunk, at a3 (without its 0, a3 behind the last character).

Returns
d0: its length, 0 without the chunk

◆ bbscenariopalette_c()

ULONG bbscenariopalette_c ( void )
static

BBScenarioPalette: the colours of the COLR chunk (behind its low and high byte).

Returns
d0: their address, 0 without the chunk

◆ bbscenarioprefix_c()

ULONG bbscenarioprefix_c ( void )
static

BBScenarioPrefix: the long of the PRFX chunk.

Returns
d0: the long, 0 without the chunk

◆ bbscenarioshapes_c()

ULONG bbscenarioshapes_c ( void )
static

BBScenarioShapeLoc: the data of the GFX! chunk.

Returns
d0: the address, 0 without the chunk

◆ bbscenariosounds_c()

ULONG bbscenariosounds_c ( void )
static

BBScenarioSounds: the data of the SFX! chunk.

Returns
d0: the address, 0 without the chunk

◆ bbshadowvalue_c()

ULONG bbshadowvalue_c ( ULONG set)
static

BBShadowValue shadowset: the long number set of the SHDW chunk (ASL.w #2: a word index).

A set outside the chunk is read unchecked (an invalid argument); with runtime error checking shadowchk refuses it (fixed, #1114).

Parameters
setd0: the shadow set
Returns
d0: the long, 0 without the chunk

◆ bbtunnelholes_c()

ULONG bbtunnelholes_c ( void )
static

BBTunnelHoles: the long at +2 of the TUNL chunk.

Returns
d0: the long, 0 without the chunk

◆ bbtunnelsloc_c()

ULONG bbtunnelsloc_c ( void )
static

BBTunnelsLoc: the data of the TUNL chunk from +8 on.

Returns
d0: the address, 0 without the chunk

◆ chunkaddr()

ULONG chunkaddr ( ULONG id,
int off )
static

◆ chunkword()

ULONG chunkword ( ULONG id,
int off )
static

◆ codefinit()

void codefinit ( void )
static

finit: does nothing (RTS).

◆ codeinit()

void codeinit ( void )
static

init: no map, no scenario, nothing cached.

Fixed (#1108): the original's init is an RTS, so a second run of a program with the library still loaded (from the editor) started with the files and caches of the run before.

◆ copystring()

ULONG copystring ( const UBYTE * text)
static

◆ findchunk()

UBYTE * findchunk ( ULONG id)
static

◆ findmapchunk()

UBYTE * findmapchunk ( ULONG id)
static

◆ FN0() [1/31]

FN0 ( BL_LONG ,
_bbdestructloc ,
"BBDestructLoc" ,
""  )

◆ FN0() [2/31]

FN0 ( BL_LONG ,
_bbmapdata ,
"BBMapData" ,
"- returns location of actual map data"  )

◆ FN0() [3/31]

FN0 ( BL_LONG ,
_bbmapdboverlay ,
"BBMapDBOverLay" ,
"- returns map destructible block overlay (or zero for none)"  )

◆ FN0() [4/31]

FN0 ( BL_LONG ,
_bbmapinfo ,
"BBMapInfo" ,
"- returns map information chunk"  )

◆ FN0() [5/31]

FN0 ( BL_LONG ,
_bbmapobjects ,
"BBMapObjects" ,
"- returns one player object chunk (or zero for none)"  )

◆ FN0() [6/31]

FN0 ( BL_LONG ,
_bbmaponeplayerinfo ,
"BBMapOnePlayerInfo" ,
"- returns one player data chunk (or zero for none)"  )

◆ FN0() [7/31]

FN0 ( BL_LONG ,
_bbmappowerups ,
"BBMapPowerUps" ,
"- returns location of custom powerups"  )

◆ FN0() [8/31]

FN0 ( BL_LONG ,
_bbmappumask ,
"BBMapPUMask" ,
"- returns map powerup mask (or zero for none)"  )

◆ FN0() [9/31]

FN0 ( BL_LONG ,
_bbmapscenarioid ,
"BBMapScenarioID" ,
"- returns scenarios of map"  )

◆ FN0() [10/31]

FN0 ( BL_LONG ,
_bbmapstartpos ,
"BBMapStartPos" ,
"- returns location of start position data"  )

◆ FN0() [11/31]

FN0 ( BL_LONG ,
_bbscenariobaddies ,
"BBScenarioBaddiesLoc" ,
""  )

◆ FN0() [12/31]

FN0 ( BL_LONG ,
_bbscenariopalette ,
"BBScenarioPalette" ,
""  )

◆ FN0() [13/31]

FN0 ( BL_LONG ,
_bbscenarioprefix ,
"BBScenarioPrefix" ,
""  )

◆ FN0() [14/31]

FN0 ( BL_LONG ,
_bbscenarioshapes ,
"BBScenarioShapeLoc" ,
""  )

◆ FN0() [15/31]

FN0 ( BL_LONG ,
_bbscenariosounds ,
"BBScenarioSounds" ,
""  )

◆ FN0() [16/31]

FN0 ( BL_LONG ,
_bbtunnelholes ,
"BBTunnelHoles" ,
""  )

◆ FN0() [17/31]

FN0 ( BL_LONG ,
_bbtunnelsloc ,
"BBTunnelsLoc" ,
""  )

◆ FN0() [18/31]

FN0 ( BL_STRING ,
_bbmapname ,
"BBMapName$" ,
"- returns the name of the map"  )

◆ FN0() [19/31]

FN0 ( BL_STRING ,
_bbscenarioauthor ,
"BBScenarioAuthor" ,
""  )

◆ FN0() [20/31]

FN0 ( BL_STRING ,
_bbscenarioname ,
"BBScenarioName" ,
""  )

◆ FN0() [21/31]

FN0 ( BL_WORD ,
_bbmapheight ,
"BBMapHeight" ,
"- returns map height"  )

◆ FN0() [22/31]

FN0 ( BL_WORD ,
_bbmapwidth ,
"BBMapWidth" ,
"- returns map width"  )

◆ FN0() [23/31]

FN0 ( BL_WORD ,
_bbnumbackground ,
"BBNumBackGround" ,
""  )

◆ FN0() [24/31]

FN0 ( BL_WORD ,
_bbnumbaddies ,
"BBNumBaddies" ,
"- returns number of baddies"  )

◆ FN0() [25/31]

FN0 ( BL_WORD ,
_bbnumdestruct ,
"BBNumDestruct" ,
""  )

◆ FN0() [26/31]

FN0 ( BL_WORD ,
_bbnumindestruct ,
"BBNumIndestruct" ,
""  )

◆ FN0() [27/31]

FN0 ( BL_WORD ,
_bbnumtunnels ,
"BBNumTunnels" ,
""  )

◆ FN0() [28/31]

FN0 ( BL_WORD ,
_bbscenariodepth ,
"BBScenarioDepth" ,
""  )

◆ FN0() [29/31]

FN0 ( BL_WORD ,
_bbscenariohighcol ,
"BBScenarioHighCol" ,
""  )

◆ FN0() [30/31]

FN0 ( BL_WORD ,
_bbscenariolevel ,
"BBScenarioLevel" ,
""  )

◆ FN0() [31/31]

FN0 ( BL_WORD ,
_bbscenariolowcol ,
"BBScenarioLowCol" ,
""  )

◆ mapchunkaddr()

ULONG mapchunkaddr ( ULONG id)
static

◆ search()

UBYTE * search ( ULONG id,
UBYTE * loc,
UBYTE * end,
ULONG * last,
UBYTE ** lastaddr )
static

◆ setbbmaploc_c()

BB_BOOL setbbmaploc_c ( struct form * form)
static

SetBBMapLoc address: the map file ("FORM" .. "BMAP") in memory for the BBMap... functions; finds its MFRM chunk.

A failed call keeps the old map, its info chunk and its cache (fixed, #554: the original stored the address before the checks). Without MFRM there is no info chunk (fixed, #551: the original took the address behind the last chunk id read); the call still succeeds.

Parameters
formd0: the address of the file
Returns
d0: BB_TRUE, BB_FALSE if it is no FORM of type BMAP

◆ setbbscenarioloc_c()

BB_BOOL setbbscenarioloc_c ( struct form * form)
static

SetBBScenarioLoc address: the scenario file ("FORM" .. "SCEN") in memory for the BBScenario.../BBNum.../BBTunnel... functions.

A failed call keeps the old file and its cache (original behaviour).

Parameters
formd0: the address of the file
Returns
d0: BB_TRUE, BB_FALSE if it is no FORM of type SCEN

◆ shadowchk()

void shadowchk ( void )

◆ shadowchk_c()

void shadowchk_c ( ULONG set)
static

The error check of BBShadowValue (debugger only).

Fixed (#1114), not in the original (ribbmaplib had no error check area): the set indexes the SHDW chunk without a check. A set is refused when it is negative, $2000 or more (its word index wraps) or not below the chunk's length / 4 (the length cut at the file's end). Without a scenario or a SHDW chunk nothing is checked (BBShadowValue gives 0). The search runs on copies of the cache: the check changes nothing. The release code is unchanged (an invalid argument).

Errors: "Shadow set must lie in the SHDW chunk".

Parameters
setd0: the shadow set (word)

Variable Documentation

◆ lastchunk

ULONG lastchunk
static

◆ lastchunkaddr

UBYTE* lastchunkaddr
static

◆ lastmapchunk

ULONG lastmapchunk
static

◆ lastmapchunkaddr

UBYTE * lastmapchunkaddr
static

◆ mapend

UBYTE * mapend
static

◆ maploc

UBYTE* maploc
static

◆ mfrmchunk

struct mfrm* mfrmchunk
static

◆ scenarioend

UBYTE * scenarioend
static

◆ scenarioloc

UBYTE* scenarioloc
static