aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authornegativeExponent2019-09-25 10:53:17 +0800
committernegativeExponent2019-09-25 11:08:40 +0800
commita0cffa0ffa785fbaff1c563627d6ce9dc0523287 (patch)
tree8bc93e24802bd2e82bf6acbb58129545f4684b35 /frontend
parent651892c3a169815448a53d9102afbb4cef8a8bda (diff)
parent030d1121f27550429364745419fc5e6161a2a431 (diff)
downloadpcsx_rearmed-a0cffa0ffa785fbaff1c563627d6ce9dc0523287.tar.gz
pcsx_rearmed-a0cffa0ffa785fbaff1c563627d6ce9dc0523287.tar.bz2
pcsx_rearmed-a0cffa0ffa785fbaff1c563627d6ce9dc0523287.zip
Merge branch 'gpu_unai_plugin_update'
Diffstat (limited to 'frontend')
-rw-r--r--frontend/libretro.c93
-rw-r--r--frontend/libretro_core_options.h70
-rw-r--r--frontend/main.c7
-rw-r--r--frontend/menu.c32
-rw-r--r--frontend/plugin_lib.h7
5 files changed, 199 insertions, 10 deletions
diff --git a/frontend/libretro.c b/frontend/libretro.c
index 081f8ba..785213b 100644
--- a/frontend/libretro.c
+++ b/frontend/libretro.c
@@ -78,6 +78,7 @@ static bool display_internal_fps = false;
static unsigned frame_count = 0;
static bool libretro_supports_bitmasks = false;
static int show_advanced_gpu_peops_settings = -1;
+static int show_advanced_gpu_unai_settings = -1;
static unsigned previous_width = 0;
static unsigned previous_height = 0;
@@ -1433,6 +1434,7 @@ static void update_variables(bool in_flight)
if (strcmp(var.value, "disabled") == 0) {
pl_rearmed_cbs.gpu_peops.iUseDither = 0;
pl_rearmed_cbs.gpu_peopsgl.bDrawDither = 0;
+ pl_rearmed_cbs.gpu_unai.dithering = 0;
#ifdef __ARM_NEON__
pl_rearmed_cbs.gpu_neon.allow_dithering = 0;
#endif
@@ -1440,6 +1442,7 @@ static void update_variables(bool in_flight)
else if (strcmp(var.value, "enabled") == 0) {
pl_rearmed_cbs.gpu_peops.iUseDither = 1;
pl_rearmed_cbs.gpu_peopsgl.bDrawDither = 1;
+ pl_rearmed_cbs.gpu_unai.dithering = 1;
#ifdef __ARM_NEON__
pl_rearmed_cbs.gpu_neon.allow_dithering = 1;
#endif
@@ -1767,6 +1770,96 @@ static void update_variables(bool in_flight)
}
#endif
+#ifdef GPU_UNAI
+ var.key = "pcsx_rearmed_gpu_unai_ilace_force";
+ var.value = NULL;
+
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
+ {
+ if (strcmp(var.value, "disabled") == 0)
+ pl_rearmed_cbs.gpu_unai.ilace_force = 0;
+ else if (strcmp(var.value, "enabled") == 0)
+ pl_rearmed_cbs.gpu_unai.ilace_force = 1;
+ }
+
+ var.key = "pcsx_rearmed_gpu_unai_pixel_skip";
+ var.value = NULL;
+
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
+ {
+ if (strcmp(var.value, "disabled") == 0)
+ pl_rearmed_cbs.gpu_unai.pixel_skip = 0;
+ else if (strcmp(var.value, "enabled") == 0)
+ pl_rearmed_cbs.gpu_unai.pixel_skip = 1;
+ }
+
+ var.key = "pcsx_rearmed_gpu_unai_lighting";
+ var.value = NULL;
+
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
+ {
+ if (strcmp(var.value, "disabled") == 0)
+ pl_rearmed_cbs.gpu_unai.lighting = 0;
+ else if (strcmp(var.value, "enabled") == 0)
+ pl_rearmed_cbs.gpu_unai.lighting = 1;
+ }
+
+ var.key = "pcsx_rearmed_gpu_unai_fast_lighting";
+ var.value = NULL;
+
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
+ {
+ if (strcmp(var.value, "disabled") == 0)
+ pl_rearmed_cbs.gpu_unai.fast_lighting = 0;
+ else if (strcmp(var.value, "enabled") == 0)
+ pl_rearmed_cbs.gpu_unai.fast_lighting = 1;
+ }
+
+ var.key = "pcsx_rearmed_gpu_unai_blending";
+ var.value = NULL;
+
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
+ {
+ if (strcmp(var.value, "disabled") == 0)
+ pl_rearmed_cbs.gpu_unai.blending = 0;
+ else if (strcmp(var.value, "enabled") == 0)
+ pl_rearmed_cbs.gpu_unai.blending = 1;
+ }
+
+ var.key = "pcsx_rearmed_show_gpu_unai_settings";
+ var.value = NULL;
+
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
+ {
+ int show_advanced_gpu_unai_settings_prev = show_advanced_gpu_unai_settings;
+
+ show_advanced_gpu_unai_settings = 1;
+ if (strcmp(var.value, "disabled") == 0)
+ show_advanced_gpu_unai_settings = 0;
+
+ if (show_advanced_gpu_unai_settings != show_advanced_gpu_unai_settings_prev)
+ {
+ unsigned i;
+ struct retro_core_option_display option_display;
+ char gpu_unai_option[5][40] = {
+ "pcsx_rearmed_gpu_unai_blending",
+ "pcsx_rearmed_gpu_unai_lighting",
+ "pcsx_rearmed_gpu_unai_fast_lighting",
+ "pcsx_rearmed_gpu_unai_ilace_force",
+ "pcsx_rearmed_gpu_unai_pixel_skip",
+ };
+
+ option_display.visible = show_advanced_gpu_unai_settings;
+
+ for (i = 0; i < 5; i++)
+ {
+ option_display.key = gpu_unai_option[i];
+ environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
+ }
+ }
+ }
+#endif // GPU_UNAI
+
if (in_flight) {
// inform core things about possible config changes
plugin_call_rearmed_cbs();
diff --git a/frontend/libretro_core_options.h b/frontend/libretro_core_options.h
index 6ea31e0..1ecc9a9 100644
--- a/frontend/libretro_core_options.h
+++ b/frontend/libretro_core_options.h
@@ -556,6 +556,76 @@ struct retro_core_option_definition option_defs_us[] = {
},
#endif
+ /* GPU UNAI Advanced Options */
+#ifdef GPU_UNAI
+ {
+ "pcsx_rearmed_show_gpu_unai_settings",
+ "Advance GPU UNAI/PCSX4All Settings",
+ "Shows or hides advanced gpu settings. A core restart might be needed for settings to take effect. NOTE: Quick Menu must be toggled for this setting to take effect.",
+ {
+ { "disabled", NULL },
+ { "enabled", NULL },
+ { NULL, NULL},
+ },
+ "disabled",
+ },
+ {
+ "pcsx_rearmed_gpu_unai_blending",
+ "(GPU) Enable Blending",
+ NULL,
+ {
+ { "disabled", NULL },
+ { "enabled", NULL },
+ { NULL, NULL},
+ },
+ "enabled",
+ },
+ {
+ "pcsx_rearmed_gpu_unai_lighting",
+ "(GPU) Enable Lighting",
+ NULL,
+ {
+ { "disabled", NULL },
+ { "enabled", NULL },
+ { NULL, NULL},
+ },
+ "enabled",
+ },
+ {
+ "pcsx_rearmed_gpu_unai_fast_lighting",
+ "(GPU) Enable Fast Lighting",
+ NULL,
+ {
+ { "disabled", NULL },
+ { "enabled", NULL },
+ { NULL, NULL},
+ },
+ "enabled",
+ },
+ {
+ "pcsx_rearmed_gpu_unai_ilace_force",
+ "(GPU) Enable Forced Interlace",
+ NULL,
+ {
+ { "disabled", NULL },
+ { "enabled", NULL },
+ { NULL, NULL},
+ },
+ "disabled",
+ },
+ {
+ "pcsx_rearmed_gpu_unai_pixel_skip",
+ "(GPU) Enable Pixel Skip",
+ NULL,
+ {
+ { "disabled", NULL },
+ { "enabled", NULL },
+ { NULL, NULL},
+ },
+ "disabled",
+ },
+#endif /* GPU UNAI Advanced Settings */
+
{
"pcsx_rearmed_show_bios_bootlogo",
"Show Bios Bootlogo",
diff --git a/frontend/main.c b/frontend/main.c
index aabed49..fcf3846 100644
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -130,6 +130,13 @@ void emu_set_default_config(void)
pl_rearmed_cbs.gpu_neon.enhancement_no_main = 0;
pl_rearmed_cbs.gpu_peops.iUseDither = 0;
pl_rearmed_cbs.gpu_peops.dwActFixes = 1<<7;
+ pl_rearmed_cbs.gpu_unai.ilace_force = 0;
+ pl_rearmed_cbs.gpu_unai.pixel_skip = 1;
+ pl_rearmed_cbs.gpu_unai.lighting = 1;
+ pl_rearmed_cbs.gpu_unai.fast_lighting = 1;
+ pl_rearmed_cbs.gpu_unai.blending = 1;
+ pl_rearmed_cbs.gpu_unai.dithering = 0;
+ // old gpu_unai config
pl_rearmed_cbs.gpu_unai.abe_hack =
pl_rearmed_cbs.gpu_unai.no_light =
pl_rearmed_cbs.gpu_unai.no_blend = 0;
diff --git a/frontend/menu.c b/frontend/menu.c
index babe109..47523b2 100644
--- a/frontend/menu.c
+++ b/frontend/menu.c
@@ -305,14 +305,14 @@ static void menu_sync_config(void)
cycle_multiplier = 10000 / psx_clock;
switch (in_type_sel1) {
- case 1: in_type1 = PSE_PAD_TYPE_ANALOGPAD; break;
- case 2: in_type1 = PSE_PAD_TYPE_NEGCON; break;
- default: in_type1 = PSE_PAD_TYPE_STANDARD;
+ case 1: in_type[0] = PSE_PAD_TYPE_ANALOGPAD; break;
+ case 2: in_type[0] = PSE_PAD_TYPE_NEGCON; break;
+ default: in_type[0] = PSE_PAD_TYPE_STANDARD;
}
switch (in_type_sel2) {
- case 1: in_type2 = PSE_PAD_TYPE_ANALOGPAD; break;
- case 2: in_type2 = PSE_PAD_TYPE_NEGCON; break;
- default: in_type2 = PSE_PAD_TYPE_STANDARD;
+ case 1: in_type[1] = PSE_PAD_TYPE_ANALOGPAD; break;
+ case 2: in_type[1] = PSE_PAD_TYPE_NEGCON; break;
+ default: in_type[1] = PSE_PAD_TYPE_STANDARD;
}
if (in_evdev_allow_abs_only != allow_abs_only_old) {
in_probe();
@@ -422,6 +422,12 @@ static const struct {
CE_INTVAL_V(frameskip, 3),
CE_INTVAL_P(gpu_peops.iUseDither),
CE_INTVAL_P(gpu_peops.dwActFixes),
+ CE_INTVAL_P(gpu_unai.ilace_force),
+ CE_INTVAL_P(gpu_unai.pixel_skip),
+ CE_INTVAL_P(gpu_unai.lighting),
+ CE_INTVAL_P(gpu_unai.fast_lighting),
+ CE_INTVAL_P(gpu_unai.blending),
+ CE_INTVAL_P(gpu_unai.dithering),
CE_INTVAL_P(gpu_unai.lineskip),
CE_INTVAL_P(gpu_unai.abe_hack),
CE_INTVAL_P(gpu_unai.no_light),
@@ -1358,10 +1364,16 @@ static int menu_loop_plugin_gpu_neon(int id, int keys)
static menu_entry e_menu_plugin_gpu_unai[] =
{
- mee_onoff ("Skip every 2nd line", 0, pl_rearmed_cbs.gpu_unai.lineskip, 1),
- mee_onoff ("Abe's Odyssey hack", 0, pl_rearmed_cbs.gpu_unai.abe_hack, 1),
- mee_onoff ("Disable lighting", 0, pl_rearmed_cbs.gpu_unai.no_light, 1),
- mee_onoff ("Disable blending", 0, pl_rearmed_cbs.gpu_unai.no_blend, 1),
+ //mee_onoff ("Skip every 2nd line", 0, pl_rearmed_cbs.gpu_unai.lineskip, 1),
+ //mee_onoff ("Abe's Odyssey hack", 0, pl_rearmed_cbs.gpu_unai.abe_hack, 1),
+ //mee_onoff ("Disable lighting", 0, pl_rearmed_cbs.gpu_unai.no_light, 1),
+ //mee_onoff ("Disable blending", 0, pl_rearmed_cbs.gpu_unai.no_blend, 1),
+ mee_onoff ("Interlace", 0, pl_rearmed_cbs.gpu_unai.ilace_force, 1),
+ mee_onoff ("Dithering", 0, pl_rearmed_cbs.gpu_unai.dithering, 1),
+ mee_onoff ("Lighting", 0, pl_rearmed_cbs.gpu_unai.lighting, 1),
+ 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_end,
};
diff --git a/frontend/plugin_lib.h b/frontend/plugin_lib.h
index 92e62e9..d51c5e7 100644
--- a/frontend/plugin_lib.h
+++ b/frontend/plugin_lib.h
@@ -80,6 +80,13 @@ struct rearmed_cbs {
int dwFrameRateTicks;
} gpu_peops;
struct {
+ int ilace_force;
+ int pixel_skip;
+ int lighting;
+ int fast_lighting;
+ int blending;
+ int dithering;
+ // old gpu_unai config for compatibility
int abe_hack;
int no_light, no_blend;
int lineskip;