X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fgpulib%2Fvout_pl.c;h=075e3c339bb64feb6e9c63395ef61df63a72bc88;hb=43047988e507799d7d5bbcd926c5d0b5b94fcdc1;hp=541b5e0bbaa07748f0f2a7ad7c17b9f42486cfe1;hpb=c82f907a99f7d0d3071471489d247f4b4394a8b7;p=pcsx_rearmed.git diff --git a/plugins/gpulib/vout_pl.c b/plugins/gpulib/vout_pl.c index 541b5e0b..075e3c33 100644 --- a/plugins/gpulib/vout_pl.c +++ b/plugins/gpulib/vout_pl.c @@ -43,6 +43,15 @@ static void check_mode_change(int force) h_out *= 2; } + gpu.state.downscale_active = + gpu.get_downscale_buffer != NULL && gpu.state.downscale_enable + && (w >= 512 || h >= 256); + + if (gpu.state.downscale_active) { + w_out = w < 512 ? w : 320; + h_out = h < 256 ? h : h / 2; + } + // width|rgb24 change? if (force || (gpu.status.reg ^ old_status) & ((7<<16)|(1<<21)) || h != old_h) { @@ -69,6 +78,9 @@ void vout_update(void) if (gpu.state.enhancement_active) vram = gpu.get_enhancement_bufer(&x, &y, &w, &h, &vram_h); + if (gpu.state.downscale_active) + vram = gpu.get_downscale_buffer(&x, &y, &w, &h, &vram_h); + if (y + h > vram_h) { if (y + h - vram_h > h / 2) { // wrap @@ -89,11 +101,12 @@ void vout_blank(void) { int w = gpu.screen.hres; int h = gpu.screen.h; + + check_mode_change(0); if (gpu.state.enhancement_active) { w *= 2; h *= 2; } - check_mode_change(0); cbs->pl_vout_flip(NULL, 1024, gpu.status.rgb24, w, h); }