BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
rimisclib.c File Reference
#include "blitzlib.h"
#include "blitzexec.h"
#include <exec/execbase.h>
#include <dos/dos.h>
#include <dos/dosextens.h>
#include <intuition/intuition.h>
#include <prefs/font.h>
#include <proto/dos.h>
#include <proto/intuition.h>

Macros

#define __NOLIBBASE__
#define DOS_BASE_NAME   dosbase_
#define INTUITION_BASE_NAME   intuibase
#define BL_ID4(a, b, c, d)
#define FONTBUF   16384
#define FONTCHUNK   164 /* "FONT", size, struct FontPrefs */
#define CIAA_PRA   (*(volatile UBYTE *)0xbfe001)
#define CIAA_TODLOW   (*(volatile UBYTE *)0xbfe801)
#define CIAA_TODMID   (*(volatile UBYTE *)0xbfe901)
#define CIAA_TODHI   (*(volatile UBYTE *)0xbfea01)

Functions

void _resettimer (void)
void _getsigbit (void)
void _iswbhere (void)
void _doeasy (void)
void _doeasy2 (void)
void _doeasy3 (void)
void _doeasy4 (void)
void _doflip (void)
void _parseinit (void)
void rimisclib_nextparsearg (void)
void _ezoutput (void)
void _ezoutput2 (void)
void _doeasy6 (void)
void _doeasysep (void)
void _doclickwait (void)
void _doprogpath (void)
void _doprogdir (void)
void _doprogname (void)
void _fromblitz (void)
void _ltos (void)
void _ascraw (void)
void _rawasc (void)
void _openfontprefs (void)
void _closefontprefs (void)
void _defaultfontheight (void)
void _defaultfontname (void)
void _nextparseuntilchar (void)
void _binstr (void)
void rimisclib_libinit (void)
void rimisclib_libfinit (void)
void ezargschk (void)
void ezreqargschk (void)
void ezgad3chk (void)
void ezgad2chk (void)
static ULONG copyout (const UBYTE *s)
static ULONG libinit_c (void)
 init: open dos.library and intuition.library (any version).
static ULONG closefontprefs_c (void)
 CloseFontPrefs: free the font prefs buffer of OpenFontPrefs.
static void libfinit_c (void)
 finit: close intuition.library (if open) and dos.library, free the font prefs buffer.
static void resettimer_c (void)
 TimerReset: set the CIA-A TOD counter to 0.
static void doclickwait_c (void)
 ClickWait: wait for a click of the left mouse button.
static ULONG getsigbit_c (const struct MsgPort *port)
 PortSigBit(msgport): the signal bit of a message port.
static BB_BOOL iswbhere_c (void)
 WorkbenchHere: whether a screen's title contains "Workbench".
static BB_BOOL fromblitz_c (void)
 FromBlitz: whether the program runs from Blitz (the task name starts with "Blitz ][ Program Proc").
static ULONG ltos_c (ULONG v)
 LtoS(longword): a long as a string of its 4 bytes.
static ULONG ascraw_c (UWORD key)
 ASCRaw(rawkey): the character of a raw key code.
static ULONG rawasc_c (const UBYTE *s)
 RawASC(char): the raw key code of a character.
static ULONG doflip_c (const ULONG *lens)
 Flip$(String$): the string reversed.
static ULONG binstr_c (const UBYTE *src, const UBYTE *find, const ULONG *lens)
 BInstr(String$,Findstring$): the position of the last Findstring$ in String$.
static void parseinit_c (const UBYTE *s)
 InitArgParse parameter$: start parsing a string with NextArg$ / NextArgChar$.
static ULONG nextparsearg_c (void)
 NextArg$: the next word of the InitArgParse string.
static ULONG nextparseuntilchar_c (UBYTE ch)
 NextArgChar$ char: the InitArgParse string up to a character.
static ULONG fmtbytes (const UBYTE *f)
static UBYTE * ezformat (const UBYTE *f, APTR args, ULONG *size)
static UWORD ezitext (struct IntuiText *it, UBYTE *s, WORD top, struct IntuiText *next)
static ULONG doeasy13 (void)
static ULONG doeasybegin (void)
static LONG quicktrunc (ULONG q)
static LONG ffptrunc (ULONG f)
static void doargs (const UBYTE *sp, UWORD cnt, UBYTE *fmt)
static ULONG doeasy_c (STRPTR title, STRPTR body, STRPTR gadget)
 EZRequest title$,body$,gadget$: an EasyRequest on the EZOutput window ('|' in the body: a line feed).
