From 40172b93195603fd10999531f5775137fb97557e Mon Sep 17 00:00:00 2001 From: kub Date: Sun, 30 Jun 2024 17:19:34 +0200 Subject: [PATCH] sms, improve system detection by extension --- pico/media.c | 2 +- pico/sms.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pico/media.c b/pico/media.c index b217fa0a..51e3fbd8 100644 --- a/pico/media.c +++ b/pico/media.c @@ -350,7 +350,7 @@ enum media_type_e PicoLoadMedia(const char *filename, // simple test for GG. Do this here since m.hardware is nulled in Insert if ((PicoIn.AHW & PAHW_SMS) && !PicoIn.hwSelect) { const char *ext = NULL; - if (rom_file && rom_file->ext && (*rom_file->ext != '\0')) { + if (rom_file && (*rom_file->ext != '\0')) { ext = rom_file->ext; } else if ((ext = strrchr(filename, '.'))) { diff --git a/pico/sms.c b/pico/sms.c index 9537caff..3313e02c 100644 --- a/pico/sms.c +++ b/pico/sms.c @@ -611,7 +611,7 @@ static u32 no_fmsound[] = { // cf Meka, meka/meka.pat // NB GG carts having the system type set to 4 (eg. HTH games) run as SMS anyway static u32 gg_smsmode[] = { // cf https://www.smspower.org/Tags/SMS-GG 0x60002401 /* Castl.Ilusion */, 0x6f101018 /* Taito Chase */, - 0x70709018 /* Olympic Gold */ , 0x70079038 /* Outrun EU */, + 0x70709018 /* Olympic Gold */ , 0x70709038 /* Outrun EU */, 0x60801068 /* Predator 2 */ , 0x70408098 /* Prince.Persia */, 0x50101037 /* Rastan Saga */ , 0x7f086018 /* RC Grandprix */, 0x60002415 /* Super Kickoff */, 0x60801108 /* WWF.Steelcage */, @@ -650,8 +650,7 @@ void PicoResetMS(void) id = CPU_LE4(*(u32 *)&Pico.rom[tmr-4]); ck = *(u16 *)&Pico.rom[tmr-6] | (id&0xf0000000) | 0xfff0000; - if (!PicoIn.hwSelect && hw && ((id+1)&0xfffe) != 0) { - PicoIn.AHW &= ~(PAHW_GG|PAHW_SG|PAHW_SC); + if (!PicoIn.hwSelect && !PicoIn.AHW && hw && ((id+1)&0xfffe) != 0) { if (hw >= 0x5 && hw < 0x8) PicoIn.AHW |= PAHW_GG; // GG cartridge detected } -- 2.39.5