|
| void | _bankloc (void) |
| void | _banksize (void) |
| void | _initbank (void) |
| void | _freebank (void) |
| void | banklib_allocmem (void) |
| void | _freemem (void) |
| void | _bankload (const UBYTE *name, struct Library *dosbase) |
| | LoadBank bank#,filename$: LoadBank with the bank's memtype if it is in use, else 0.
|
| void | _bankloadb (const UBYTE *name, ULONG memtype, struct Library *dosbase) |
| | LoadBank bank#,filename$,memtype: load a file into the bank.
|
| void | _banksave (const UBYTE *name, struct Library *dosbase) |
| | SaveBank bank#,filename$: write the bank to a new file.
|
| static void | freebank (struct bank *b) |
| static void | freebank_c (void) |
| | FreeBank bank#: free the bank's memory.
|
| | BLITZ_ALIAS (_freebank, freebank_c) |
| static void | initbank (struct bank *b, ULONG size, ULONG memtype) |
| static void | initbank_c (ULONG size, ULONG memtype) |
| | InitBank bank#,size,memtype: (re)allocate the bank.
|
| | BLITZ_ALIAS (_initbank, initbank_c) |
| static ULONG | bankloc_c (const struct bank *b) |
| | Bank(bank#), BankLoc(bank#): the address of the bank's memory.
|
| | BLITZ_ALIAS (_bankloc, bankloc_c) |
| static ULONG | banksize_c (const struct bank *b) |
| | BankSize(bank#): the size of the bank.
|
| | BLITZ_ALIAS (_banksize, banksize_c) |
| static ULONG | allocmem_c (ULONG size, ULONG memtype) |
| | AllocMem(size,memtype): memory from memlib globalloc (freed at the end of the program).
|
| static void | freemem_c (ULONG mem, ULONG size) |
| | FreeMem address,size: memlib globfree (a1 = address, d0 = size).
|
| | BLITZ_ALIAS (_freemem, freemem_c) |
| void _bankloadb |
( |
const UBYTE * | name, |
|
|
ULONG | memtype, |
|
|
struct Library * | dosbase ) |
LoadBank bank#,filename$,memtype: load a file into the bank.
Asks fileiolib's Exists (ALibJsr $3E15) for the file size: 0 (no file, an empty file) = nothing happens. The bank is (re)allocated with the file size if the memtype differs or if the file is not smaller than the bank (CMP.l/BMI: the same size is reallocated too); a larger bank is kept, its old contents behind the file's data stay. Then Read(file,
pos, BANK size). Errors of Open/Read are ignored. Fixed (#72): a drawer (Exists = -1) leaves the bank as it is; the original reallocated it with $FFFFFFFF bytes for a different memtype (memlib's header made it AllocMem(7), pos behind that block, size -1).
The bank comes in a3 (!libs {banklib,$1380}, from bank# in d0).
- Parameters
-
| name | d1: the file name |
| memtype | d2: the memory type (0 = fast, 2 = chip, 65536 = clear) |
| dosbase | a6: dos.library |
| void _banksave |
( |
const UBYTE * | name, |
|
|
struct Library * | dosbase ) |
SaveBank bank#,filename$: write the bank to a new file.
Write(pos, size); nothing for an unused bank. Not a bug (no error reporting anywhere in the library): errors of Open/Write are ignored.
The bank comes in a3 (!libs {banklib,$1380}, from bank# in d0).
- Parameters
-
FreeBank bank#: free the bank's memory.
memlib globfree of pos/size if both are set, then both cleared; memtype stays (not a bug: no visible effect).
The bank comes in a3 (!libs {banklib,$1380}, from bank# in d0).
| void initbank_c |
( |
ULONG | size, |
|
|
ULONG | memtype ) |
|
static |
InitBank bank#,size,memtype: (re)allocate the bank.
Frees the bank, then (size not 0) stores size and memtype and allocates size bytes (memlib globalloc). Not a bug (intended): size 0 only frees the bank. Not a bug (no visible effect, #71): size and memtype are stored before the allocation; the original memlib never returns from a failed one ("Out of Memory!"), only the C memlib does (K).
The bank comes in a3 (!libs {banklib,$1380}, from bank# in d0).
- Parameters
-
| size | d1: the size in bytes |
| memtype | d2: the memory type (0 = fast, 2 = chip, 65536 = clear) |