+static int menu_do_last_cd_img(int is_get)
+{
+ char path[256];
+ FILE *f;
+
+ snprintf(path, sizeof(path), "." PCSX_DOT_DIR "lastcdimg.txt");
+ f = fopen(path, is_get ? "r" : "w");
+ if (f == NULL)
+ return -1;
+
+ if (is_get)
+ fscanf(f, "%255s", last_selected_fname);
+ else
+ fprintf(f, "%s\n", last_selected_fname);
+ fclose(f);
+
+ return 0;
+}
+