Description
The Tennokoe 2, IFU-30 and DUO systems provided an extra 2KB of battery powered back up memory.
The backup ram (BRAM for short) “file system” is organized as follows :
BRAM Header (16 bytes)
00-03 | Header tag (equals to “HUBM”) |
04-05 | Pointer to the first byte after BRAM. |
06-07 | Pointer to the next available BRAM slot (first unused byte). |
08-0f | Reserved (set to 0). |
BRAM Entry Header
00-01 | Entry size. This size includes the $10 bytes of the entry header. |
02-03 | Checksum. The checksum is the sum of the entry bytes starting from byte #4 (i.e all bytes except the entry size and checksum). The value stored is the opposite of the computed checksum. This way the consistency check only consists in adding the ssum the stored checksum and the newly computed one. If this sum is 0, the entry is valid. |
04-0f | Entry name. |
BRAM Entry name
00-01 | Unique ID. |
02-0b | ASCII name (padded with spaces). |
BRAM Entry Data
Miscenalleous data which size is given in the BRAM Entry Header.
BRAM Entry Trailer (2 bytes)
This 2 bytes are set to zeroes. They are not part of the BRAM “used area”. It is used as a linked list terminator.
For CD-ROM programs, the following BRAM routines are provided from the System Card:
- bm_format
- bm_free
- bm_read
- bm_write
- bm_delete
- bm_files
Summary
Backup RAM. | The Tennokoe 2, IFU-30 and DUO systems provided an extra 2KB of battery powered back up memory. |
Functions | |
bm_bind | Unlock and map BRAM to mpr #4. |
bm_unbind | Lock BRAM and restore mpr #4. |
bm_test | Test if data can safely be written to BRAM. |
bm_check_header | Checks if the BRAM header is valid. |
bm_detect | Detect if a BRAM is present on the system. |
bm_size | Get the storage capacity in bytes of the backup RAM. |
bm_format | Initialize backup memory. |
bm_free | Returns the number of free bytes. |
bm_checksum | Compute checksum. |
bm_open | Finds the BRAM entry whose name is given as argument. |
bm_adjust_pointer | |
bm_read | Read entry data. |
bm_write | Update entry data. |
bm_delete | Delete the specified entry. |
bm_files | Get file by index and store the information in a buffer. |
bm_getptr.2 | Given a pointer to the BRAM, obtain the name of the entry and the pointer to the next entry. |
bm_create | Create a new entry at the end of current storage. |
bm_exists | Check if there is an entry which name matches the one given as parameter. |