replace duplicate code with common folder creation function

This commit is contained in:
smesgr9000 2024-06-16 10:39:47 +02:00
parent e1bd042d82
commit da8dc3d94e
2 changed files with 2 additions and 25 deletions

View File

@ -458,22 +458,7 @@ void readROM_FAIRCHILD() {
}
void read16K_FAIRCHILD() { // Read 16K Bytes
createFolder("FAIRCHILD", "ROM", romName, "bin");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
// open file on sdcard
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
print_FatalError(create_file_STR);
}
// write new folder number back to EEPROM
foldern++;
EEPROM_writeAnything(0, foldern);
createFolderAndOpenFile("FAIRCHILD", "ROM", romName, "bin");
unsigned long cartsize = FAIRCHILD[fairchildsize] * 0x400;
for (uint16_t y = 0; y < 0x20; y++) {

View File

@ -753,15 +753,7 @@ void read_rom_PCE(void) {
// Get name, add extension and convert to char array for sd lib
createFolder("PCE", "ROM", "PCEROM", "pce");
print_Msg(F("Saving ROM to "));
print_Msg(folder);
print_Msg(F("/"));
println_Msg(fileName);
display_Update();
// write new folder number back to eeprom
foldern = foldern + 1;
EEPROM_writeAnything(0, foldern);
printAndIncrementFolder();
//open file on sd card
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {