#include "huc.h"
main()
{
char namebuf[13]; /* for BRAM filenames */
int nextptr; /* pointer to the next filename in BRAM */
int line_cnt; /* for displaying the results */
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) */
}
namebuf[12] = 0; /* the last char in the namebuffer has to be an absolute 0 */
nextptr = BRAM_STARTPTR; /* sets up the first pointer */
line_cnt = 2; /* first result will be displayed on character line 5 */
while (nextptr = bm_getptr(nextptr, namebuf)) /* get the next filename */
{
put_string(&namebuf[2], 3, line_cnt); /* display the filename */
put_number(namebuf[0], 1, 0, line_cnt); /* display the first value of the two-byte ID */
put_number(namebuf[1], 1, 1, line_cnt); /* display the second value of the two-byte ID */
put_number(bm_sizeof(namebuf), 4, 15, line_cnt); /* get the size of the file and display it */
line_cnt++; /* increment the char line counter */
}
} |