From b453e661ba9253708f7a9848c56981a876224a48 Mon Sep 17 00:00:00 2001 From: Apaczer <94932128+Apaczer@users.noreply.github.com> Date: Tue, 18 Mar 2025 14:49:26 +0100 Subject: [PATCH] libretro: add "Interlace mode" to UNAI options --- frontend/libretro.c | 12 ++++++++++++ frontend/libretro_core_options.h | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/frontend/libretro.c b/frontend/libretro.c index 8571c458..03db4b40 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -949,6 +949,7 @@ static bool update_option_visibility(void) struct retro_core_option_display option_display; char gpu_unai_option[][40] = { "pcsx_rearmed_gpu_unai_blending", + "pcsx_rearmed_gpu_unai_skipline", "pcsx_rearmed_gpu_unai_lighting", "pcsx_rearmed_gpu_unai_fast_lighting", "pcsx_rearmed_gpu_unai_scale_hires", @@ -2696,6 +2697,17 @@ static void update_variables(bool in_flight) pl_rearmed_cbs.gpu_unai.old_renderer = 0; } + var.key = "pcsx_rearmed_gpu_unai_skipline"; + 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_lighting"; var.value = NULL; diff --git a/frontend/libretro_core_options.h b/frontend/libretro_core_options.h index 3e80968b..de65b475 100644 --- a/frontend/libretro_core_options.h +++ b/frontend/libretro_core_options.h @@ -781,6 +781,20 @@ struct retro_core_option_v2_definition option_defs_us[] = { }, "enabled", }, + { + "pcsx_rearmed_gpu_unai_skipline", + "(GPU) Skip every 2nd line", + "Skip every 2nd line", + "Skips every second scanline. Can be enabled to improve performance at the expense of display inaccuracies (artifacts etc.).", + NULL, + "gpu_unai", + { + { "disabled", NULL }, + { "enabled", NULL }, + { NULL, NULL}, + }, + "disabled", + }, { "pcsx_rearmed_gpu_unai_lighting", "(GPU) Lighting Effects", -- 2.39.5