aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorJustin Weiss2020-08-02 22:04:52 -0700
committerJustin Weiss2020-08-13 08:56:50 -0700
commit43047988e507799d7d5bbcd926c5d0b5b94fcdc1 (patch)
tree40cdd3800bfb51ca35efc795417e9daa8d33296f /frontend
parentab323c13064ac483e66682556ae3bf387df0f29d (diff)
downloadpcsx_rearmed-43047988e507799d7d5bbcd926c5d0b5b94fcdc1.tar.gz
pcsx_rearmed-43047988e507799d7d5bbcd926c5d0b5b94fcdc1.tar.bz2
pcsx_rearmed-43047988e507799d7d5bbcd926c5d0b5b94fcdc1.zip
Add an option to downscale hi-res views
Some older devices that use gpu_unai don't have a high enough resolution to display all of the pixels in high-res mode. There's a setting in unai to skip rendering of these pixels, but it's not connected to the libretro frontend, and does not appear to be used in the gpulib implementation at all. This commit adds a gpu_unai setting, Enable Hi-Res Downscaling, that will enable pixel skipping and blit only the pixels actually rendered into a buffer no larger than 384x240. This buffer is then treated as the actual framebuffer by gpulib and the libretro frontend.
Diffstat (limited to 'frontend')
-rw-r--r--frontend/libretro.c18
-rw-r--r--frontend/libretro_core_options.h11
-rw-r--r--frontend/main.c1
-rw-r--r--frontend/menu.c1
-rw-r--r--frontend/plugin_lib.h1
5 files changed, 29 insertions, 3 deletions
diff --git a/frontend/libretro.c b/frontend/libretro.c
index 50392a9..8dc6bc3 100644
--- a/frontend/libretro.c
+++ b/frontend/libretro.c
@@ -1999,6 +1999,17 @@ static void update_variables(bool in_flight)
pl_rearmed_cbs.gpu_unai.blending = 1;
}
+ var.key = "pcsx_rearmed_gpu_unai_scale_hires";
+ var.value = NULL;
+
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
+ {
+ if (strcmp(var.value, "disabled") == 0)
+ pl_rearmed_cbs.gpu_unai.scale_hires = 0;
+ else if (strcmp(var.value, "enabled") == 0)
+ pl_rearmed_cbs.gpu_unai.scale_hires = 1;
+ }
+
var.key = "pcsx_rearmed_show_gpu_unai_settings";
var.value = NULL;
@@ -2014,17 +2025,18 @@ static void update_variables(bool in_flight)
{
unsigned i;
struct retro_core_option_display option_display;
- char gpu_unai_option[5][40] = {
+ char gpu_unai_option[6][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"
+ "pcsx_rearmed_gpu_unai_pixel_skip",
+ "pcsx_rearmed_gpu_unai_scale_hires"
};
option_display.visible = show_advanced_gpu_unai_settings;
- for (i = 0; i < 5; i++)
+ for (i = 0; i < 6; i++)
{
option_display.key = gpu_unai_option[i];
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
diff --git a/frontend/libretro_core_options.h b/frontend/libretro_core_options.h
index 95544f0..283abc6 100644
--- a/frontend/libretro_core_options.h
+++ b/frontend/libretro_core_options.h
@@ -961,6 +961,17 @@ struct retro_core_option_definition option_defs_us[] = {
},
"disabled",
},
+ {
+ "pcsx_rearmed_gpu_unai_scale_hires",
+ "(GPU) Enable Hi-Res Downscaling",
+ "When enabled, will scale hi-res modes to 320x240, skipping unrendered pixels.",
+ {
+ { "disabled", NULL },
+ { "enabled", NULL },
+ { NULL, NULL},
+ },
+ "disabled",
+ },
#endif /* GPU UNAI Advanced Settings */
{
diff --git a/frontend/main.c b/frontend/main.c
index b1ee4c7..51cb7bf 100644
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -140,6 +140,7 @@ void emu_set_default_config(void)
pl_rearmed_cbs.gpu_unai.abe_hack =
pl_rearmed_cbs.gpu_unai.no_light =
pl_rearmed_cbs.gpu_unai.no_blend = 0;
+ pl_rearmed_cbs.gpu_unai.scale_hires = 0;
memset(&pl_rearmed_cbs.gpu_peopsgl, 0, sizeof(pl_rearmed_cbs.gpu_peopsgl));
pl_rearmed_cbs.gpu_peopsgl.iVRamSize = 64;
pl_rearmed_cbs.gpu_peopsgl.iTexGarbageCollection = 1;
diff --git a/frontend/menu.c b/frontend/menu.c
index f4a45ba..e5c2738 100644
--- a/frontend/menu.c
+++ b/frontend/menu.c
@@ -432,6 +432,7 @@ static const struct {
CE_INTVAL_P(gpu_unai.abe_hack),
CE_INTVAL_P(gpu_unai.no_light),
CE_INTVAL_P(gpu_unai.no_blend),
+ CE_INTVAL_P(gpu_unai.scale_hires),
CE_INTVAL_P(gpu_neon.allow_interlace),
CE_INTVAL_P(gpu_neon.enhancement_enable),
CE_INTVAL_P(gpu_neon.enhancement_no_main),
diff --git a/frontend/plugin_lib.h b/frontend/plugin_lib.h
index 09cc4c5..ee03169 100644
--- a/frontend/plugin_lib.h
+++ b/frontend/plugin_lib.h
@@ -91,6 +91,7 @@ struct rearmed_cbs {
int abe_hack;
int no_light, no_blend;
int lineskip;
+ int scale_hires;
} gpu_unai;
struct {
int dwActFixes;