diff --git a/source/cd_hw/scd.c b/source/cd_hw/scd.c index e10a0b1..9fe24a8 100644 --- a/source/cd_hw/scd.c +++ b/source/cd_hw/scd.c @@ -1069,7 +1069,7 @@ void scd_init(void) } /* $200000-$3FFFFF (resp. $600000-$7FFFFF): Word-RAM in 2M mode (256KB mirrored) */ - for (i=base+0x20; i 0) { - /* auto-save previous game state */ - slot_autosave(config.s_default,config.s_device); + /* check if loaded game has changed */ + if (reload) + { + /* auto-save previous game state */ + slot_autosave(config.s_default,config.s_device); - /* update pathname for screenshot, save & cheat files */ - if (romtype & SYSTEM_SMS) - { - /* Master System ROM file */ - filetype = 2; - sprintf(rom_filename,"ms/%s",filelist[selection].filename); - } - else if (romtype & SYSTEM_GG) - { - /* Game Gear ROM file */ - filetype = 3; - sprintf(rom_filename,"gg/%s",filelist[selection].filename); - } - else if (romtype == SYSTEM_SG) - { - /* SG-1000 ROM file */ - filetype = 4; - sprintf(rom_filename,"sg/%s",filelist[selection].filename); - } - else if (romtype == SYSTEM_MCD) - { - /* CD image file */ - filetype = 1; - sprintf(rom_filename,"cd/%s",filelist[selection].filename); - } - else - { - /* by default, Genesis ROM file */ - filetype = 0; - sprintf(rom_filename,"md/%s",filelist[selection].filename); - } + /* update pathname for screenshot, save & cheat files */ + if (romtype & SYSTEM_SMS) + { + /* Master System ROM file */ + filetype = 2; + sprintf(rom_filename,"ms/%s",filelist[selection].filename); + } + else if (romtype & SYSTEM_GG) + { + /* Game Gear ROM file */ + filetype = 3; + sprintf(rom_filename,"gg/%s",filelist[selection].filename); + } + else if (romtype == SYSTEM_SG) + { + /* SG-1000 ROM file */ + filetype = 4; + sprintf(rom_filename,"sg/%s",filelist[selection].filename); + } + else if (romtype == SYSTEM_MCD) + { + /* CD image file */ + filetype = 1; + sprintf(rom_filename,"cd/%s",filelist[selection].filename); + } + else + { + /* by default, Genesis ROM file */ + filetype = 0; + sprintf(rom_filename,"md/%s",filelist[selection].filename); + } - /* remove file extension */ - int i = strlen(rom_filename) - 1; - while ((i > 0) && (rom_filename[i] != '.')) i--; - if (i > 0) rom_filename[i] = 0; + /* remove file extension */ + int i = strlen(rom_filename) - 1; + while ((i > 0) && (rom_filename[i] != '.')) i--; + if (i > 0) rom_filename[i] = 0; + } /* add/move the file to the top of the history. */ history_add_file(filepath, filelist[selection].filename, filetype);