remove duplicate code to print saving and increment of folder id

This commit is contained in:
smesgr9000 2024-05-25 14:07:08 +02:00
parent d1d83bbd10
commit 6abe29fcd9
30 changed files with 57 additions and 348 deletions

View File

@ -299,19 +299,12 @@ void readROM_2600() {
createFolder("ATARI", "ROM", romName, "a26");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
// 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);
// ROM Start 0xF000
// Address A12-A0 = 0x1000 = 1 0000 0000 0000 = 4KB
// Read Start 0x1000

View File

@ -219,19 +219,12 @@ void readROM_5200() {
createFolder("5200", "ROM", romName, "a52");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
// open file on sdcard
if (!myFile.open(fileName, O_RDWR | O_CREAT))
print_FatalError(sd_error_STR);
// write new folder number back to EEPROM
foldern++;
EEPROM_writeAnything(0, foldern);
// 5200 A13-A0 = 10 0000 0000 0000
switch (a5200mapper) {

View File

@ -345,19 +345,12 @@ void readROM_7800() {
createFolder("7800", "ROM", romName, "a78");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
// open file on sdcard
if (!myFile.open(fileName, O_RDWR | O_CREAT))
print_FatalError(sd_error_STR);
// write new folder number back to EEPROM
foldern++;
EEPROM_writeAnything(0, foldern);
switch (a7800mapper) {
case 0: // Standard 16K/32K/48K [7816/7832/7848]
readStandard_7800();

View File

@ -153,18 +153,12 @@ void readROM_ARC() {
createFolder("ARC", "ROM", romName, "bin");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
// 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);
readSegment_ARC(0x0000, 0x0800); // 2K
if (arcsize > 0) {

View File

@ -367,19 +367,12 @@ void readROM_C64() {
createFolder("C64", "ROM", romName, "bin");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
// open file on sdcard
if (!myFile.open(fileName, O_RDWR | O_CREAT))
print_FatalError(sd_error_STR);
// write new folder number back to EEPROM
foldern++;
EEPROM_writeAnything(0, foldern);
switch (c64mapper) {
case 0: // Normal (4K/8K/16K) & Ultimax (8K/16K)
readPorts_C64();

View File

@ -165,19 +165,12 @@ void readROM_COL() {
createFolder("COL", "ROM", romName, "col");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
// 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);
// RESET ALL CS PINS HIGH (DISABLE)
PORTH |= (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6);

View File

@ -678,6 +678,17 @@ void createFolder(const char* system, const char* subfolder, const char* gameNam
sd.chdir(folder);
}
void printAndIncrementFolder() {
// Save location
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
// write new folder number back to eeprom
foldern = foldern + 1;
EEPROM_writeAnything(0, foldern);
}
// move file pointer to first game line with matching letter. If no match is found the last database entry is selected
void seek_first_letter_in_database(FsFile& database, byte myLetter) {
char gamename_str[3];

View File

@ -395,20 +395,13 @@ void readROM_FAIRCHILD() {
createFolder("FAIRCHILD", "ROM", romName, "bin");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
// 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);
unsigned long cartsize = FAIRCHILD[fairchildsize] * 0x400;
uint8_t blocks = cartsize / 0x200;
setROMC_FAIRCHILD(0x8); // Clear PC0

View File

@ -1110,14 +1110,7 @@ void readROM_GB() {
createFolder("GB", "ROM", romName, "gb");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {
@ -1465,14 +1458,7 @@ void readSRAMFLASH_MBC6_GB() {
createFolder("GB", "SAVE", romName, "sav");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {
@ -2543,14 +2529,7 @@ void readPelican_GB() {
createFolder("GB", "ROM", "Pelican", "GB");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {
@ -3358,14 +3337,7 @@ void readGameshark_GB() {
// Get name, add extension and convert to char array for sd lib
createFolder("GB", "ROM", "Gameshark", "GB");
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {

View File

@ -825,14 +825,7 @@ void readROM_GBA() {
//clear the screen
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {
@ -929,15 +922,7 @@ void readSRAM_GBA(boolean browseFile, uint32_t sramSize, uint32_t pos) {
if (browseFile) {
// Get name, add extension and convert to char array for sd lib
createFolder("GBA", "SAVE", romName, "srm");
// Save location
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
// write new folder number back to eeprom
foldern = foldern + 1;
EEPROM_writeAnything(0, foldern);
printAndIncrementFolder();
}
//open file on sd card
@ -1064,14 +1049,7 @@ void readFRAM_GBA(unsigned long framSize) {
// Get name, add extension and convert to char array for sd lib
createFolder("GBA", "SAVE", romName, "srm");
// Save location
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {
@ -1461,15 +1439,7 @@ void readFLASH_GBA(boolean browseFile, uint32_t flashSize, uint32_t pos) {
// Get name, add extension and convert to char array for sd lib
createFolder("GBA", "SAVE", romName, "fla");
// Save location
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
// write new folder number back to eeprom
foldern = foldern + 1;
EEPROM_writeAnything(0, foldern);
printAndIncrementFolder();
}
//open file on sd card
@ -1697,15 +1667,7 @@ void readEeprom_GBA(word eepSize) {
// Get name, add extension and convert to char array for sd lib
createFolder("GBA", "SAVE", romName, "eep");
// Save location
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {

View File

@ -272,14 +272,7 @@ void readRAM_GPC() {
//clear the screen
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {

View File

@ -306,19 +306,12 @@ void readROM_INTV() {
createFolder("INTV", "ROM", romName, "int");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
// 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);
switch (intvmapper) {
case 0: //default mattel up to 32K (8K/12K/16K/24K/32K)
readSegment_INTV(0x5000, 0x6000); // 8K

View File

@ -525,13 +525,7 @@ void readROM_LOOPY() {
createFolder("LOOPY", "ROM", romName, "bin");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
foldern = foldern + 1;
EEPROM_writeAnything(0, foldern);
printAndIncrementFolder();
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
print_FatalError(sd_error_STR);

View File

@ -1427,14 +1427,7 @@ void readROM_MD() {
createFolder("MD", "ROM", romName, "BIN");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {
@ -2883,14 +2876,7 @@ void readRealtec_MD() {
createFolder("MD", "ROM", romName, "MD");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {

View File

@ -346,19 +346,12 @@ void readROM_MSX() {
createFolder("MSX", "ROM", romName, "bin");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
// open file on sdcard
if (!myFile.open(fileName, O_RDWR | O_CREAT))
print_FatalError(sd_error_STR);
// write new folder number back to EEPROM
foldern++;
EEPROM_writeAnything(0, foldern);
switch (msxmapper) {
case 0: // No Mapper
disableCS();

View File

@ -2820,14 +2820,7 @@ void readRom_N64() {
// clear the screen
// display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {
@ -2868,14 +2861,7 @@ uint32_t readRom_N64() {
// clear the screen
// display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {

View File

@ -614,10 +614,9 @@ void getMapping() {
sprintf(crcStr, "%08lX", oldcrc32);
print_Msg(crcStr);
if (oldcrc32 != oldcrc32MMC3) {
char crcStrMMC3[9];
print_Msg(F(" or "));
sprintf(crcStrMMC3, "%08lX", oldcrc32MMC3);
print_Msg(crcStrMMC3);
sprintf(crcStr, "%08lX", oldcrc32MMC3);
print_Msg(crcStr);
}
println_Msg(F("..."));
display_Update();
@ -715,14 +714,7 @@ void read_NES(const char* fileSuffix, const byte* header, const uint8_t headersi
createFolder("NES", "ROM", romName, fileSuffix);
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {

View File

@ -215,19 +215,12 @@ void readROM_NGP(char* outPathBuf, size_t bufferSize) {
snprintf(outPathBuf, bufferSize, "%s/%s", folder, fileName);
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
// 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);
// back to read mode
dataOut();
writeByte_NGP(0x0, 0xf0);

View File

@ -215,20 +215,13 @@ void readROM_ODY2() {
createFolder("ODY2", "ROM", romName, "bin");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
// 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);
if (ody2mapper == 1) { // A10 CONNECTED
// Videopac 31: Musician
// Videopac 40: 4 in 1 Row/4 en 1 Ligne

View File

@ -427,13 +427,7 @@ void readSingleROM_PCW() {
// Create file
createFolder("PCW", "ROM", romName, "pcw");
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
foldern = foldern + 1;
EEPROM_writeAnything(0, foldern);
printAndIncrementFolder();
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
print_FatalError(sd_error_STR);
@ -561,13 +555,7 @@ void readMultiROM_PCW() {
// Create file
createFolder("PCW", "ROM", romName, "pcw");
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
foldern = foldern + 1;
EEPROM_writeAnything(0, foldern);
printAndIncrementFolder();
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
print_FatalError(sd_error_STR);

View File

@ -242,19 +242,12 @@ void readROM_POKE() {
createFolder("POKE", "ROM", romName, "min");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
// open file on sdcard
if (!myFile.open(fileName, O_RDWR | O_CREAT))
print_FatalError(sd_error_STR);
// write new folder number back to EEPROM
foldern++;
EEPROM_writeAnything(0, foldern);
// read rom
uint32_t progress = 0;
draw_progressbar(0, 0x80000);

View File

@ -559,14 +559,7 @@ void readROM_SMS() {
}
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {
@ -658,14 +651,7 @@ void readSRAM_SMS() {
createFolder(system, "SAVE", romName, "sav");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
// write new folder number back to eeprom
foldern = foldern + 1;
EEPROM_writeAnything(0, foldern);
printAndIncrementFolder();
// Create file on sd card
if (myFile.open(fileName, O_RDWR | O_CREAT)) {

View File

@ -1295,14 +1295,7 @@ void readROM_SNES() {
//clear the screen
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {

View File

@ -170,14 +170,7 @@ void readRom_ST(unsigned int bankStart, unsigned int bankEnd) {
createFolder("ST", "ROM", "SUFAMI_TURBO", "st");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
// write new folder number back to eeprom
foldern++;
EEPROM_writeAnything(0, foldern);
printAndIncrementFolder();
//open file on sd card
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {

View File

@ -152,10 +152,7 @@ static void readROM_Acan() {
snprintf(folder, FILEPATH_LENGTH, "/ACAN/ROM/%d", foldern);
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
sd.mkdir(folder, true);
sd.chdir(folder);
@ -163,9 +160,6 @@ static void readROM_Acan() {
if (!myFile.open("rom.bin", O_RDWR | O_CREAT))
print_FatalError(create_file_STR);
foldern++;
EEPROM_writeAnything(0, foldern);
draw_progressbar(0, cartSize);
dataIn_MD();
@ -197,10 +191,7 @@ static void readSRAM_Acan() {
snprintf(folder, FILEPATH_LENGTH, "/ACAN/SAVE/%d", foldern);
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
sd.mkdir(folder, true);
sd.chdir(folder);
@ -208,9 +199,6 @@ static void readSRAM_Acan() {
if (!myFile.open("save.bin", O_RDWR | O_CREAT))
print_FatalError(create_file_STR);
foldern++;
EEPROM_writeAnything(0, foldern);
dataIn_MD();
for (uint32_t i = 0; i < 0x10000; i += 1024) {
for (uint32_t j = 0; j < 1024; j += 2)
@ -295,10 +283,7 @@ static void readUM6650() {
snprintf(folder, sizeof(folder), "/ACAN/UM6650/%d", foldern);
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
sd.mkdir(folder, true);
sd.chdir(folder);
@ -306,9 +291,6 @@ static void readUM6650() {
if (!myFile.open("UM6650.bin", O_RDWR | O_CREAT))
print_FatalError(create_file_STR);
foldern++;
EEPROM_writeAnything(0, foldern);
for (uint16_t i = 0; i < 256; i++) {
dataOut_MD();
writeWord_Acan(0xeb0d03, i);

View File

@ -417,14 +417,7 @@ void readROM_SV() {
//clear the screen
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
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)) {

View File

@ -413,13 +413,7 @@ void readROM_VB() {
createFolder("VBOY", "ROM", romName, "vb");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
foldern = foldern + 1;
EEPROM_writeAnything(0, foldern);
printAndIncrementFolder();
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
print_FatalError(sd_error_STR);

View File

@ -199,19 +199,12 @@ void readROM_VECTREX() {
createFolder("VECTREX", "ROM", romName, "vec");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
// open file on sdcard
if (!myFile.open(fileName, O_RDWR | O_CREAT))
print_FatalError(sd_error_STR);
// write new folder number back to EEPROM
foldern++;
EEPROM_writeAnything(0, foldern);
PB6_DISABLE; // PB6 LOW - Switch Bank
// Standard Carts 4K/8K

View File

@ -490,19 +490,12 @@ static uint16_t readROM_WS(char *outPathBuf, size_t bufferSize) {
snprintf(outPathBuf, bufferSize, "%s/%s", folder, fileName);
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
// 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);
// get correct starting rom bank
uint16_t bank = (256 - (cartSize >> 16));
uint32_t progress = 0;
@ -564,13 +557,7 @@ static void readSRAM_WS() {
createFolder("WS", "SAVE", romName, "save");
display_Clear();
print_Msg(F("Saving "));
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
foldern++;
EEPROM_writeAnything(0, foldern);
printAndIncrementFolder();
if (!myFile.open(fileName, O_RDWR | O_CREAT))
print_FatalError(create_file_STR);
@ -703,13 +690,7 @@ static void readEEPROM_WS() {
createFolder("WS", "SAVE", romName, "eep");
display_Clear();
print_Msg(F("Saving "));
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
foldern++;
EEPROM_writeAnything(0, foldern);
printAndIncrementFolder();
if (!myFile.open(fileName, O_RDWR | O_CREAT))
print_FatalError(create_file_STR);

View File

@ -188,19 +188,12 @@ void readROM_WSV() {
createFolder("WSV", "ROM", romName, "sv");
display_Clear();
print_STR(saving_to_STR, 0);
print_Msg(folder);
println_Msg(F("/..."));
display_Update();
printAndIncrementFolder();
// 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);
// start reading rom
dataIn_WSV();
controlIn_WSV();