static ULONG doeasy2_c (STRPTR body, STRPTR gadget)
 EZRequest body$,gadget$: an EasyRequest without a title.
static ULONG doeasy3_c (STRPTR body)
 EZRequest body$: an EasyRequest without a title, gadget "Ok".
static ULONG doeasy4_c (STRPTR title, STRPTR body, STRPTR gadget, UBYTE *args, UWORD reps)
 EZRequest title$,body$,gadget$,var..: an EasyRequest with the arguments as the format arguments.
static ULONG doeasy6_c (UBYTE *args, ULONG reps)
 EZRequestArgs args..: an EasyRequest whose body is built from the arguments.
static void ezoutput_c (struct Window **w)
 EZOutput win#: the window of the EZRequests.
static void ezoutput2_c (void)
 EZOutput: the EZRequests on the default screen again (no window).
static void doeasysep_c (const UBYTE *s)
 EZSeparator char: the separator EZRequestArgs puts between the arguments (default '|', a line feed).
static void dirpath13 (UBYTE *buf)
static void progname13 (UBYTE *buf)
static ULONG doprogpath_c (void)
 ProgPath$: the program's directory and name.
static ULONG doprogdir_c (void)
 ProgDir$: the program's directory.
static ULONG doprogname_c (void)
 ProgName$: the program's name.
static BB_BOOL openfontprefs_c (void)
 OpenFontPrefs: read ENV:SYS/Font.Prefs into a 16K buffer.
static const struct FontPrefs * findfont (UWORD type)
static ULONG defaultfontheight_c (ULONG type)
 DefaultFontHeight(fonttype): the height of a font of the font prefs (OpenFontPrefs).
static ULONG defaultfontname_c (UWORD type)
 DefaultFontName(fonttype): the name of a font of the font prefs.
static void gadchk (const UBYTE *g)
static ULONG argbytes (const UBYTE *sp, UWORD cnt)
static void ezargschk_c (const UBYTE *args, UWORD reps, const UBYTE *gadget)
 The error check of EZRequest title$,body$,gadget$,var.. (debugger only).
static void ezgad3chk_c (const UBYTE *gadget)
 The error check of EZRequest title$,body$,gadget$ (debugger only).
static void ezgad2chk_c (const UBYTE *gadget)
 The error check of EZRequest body$,gadget$ (debugger only).
static void ezreqargschk_c (const UBYTE *args, UWORD reps)
 The error check of EZRequestArgs args.. (debugger only).

Variables

static struct DosLibrary * dosbase_
static struct IntuitionBase * intuibase
static const char dosname [] = "dos.library"
static const char intuiname [] = "intuition.library"
static UBYTE * fontpos
static UBYTE * fontloc
static ULONG fontlen
static BPTR fontfh
static const char fontname [] = "ENV:SYS/Font.Prefs"
struct { 
   UBYTE   guard0 [2] 
   UBYTE   rawprogname [256] 
   UBYTE   guard1 [2] 
   UBYTE   progname [256] 
   UBYTE   guard2 [2] 
   UBYTE   progdir [256] 
} pd
static UBYTE * parseadr
static UBYTE * curadr
static UBYTE argbuffer [256]
struct { 
   struct EasyStruct   es 
   APTR   args 
   ULONG   args2 [16] 
} ez = { { 20, 0, NULL, NULL, NULL }, NULL, { 0 } }
static UBYTE ezargsbuf [160]
static ULONG numargs
static UBYTE flag
static UBYTE sep = '|'
static UBYTE * ezfirst
static struct Window * win
static const char okgad [] = "Ok"
static const UBYTE * thisscreen
static const char titlestring [] = "Workbench"
static const char procname [] = "Blitz ][ Program Proc"
static const UBYTE rawtable [114]
static const UWORD ez_putch [] = { 0x16c0, 0x4e75 }
static const UWORD ez_countch [] = { 0x5293, 0x4e75 }
static struct TextAttr topaz8 = { (STRPTR)"topaz.font", 8, FS_NORMAL, FPF_ROMFONT }

