libretro: add some SPU options
authornotaz <notasas@gmail.com>
Sat, 20 Dec 2014 00:49:35 +0000 (02:49 +0200)
committernotaz <notasas@gmail.com>
Sat, 20 Dec 2014 00:59:02 +0000 (02:59 +0200)
frontend/libretro.c

index 524aedf..4cd4e47 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();