aboutsummaryrefslogtreecommitdiff
path: root/frontend/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/menu.c')
-rw-r--r--frontend/menu.c67
1 files changed, 43 insertions, 24 deletions
diff --git a/frontend/menu.c b/frontend/menu.c
index bd56cf4..fc95294 100644
--- a/frontend/menu.c
+++ b/frontend/menu.c
@@ -87,6 +87,9 @@ typedef enum
MA_OPT_VOUT_MODE,
MA_OPT_SCANLINES,
MA_OPT_SCANLINE_LEVEL,
+ MA_PLUG_PEOPS,
+ MA_PLUG_UNAI,
+ MA_PLUG_PEOPSGL,
} menu_id;
static int last_vout_w, last_vout_h, last_vout_bpp;
@@ -101,10 +104,15 @@ int scanlines, scanline_level = 20;
int soft_scaling, analog_deadzone; // for Caanoo
int soft_filter;
+#ifdef TRIMUI
+#define DEFAULT_PSX_CLOCK 57
+#define DEFAULT_PSX_CLOCK_S "57"
+#else
// Default to 100% CPU speed as most hardware can handle it nowadays using the dynamic recompiler.
// If not, the option is in the advanced speed hacks menu, so in a logical place.
#define DEFAULT_PSX_CLOCK 100
#define DEFAULT_PSX_CLOCK_S "100"
+#endif
static const char *bioses[24];
static const char *gpu_plugins[16];
@@ -123,6 +131,7 @@ static int bios_sel, gpu_plugsel, spu_plugsel;
#define MENU_SHOW_MINIMIZE 0
#define MENU_SHOW_FULLSCREEN 1
#define MENU_SHOW_VOLUME 0
+#define MENU_SHOW_DISPLAY 1
#endif
static int min(int x, int y) { return x < y ? x : y; }
@@ -420,6 +429,7 @@ static const struct {
CE_INTVAL_N("adev0_is_nublike", in_adev_is_nublike[0]),
CE_INTVAL_N("adev1_is_nublike", in_adev_is_nublike[1]),
CE_INTVAL_V(frameskip, 3),
+ CE_INTVAL_P(frameskip_type),
CE_INTVAL_P(thread_rendering),
CE_INTVAL_P(gpu_peops.iUseDither),
CE_INTVAL_P(gpu_peops.dwActFixes),
@@ -477,10 +487,14 @@ static char *get_cd_label(void)
static void make_cfg_fname(char *buf, size_t size, int is_game)
{
- if (is_game)
- snprintf(buf, size, "." PCSX_DOT_DIR "cfg/%.32s-%.9s.cfg", get_cd_label(), CdromId);
+ char fname[MAXPATHLEN];
+
+ if (is_game) {
+ snprintf(fname, MAXPATHLEN, "%.32s-%.9s.cfg", get_cd_label(), CdromId);
+ make_path(buf, size, "/cfg/", fname);
+ }
else
- snprintf(buf, size, "." PCSX_DOT_DIR "%s", cfgfile_basename);
+ make_path(buf, size, cfgfile_basename, NULL);
}
static void keys_write_all(FILE *f);
@@ -537,7 +551,7 @@ static int menu_do_last_cd_img(int is_get)
FILE *f;
int i, ret = -1;
- snprintf(path, sizeof(path), "." PCSX_DOT_DIR "lastcdimg.txt");
+ MAKE_PATH(path, "lastcdimg.txt", NULL);
f = fopen(path, is_get ? "r" : "w");
if (f == NULL) {
ret = -1;
@@ -581,7 +595,7 @@ static void parse_str_val(char *cval, const char *src)
static void keys_load_all(const char *cfg);
-static int menu_load_config(int is_game)
+int menu_load_config(int is_game)
{
char cfgfile[MAXPATHLEN];
int i, ret = -1;
@@ -694,15 +708,13 @@ fail:
if (memcard1_sel == 0)
strcpy(Config.Mcd1, "none");
else if (memcards[memcard1_sel] != NULL)
- snprintf(Config.Mcd1, sizeof(Config.Mcd1), ".%s%s",
- MEMCARD_DIR, memcards[memcard1_sel]);
+ MAKE_PATH(Config.Mcd1, MEMCARD_DIR, memcards[memcard1_sel]);
}
if ((unsigned int)memcard2_sel < ARRAY_SIZE(memcards)) {
if (memcard2_sel == 0)
strcpy(Config.Mcd2, "none");
else if (memcards[memcard2_sel] != NULL)
- snprintf(Config.Mcd2, sizeof(Config.Mcd2), ".%s%s",
- MEMCARD_DIR, memcards[memcard2_sel]);
+ MAKE_PATH(Config.Mcd2, MEMCARD_DIR, memcards[memcard2_sel]);
}
if (strcmp(mcd1_old, Config.Mcd1) || strcmp(mcd2_old, Config.Mcd2))
LoadMcds(Config.Mcd1, Config.Mcd2);
@@ -1376,6 +1388,7 @@ static menu_entry e_menu_plugin_gpu_unai[] =
mee_onoff ("Fast lighting", 0, pl_rearmed_cbs.gpu_unai.fast_lighting, 1),
mee_onoff ("Blending", 0, pl_rearmed_cbs.gpu_unai.blending, 1),
mee_onoff ("Pixel skip", 0, pl_rearmed_cbs.gpu_unai.pixel_skip, 1),
+ mee_onoff ("Downscale Hi-Res", 0, pl_rearmed_cbs.gpu_unai.scale_hires, 1),
mee_end,
};
@@ -1499,16 +1512,16 @@ static const char h_spu[] = "Configure built-in P.E.Op.S. Sound Driver V1
static menu_entry e_menu_plugin_options[] =
{
- mee_enum_h ("BIOS", 0, bios_sel, bioses, h_bios),
- mee_enum_h ("GPU plugin", 0, gpu_plugsel, gpu_plugins, h_plugin_gpu),
- mee_enum_h ("SPU plugin", 0, spu_plugsel, spu_plugins, h_plugin_spu),
+ mee_enum_h ("BIOS", 0, bios_sel, bioses, h_bios),
+ mee_enum_h ("GPU plugin", 0, gpu_plugsel, gpu_plugins, h_plugin_gpu),
+ mee_enum_h ("SPU plugin", 0, spu_plugsel, spu_plugins, h_plugin_spu),
#ifdef __ARM_NEON__
- mee_handler_h ("Configure built-in GPU plugin", menu_loop_plugin_gpu_neon, h_gpu_neon),
+ mee_handler_h ("Configure built-in GPU plugin", menu_loop_plugin_gpu_neon, h_gpu_neon),
#endif
- mee_handler_h ("Configure gpu_peops plugin", menu_loop_plugin_gpu_peops, h_gpu_peops),
- mee_handler_h ("Configure gpu_unai GPU plugin", menu_loop_plugin_gpu_unai, h_gpu_unai),
- mee_handler_h ("Configure gpu_gles GPU plugin", menu_loop_plugin_gpu_peopsgl, h_gpu_peopsgl),
- mee_handler_h ("Configure built-in SPU plugin", menu_loop_plugin_spu, h_spu),
+ mee_handler_id_h ("Configure gpu_peops plugin", MA_PLUG_PEOPS, menu_loop_plugin_gpu_peops, h_gpu_peops),
+ mee_handler_id_h ("Configure gpu_unai GPU plugin", MA_PLUG_UNAI, menu_loop_plugin_gpu_unai, h_gpu_unai),
+ mee_handler_id_h ("Configure gpu_gles GPU plugin", MA_PLUG_PEOPSGL, menu_loop_plugin_gpu_peopsgl, h_gpu_peopsgl),
+ mee_handler_h ("Configure built-in SPU plugin", menu_loop_plugin_spu, h_spu),
mee_end,
};
@@ -1604,6 +1617,7 @@ static int mh_restore_defaults(int id, int keys)
static const char *men_region[] = { "Auto", "NTSC", "PAL", NULL };
static const char *men_frameskip[] = { "Auto", "Off", "1", "2", "3", NULL };
+static const char *men_fs_type[] = { "Time", "Audio", NULL };
/*
static const char *men_confirm_save[] = { "OFF", "writes", "loads", "both", NULL };
static const char h_confirm_save[] = "Ask for confirmation when overwriting save,\n"
@@ -1618,6 +1632,7 @@ static menu_entry e_menu_options[] =
// mee_range ("Save slot", 0, state_slot, 0, 9),
// mee_enum_h ("Confirm savestate", 0, dummy, men_confirm_save, h_confirm_save),
mee_enum_h ("Frameskip", 0, frameskip, men_frameskip, h_frameskip),
+ mee_enum ("Auto frameskip type", 0, pl_rearmed_cbs.frameskip_type, men_fs_type),
mee_onoff ("Show FPS", 0, g_opts, OPT_SHOWFPS),
mee_enum ("Region", 0, region, men_region),
mee_range ("CPU clock", MA_OPT_CPU_CLOCKS, cpu_clock, 20, 5000),
@@ -1768,10 +1783,10 @@ static void handle_memcard_sel(void)
{
strcpy(Config.Mcd1, "none");
if (memcard1_sel != 0)
- snprintf(Config.Mcd1, sizeof(Config.Mcd1), ".%s%s", MEMCARD_DIR, memcards[memcard1_sel]);
+ MAKE_PATH(Config.Mcd1, MEMCARD_DIR, memcards[memcard1_sel]);
strcpy(Config.Mcd2, "none");
if (memcard2_sel != 0)
- snprintf(Config.Mcd2, sizeof(Config.Mcd2), ".%s%s", MEMCARD_DIR, memcards[memcard2_sel]);
+ MAKE_PATH(Config.Mcd2, MEMCARD_DIR, memcards[memcard2_sel]);
LoadMcds(Config.Mcd1, Config.Mcd2);
draw_mc_bg();
}
@@ -2451,7 +2466,8 @@ do_plugins:
closedir(dir);
do_memcards:
- dir = opendir("." MEMCARD_DIR);
+ MAKE_PATH(fname, MEMCARD_DIR, NULL);
+ dir = opendir(fname);
if (dir == NULL) {
perror("scan_bios_plugins memcards opendir");
return;
@@ -2471,7 +2487,7 @@ do_memcards:
if (ent->d_type != DT_REG && ent->d_type != DT_LNK)
continue;
- snprintf(fname, sizeof(fname), "." MEMCARD_DIR "%s", ent->d_name);
+ MAKE_PATH(fname, MEMCARD_DIR, ent->d_name);
if (stat(fname, &st) != 0) {
printf("bad memcard file: %s\n", ent->d_name);
continue;
@@ -2515,9 +2531,6 @@ void menu_init(void)
exit(1);
}
- emu_make_path(buff, "skin/background.png", sizeof(buff));
- readpng(g_menubg_src_ptr, buff, READPNG_BG, g_menuscreen_w, g_menuscreen_h);
-
i = plat_target.cpu_clock_set != NULL
&& plat_target.cpu_clock_get != NULL && cpu_clock_st > 0;
me_enable(e_menu_gfx_options, MA_OPT_CPU_CLOCKS, i);
@@ -2545,6 +2558,12 @@ void menu_init(void)
me_enable(e_menu_keyconfig, MA_CTRL_NUBS_BTNS, MENU_SHOW_NUBS_BTNS);
me_enable(e_menu_keyconfig, MA_CTRL_VIBRATION, MENU_SHOW_VIBRATION);
me_enable(e_menu_keyconfig, MA_CTRL_DEADZONE, MENU_SHOW_DEADZONE);
+ me_enable(e_menu_options, MA_OPT_DISP_OPTS, MENU_SHOW_DISPLAY);
+
+#ifdef TRIMUI
+ me_enable(e_menu_plugin_options, MA_PLUG_PEOPS, FALSE);
+ me_enable(e_menu_plugin_options, MA_PLUG_PEOPSGL, FALSE);
+#endif
}
void menu_notify_mode_change(int w, int h, int bpp)