Instead of trying to get a file on the VMU, I'm making a struct that contains all the data I need for a save. I'm trying to store that in pkg.data but I'm not sure if what I'm doing is right.
Code: Select all
int VMU_saveGame() {
vmu_pkg_t pkg;
player_data p;
uint8 data[4096], *pkg_out;
int pkg_size;
int i;
file_t f;
strcpy(pkg.desc_short, "Test_VMU");
strcpy(pkg.desc_long, "This is a test VMU file");
strcpy(pkg.app_id, "Reaperi Cycle");
pkg.icon_cnt = 0;
pkg.icon_anim_speed = 0;
pkg.eyecatch_type = VMUPKG_EC_NONE;
if (!VMU_packData(p)) //this is a function that just get all the player data and puts it into a strucs
return(0);
pkg.data_len = 4096;
pkg.data = &p;
vmu_pkg_build(&pkg, &pkg_out, &pkg_size);
fs_unlink("/vmu/a1/REAPERI");
f = fs_open("/vmu/a1/REAPERI", O_WRONLY);
if(!f) {
return(0);
}
setParam(5, "Saved File!");
fs_write(f, pkg_out, pkg_size);
fs_close(f);
return(1);
}