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