From: kub Date: Sun, 30 Jun 2024 15:19:34 +0000 (+0200) Subject: sms, improve system detection by extension X-Git-Tag: v2.00~18 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40172b93195603fd10999531f5775137fb97557e;p=picodrive.git sms, improve system detection by extension --- 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 }