BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
environlib.c File Reference
#include "blitzlib.h"
#include "blitzexec.h"
#include <intuition/screens.h>

Macros

#define ENV_FUNC(type, code, name)
#define SCDATA_SIZE   346 /* new screen size */
#define GetScreenData   (-426) /* intuition */

Functions

void environlib_codeinit (void)
void dowbwidth (void)
void dowbhite (void)
void dowbdepth (void)
void dowbviewmode (void)
void doprocessor (void)
void docr_vbr (void)
void doexecversion (void)
void doextwbviewmode (void)
 ENV_FUNC (BL_LONG, dowbwidth, "WBWidth")
 ENV_FUNC (BL_LONG, dowbhite, "WBHeight")
 ENV_FUNC (BL_WORD, dowbdepth, "WBDepth")
 ENV_FUNC (BL_WORD, dowbviewmode, "WBViewMode")
 ENV_FUNC (BL_WORD, doprocessor, "Processor")
 ENV_FUNC (BL_LONG, docr_vbr, "cr_vbr")
 ENV_FUNC (BL_WORD, doexecversion, "ExecVersion")
 ENV_FUNC (BL_WORD, doextwbviewmode, "WBExtViewMode")
static ULONG getvbr (void)
static void codeinit_c (const void *intuition)
static ULONG wbwidth_c (void)
 WBWidth: the width of the Workbench screen.
static ULONG wbhite_c (void)
 WBHeight: the height of the Workbench screen.
static ULONG cr_vbr_c (void)
 cr_vbr: the vector base register.
static ULONG wbdepth_c (void)
 WBDepth: the depth of the Workbench screen's bitmap.
static ULONG wbviewmode_c (void)
 WBViewMode: the view modes of the Workbench screen.
static ULONG extwbviewmode_c (void)
 WBExtViewMode: the word behind ViewPort.Modes of the Workbench screen.
static ULONG processor_c (void)
 Processor: the CPU, from exec's AttnFlags.
static ULONG execversion_c (void)
 ExecVersion: exec.library's version (SysBase->LibNode.lib_Version).
 BLITZ_ALIAS (dowbwidth, wbwidth_c)
 BLITZ_ALIAS (dowbhite, wbhite_c)
 BLITZ_ALIAS (docr_vbr, cr_vbr_c)
 BLITZ_ALIAS (dowbdepth, wbdepth_c)
 BLITZ_ALIAS (dowbviewmode, wbviewmode_c)
 BLITZ_ALIAS (doextwbviewmode, extwbviewmode_c)
 BLITZ_ALIAS (doprocessor, processor_c)
 BLITZ_ALIAS (doexecversion, execversion_c)

Variables

static struct Screen scdata
static ULONG wbwidth_
static ULONG wbhite_
static ULONG wbview_
static ULONG vbr_
static UWORD wbdepth_
static UWORD cpu_
static UWORD execver_

Macro Definition Documentation

◆ ENV_FUNC

#define ENV_FUNC ( type,
code,
name )
Value:
BLITZ_ARGS0(); \
BLITZ_LIBS0(); \
BLITZ_SUBS(code, 0, 0); \
BLITZ_NAME(name, "")
char * name
Definition asllib.c:150
#define BLITZ_AFUNCTION(t)
Definition blitzlib.h:344
UWORD type
Definition editlib.c:263
UBYTE code[4]
Definition ridisasmlib.c:375

◆ GetScreenData

#define GetScreenData   (-426) /* intuition */

◆ SCDATA_SIZE

#define SCDATA_SIZE   346 /* new screen size */

Function Documentation

◆ BLITZ_ALIAS() [1/8]

BLITZ_ALIAS ( docr_vbr ,
cr_vbr_c  )

◆ BLITZ_ALIAS() [2/8]

BLITZ_ALIAS ( doexecversion ,
execversion_c  )

◆ BLITZ_ALIAS() [3/8]

BLITZ_ALIAS ( doextwbviewmode ,
extwbviewmode_c  )

◆ BLITZ_ALIAS() [4/8]

BLITZ_ALIAS ( doprocessor ,
processor_c  )

◆ BLITZ_ALIAS() [5/8]

BLITZ_ALIAS ( dowbdepth ,
wbdepth_c  )

◆ BLITZ_ALIAS() [6/8]

BLITZ_ALIAS ( dowbhite ,
wbhite_c  )

◆ BLITZ_ALIAS() [7/8]

BLITZ_ALIAS ( dowbviewmode ,
wbviewmode_c  )

◆ BLITZ_ALIAS() [8/8]

