X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=ginge.git;a=blobdiff_plain;f=prep%2Fmain.c;h=a03bc38b066fcd39d2978f58adfc5ff6093fff46;hp=8acbef783b090ee9ba53b3341ba23b7c44a82f70;hb=6ca083930098ee075c8f61cf2c04d616349959c3;hpb=e6c89531c9402107731e5b5ef5c34282ce5967a4 diff --git a/prep/main.c b/prep/main.c index 8acbef7..a03bc38 100644 --- a/prep/main.c +++ b/prep/main.c @@ -258,6 +258,13 @@ int main(int argc, char *argv[]) return 1; } + if (strcmp(argv[1], "--cleanup") == 0) { + // as loader may crash eny time, restore screen for them menu + host_video_init(NULL, 0); + host_video_finish(); + return 0; + } + if (getcwd(cwd, sizeof(cwd)) == NULL) { err(PFX "failed to get cwd\n"); return 1; @@ -414,6 +421,10 @@ pass: fclose(fin); no_in_script: +#ifdef WIZ + fprintf(fout, "sync\n"); + fprintf(fout, "%sginge_prep --cleanup\n", root_path); +#endif if (rerun_gp2xmenu) { fprintf(fout, "cd %s\n", root_path); fprintf(fout, "exec %s%s\n", root_path, LAUNCHER);