mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-30 00:14:15 +01:00
replace duplicate code with common folder creation function
This commit is contained in:
parent
e1bd042d82
commit
da8dc3d94e
@ -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++) {
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user