BLITZ_ALIAS ( dowbwidth ,
wbwidth_c  )

◆ codeinit_c()

void codeinit_c ( const void * intuition)
static

◆ cr_vbr_c()

ULONG cr_vbr_c ( void )
static

cr_vbr: the vector base register.

Read at program start in supervisor state, on a 68010 or higher; 0 on the 68000. Fixed (#42): the original reads it only from the 68020 on (0 on a 68010).

Returns
d0: the VBR (long)

◆ docr_vbr()

void docr_vbr ( void )

◆ doexecversion()

void doexecversion ( void )

◆ doextwbviewmode()

void doextwbviewmode ( void )

◆ doprocessor()

void doprocessor ( void )

◆ dowbdepth()

void dowbdepth ( void )

◆ dowbhite()

void dowbhite ( void )

◆ dowbviewmode()

void dowbviewmode ( void )

◆ dowbwidth()

void dowbwidth ( void )

◆ ENV_FUNC() [1/8]

ENV_FUNC ( BL_LONG ,
docr_vbr ,
"cr_vbr"  )

◆ ENV_FUNC() [2/8]

ENV_FUNC ( BL_LONG ,
dowbhite ,
"WBHeight"  )

◆ ENV_FUNC() [3/8]

ENV_FUNC ( BL_LONG ,
dowbwidth ,
"WBWidth"  )

◆ ENV_FUNC() [4/8]

ENV_FUNC ( BL_WORD ,
doexecversion ,
"ExecVersion"  )

◆ ENV_FUNC() [5/8]

ENV_FUNC ( BL_WORD ,
doextwbviewmode ,
"WBExtViewMode"  )

◆ ENV_FUNC() [6/8]

ENV_FUNC ( BL_WORD ,
doprocessor ,
"Processor"  )

◆ ENV_FUNC() [7/8]

ENV_FUNC ( BL_WORD ,
dowbdepth ,
"WBDepth"  )

◆ ENV_FUNC() [8/8]

ENV_FUNC ( BL_WORD ,
dowbviewmode ,
"WBViewMode"  )

◆ environlib_codeinit()

void environlib_codeinit ( void )

◆ execversion_c()

ULONG execversion_c ( void )
static

ExecVersion: exec.library's version (SysBase->LibNode.lib_Version).

Returns
d0: the version, a zero-extended long (ElmoreSysLib's checkrom and ElmoreLib compare it as a long, CMP.l #36,d0)

◆ extwbviewmode_c()

ULONG extwbviewmode_c ( void )
static

WBExtViewMode: the word behind ViewPort.Modes of the Workbench screen.

The low word of the long read at ViewPort.Modes at program start (MOVE.w wbview_+2): ViewPort.SpritePriority and ExtendedModes.

Returns
d0.w: the word (the upper word of d0 is undefined)

◆ getvbr()

ULONG getvbr ( void )
static

◆ processor_c()

ULONG processor_c ( void )
static

Processor: the CPU, from exec's AttnFlags.

The number of shifts until AttnFlags & 15 is 0: 0 = 68000, 1 = 68010, 2 = 68020, 3 = 68030, 4 = 68040.

Returns
d0.w: the number (the upper word of d0 is undefined)

◆ wbdepth_c()

ULONG wbdepth_c ( void )
static

WBDepth: the depth of the Workbench screen's bitmap.

The value read at program start (RastPort.BitMap->Depth of the copy).

Returns
d0: the depth (zero-extended)

◆ wbhite_c()

ULONG wbhite_c ( void )
static

WBHeight: the height of the Workbench screen.

The value read at program start (GetScreenData, not checked).

Returns
d0: the height (long)

◆ wbviewmode_c()

ULONG wbviewmode_c ( void )
static

WBViewMode: the view modes of the Workbench screen.

ViewPort.Modes of the copy read at program start (MOVE.w wbview_).

Returns
d0.w: the modes (the upper word of d0 is undefined)

◆ wbwidth_c()

ULONG wbwidth_c ( void )
static

WBWidth: the width of the Workbench screen.

The value read at program start (GetScreenData, not checked: a failed call leaves 0).

Returns
d0: the width (long)

Variable Documentation

◆ cpu_

UWORD cpu_
static

◆ execver_

UWORD execver_
static

◆ scdata

struct Screen scdata
static

◆ vbr_

ULONG vbr_
static

◆ wbdepth_

UWORD wbdepth_
static

◆ wbhite_

ULONG wbhite_
static

◆ wbview_

ULONG wbview_
static

◆ wbwidth_

ULONG wbwidth_
static