notaz.gp2x.de
/
pcsx_rearmed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
2c843d9
)
frontend: always save last cdimgpath
author
notaz
<notasas@gmail.com>
Sun, 22 Jul 2012 21:44:32 +0000
(
00:44
+0300)
committer
notaz
<notasas@gmail.com>
Sun, 22 Jul 2012 21:44:32 +0000
(
00:44
+0300)
frontend/menu.c
patch
|
blob
|
blame
|
history
diff --git
a/frontend/menu.c
b/frontend/menu.c
index
3fd5425
..
301a10d
100644
(file)
--- a/
frontend/menu.c
+++ b/
frontend/menu.c
@@
-376,15
+376,31
@@
static int menu_write_config(int is_game)
}
}
}
}
- if (!is_game)
- fprintf(f, "lastcdimg = %s\n", last_selected_fname);
-
keys_write_all(f);
fclose(f);
return 0;
}
keys_write_all(f);
fclose(f);
return 0;
}
+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;
+}
+
static void parse_str_val(char *cval, const char *src)
{
char *tmp;
static void parse_str_val(char *cval, const char *src)
{
char *tmp;
@@
-2222,6
+2238,7
@@
void menu_init(void)
menu_set_defconfig();
menu_load_config(0);
menu_set_defconfig();
menu_load_config(0);
+ menu_do_last_cd_img(1);
last_psx_w = 320;
last_psx_h = 240;
last_psx_bpp = 16;
last_psx_w = 320;
last_psx_h = 240;
last_psx_bpp = 16;
@@
-2384,5
+2401,6
@@
void me_update_msg(const char *msg)
void menu_finish(void)
{
void menu_finish(void)
{
+ menu_do_last_cd_img(0);
plat_cpu_clock_apply(cpu_clock_st);
}
plat_cpu_clock_apply(cpu_clock_st);
}