Fixed NEON GPU plugin for PC by using stdint.h types - use
[pcsx_rearmed.git] / frontend / libretro.c
index be132a1..bce05e8 100644 (file)
@@ -243,7 +243,10 @@ void retro_set_environment(retro_environment_t cb)
       { "frameskip", "Frameskip; 0|1|2|3" },
       { "region", "Region; Auto|NTSC|PAL" },
       { "pad1type", "Pad 1 Type; standard|analog" },
-#ifdef __ARM_NEON__
+#ifndef DRC_DISABLE
+      { "rearmed_drc", "Dynamic recompiler; enabled|disabled" },
+#endif
+#if defined(__ARM_NEON__) || defined(NEON_PC)
       { "neon_interlace_enable", "Enable interlacing mode(s); disabled|enabled" },
       { "neon_enhancement_enable", "Enhanced resolution (slow); disabled|enabled" },
       { "neon_enhancement_no_main", "Enhanced resolution speed hack; disabled|enabled" },
@@ -797,7 +800,7 @@ static void update_variables(bool in_flight)
          in_type1 = PSE_PAD_TYPE_ANALOGPAD;
    }
 
-#ifdef __ARM_NEON__
+#if defined(__ARM_NEON__) || defined(NEON_PC)
    var.value = "NULL";
    var.key = "neon_interlace_enable";
 
@@ -832,6 +835,28 @@ static void update_variables(bool in_flight)
    }
 #endif
 
+#ifndef DRC_DISABLE
+   var.value = NULL;
+   var.key = "rearmed_drc";
+
+   if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
+   {
+      R3000Acpu *prev_cpu = psxCpu;
+
+      if (strcmp(var.value, "disabled") == 0)
+         Config.Cpu = CPU_INTERPRETER;
+      else if (strcmp(var.value, "enabled") == 0)
+         Config.Cpu = CPU_DYNAREC;
+
+      psxCpu = (Config.Cpu == CPU_INTERPRETER) ? &psxInt : &psxRec;
+      if (psxCpu != prev_cpu) {
+         prev_cpu->Shutdown();
+         psxCpu->Init();
+         psxCpu->Reset(); // not really a reset..
+      }
+   }
+#endif
+
        if (in_flight) {
                // inform core things about possible config changes
                plugin_call_rearmed_cbs();