Use default eeprom file if none is provided
This commit is contained in:
parent
829c08c031
commit
2c3df24fc1
2 changed files with 13 additions and 8 deletions
|
@ -620,5 +620,14 @@ int main(int argc, const char** argv)
|
|||
|
||||
parser.ParseCLI(argc, argv);
|
||||
|
||||
return SimRun(args::get(eepromFile), args::get(eepromWrite), args::get(factoryReset));
|
||||
std::string eepromFileName = args::get(eepromFile);
|
||||
|
||||
//Use a default EEPROM file if none is provided.
|
||||
if(eepromFileName.length()==0)
|
||||
{
|
||||
eepromFileName = SDL_GetPrefPath("Vulk Data System", "NuEVI Simulator");
|
||||
eepromFileName += "eeprom.bin";
|
||||
}
|
||||
|
||||
return SimRun(eepromFileName, args::get(eepromWrite), args::get(factoryReset));
|
||||
}
|
||||
|
|
|
@ -109,13 +109,9 @@ int16_t EEPROMClass::setStorage(const char* filename, bool write)
|
|||
}
|
||||
|
||||
void EEPROMClass::closeStorage() {
|
||||
if(storage==NULL)
|
||||
if(storage!=NULL)
|
||||
{
|
||||
return;
|
||||
fclose(storage);
|
||||
storage=NULL;
|
||||
}
|
||||
|
||||
printf("Closing EEPROM storage\n");
|
||||
|
||||
fclose(storage);
|
||||
storage=NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue