From: notaz Date: Sun, 10 Nov 2024 16:38:18 +0000 (+0200) Subject: gpu_unai: clean up ilace_mask X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68dc9ab0a8c219c6f73b72bd7d6a18e6816534c0;p=pcsx_rearmed.git gpu_unai: clean up ilace_mask do_cmd_list() was no place for it. It should also alternate odd/even lines but I leave that for later. --- diff --git a/plugins/gpu_unai/gpulib_if.cpp b/plugins/gpu_unai/gpulib_if.cpp index ca794ddd..c7169dd6 100644 --- a/plugins/gpu_unai/gpulib_if.cpp +++ b/plugins/gpu_unai/gpulib_if.cpp @@ -285,22 +285,13 @@ void renderer_finish(void) void renderer_notify_res_change(void) { - if (LineSkipEnabled()) { - // Set rendering line-skip (only render every other line in high-res - // 480 vertical mode, or, optionally, force it for all video modes) - - if (gpu.screen.vres == 480) { - if (gpu_unai.config.ilace_force) { - gpu_unai.ilace_mask = 3; // Only need 1/4 of lines - } else { - gpu_unai.ilace_mask = 1; // Only need 1/2 of lines - } - } else { - // Vert resolution changed from 480 to lower one - gpu_unai.ilace_mask = gpu_unai.config.ilace_force; - } - } else { - gpu_unai.ilace_mask = 0; + gpu_unai.ilace_mask = gpu_unai.config.ilace_force; + +#ifndef HAVE_PRE_ARMV7 /* XXX */ + if (gpu_unai.config.scale_hires) +#endif + { + gpu_unai.ilace_mask |= !!(gpu.status & PSX_GPU_STATUS_INTERLACE); } /* @@ -398,17 +389,6 @@ int do_cmd_list(u32 *list_, int list_len, if (IS_OLD_RENDERER()) return oldunai_do_cmd_list(list_, list_len, cycles_sum_out, cycles_last, last_cmd); - //TODO: set ilace_mask when resolution changes instead of every time, - // eliminate #ifdef below. - gpu_unai.ilace_mask = gpu_unai.config.ilace_force; - -#ifdef HAVE_PRE_ARMV7 /* XXX */ - gpu_unai.ilace_mask |= !!(gpu.status & PSX_GPU_STATUS_INTERLACE); -#endif - if (gpu_unai.config.scale_hires) { - gpu_unai.ilace_mask |= !!(gpu.status & PSX_GPU_STATUS_INTERLACE); - } - for (; list < list_end; list += 1 + len) { cmd = le32_to_u32(*list) >> 24; @@ -827,6 +807,7 @@ void renderer_flush_queues(void) void renderer_set_interlace(int enable, int is_odd) { + renderer_notify_res_change(); } #include "../../frontend/plugin_lib.h"