bm_free

Prototypes:
Returns:
Description:

This function returns 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.

Complete Example:

#include "huc.h"

main()
{
  set_color(1, 511); /* set color 1 to pure white */
  set_font_color(1, 0); /* set the font color */
  set_font_pal(0); /* set the font palette */
  load_default_font(); /* load the default font */

  if(!bm_check()) /* check to see if BRAM is available on this system */
  {
    put_string("BACKUP RAM NOT AVAILABLE.", 0, 0); /* give an error message */
    while(1) { vsync(); } /* infinite loop (effectively stops the program) */
  }
  put_number(bm_free(), 4, 0, 0); /* output the amount of free backup RAM */
}

Sample Output:



Notes:

This function was added in version 1.50.

See Also:

bm_check | bm_sizeof