From 1ffc8b84f1f43be66acad4782196070b456360eb Mon Sep 17 00:00:00 2001 From: kub Date: Thu, 21 Oct 2021 20:40:13 +0200 Subject: [PATCH] sms, revisit FM settings setting moved to SMS section, default off since it crashes some games --- pico/sms.c | 5 ++--- platform/common/emu.c | 2 +- platform/common/menu_pico.c | 6 ++++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pico/sms.c b/pico/sms.c index 67813420..2aa8838c 100644 --- a/pico/sms.c +++ b/pico/sms.c @@ -137,8 +137,7 @@ static unsigned char z80_sms_in(unsigned short a) break; case 0xf2: // bit 0 = 1 active FM Pac - d = ymflag; - //printf("read FM Check = %02x\n", d); + d = 0xf8 | ymflag; break; } } @@ -202,7 +201,7 @@ static void z80_sms_out(unsigned short a, unsigned char d) break; case 0xf2: // bit 0 = 1 active FM Pac - ymflag = d; + ymflag = d & 0x1; break; } } diff --git a/platform/common/emu.c b/platform/common/emu.c index faadafd1..26699eae 100644 --- a/platform/common/emu.c +++ b/platform/common/emu.c @@ -589,7 +589,7 @@ void emu_prep_defconfig(void) memset(&defaultConfig, 0, sizeof(defaultConfig)); defaultConfig.EmuOpt = EOPT_EN_SRAM | EOPT_EN_SOUND | EOPT_16BPP | EOPT_EN_CD_LEDS | EOPT_GZIP_SAVES | 0x10/*?*/; - defaultConfig.s_PicoOpt = POPT_EN_SNDFILTER|POPT_EN_YM2413|POPT_EN_GG_LCD | + defaultConfig.s_PicoOpt = POPT_EN_SNDFILTER|POPT_EN_GG_LCD | POPT_EN_STEREO|POPT_EN_FM|POPT_EN_PSG|POPT_EN_Z80 | POPT_EN_MCD_PCM|POPT_EN_MCD_CDDA|POPT_EN_MCD_GFX | POPT_EN_DRC|POPT_ACC_SPRITES | diff --git a/platform/common/menu_pico.c b/platform/common/menu_pico.c index 011df1c9..cbe22c84 100644 --- a/platform/common/menu_pico.c +++ b/platform/common/menu_pico.c @@ -528,10 +528,13 @@ static int menu_loop_32x_options(int id, int keys) #ifndef NO_SMS static const char *sms_hardwares[] = { "auto", "Game Gear", "Master System", NULL }; +static const char h_smsfm[] = "FM sound is only supported by few games\nOther games may crash with FM enabled"; static menu_entry e_menu_sms_options[] = { - mee_enum ("System", MA_SMSOPT_HARDWARE, PicoIn.hwSelect, sms_hardwares ), + mee_enum ("System", MA_SMSOPT_HARDWARE, PicoIn.hwSelect, sms_hardwares ), + mee_onoff_h ("FM Sound Unit", MA_OPT2_ENABLE_YM2413, PicoIn.opt, POPT_EN_YM2413, h_smsfm), + mee_end, }; static int menu_loop_sms_options(int id, int keys) @@ -557,7 +560,6 @@ static menu_entry e_menu_adv_options[] = mee_onoff ("Emulate YM2612 (FM)", MA_OPT2_ENABLE_YM2612, PicoIn.opt, POPT_EN_FM), mee_onoff ("Disable YM2612 SSG-EG", MA_OPT2_DISABLE_YM_SSG,PicoIn.opt, POPT_DIS_FM_SSGEG), mee_onoff ("Emulate SN76496 (PSG)", MA_OPT2_ENABLE_SN76496,PicoIn.opt, POPT_EN_PSG), - mee_onoff ("Emulate YM2413 (FM)", MA_OPT2_ENABLE_YM2413 ,PicoIn.opt, POPT_EN_YM2413), mee_onoff ("Emulate Game Gear LCD", MA_OPT2_ENABLE_GGLCD ,PicoIn.opt, POPT_EN_GG_LCD), mee_onoff ("Disable idle loop patching",MA_OPT2_NO_IDLE_LOOPS,PicoIn.opt, POPT_DIS_IDLE_DET), mee_onoff ("Disable frame limiter", MA_OPT2_NO_FRAME_LIMIT,currentConfig.EmuOpt, EOPT_NO_FRMLIMIT), -- 2.39.5