Theme install now works, added fast reboot code

This commit is contained in:
2017-08-26 16:00:10 -04:00
parent 6b61ae9e5f
commit ae42b9648c
4 changed files with 18 additions and 5 deletions

View File

@@ -8,6 +8,7 @@ FS_Archive ArchiveHomeExt;
FS_Archive ArchiveThemeExt;
Result open_archives(void);
Result close_archives(void);
int get_number_entries(char*);
u64 file_to_buf(FS_Path path, FS_Archive archive, char** buf);
u32 zip_file_to_buf(char *file_name, u16 *zip_path, char **buf);

View File

@@ -57,6 +57,20 @@ Result open_archives(void)
return 0;
}
Result close_archives(void)
{
Result retValue;
retValue = FSUSER_CloseArchive(ArchiveSD);
if(R_FAILED(retValue)) return retValue;
retValue = FSUSER_CloseArchive(ArchiveHomeExt);
if(R_FAILED(retValue)) return retValue;
retValue = FSUSER_CloseArchive(ArchiveThemeExt);
if(R_FAILED(retValue)) return retValue;
return 0;
}
int get_number_entries(char *path)
{
int count = 0;

View File

@@ -50,7 +50,9 @@ int main(void)
u32 kDown = hidKeysDown();
if (kDown & KEY_START)
{
break;
close_archives();
PTMSYSM_ShutdownAsync(0);
ptmSysmExit();
}
}

View File

@@ -45,8 +45,6 @@ Result single_install(theme theme_to_install)
return MAKERESULT(RL_PERMANENT, RS_CANCELED, RM_APPLICATION, RD_NOT_FOUND);
}
remake_file("/BodyCache.bin", ArchiveThemeExt, 0x150000);
size = buf_to_file(body_size, "/BodyCache.bin", ArchiveThemeExt, body); // Write body data to file
free(body);
@@ -72,8 +70,6 @@ Result single_install(theme theme_to_install)
return MAKERESULT(RL_PERMANENT, RS_CANCELED, RM_APPLICATION, RD_TOO_LARGE);
}
remake_file("/BgmCache.bin", ArchiveThemeExt, 3371008);
size = buf_to_file(music_size, "/BgmCache.bin", ArchiveThemeExt, music);
free(music);