void save() { if (fileSaved) { printer.printString("Saved "+loadedFilename); return; } if (loadedFilename.empty()) { saveAs(); } else { saveRamToFile(loadedFilename); fileSaved = true; printer.printString("Saved "+loadedFilename); redrawScreen(); } }
void saveAs() { string fileName = getFreeFileName(); saveRamToFile(fileName); loadedFilename = fileName; fileSaved = true; printer.printString("Saved as "+fileName); redrawScreen(); }