From 5c1cbedc034c59caba3955c663868c74e9631731 Mon Sep 17 00:00:00 2001 From: pjft Date: Sat, 6 May 2017 21:51:55 +0100 Subject: Adding enable/disable dithering core option with support for Neon GPU --- frontend/libretro.c | 22 ++++++++++++++++++++++ frontend/plugin_lib.h | 1 + 2 files changed, 23 insertions(+) (limited to 'frontend') diff --git a/frontend/libretro.c b/frontend/libretro.c index c078494..3013a7f 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -456,6 +456,7 @@ void retro_set_environment(retro_environment_t cb) { "pcsx_rearmed_multitap1", "Multitap 1; auto|disabled|enabled" }, { "pcsx_rearmed_multitap2", "Multitap 2; auto|disabled|enabled" }, { "pcsx_rearmed_vibration", "Enable Vibration; enabled|disabled" }, + { "pcsx_rearmed_dithering", "Enable Dithering; enabled|disabled" }, #ifndef DRC_DISABLE { "pcsx_rearmed_drc", "Dynamic recompiler; enabled|disabled" }, #endif @@ -1376,6 +1377,27 @@ static void update_variables(bool in_flight) in_enable_vibration = 1; } + var.value = NULL; + var.key = "pcsx_rearmed_dithering"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value) + { + if (strcmp(var.value, "disabled") == 0) { + pl_rearmed_cbs.gpu_peops.iUseDither = 0; + pl_rearmed_cbs.gpu_peopsgl.bDrawDither = 0; +#ifdef __ARM_NEON__ + pl_rearmed_cbs.gpu_neon.allow_dithering = 0; +#endif + } + else if (strcmp(var.value, "enabled") == 0) { + pl_rearmed_cbs.gpu_peops.iUseDither = 1; + pl_rearmed_cbs.gpu_peopsgl.bDrawDither = 1; +#ifdef __ARM_NEON__ + pl_rearmed_cbs.gpu_neon.allow_dithering = 1; +#endif + } + } + #ifdef __ARM_NEON__ var.value = "NULL"; var.key = "pcsx_rearmed_neon_interlace_enable"; diff --git a/frontend/plugin_lib.h b/frontend/plugin_lib.h index 83b2774..92e62e9 100644 --- a/frontend/plugin_lib.h +++ b/frontend/plugin_lib.h @@ -71,6 +71,7 @@ struct rearmed_cbs { int allow_interlace; // 0 off, 1 on, 2 guess int enhancement_enable; int enhancement_no_main; + int allow_dithering; } gpu_neon; struct { int iUseDither; -- cgit v1.2.3