core, revisit Sega 8 bit hardware handling

This commit is contained in:
kub 2023-02-22 23:22:45 +00:00
parent cab84f29e5
commit 0aa63fce12
9 changed files with 63 additions and 58 deletions

View file

@ -345,12 +345,6 @@ enum media_type_e PicoLoadMedia(const char *filename,
do_region_override(filename);
}
if (PicoCartInsert(rom_data, rom_size, carthw_cfg_fname)) {
media_type = PM_ERROR;
goto out;
}
rom_data = NULL; // now belongs to PicoCart
// 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;
@ -363,18 +357,24 @@ enum media_type_e PicoLoadMedia(const char *filename,
}
}
if (ext && !strcmp(ext,"gg") && !PicoIn.hwSelect) {
Pico.m.hardware |= PMS_HW_GG;
PicoIn.AHW |= PAHW_GG;
lprintf("detected GG ROM\n");
} else if (ext && !strcmp(ext,"sg")) {
Pico.m.hardware |= PMS_HW_SG;
PicoIn.AHW |= PAHW_SG;
lprintf("detected SG-1000 ROM\n");
} else if (ext && !strcmp(ext,"sc")) {
Pico.m.hardware |= PMS_HW_SC;
PicoIn.AHW |= PAHW_SC;
lprintf("detected SC-3000 ROM\n");
} else
lprintf("detected SMS ROM\n");
}
if (PicoCartInsert(rom_data, rom_size, carthw_cfg_fname)) {
media_type = PM_ERROR;
goto out;
}
rom_data = NULL; // now belongs to PicoCart
// insert CD if it was detected
Pico.m.ncart_in = 0;
if (cd_img_type != CT_UNKNOWN) {