From 43047988e507799d7d5bbcd926c5d0b5b94fcdc1 Mon Sep 17 00:00:00 2001 From: Justin Weiss Date: Sun, 2 Aug 2020 22:04:52 -0700 Subject: 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. --- plugins/gpu_unai/gpu_unai.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins/gpu_unai/gpu_unai.h') diff --git a/plugins/gpu_unai/gpu_unai.h b/plugins/gpu_unai/gpu_unai.h index 8fb2293..6886eb8 100644 --- a/plugins/gpu_unai/gpu_unai.h +++ b/plugins/gpu_unai/gpu_unai.h @@ -138,6 +138,9 @@ struct gpu_unai_t { GPUPacket PacketBuffer; u16 *vram; +#ifdef USE_GPULIB + u16 *downscale_vram; +#endif //////////////////////////////////////////////////////////////////////////// // Variables used only by older standalone version of gpu_unai (gpu.cpp) #ifndef USE_GPULIB @@ -307,7 +310,7 @@ static inline bool ProgressiveInterlaceEnabled() // running on higher-res device or a resampling downscaler is enabled. static inline bool PixelSkipEnabled() { - return gpu_unai.config.pixel_skip; + return gpu_unai.config.pixel_skip || gpu_unai.config.scale_hires; } static inline bool LineSkipEnabled() -- cgit v1.2.3