sms, improve system detection by extension

This commit is contained in:
kub 2024-06-30 17:19:34 +02:00
parent 543e97f6f0
commit 40172b9319
2 changed files with 3 additions and 4 deletions

View file

@ -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 // simple test for GG. Do this here since m.hardware is nulled in Insert
if ((PicoIn.AHW & PAHW_SMS) && !PicoIn.hwSelect) { if ((PicoIn.AHW & PAHW_SMS) && !PicoIn.hwSelect) {
const char *ext = NULL; 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; ext = rom_file->ext;
} }
else if ((ext = strrchr(filename, '.'))) { else if ((ext = strrchr(filename, '.'))) {

View file

@ -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 // 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 static u32 gg_smsmode[] = { // cf https://www.smspower.org/Tags/SMS-GG
0x60002401 /* Castl.Ilusion */, 0x6f101018 /* Taito Chase */, 0x60002401 /* Castl.Ilusion */, 0x6f101018 /* Taito Chase */,
0x70709018 /* Olympic Gold */ , 0x70079038 /* Outrun EU */, 0x70709018 /* Olympic Gold */ , 0x70709038 /* Outrun EU */,
0x60801068 /* Predator 2 */ , 0x70408098 /* Prince.Persia */, 0x60801068 /* Predator 2 */ , 0x70408098 /* Prince.Persia */,
0x50101037 /* Rastan Saga */ , 0x7f086018 /* RC Grandprix */, 0x50101037 /* Rastan Saga */ , 0x7f086018 /* RC Grandprix */,
0x60002415 /* Super Kickoff */, 0x60801108 /* WWF.Steelcage */, 0x60002415 /* Super Kickoff */, 0x60801108 /* WWF.Steelcage */,
@ -650,8 +650,7 @@ void PicoResetMS(void)
id = CPU_LE4(*(u32 *)&Pico.rom[tmr-4]); id = CPU_LE4(*(u32 *)&Pico.rom[tmr-4]);
ck = *(u16 *)&Pico.rom[tmr-6] | (id&0xf0000000) | 0xfff0000; ck = *(u16 *)&Pico.rom[tmr-6] | (id&0xf0000000) | 0xfff0000;
if (!PicoIn.hwSelect && hw && ((id+1)&0xfffe) != 0) { if (!PicoIn.hwSelect && !PicoIn.AHW && hw && ((id+1)&0xfffe) != 0) {
PicoIn.AHW &= ~(PAHW_GG|PAHW_SG|PAHW_SC);
if (hw >= 0x5 && hw < 0x8) if (hw >= 0x5 && hw < 0x8)
PicoIn.AHW |= PAHW_GG; // GG cartridge detected PicoIn.AHW |= PAHW_GG; // GG cartridge detected
} }