Macro Definition Documentation

◆ __NOLIBBASE__

#define __NOLIBBASE__

◆ BL_ID4

#define BL_ID4 ( 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

◆ CIAA_PRA

#define CIAA_PRA   (*(volatile UBYTE *)0xbfe001)

◆ CIAA_TODHI

#define CIAA_TODHI   (*(volatile UBYTE *)0xbfea01)

◆ CIAA_TODLOW

#define CIAA_TODLOW   (*(volatile UBYTE *)0xbfe801)

◆ CIAA_TODMID

#define CIAA_TODMID   (*(volatile UBYTE *)0xbfe901)

◆ DOS_BASE_NAME

#define DOS_BASE_NAME   dosbase_

◆ FONTBUF

#define FONTBUF   16384

◆ FONTCHUNK

#define FONTCHUNK   164 /* "FONT", size, struct FontPrefs */

◆ INTUITION_BASE_NAME

#define INTUITION_BASE_NAME   intuibase

Function Documentation

◆ _ascraw()

void _ascraw ( void )

◆ _binstr()

void _binstr ( void )

◆ _closefontprefs()

void _closefontprefs ( void )

◆ _defaultfontheight()

void _defaultfontheight ( void )

◆ _defaultfontname()

void _defaultfontname ( void )

◆ _doclickwait()

void _doclickwait ( void )

◆ _doeasy()

void _doeasy ( void )

◆ _doeasy2()

void _doeasy2 ( void )

◆ _doeasy3()

void _doeasy3 ( void )

◆ _doeasy4()

void _doeasy4 ( void )

◆ _doeasy6()

void _doeasy6 ( void )

◆ _doeasysep()

void _doeasysep ( void )

◆ _doflip()

void _doflip ( void )

◆ _doprogdir()

void _doprogdir ( void )

◆ _doprogname()

void _doprogname ( void )

◆ _doprogpath()

void _doprogpath ( void )

◆ _ezoutput()

void _ezoutput ( void )

◆ _ezoutput2()

void _ezoutput2 ( void )

◆ _fromblitz()

void _fromblitz ( void )

◆ _getsigbit()

void _getsigbit ( void )

◆ _iswbhere()

void _iswbhere ( void )

◆ _ltos()

void _ltos ( void )

◆ _nextparseuntilchar()

void _nextparseuntilchar ( void )

◆ _openfontprefs()

void _openfontprefs ( void )

◆ _parseinit()

void _parseinit ( void )

◆ _rawasc()

void _rawasc ( void )

◆ _resettimer()

void _resettimer ( void )

◆ argbytes()

ULONG argbytes ( const UBYTE * sp,
UWORD cnt )
static

◆ ascraw_c()

ULONG ascraw_c ( UWORD key)
static

ASCRaw(rawkey): the character of a raw key code.

