gpulib: add some missed sync and flush
[pcsx_rearmed.git] / plugins / gpu_neon / psx_gpu / psx_gpu_4x.c
index 942b3d3..bd6c7a1 100644 (file)
@@ -1,6 +1,10 @@
+#define select_enhancement_buf_index(psx_gpu, x) \\r
+  ((psx_gpu)->enhancement_buf_by_x16[(u32)(x) / \\r
+    (1024u / sizeof((psx_gpu)->enhancement_buf_by_x16))])\r
+\r
 #define select_enhancement_buf_ptr(psx_gpu, x) \\r
   ((psx_gpu)->enhancement_buf_ptr + \\r
-   ((psx_gpu)->enhancement_buf_by_x16[(x) / 16] << 20))\r
+    (select_enhancement_buf_index(psx_gpu, x) << 20))\r
 \r
 #if !defined(NEON_BUILD) || defined(SIMD_BUILD)\r
 \r
@@ -233,7 +237,11 @@ void setup_sprite_16bpp_4x(psx_gpu_struct *psx_gpu, s32 x, s32 y, s32 u,
 static void setup_sprite_untextured_4x(psx_gpu_struct *psx_gpu, s32 x, s32 y,\r
  s32 u, s32 v, s32 width, s32 height, u32 color)\r
 {\r
-  setup_sprite_untextured(psx_gpu, x, y, u, v, width * 2, height * 2, color);\r
+  width *= 2;\r
+  height *= 2;\r
+  if (width > 1024)\r
+    width = 1024;\r
+  setup_sprite_untextured(psx_gpu, x, y, u, v, width, height, color);\r
 }\r
 \r
 #define setup_sprite_blocks_switch_textured_4x(texture_mode)                   \\r