+static void psxMemFreeMap(void)
+{
+ if (psxM) psxUnmap(psxM, 0x00210000, MAP_TAG_RAM);
+ if (psxH) psxUnmap(psxH, 0x10000, MAP_TAG_OTHER);
+ if (psxR) psxUnmap(psxR, 0x80000, MAP_TAG_OTHER);
+ psxM = psxH = psxR = NULL;
+ psxP = NULL;
+}
+
+int psxMemInit(void)
+{
+ unsigned int i;
+ int ret;
+
+ if (LIGHTREC_CUSTOM_MAP)
+ ret = lightrec_init_mmap();
+ else
+ ret = psxMemInitMap();
+ if (ret) {