X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=frontend%2Flibretro.c;h=4cd4e47f19c0b488b0efce0c1778cde04d3d294d;hb=01394a7f6afd51681cf7ef2f5d55e607a53517f2;hp=b625c1a0d470291521d2d237972c012bd6e350d3;hpb=3e24db8463c1d18195cd38c345e5197967780dd8;p=pcsx_rearmed.git diff --git a/frontend/libretro.c b/frontend/libretro.c index b625c1a0..4cd4e47f 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -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" @@ -39,7 +40,6 @@ static int vout_doffs_old, vout_fb_dirty; static bool vout_can_dupe; static bool duping_enable; -static int samples_sent, samples_to_send; static int plugins_opened; static int is_pal_mode; @@ -216,16 +216,13 @@ static void snd_finish(void) static int snd_busy(void) { - if (samples_to_send > samples_sent) - return 0; /* give more samples */ - else - return 1; + return 0; } static void snd_feed(void *buf, int bytes) { - audio_batch_cb(buf, bytes / 4); - samples_sent += bytes / 4; + if (audio_batch_cb != NULL) + audio_batch_cb(buf, bytes / 4); } void out_register_libretro(struct out_driver *drv) @@ -248,11 +245,13 @@ void retro_set_environment(retro_environment_t cb) { "rearmed_drc", "Dynamic recompiler; enabled|disabled" }, #endif #ifdef __ARM_NEON__ - { "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" }, + { "pcsx_rearmed_neon_interlace_enable", "Enable interlacing mode(s); disabled|enabled" }, + { "pcsx_rearmed_neon_enhancement_enable", "Enhanced resolution (slow); disabled|enabled" }, + { "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 }, }; @@ -979,7 +978,7 @@ static void update_variables(bool in_flight) #ifdef __ARM_NEON__ var.value = "NULL"; - var.key = "neon_interlace_enable"; + var.key = "pcsx_rearmed_neon_interlace_enable"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value) { @@ -990,7 +989,7 @@ static void update_variables(bool in_flight) } var.value = NULL; - var.key = "neon_enhancement_enable"; + var.key = "pcsx_rearmed_neon_enhancement_enable"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value) { @@ -1001,7 +1000,7 @@ static void update_variables(bool in_flight) } var.value = NULL; - var.key = "neon_enhancement_no_main"; + var.key = "pcsx_rearmed_neon_enhancement_no_main"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value) { @@ -1045,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(); @@ -1088,8 +1113,6 @@ void retro_run(void) stop = 0; psxCpu->Execute(); - samples_to_send += is_pal_mode ? 44100 / 50 : 44100 / 60; - video_cb((vout_fb_dirty || !vout_can_dupe || !duping_enable) ? vout_buf : NULL, vout_width, vout_height, vout_width * 2); vout_fb_dirty = 0;