Backup Ram Functions

bm_check( void );

Return whether the backup ram is available.


bm_format( void );

Format the whole backup ram. Does not format if data is already formatted. Actually, data isn't erased but the header data reports so. You should be able to find old data in the bram using raw reads in the backup ram bank but not through the usual HuC functions. Return backup ram status as defined in the hucc.h file.


bm_free( void );

Return the number of free bytes available for user data. The amount required for the data header and the necessary 2-byte termination are already deducted from this amount. The value returned is the number of bytes free for user data.


bm_read( unsigned char *buffer, unsigned char *name, unsigned int offset, unsigned int length );

Read 'nb' bytes from file named 'name' and put them into 'buf'. I'm not sure whether the 'offset' is relative to the buffer or the file ... Return backup ram status as defined in the hucc.h file.


bm_write( unsigned char *buffer, unsigned char *name, unsigned int offset, unsigned int length );

Write into the file named 'name'. Data to write are in the buffer 'buf' and 'nb' bytes are written from offset 'offset' in the buffer. Return backup ram status as defined in the hucc.h file.


bm_delete( unsigned char *name );

Delete BRAM entry with a given name


bm_exist( unsigned char *name );

Check whether a backup ram file exists. This returns TRUE (!= 0) if good; FALSE (0) if bad. The name structure is not just an ASCII name; it begins with a 2-byte "uniqueness ID" which is almost always 00 00, followed by 10 bytes of ASCII name - which should be padded with trailing spaces.


bm_create( unsigned char *name, unsigned int length );

Create a new file names 'name' with a size of 'size' bytes. Return backup ram status as defined in the hucc.h file.

Last updated