SDL: Define available PS2 RAM

From 7343ece806fca9b5240e03a73f7165c92bbe4ece Mon Sep 17 00:00:00 2001
From: Francisco Javier Trujillo Mata <[EMAIL REDACTED]>
Date: Mon, 6 Jun 2022 00:05:43 +0200
Subject: [PATCH] Define available PS2 RAM

---
 src/cpuinfo/SDL_cpuinfo.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c
index 9f2101cf21a..9386d0ebb6a 100644
--- a/src/cpuinfo/SDL_cpuinfo.c
+++ b/src/cpuinfo/SDL_cpuinfo.c
@@ -98,6 +98,10 @@
 #include <swis.h>
 #endif
 
+#ifdef __PS2__
+#include <kernel.h>
+#endif
+
 #define CPU_HAS_RDTSC   (1 << 0)
 #define CPU_HAS_ALTIVEC (1 << 1)
 #define CPU_HAS_MMX     (1 << 2)
@@ -1081,6 +1085,12 @@ SDL_GetSystemRAM(void)
             SDL_SystemRAM = 536870912;
         }
 #endif
+#ifdef __PS2__
+        if (SDL_SystemRAM <= 0) {
+            /* PlayStation 2 has 32MiB however there are some special models with 64 and 128 */
+            SDL_SystemRAM = GetMemorySize();
+        }
+#endif
 #endif
     }
     return SDL_SystemRAM;