diff --git a/platform/common/menu_pico.c b/platform/common/menu_pico.c index 56318a098..78dfcc33f 100644 --- a/platform/common/menu_pico.c +++ b/platform/common/menu_pico.c @@ -639,10 +639,12 @@ static int menu_loop_adv_options(int id, int keys) static int sndrate_prevnext(int rate, int dir) { - static const int rates[] = { 8000, 11025, 16000, 22050, 44100, 53000 }; - int rate_count = sizeof(rates)/sizeof(rates[0]); + const int *rates = plat_target.sound_rates; + int rate_count; int i; + for (rate_count = 0; rates[rate_count] != -1; rate_count++) + ; for (i = 0; i < rate_count; i++) if (rates[i] == rate) break; diff --git a/platform/common/plat_sdl.c b/platform/common/plat_sdl.c index c47ef1b7f..785fb1bf7 100644 --- a/platform/common/plat_sdl.c +++ b/platform/common/plat_sdl.c @@ -30,7 +30,8 @@ static struct in_pdata in_sdl_platform_data = { .defbinds = in_sdl_defbinds, }; -struct plat_target plat_target; +static int sound_rates[] = { 8000, 11025, 16000, 22050, 32000, 44100, 53000, -1 }; +struct plat_target plat_target = { .sound_rates = sound_rates }; #if defined __MIYOO__ const char *plat_device = "miyoo"; diff --git a/platform/gp2x/emu.c b/platform/gp2x/emu.c index d59f3ecae..460b1541e 100644 --- a/platform/gp2x/emu.c +++ b/platform/gp2x/emu.c @@ -778,7 +778,7 @@ void pemu_sound_start(void) } } -static const int sound_rates[] = { 53000, 44100, 32000, 22050, 16000, 11025, 8000 }; +static const int sound_rates[] = { 52000, 44100, 32000, 22050, 16000, 11025, 8000 }; void pemu_sound_stop(void) { diff --git a/platform/libpicofe b/platform/libpicofe index c825b167e..82b485477 160000 --- a/platform/libpicofe +++ b/platform/libpicofe @@ -1 +1 @@ -Subproject commit c825b167e9c08afaec23721f983ba003d86b838a +Subproject commit 82b4854771302e23201de274eee2969fc28be8be diff --git a/platform/ps2/plat.c b/platform/ps2/plat.c index af780c490..253e18784 100644 --- a/platform/ps2/plat.c +++ b/platform/ps2/plat.c @@ -19,7 +19,8 @@ #include "../libpicofe/plat.h" -struct plat_target plat_target = {}; +static int sound_rates[] = { 11025, 22050, 44100, -1 }; +struct plat_target plat_target = { .sound_rates = sound_rates }; static void reset_IOP() { SifInitRpc(0); diff --git a/platform/psp/emu.c b/platform/psp/emu.c index 54773387d..8b5a49810 100644 --- a/platform/psp/emu.c +++ b/platform/psp/emu.c @@ -1,6 +1,7 @@ /* * PicoDrive * (C) notaz, 2007,2008 + * (C) irixxxx, 2022-2024 * * This work is licensed under the terms of MAME license. * See COPYING file in the top-level directory. diff --git a/platform/psp/plat.c b/platform/psp/plat.c index e73339f61..64ae04325 100644 --- a/platform/psp/plat.c +++ b/platform/psp/plat.c @@ -273,6 +273,7 @@ static int plat_bat_capacity_get(void) return scePowerGetBatteryLifePercent(); } +static int sound_rates[] = { 8000, 11025, 16000, 22050, 32000, 44100, -1 }; struct plat_target plat_target = { .cpu_clock_get = plat_cpu_clock_get, .cpu_clock_set = plat_cpu_clock_set, @@ -280,6 +281,7 @@ struct plat_target plat_target = { // .gamma_set = plat_gamma_set, // .hwfilter_set = plat_hwfilter_set, // .hwfilters = plat_hwfilters, + .sound_rates = sound_rates, }; int _flush_cache (char *addr, const int size, const int op)