gpulib: add a "borderless" option to restore old behavior
[pcsx_rearmed.git] / plugins / gpulib / gpu.c
index fdb109c..f076774 100644 (file)
 #include <string.h>
 #include "gpu.h"
 #include "../../libpcsxcore/gpu.h" // meh
+#include "../../frontend/plugin_lib.h"
 
+#ifndef ARRAY_SIZE
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#endif
 #ifdef __GNUC__
 #define unlikely(x) __builtin_expect((x), 0)
 #define preload __builtin_prefetch
@@ -81,9 +84,9 @@ static noinline void update_width(void)
     sw /= hdiv;
     sw = (sw + 2) & ~3; // according to nocash
     switch (gpu.state.screen_centering_type) {
-    case 1:
+    case C_INGAME:
       break;
-    case 2:
+    case C_MANUAL:
       x = gpu.state.screen_centering_x;
       break;
     default:
@@ -125,9 +128,12 @@ static noinline void update_height(void)
     /* nothing displayed? */;
   else {
     switch (gpu.state.screen_centering_type) {
-    case 1:
+    case C_INGAME:
+      break;
+    case C_BORDERLESS:
+      y = 0;
       break;
-    case 2:
+    case C_MANUAL:
       y = gpu.state.screen_centering_y;
       break;
     default:
@@ -903,8 +909,6 @@ void GPUgetScreenInfo(int *y, int *base_hres)
     *base_hres >>= 1;
 }
 
-#include "../../frontend/plugin_lib.h"
-
 void GPUrearmedCallbacks(const struct rearmed_cbs *cbs)
 {
   gpu.frameskip.set = cbs->frameskip;