From c8108d888a6320df47cbef60d3f1527d8e1c6976 Mon Sep 17 00:00:00 2001 From: retro-wertz Date: Mon, 29 Jul 2019 22:51:08 +0800 Subject: Add advanced gpu core options - works for peops gpu plugin only --- frontend/libretro.c | 131 +++++++++++++++++++++++++++++++++++- frontend/libretro_core_options.h | 139 +++++++++++++++++++++++++++++++++++---- 2 files changed, 257 insertions(+), 13 deletions(-) (limited to 'frontend') diff --git a/frontend/libretro.c b/frontend/libretro.c index f5522a3..45c4c9c 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -77,6 +77,7 @@ static bool found_bios; 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 unsigned previous_width = 0; static unsigned previous_height = 0; @@ -1360,6 +1361,7 @@ static void update_variables(bool in_flight) { struct retro_variable var; int i; + int gpu_peops_fix = 0; var.value = NULL; var.key = "pcsx_rearmed_frameskip"; @@ -1631,6 +1633,132 @@ static void update_variables(bool in_flight) } #endif +#ifdef DRC_DISABLE + var.value = "NULL"; + var.key = "pcsx_rearmed_gpu_peops_fix_0"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + if (strcmp(var.value, "enabled") == 0) + gpu_peops_fix |= (1 << 0); + } + + var.value = "NULL"; + var.key = "pcsx_rearmed_gpu_peops_fix_1"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + if (strcmp(var.value, "enabled") == 0) + gpu_peops_fix |= (1 << 1); + } + + var.value = "NULL"; + var.key = "pcsx_rearmed_gpu_peops_fix_2"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + if (strcmp(var.value, "enabled") == 0) + gpu_peops_fix |= (1 << 2); + } + + var.value = "NULL"; + var.key = "pcsx_rearmed_gpu_peops_fix_3"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + if (strcmp(var.value, "enabled") == 0) + gpu_peops_fix |= (1 << 3); + } + + var.value = "NULL"; + var.key = "pcsx_rearmed_gpu_peops_fix_6"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + if (strcmp(var.value, "enabled") == 0) + gpu_peops_fix |= (1 << 6); + } + + var.value = "NULL"; + var.key = "pcsx_rearmed_gpu_peops_fix_7"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + if (strcmp(var.value, "enabled") == 0) + gpu_peops_fix |= (1 << 7); + } + + var.value = "NULL"; + var.key = "pcsx_rearmed_gpu_peops_fix_8"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + if (strcmp(var.value, "enabled") == 0) + gpu_peops_fix |= (1 << 8); + } + + var.value = "NULL"; + var.key = "pcsx_rearmed_gpu_peops_fix_9"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + if (strcmp(var.value, "enabled") == 0) + gpu_peops_fix |= (1 << 9); + } + + var.value = "NULL"; + var.key = "pcsx_rearmed_gpu_peops_fix_10"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + if (strcmp(var.value, "enabled") == 0) + gpu_peops_fix |= (1 << 10); + } + + if (pl_rearmed_cbs.gpu_peops.dwActFixes != gpu_peops_fix) + pl_rearmed_cbs.gpu_peops.dwActFixes = gpu_peops_fix; + + + /* Show/hide core options */ + + var.key = "pcsx_rearmed_show_gpu_peops_settings"; + var.value = NULL; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + int show_advanced_gpu_peops_settings_prev = show_advanced_gpu_peops_settings; + + show_advanced_gpu_peops_settings = 1; + if (strcmp(var.value, "disabled") == 0) + show_advanced_gpu_peops_settings = 0; + + if (show_advanced_gpu_peops_settings != show_advanced_gpu_peops_settings_prev) + { + unsigned i; + struct retro_core_option_display option_display; + char gpu_peops_option[9][32] = { + "pcsx_rearmed_gpu_peops_fix_0", + "pcsx_rearmed_gpu_peops_fix_1", + "pcsx_rearmed_gpu_peops_fix_2", + "pcsx_rearmed_gpu_peops_fix_3", + "pcsx_rearmed_gpu_peops_fix_6", + "pcsx_rearmed_gpu_peops_fix_7", + "pcsx_rearmed_gpu_peops_fix_8", + "pcsx_rearmed_gpu_peops_fix_9", + "pcsx_rearmed_gpu_peops_fix_10", + }; + + option_display.visible = show_advanced_gpu_peops_settings; + + for (i = 0; i < 9; i++) + { + option_display.key = gpu_peops_option[i]; + environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display); + } + } + } +#endif + if (in_flight) { // inform core things about possible config changes plugin_call_rearmed_cbs(); @@ -1758,7 +1886,7 @@ void retro_run(void) if (in_type[i] == PSE_PAD_TYPE_NONE) continue; - + if (libretro_supports_bitmasks) ret = input_state_cb(i, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_MASK); else @@ -2121,6 +2249,7 @@ void retro_init(void) cycle_multiplier = 200; #endif pl_rearmed_cbs.gpu_peops.iUseDither = 1; + pl_rearmed_cbs.gpu_peops.dwActFixes = 1 << 7; spu_config.iUseFixedUpdates = 1; SaveFuncs.open = save_open; diff --git a/frontend/libretro_core_options.h b/frontend/libretro_core_options.h index 66f1b0c..38af23b 100644 --- a/frontend/libretro_core_options.h +++ b/frontend/libretro_core_options.h @@ -74,8 +74,8 @@ struct retro_core_option_definition option_defs_us[] = { }, { "pcsx_rearmed_memcard2", - "Enable second memory card (shared)", - "Enabled the memory card slot 2. This is shared amongs all games.", + "Enable Second Memory Card (Shared)", + "Enabled the memory card slot 2. This memory card is shared amongs all games.", { { "disable", NULL }, { "enabled", NULL }, @@ -218,7 +218,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "pcsx_rearmed_negcon_deadzone", - "NegCon Twist Deadzone (percent)", + "NegCon Twist Deadzone (Percent)", "Sets the deadzone of the RetroPad left analog stick when simulating the 'twist' action of emulated neGcon Controllers. Used to eliminate drift/unwanted input.", { { "0", NULL }, @@ -247,7 +247,7 @@ struct retro_core_option_definition option_defs_us[] = { { "pcsx_rearmed_vibration", "Enable Vibration", - "Enables Vibration feedback for controllers that supports vibration features.", + "Enables vibration feedback for controllers that supports vibration features.", { { "disabled", NULL }, { "enabled", NULL }, @@ -270,7 +270,7 @@ struct retro_core_option_definition option_defs_us[] = { #ifndef DRC_DISABLE { "pcsx_rearmed_drc", - "Dynamic recompiler", + "Dynamic Recompiler", "Enables core to use dynamic recompiler or interpreter (slower) cpu instructions.", { { "disabled", NULL }, @@ -281,7 +281,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "pcsx_rearmed_psxclock", - "PSX CPU clock", + "PSX CPU Clock", PSX_CLOCK_LABEL, { { "30", NULL }, @@ -364,7 +364,7 @@ struct retro_core_option_definition option_defs_us[] = { #ifdef __ARM_NEON__ { "pcsx_rearmed_neon_interlace_enable", - "Enable interlacing mode(s)", + "Enable Interlacing Mode", "Enables fake scanlines effect.", { { "disabled", NULL }, @@ -375,7 +375,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "pcsx_rearmed_neon_enhancement_enable", - "Enhanced resolution (slow)", + "Enhanced Resolution (Slow)", "Renders in double resolution at the cost of lower performance", { { "disabled", NULL }, @@ -386,7 +386,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "pcsx_rearmed_neon_enhancement_no_main", - "Enhanced resolution speed hack", + "Enhanced Resolution (Speed Hack)", "Speed hack for Enhanced resolution option (glitches some games).", { { "disabled", NULL }, @@ -399,7 +399,7 @@ struct retro_core_option_definition option_defs_us[] = { { "pcsx_rearmed_duping_enable", - "Frame duping", + "Frame Duping", "A speedup, redraws/reuses the last frame if there was no new data.", { { "disabled", NULL }, @@ -419,6 +419,121 @@ struct retro_core_option_definition option_defs_us[] = { }, "disabled", }, + + /* GPU PEOPS OPTIONS */ +#ifdef DRC_DISABLE + { + "pcsx_rearmed_show_gpu_peops_settings", + "Show Advance GPU Settings", + "Enable or disable various gpu fixes. 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_peops_fix_0", + "(GPU) Odd/Even Bit Hack", + "Needed for Chrono Cross.", + { + { "disabled", NULL }, + { "enabled", NULL }, + { NULL, NULL}, + }, + "disabled", + }, + { + "pcsx_rearmed_gpu_peops_fix_1", + "(GPU) Expand Screen Width", + "Capcom fighting games", + { + { "disabled", NULL }, + { "enabled", NULL }, + { NULL, NULL}, + }, + "disabled", + }, + { + "pcsx_rearmed_gpu_peops_fix_2", + "(GPU) Ignore Brightness Color", + "Black screens in Lunar", + { + { "disabled", NULL }, + { "enabled", NULL }, + { NULL, NULL}, + }, + "disabled", + }, + { + "pcsx_rearmed_gpu_peops_fix_3", + "(GPU) Disable Coordinate Check", + "Compatibility mode", + { + { "disabled", NULL }, + { "enabled", NULL }, + { NULL, NULL}, + }, + "disabled", + }, + { + "pcsx_rearmed_gpu_peops_fix_6", + "(GPU) Lazy Screen Update", + "Pandemonium 2", + { + { "disabled", NULL }, + { "enabled", NULL }, + { NULL, NULL}, + }, + "disabled", + }, + { + "pcsx_rearmed_gpu_peops_fix_7", + "(GPU) Old Frame Skipping", + "Skip every second frame", + { + { "disabled", NULL }, + { "enabled", NULL }, + { NULL, NULL}, + }, + "enabled", + }, + { + "pcsx_rearmed_gpu_peops_fix_8", + "(GPU) Repeated Flat Tex Triangles", + "Needed by Dark Forces", + { + { "disabled", NULL }, + { "enabled", NULL }, + { NULL, NULL}, + }, + "disabled", + }, + { + "pcsx_rearmed_gpu_peops_fix_9", + "(GPU) Draw Quads with Triangles", + "Better g-colors, worse textures", + { + { "disabled", NULL }, + { "enabled", NULL }, + { NULL, NULL}, + }, + "disabled", + }, + { + "pcsx_rearmed_gpu_peops_fix_10", + "(GPU) Fake 'Gpu Busy' States", + "Toggle busy flags after drawing", + { + { "disabled", NULL }, + { "enabled", NULL }, + { NULL, NULL}, + }, + "disabled", + }, +#endif + { "pcsx_rearmed_show_bios_bootlogo", "Show Bios Bootlogo", @@ -443,7 +558,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "pcsx_rearmed_spu_interpolation", - "Sound: Interpolation", + "Sound Interpolation", NULL, { { "simple", NULL }, @@ -692,7 +807,7 @@ static INLINE void libretro_set_core_options(retro_environment_t environ_cb) /* Skip options that are irrelevant when using the * old style core options interface */ - if ((strcmp(key, "fceumm_advance_sound_options") == 0)) + if ((strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0)) continue; if (desc) -- cgit v1.2.3