extern Uint8 game_name[]; /* Game name (sort item) */
extern Uint16 icon_palette[]; /* Icon palette data */
extern Uint8 icon_data[]; /* Icon pixel data */
extern Uint8 visual_data[]; /* Visual data */
extern Uint8 save_data[]; /* Application save data */
Sint32 nblock1, nblock2;
void* buf;
BUS_BACKUPFILEHEADER hdr; /* Memory card file header */
memset(&hdr, 0, sizeof(hdr));
strcpy(hdr.vms_comment, "VMS_COMMENT"); /* Visual memory comment setting */
strcpy(hdr.btr_comment, "BOOT ROM full-character comment"); /* BootROM comment setting */
memcpy(hdr.game_name, game_name, 16); /* Game name (sort item) setting */
hdr.icon_palette = icon_palette; /* Icon palette data setting */
hdr.icon_data = icon_data; /* Icon pixel data setting */
hdr.icon_num = 1; /* Number of icons setting */
hdr.icon_speed = 1; /* Icon speed setting */
hdr.visual_data = visual_data; /* Visual comment setting */
hdr.visual_type = BUD_VISUALTYPE_C; /* Visual type setting */
hdr.save_data = save_data; /* Application save data */
hdr.save_size = 0x400; /* Application save data size */
nblock = buCalcBackupFileSize(hdr.icon_num, hdr.visual_type, hdr.save_size);
buf = syMalloc(nblock * 512); /* Allocates (the number of blocks to be used x 512 bytes) */
if (buf == NULL) {
/* Memory cannot be allocated */
return NG;
}
nblock = buMakeBackupFileImage(buf, &hdr);
if (nblock < 0) {
/* Structure includes an invalid parameter */
return NG;
}