gpulib: more doubleres hacks master github/master
authornotaz <notasas@gmail.com>
Sun, 8 Mar 2026 00:49:20 +0000 (02:49 +0200)
committernotaz <notasas@gmail.com>
Sun, 8 Mar 2026 01:41:22 +0000 (03:41 +0200)
libretro/pcsx_rearmed#912

plugins/gpulib/gpu.c
plugins/gpulib/gpu.h
plugins/gpulib/vout_pl.c

index 271e1c7..b6f3565 100644 (file)
@@ -1205,6 +1205,7 @@ void GPUrearmedCallbacks(const struct rearmed_cbs *cbs)
   gpu.state.frame_count = (uint32_t *)cbs->gpu_frame_count;
   gpu.state.allow_interlace = cbs->gpu_neon.allow_interlace;
   gpu.state.enhancement_enable = cbs->gpu_neon.enhancement_enable;
+  gpu.state.enhancement_active = 0;
   gpu.state.downscale_enable = cbs->scale_hires;
   gpu.state.screen_centering_type_default = cbs->screen_centering_type_default;
   if (gpu.state.screen_centering_type != cbs->screen_centering_type
index 86b1fe6..177e5aa 100644 (file)
@@ -101,7 +101,8 @@ struct psx_gpu {
       uint32_t hcnt;
     } last_list;
     uint32_t last_vram_read_frame;
-    uint32_t w_out_old, h_out_old, status_vo_old;
+    uint16_t w_out_old, h_out_old, src_y_old;
+    uint32_t status_vo_old;
     short screen_centering_type;
     short screen_centering_type_default;
     short screen_centering_x;
index b96d9c2..07cf6da 100644 (file)
@@ -38,13 +38,15 @@ static void check_mode_change(struct psx_gpu *gpu, int force)
   w = w_out = (gpu->status & PSX_GPU_STATUS_RGB24) ? 2048/3 : 1024;
   h = h_out = 512;
 #endif
-  gpu->state.enhancement_active =
-    gpu->get_enhancement_bufer != NULL && gpu->state.enhancement_enable
-    && w <= 512 && h <= 256 && !(gpu->status & PSX_GPU_STATUS_RGB24);
-
-  if (gpu->state.enhancement_active) {
-    w_out *= 2;
-    h_out *= 2;
+  if (gpu->get_enhancement_bufer != NULL && gpu->state.enhancement_enable) {
+    gpu->state.enhancement_active =
+      w <= 512 && h <= 256 && !(gpu->status & PSX_GPU_STATUS_RGB24) &&
+      gpu->screen.src_y < (512 - 256/2) && gpu->state.src_y_old < (512 - 256/2);
+    gpu->state.src_y_old = gpu->screen.src_y;
+    if (gpu->state.enhancement_active) {
+      w_out *= 2;
+      h_out *= 2;
+    }
   }
   if (gpu->status & PSX_GPU_STATUS_RGB24) {
     // some asm relies on this alignment