Skip to content

Commit

Permalink
check if there is already a backup
Browse files Browse the repository at this point in the history
  • Loading branch information
balika011 committed Apr 4, 2021
1 parent 0c2fb56 commit f5375e6
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,36 @@ void drawLogo()

char backupNVM()
{
FILE *f = fopen("mass:/nvm.bin", "wb");
FILE *f = fopen("mass:/nvm.bin", "rb");
if (f)
{
fclose(f);
gsKit_clear(gsGlobal, Black);

struct MENU menu;
menu.title = "An NVM backup found";
menu.x_text = "X Select";
menu.o_text = "O Exit";
menu.option_count = 2;

menu.options[0] = "Create a new backup";
menu.options[1] = "Keep the current backup";

int selected = drawMenu(&menu);

if (selected == -1)
{
ResetIOP();
LoadExecPS2("rom0:OSDSYS", 0, NULL);
SleepThread();
}
else if(selected == 1)
{
return 1;
}
}

f = fopen("mass:/nvm.bin", "wb");
if (!f)
{
gsKit_clear(gsGlobal, Black);
Expand Down

0 comments on commit f5375e6

Please sign in to comment.