From 8287d597a2b0c9a51a49cc7c6124b4d59663deea Mon Sep 17 00:00:00 2001 From: r5 Date: Wed, 20 Sep 2017 19:24:52 +0100 Subject: [PATCH 1/5] (libretro) Expose stereo/mono core option --- libretro/libretro.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libretro/libretro.c b/libretro/libretro.c index e264117..262c5c7 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -514,7 +514,7 @@ static void config_default(void) config.hg = 100.0; config.dac_bits = 14; /* MAX DEPTH */ config.ym2413 = 2; /* AUTO */ - config.mono = 0; /* STEREO output */ + config.mono = 1; /* MONO output */ /* system options */ config.system = 0; /* AUTO */ @@ -1032,7 +1032,16 @@ static void check_variables(void) } } } - + + var.key = "genesis_plus_gx_sound_output"; + environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var); + { + if (!strcmp(var.value, "mono")) + config.mono = 1; + else if (!strcmp(var.value, "stereo")) + config.mono = 0; + } + var.key = "genesis_plus_gx_audio_filter"; environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var); { @@ -1628,6 +1637,7 @@ void retro_set_environment(retro_environment_t cb) { "genesis_plus_gx_lock_on", "Cartridge lock-on; disabled|game genie|action replay (pro)|sonic & knuckles" }, { "genesis_plus_gx_ym2413", "Master System FM; auto|disabled|enabled" }, { "genesis_plus_gx_dac_bits", "YM2612 DAC quantization; disabled|enabled" }, + { "genesis_plus_gx_sound_output", "Sound output; mono|stereo" }, { "genesis_plus_gx_audio_filter", "Audio filter; disabled|Lowpass" }, { "genesis_plus_gx_lowpass_range", "Low-pass filter %; 60|65|70|75|80|85|90|95|5|10|15|20|25|30|35|40|45|50|55"}, From f0fe9307c9ccd3b8eb6f9b25c410c477ef4141d1 Mon Sep 17 00:00:00 2001 From: r5 Date: Thu, 21 Sep 2017 14:38:22 +0100 Subject: [PATCH 2/5] (libretro) Revert default sound output to 'stereo' --- libretro/libretro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libretro/libretro.c b/libretro/libretro.c index 262c5c7..4998366 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -514,7 +514,7 @@ static void config_default(void) config.hg = 100.0; config.dac_bits = 14; /* MAX DEPTH */ config.ym2413 = 2; /* AUTO */ - config.mono = 1; /* MONO output */ + config.mono = 0; /* STEREO output */ /* system options */ config.system = 0; /* AUTO */ @@ -1637,7 +1637,7 @@ void retro_set_environment(retro_environment_t cb) { "genesis_plus_gx_lock_on", "Cartridge lock-on; disabled|game genie|action replay (pro)|sonic & knuckles" }, { "genesis_plus_gx_ym2413", "Master System FM; auto|disabled|enabled" }, { "genesis_plus_gx_dac_bits", "YM2612 DAC quantization; disabled|enabled" }, - { "genesis_plus_gx_sound_output", "Sound output; mono|stereo" }, + { "genesis_plus_gx_sound_output", "Sound output; stereo|mono" }, { "genesis_plus_gx_audio_filter", "Audio filter; disabled|Lowpass" }, { "genesis_plus_gx_lowpass_range", "Low-pass filter %; 60|65|70|75|80|85|90|95|5|10|15|20|25|30|35|40|45|50|55"}, From 5cd8f6e7d39aa2e17d5d73fd4f21746fbccbdcbe Mon Sep 17 00:00:00 2001 From: LodanZark Date: Thu, 21 Sep 2017 15:13:17 +0100 Subject: [PATCH 3/5] change the Lowpass core option to lowercase change the Lowpass core option to lowercase for better consistence with other options --- libretro/libretro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libretro/libretro.c b/libretro/libretro.c index 262c5c7..a1adb2b 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -1045,7 +1045,7 @@ static void check_variables(void) var.key = "genesis_plus_gx_audio_filter"; environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var); { - if (!strcmp(var.value, "Lowpass")) + if (!strcmp(var.value, "lowpass")) config.filter = 1; #if HAVE_EQ @@ -1638,7 +1638,7 @@ void retro_set_environment(retro_environment_t cb) { "genesis_plus_gx_ym2413", "Master System FM; auto|disabled|enabled" }, { "genesis_plus_gx_dac_bits", "YM2612 DAC quantization; disabled|enabled" }, { "genesis_plus_gx_sound_output", "Sound output; mono|stereo" }, - { "genesis_plus_gx_audio_filter", "Audio filter; disabled|Lowpass" }, + { "genesis_plus_gx_audio_filter", "Audio filter; disabled|lowpass" }, { "genesis_plus_gx_lowpass_range", "Low-pass filter %; 60|65|70|75|80|85|90|95|5|10|15|20|25|30|35|40|45|50|55"}, #if HAVE_EQ From ba28a28b7e0751900e3277d7789154871d14642b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 26 Sep 2017 00:49:48 +0200 Subject: [PATCH 4/5] Fix Emscripten --- core/sound/ym3438.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/sound/ym3438.c b/core/sound/ym3438.c index 8a9d328..5dd8b42 100644 --- a/core/sound/ym3438.c +++ b/core/sound/ym3438.c @@ -42,6 +42,7 @@ * version: 1.0.2 */ +#include #include "ym3438.h" enum { From accc1c030e6f306423359fe0c3864a420fd9cb0d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 26 Sep 2017 04:18:19 +0200 Subject: [PATCH 5/5] Use stdint.h instead of inttypes.h - fixes MSVC < 2010 --- core/sound/ym3438.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/sound/ym3438.h b/core/sound/ym3438.h index 3ba0846..1f44ec7 100644 --- a/core/sound/ym3438.h +++ b/core/sound/ym3438.h @@ -45,7 +45,7 @@ #ifndef YM3438_H #define YM3438_H -#include +#include typedef uintptr_t Bitu; typedef intptr_t Bits;