libretro: minor fixes
[pcsx_rearmed.git] / frontend / libretro.c
index 524aedf..23c34ae 100644 (file)
@@ -19,6 +19,7 @@
 #include "../libpcsxcore/cdriso.h"
 #include "../libpcsxcore/cheat.h"
 #include "../plugins/dfsound/out.h"
+#include "../plugins/dfsound/spu_config.h"
 #include "../plugins/dfinput/externals.h"
 #include "cspace.h"
 #include "main.h"
@@ -249,6 +250,8 @@ void retro_set_environment(retro_environment_t cb)
       { "pcsx_rearmed_neon_enhancement_no_main", "Enhanced resolution speed hack; disabled|enabled" },
 #endif
       { "pcsx_rearmed_duping_enable", "Frame duping; on|off" },
+      { "pcsx_rearmed_spu_reverb", "Sound: Reverb; on|off" },
+      { "pcsx_rearmed_spu_interpolation", "Sound: Interpolation; simple|gaussian|cubic|off" },
       { NULL, NULL },
    };
 
@@ -1041,6 +1044,32 @@ static void update_variables(bool in_flight)
    }
 #endif
 
+   var.value = "NULL";
+   var.key = "pcsx_rearmed_spu_reverb";
+
+   if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
+   {
+      if (strcmp(var.value, "off") == 0)
+         spu_config.iUseReverb = false;
+      else if (strcmp(var.value, "on") == 0)
+         spu_config.iUseReverb = true;
+   }
+
+   var.value = "NULL";
+   var.key = "pcsx_rearmed_spu_interpolation";
+
+   if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
+   {
+      if (strcmp(var.value, "simple") == 0)
+         spu_config.iUseInterpolation = 1;
+      else if (strcmp(var.value, "gaussian") == 0)
+         spu_config.iUseInterpolation = 2;
+      else if (strcmp(var.value, "cubic") == 0)
+         spu_config.iUseInterpolation = 3;
+      else if (strcmp(var.value, "off") == 0)
+         spu_config.iUseInterpolation = 0;
+   }
+
    if (in_flight) {
       // inform core things about possible config changes
       plugin_call_rearmed_cbs();
@@ -1154,7 +1183,7 @@ void retro_init(void)
        const char *bios[] = { "scph1001", "scph5501", "scph7001" };
        const char *dir;
        char path[256];
-       int i, ret, level;
+       int i, ret;
        bool found_bios = false;
 
        ret = emu_core_preinit();
@@ -1198,16 +1227,13 @@ void retro_init(void)
                environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE, (void*)&msg);
        }
 
-       level = 1;
-       environ_cb(RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL, &level);
-
        environ_cb(RETRO_ENVIRONMENT_GET_CAN_DUPE, &vout_can_dupe);
        environ_cb(RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE, &disk_control);
 
        /* Set how much slower PSX CPU runs * 100 (so that 200 is 2 times)
         * we have to do this because cache misses and some IO penalties
         * are not emulated. Warning: changing this may break compatibility. */
-#ifdef __ARM_ARCH_7A__
+#if !defined(__arm__) || defined(__ARM_ARCH_7A__)
        cycle_multiplier = 175;
 #else
        cycle_multiplier = 200;