From the original's table of 114 entries; a key outside 0..113 (a key up code, a negative value) gives the character 0, as the table's keys without a character do. Fixed (#744): the original did not check the code and read behind (or before) the table.

Parameters
keyd0.w: the raw key code
Returns
d0: 1, the length of the string at a3

◆ binstr_c()

ULONG binstr_c ( const UBYTE * src,
const UBYTE * find,
const ULONG * lens )
static

BInstr(String$,Findstring$): the position of the last Findstring$ in String$.

Searches backwards. DIFF: a2 and a3 stay unchanged (the original leaves them on the strings).

Parameters
srcd0: String$
findd1: Findstring$
lensa2: the argument stack, -4(a2) the length of String$
Returns
d0: the position, 1 based; 0 if none (and for Findstring$ = "")

◆ closefontprefs_c()

ULONG closefontprefs_c ( void )
static

CloseFontPrefs: free the font prefs buffer of OpenFontPrefs.

Returns
d0: 0 (OpenFontPrefs' failures return it)

◆ copyout()

ULONG copyout ( const UBYTE * s)
static

◆ defaultfontheight_c()

ULONG defaultfontheight_c ( ULONG type)
static

DefaultFontHeight(fonttype): the height of a font of the font prefs (OpenFontPrefs).

Parameters
typed0.w: fp_Type (0 icon, 1 system, 2 screen)
Returns
d0.w: its ta_YSize (d0's high word kept); 0 if there is no buffer or no such chunk (#745)

◆ defaultfontname_c()

ULONG defaultfontname_c ( UWORD type)
static

DefaultFontName(fonttype): the name of a font of the font prefs.

Parameters
typed0.w: fp_Type (0 icon, 1 system, 2 screen)
Returns
d0: the length of fp_Name (at a3, a3 on the 0, fixed #743); 0 ("") if there is no buffer or no such chunk (#745)

◆ dirpath13()

void dirpath13 ( UBYTE * buf)
static

◆ doargs()

void doargs ( const UBYTE * sp,
UWORD cnt,
UBYTE * fmt )
static

◆ doclickwait_c()

void doclickwait_c ( void )
static

ClickWait: wait for a click of the left mouse button.

Busy waits on CIA-A until the button is pressed, a short delay (DBRA of 12767), until it is released.

◆ doeasy13()

ULONG doeasy13 ( void )
static

◆ doeasy2_c()

ULONG doeasy2_c ( STRPTR body,
STRPTR gadget )
static

EZRequest body$,gadget$: an EasyRequest without a title.

Fixed (#1027): a3 = body$ afterwards (the original: 0).

Parameters
bodyd0: the body text
gadgetd1: the gadgets
Returns
d0: what EasyRequestArgs returns

◆ doeasy3_c()

ULONG doeasy3_c ( STRPTR body)
static

EZRequest body$: an EasyRequest without a title, gadget "Ok".

Parameters
bodyd0: the body text
Returns
d0: what EasyRequestArgs returns

◆ doeasy4_c()

ULONG doeasy4_c ( STRPTR title,
STRPTR body,
STRPTR gadget,
UBYTE * args,
UWORD reps )
static

EZRequest title$,body$,gadget$,var..: an EasyRequest with the arguments as the format arguments.

See doargs; no limit of the 16 argument longs (an invalid argument: ezargschk, fixed #748). Quick and Float arguments: their integer part (fixed #750, #749). Fixed (#1027): a3 = title$ afterwards (the original: the argument array).

Parameters
titled0: the title
bodyd1: the body (format) text
gadgetd2: the gadgets
argsa2: the argument stack: the three lengths, below them the repeated arguments
repsd7.w: the number of arguments
Returns
d0: what EasyRequestArgs returns

◆ doeasy6_c()

ULONG doeasy6_c ( UBYTE * args,
ULONG reps )
static

EZRequestArgs args..: an EasyRequest whose body is built from the arguments.

s / ld / d per type, separated by the EZSeparator character ('|': a line feed), gadget "Ok", no title. Fixed (#747): the format text ends with a 0 (the original wrote none, a shorter text kept the end of the one before). No limit of the arguments (an invalid argument: ezreqargschk, fixed #748); BUG(orig): without arguments a type word is read from a2 and the count 0 runs the loop 65536 times (#746). Quick/Float: their integer part (fixed #750, #749). Fixed (#1027): a3 = the first string argument afterwards, unchanged without one (the original: the argument array).

Parameters
argsa2: the argument stack, the repeated arguments
repsd7.w: the number of arguments
Returns
d0: what EasyRequestArgs returns

◆ doeasy_c()

ULONG doeasy_c ( STRPTR title,
STRPTR body,
STRPTR gadget )
static

EZRequest title$,body$,gadget$: an EasyRequest on the EZOutput window ('|' in the body: a line feed).

DIFF: a2 stays (the original: 0). Fixed (#1027): a3 = title$ afterwards (the original: 0).

Parameters
titled0: the title
bodyd1: the body text
gadgetd2: the gadgets ('|' separated)
Returns
d0: what EasyRequestArgs returns (the gadget number)

◆ doeasybegin()

ULONG doeasybegin ( void )
static

◆ doeasysep_c()

void doeasysep_c ( const UBYTE * s)
static

EZSeparator char: the separator EZRequestArgs puts between the arguments (default '|', a line feed).

Parameters
sd0: the string, its first character

◆ doflip_c()

ULONG doflip_c ( const ULONG * lens)
static

Flip$(String$): the string reversed.

Reversed in place: the argument is the string below a3, a3 stays. A string of 0 or 1 characters stays as it is. Fixed (#751): the original swapped 65536 byte pairs around it (DBRA with -1).

Parameters
lensa2: the argument stack, -4(a2) the length of the string
Returns
d0: the length

◆ doprogdir_c()

ULONG doprogdir_c ( void )
static

ProgDir$: the program's directory.

Calls ProgPath$ only while its buffer is empty (the directory does not change). a3 ends on the 0 (fixed, #743).

Returns
d0: the length

◆ doprogname_c()

ULONG doprogname_c ( void )
static

ProgName$: the program's name.

Calls ProgPath$ only while its buffer is empty. a3 ends on the 0 (fixed, #743).

Returns
d0: the length

◆ doprogpath_c()

ULONG doprogpath_c ( void )
static

ProgPath$: the program's directory and name.

GetProgramDir (without one: the current directory) and GetProgramName (empty: the task name); fills the buffers of ProgDir$ and ProgName$. a3 ends on the 0 of the result (fixed, #743: the original left it behind the 0). Without a directory name the result is the name alone; fixed (#758): the original decided on the "/" by the byte before the result. "/" is added unless the directory ends in ":". Below dos V36 (Kickstart 1.x has none of the four functions; fixed #1150, the original called them there, behind dos's jump table): the current directory, its path built by the library (dirpath13), and the shell's command name (cli_CommandName; without a shell the task name). A program started with a path from another directory gets the current directory there, not its own.

Returns
d0: the length

◆ ezargschk()

void ezargschk ( void )

◆ ezargschk_c()

void ezargschk_c ( const UBYTE * args,
UWORD reps,
const UBYTE * gadget )
static

The error check of EZRequest title$,body$,gadget$,var.. (debugger only).

Fixed (#748), not in the original (neither form limits its arguments; the library had no error check area): arguments that take more than the 64 bytes of the argument array (16 longs), which doargs would write behind it. The release code is unchanged (the number of arguments is in the program's source).

Fixed (#1150): below intuition V36 also more than two gadgets, as ezgad3chk.

Errors: "Too Many EZRequest Arguments"; "More than two EZRequest gadgets need Kickstart 2.0".

Parameters
argsa2: the argument stack: the three lengths, below them the repeated arguments
repsd7.w: the number of arguments
gadgetd2: the gadgets

◆ ezformat()

UBYTE * ezformat ( const UBYTE * f,
APTR args,
ULONG * size )
static

◆ ezgad2chk()

void ezgad2chk ( void )

◆ ezgad2chk_c()

void ezgad2chk_c ( const UBYTE * gadget)
static

The error check of EZRequest body$,gadget$ (debugger only).

As ezgad3chk (fixed #1150).

Errors: "More than two EZRequest gadgets need Kickstart 2.0".

Parameters
gadgetd1: the gadgets

◆ ezgad3chk()

void ezgad3chk ( void )

◆ ezgad3chk_c()

void ezgad3chk_c ( const UBYTE * gadget)
static

The error check of EZRequest title$,body$,gadget$ (debugger only).

Fixed (#1150), not in the original (it called EasyRequestArgs also on Kickstart 1.x, a crash): below intuition V36 more than two gadgets, which the library's AutoRequest cannot show (the release code shows no requester and returns 0).

Errors: "More than two EZRequest gadgets need Kickstart 2.0".

Parameters
gadgetd2: the gadgets

◆ ezitext()

UWORD ezitext ( struct IntuiText * it,
UBYTE * s,
WORD top,
struct IntuiText * next )
static

◆ ezoutput2_c()

void ezoutput2_c ( void )
static

EZOutput: the EZRequests on the default screen again (no window).

◆ ezoutput_c()

void ezoutput_c ( struct Window ** w)
static

EZOutput win#: the window of the EZRequests.

Parameters
wa0: the window object (windowslib, ia0|pd0), its first long the Window

◆ ezreqargschk()

void ezreqargschk ( void )

◆ ezreqargschk_c()

void ezreqargschk_c ( const UBYTE * args,
UWORD reps )
static

The error check of EZRequestArgs args.. (debugger only).

As ezargschk (fixed #748): more than 64 bytes of arguments. Within 64 bytes the format text cannot overflow its 160 bytes (at most 32 words, 3 bytes each with the separator: 96).

Errors: "Too Many EZRequest Arguments".

Parameters
argsa2: the argument stack, the repeated arguments
repsd7.w: the number of arguments

◆ ffptrunc()

LONG ffptrunc ( ULONG f)
static

◆ findfont()

const struct FontPrefs * findfont ( UWORD type)
static

◆ fmtbytes()

ULONG fmtbytes ( const UBYTE * f)
static

◆ fromblitz_c()

BB_BOOL fromblitz_c ( void )
static

FromBlitz: whether the program runs from Blitz (the task name starts with "Blitz ][ Program Proc").

Compares bytes (DIFF: the original's CMPM.l is an address error at an odd task name on a 68000).

Returns
d0: BB_TRUE if it does, else BB_FALSE

◆ gadchk()

void gadchk ( const UBYTE * g)
static

◆ getsigbit_c()

ULONG getsigbit_c ( const struct MsgPort * port)
static

PortSigBit(msgport): the signal bit of a message port.

Parameters
portd0: the MsgPort
Returns
d0: its mp_SigBit (a byte result)

◆ iswbhere_c()

BB_BOOL iswbhere_c ( void )
static

WorkbenchHere: whether a screen's title contains "Workbench".

Searches the screen titles from the library's IntuitionBase (FirstScreen) up to the end of the list, each title from every character on; a screen without a title is skipped. Fixed (#759): the original took IntuitionBase from d0, which is no argument (MOVE.l intuibase,a0 overwritten by MOVE.l d0,a0). Fixed (#761): the original never ends the screen list (no 0 check: it reads the "screen" at address 0 and goes on), so it returned BB_TRUE or hung, never BB_FALSE. Fixed (#762): the original restarted the same title when it ended during a partial match, for ever for a title that ends with the start of "Workbench". Fixed (#760): the original went on with the next screen at the first mismatch after a "W" ("A Window on Workbench" was not found).

Returns
d0: BB_TRUE when found, BB_FALSE at the end of the list

◆ libfinit_c()

void libfinit_c ( void )
static

finit: close intuition.library (if open) and dos.library, free the font prefs buffer.

The bases are not cleared (no defect: nothing uses them after finit).

◆ libinit_c()

ULONG libinit_c ( void )
static

init: open dos.library and intuition.library (any version).

No font prefs buffer yet.

Returns
d0: the intuition.library base (0 if it is missing)

◆ ltos_c()

ULONG ltos_c ( ULONG v)
static

LtoS(longword): a long as a string of its 4 bytes.

Highest byte first, written to a3 without a 0. The bytes 0-31 and 128-255 become 128 (a signed CMPI.b #32), the documented "non-ASCII characters are replaced with character 128" (no defect, #753).

Parameters
vd0: the long
Returns
d0: 4, the length

◆ nextparsearg_c()

ULONG nextparsearg_c ( void )
static

NextArg$: the next word of the InitArgParse string.

Leading spaces are skipped; quotes group (a quoted word ends at the closing quote even if no space follows, as ReadItem does), "" inside quotes is a quote. The word goes to a3 without a 0 (none needed, #257). The parse position stays on the 0 at the end of the string. Fixed (#755): the original counts the quotes (d7) and ends the word at an even count unless a quote follows; "" moved the count on by one only, so the quote behind it copied the next character (possibly the 0, stepping behind it). A quote now ends the word unless a quote follows, which is copied once.

Returns
d0: the length; 0 at the end (also before InitArgParse)

◆ nextparseuntilchar_c()

ULONG nextparseuntilchar_c ( UBYTE ch)
static

NextArgChar$ char: the InitArgParse string up to a character.

Everything up to char (or the end) to a3, without a 0; the parse position goes behind char. Before InitArgParse and after NextArg$ came to the end the result is "", as NextArg$'s. Fixed (#754): the original did not check the parse pointer and read from address 0.

Parameters
chd0.b: the character
Returns
d0: the length

◆ openfontprefs_c()

BB_BOOL openfontprefs_c ( void )
static

OpenFontPrefs: read ENV:SYS/Font.Prefs into a 16K buffer.

Without memory for the buffer it returns BB_FALSE; fixed (#756): the original did not check AllocMem and read the file to address 0. The buffer of an OpenFontPrefs before is freed first; fixed (#757): the original lost it. Fixed (#745): the chunks are read within the bytes read (the original ignored Read's result and took the PRHD size unchecked; a read error is a failed open now).

Returns
d0: BB_TRUE if it is a FORM PREF with PRHD and a FONT chunk behind it; else BB_FALSE, the buffer freed (the tail call of CloseFontPrefs, which returns 0)

◆ parseinit_c()

void parseinit_c ( const UBYTE * s)
static

InitArgParse parameter$: start parsing a string with NextArg$ / NextArgChar$.

Copies at most 255 characters of it and a 0 into the 256 byte buffer; the rest of a longer string is cut off. Fixed (#752): the original copies without a limit and clears four more bytes behind the copy, an end guard for NextArg$, which stepped behind the 0 (it stays on it since #755).

Parameters
sd0: the string

◆ progname13()

void progname13 ( UBYTE * buf)
static

◆ quicktrunc()

LONG quicktrunc ( ULONG q)
static

◆ rawasc_c()

ULONG rawasc_c ( const UBYTE * s)
static

RawASC(char): the raw key code of a character.

The first index of the string's first character in the table; -1 for a character not in the table and for "" (as Asc gives -1 for ""). Fixed (#744): the original searched on behind the table until it found the byte somewhere (or for ever), and found "" (its 0) at 14.

Parameters
sd0: the string
Returns
d0.w: the raw key code, -1 if there is none

◆ resettimer_c()

void resettimer_c ( void )
static

TimerReset: set the CIA-A TOD counter to 0.

Writing the high byte stops it, the low byte starts it again.

◆ rimisclib_libfinit()

void rimisclib_libfinit ( void )

◆ rimisclib_libinit()

void rimisclib_libinit ( void )

◆ rimisclib_nextparsearg()

void rimisclib_nextparsearg ( void )

Variable Documentation

◆ argbuffer

UBYTE argbuffer[256]
static

◆ args

APTR args

◆ args2

ULONG args2[16]

◆ curadr

UBYTE * curadr
static

◆ dosbase_

struct DosLibrary* dosbase_
static

◆ dosname

const char dosname[] = "dos.library"
static

◆ es

struct EasyStruct es

◆ [struct]

struct { ... } ez

◆ ez_countch

const UWORD ez_countch[] = { 0x5293, 0x4e75 }
static

◆ ez_putch

const UWORD ez_putch[] = { 0x16c0, 0x4e75 }
static

◆ ezargsbuf

UBYTE ezargsbuf[160]
static

◆ ezfirst

UBYTE* ezfirst
static

◆ flag

UBYTE flag
static

◆ fontfh

BPTR fontfh
static

◆ fontlen

ULONG fontlen
static

◆ fontloc

UBYTE * fontloc
static

◆ fontname

const char fontname[] = "ENV:SYS/Font.Prefs"
static

◆ fontpos

UBYTE* fontpos
static

◆ guard0

UBYTE guard0[2]

◆ guard1

UBYTE guard1[2]

◆ guard2

UBYTE guard2[2]

◆ intuibase

struct IntuitionBase* intuibase
static

◆ intuiname

const char intuiname[] = "intuition.library"
static

◆ numargs

ULONG numargs
static

◆ okgad

const char okgad[] = "Ok"
static

◆ parseadr

UBYTE* parseadr
static

◆ [struct]

struct { ... } pd

◆ procname

const char procname[] = "Blitz ][ Program Proc"
static

◆ progdir

UBYTE progdir[256]

◆ progname

UBYTE progname[256]

◆ rawprogname

UBYTE rawprogname[256]

◆ rawtable

const UBYTE rawtable[114]
static
Initial value:
= {
'\'', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', '\\', 0, '0',
'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', 0, '1', '2', '3',
'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '#', 0, 0, '4', '5', '6', 0,
'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', 0, '.', '7', '8', '9', ' ', 0, 9, 13,
0,
27, 8, 0, 0, 0, '-', 0, 28, 29, 30, 31,
129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
'(', ')', '/', '*', '+', 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}

◆ sep

UBYTE sep = '|'
static

◆ thisscreen

const UBYTE* thisscreen
static

◆ titlestring

const char titlestring[] = "Workbench"
static

◆ topaz8

struct TextAttr topaz8 = { (STRPTR)"topaz.font", 8, FS_NORMAL, FPF_ROMFONT }
static

◆ win

struct Window* win
static