mirror of
https://github.com/sanni/cartreader.git
synced 2024-12-25 12:31:54 +01:00
Set eeprom location for folder number to 0 again
This commit is contained in:
parent
1fe0b53a0d
commit
34d6871f7d
@ -418,7 +418,7 @@ void aboutScreen() {
|
|||||||
display_Update();
|
display_Update();
|
||||||
delay(2000);
|
delay(2000);
|
||||||
foldern = 0;
|
foldern = 0;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
resetArduino();
|
resetArduino();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -554,7 +554,7 @@ void setup() {
|
|||||||
PORTG |= (1 << 2);
|
PORTG |= (1 << 2);
|
||||||
|
|
||||||
// Read current folder number out of eeprom
|
// Read current folder number out of eeprom
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
|
|
||||||
#ifdef enable_OLED
|
#ifdef enable_OLED
|
||||||
// GLCD
|
// GLCD
|
||||||
@ -868,7 +868,7 @@ byte questionBox_Serial(const __FlashStringHelper* question, char answers[7][20]
|
|||||||
sd.mkdir("IMPORT", true);
|
sd.mkdir("IMPORT", true);
|
||||||
|
|
||||||
// Create and open file on sd card
|
// Create and open file on sd card
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(fileName, "IMPORT/%d.bin", foldern);
|
sprintf(fileName, "IMPORT/%d.bin", foldern);
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
print_Error(F("Can't create file on SD"), true);
|
print_Error(F("Can't create file on SD"), true);
|
||||||
@ -888,7 +888,7 @@ byte questionBox_Serial(const __FlashStringHelper* question, char answers[7][20]
|
|||||||
|
|
||||||
// Write new folder number back to eeprom
|
// Write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
print_Msg(F("Imported "));
|
print_Msg(F("Imported "));
|
||||||
print_Msg(fileSize);
|
print_Msg(fileSize);
|
||||||
|
@ -1483,14 +1483,14 @@ void readFlash() {
|
|||||||
sd.chdir("/");
|
sd.chdir("/");
|
||||||
|
|
||||||
// Get name, add extension and convert to char array for sd lib
|
// Get name, add extension and convert to char array for sd lib
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sd.mkdir("FLASH", true);
|
sd.mkdir("FLASH", true);
|
||||||
sd.chdir("FLASH");
|
sd.chdir("FLASH");
|
||||||
sprintf(fileName, "FL%d", foldern);
|
sprintf(fileName, "FL%d", foldern);
|
||||||
strcat(fileName, ".bin");
|
strcat(fileName, ".bin");
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
display_Clear();
|
display_Clear();
|
||||||
print_Msg(F("Saving as "));
|
print_Msg(F("Saving as "));
|
||||||
@ -1804,14 +1804,14 @@ void readFlash16() {
|
|||||||
sd.chdir("/");
|
sd.chdir("/");
|
||||||
|
|
||||||
// Get name, add extension and convert to char array for sd lib
|
// Get name, add extension and convert to char array for sd lib
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sd.mkdir("FLASH", true);
|
sd.mkdir("FLASH", true);
|
||||||
sd.chdir("FLASH");
|
sd.chdir("FLASH");
|
||||||
sprintf(fileName, "FL%d", foldern);
|
sprintf(fileName, "FL%d", foldern);
|
||||||
strcat(fileName, ".bin");
|
strcat(fileName, ".bin");
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
display_Clear();
|
display_Clear();
|
||||||
print_Msg(F("Saving as "));
|
print_Msg(F("Saving as "));
|
||||||
@ -2091,14 +2091,14 @@ void read_Eprom() {
|
|||||||
sd.chdir("/");
|
sd.chdir("/");
|
||||||
|
|
||||||
// Get name, add extension and convert to char array for sd lib
|
// Get name, add extension and convert to char array for sd lib
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sd.mkdir("FLASH", true);
|
sd.mkdir("FLASH", true);
|
||||||
sd.chdir("FLASH");
|
sd.chdir("FLASH");
|
||||||
sprintf(fileName, "FL%d", foldern);
|
sprintf(fileName, "FL%d", foldern);
|
||||||
strcat(fileName, ".bin");
|
strcat(fileName, ".bin");
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
display_Clear();
|
display_Clear();
|
||||||
print_Msg(F("Saving as "));
|
print_Msg(F("Saving as "));
|
||||||
|
@ -397,7 +397,7 @@ void readROM_GB() {
|
|||||||
strcat(fileName, ".GB");
|
strcat(fileName, ".GB");
|
||||||
|
|
||||||
// create a new folder for the rom file
|
// create a new folder for the rom file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "GB/ROM/%s/%d", romName, foldern);
|
sprintf(folder, "GB/ROM/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
@ -410,7 +410,7 @@ void readROM_GB() {
|
|||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
//open file on sd card
|
//open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
@ -498,7 +498,7 @@ boolean compare_checksum_GB() {
|
|||||||
strcat(fileName, ".GB");
|
strcat(fileName, ".GB");
|
||||||
|
|
||||||
// last used rom folder
|
// last used rom folder
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "GB/ROM/%s/%d", romName, foldern - 1);
|
sprintf(folder, "GB/ROM/%s/%d", romName, foldern - 1);
|
||||||
|
|
||||||
char calcsumStr[5];
|
char calcsumStr[5];
|
||||||
@ -529,14 +529,14 @@ void readSRAM_GB() {
|
|||||||
strcat(fileName, ".sav");
|
strcat(fileName, ".sav");
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "GB/SAVE/%s/%d", romName, foldern);
|
sprintf(folder, "GB/SAVE/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
//open file on sd card
|
//open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
|
@ -868,7 +868,7 @@ void readROM_GBA() {
|
|||||||
strcat(fileName, ".gba");
|
strcat(fileName, ".gba");
|
||||||
|
|
||||||
// create a new folder for the rom file
|
// create a new folder for the rom file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "GBA/ROM/%s/%d", romName, foldern);
|
sprintf(folder, "GBA/ROM/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
@ -882,7 +882,7 @@ void readROM_GBA() {
|
|||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
//open file on sd card
|
//open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
@ -918,7 +918,7 @@ boolean compare_checksum_GBA () {
|
|||||||
strcat(fileName, ".gba");
|
strcat(fileName, ".gba");
|
||||||
|
|
||||||
// last used rom folder
|
// last used rom folder
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "GBA/ROM/%s/%d", romName, foldern - 1);
|
sprintf(folder, "GBA/ROM/%s/%d", romName, foldern - 1);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
|
|
||||||
@ -968,7 +968,7 @@ void readSRAM_GBA(boolean browseFile, unsigned long sramSize, uint32_t pos) {
|
|||||||
strcat(fileName, ".srm");
|
strcat(fileName, ".srm");
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "GBA/SAVE/%s/%d", romName, foldern);
|
sprintf(folder, "GBA/SAVE/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
@ -980,7 +980,7 @@ void readSRAM_GBA(boolean browseFile, unsigned long sramSize, uint32_t pos) {
|
|||||||
display_Update();
|
display_Update();
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
}
|
}
|
||||||
|
|
||||||
//open file on sd card
|
//open file on sd card
|
||||||
@ -1099,7 +1099,7 @@ void readFRAM_GBA (unsigned long framSize) {
|
|||||||
strcat(fileName, ".srm");
|
strcat(fileName, ".srm");
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "GBA/SAVE/%s/%d", romName, foldern);
|
sprintf(folder, "GBA/SAVE/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
@ -1111,7 +1111,7 @@ void readFRAM_GBA (unsigned long framSize) {
|
|||||||
display_Update();
|
display_Update();
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
//open file on sd card
|
//open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
@ -1502,7 +1502,7 @@ void readFLASH_GBA (boolean browseFile, unsigned long flashSize, uint32_t pos) {
|
|||||||
strcat(fileName, ".fla");
|
strcat(fileName, ".fla");
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
|
|
||||||
sprintf(folder, "GBA/SAVE/%s/%d", romName, foldern);
|
sprintf(folder, "GBA/SAVE/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
@ -1516,7 +1516,7 @@ void readFLASH_GBA (boolean browseFile, unsigned long flashSize, uint32_t pos) {
|
|||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
}
|
}
|
||||||
|
|
||||||
//open file on sd card
|
//open file on sd card
|
||||||
@ -1731,7 +1731,7 @@ void readEeprom_GBA(word eepSize) {
|
|||||||
strcat(fileName, ".eep");
|
strcat(fileName, ".eep");
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
|
|
||||||
sprintf(folder, "GBA/SAVE/%s/%d", romName, foldern);
|
sprintf(folder, "GBA/SAVE/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
@ -1745,7 +1745,7 @@ void readEeprom_GBA(word eepSize) {
|
|||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
//open file on sd card
|
//open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
|
@ -239,12 +239,12 @@ void gbSmartFlashMenu()
|
|||||||
display_Clear();
|
display_Clear();
|
||||||
sd.chdir("/");
|
sd.chdir("/");
|
||||||
|
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(fileName, "GBS%d.bin", foldern);
|
sprintf(fileName, "GBS%d.bin", foldern);
|
||||||
sd.mkdir("GB/GBS", true);
|
sd.mkdir("GB/GBS", true);
|
||||||
sd.chdir("GB/GBS");
|
sd.chdir("GB/GBS");
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
gbSmartReadFlash();
|
gbSmartReadFlash();
|
||||||
break;
|
break;
|
||||||
|
@ -764,7 +764,7 @@ void readROM_MD() {
|
|||||||
strcat(fileName, ".MD");
|
strcat(fileName, ".MD");
|
||||||
|
|
||||||
// create a new folder
|
// create a new folder
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "MD/ROM/%s/%d", romName, foldern);
|
sprintf(folder, "MD/ROM/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
@ -777,7 +777,7 @@ void readROM_MD() {
|
|||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
// Open file on sd card
|
// Open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
@ -951,14 +951,14 @@ void readSram_MD() {
|
|||||||
strcat(fileName, ".srm");
|
strcat(fileName, ".srm");
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "MD/SAVE/%s/%d", romName, foldern);
|
sprintf(folder, "MD/SAVE/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
// Open file on sd card
|
// Open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
@ -1732,7 +1732,7 @@ void readEEP_MD() {
|
|||||||
strcat(fileName, ".eep");
|
strcat(fileName, ".eep");
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sd.chdir();
|
sd.chdir();
|
||||||
sprintf(folder, "MD/SAVE/%s/%d", romName, foldern);
|
sprintf(folder, "MD/SAVE/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
@ -1740,7 +1740,7 @@ void readEEP_MD() {
|
|||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
println_Msg(F("Reading..."));
|
println_Msg(F("Reading..."));
|
||||||
display_Update();
|
display_Update();
|
||||||
@ -1834,7 +1834,7 @@ void readBram_MD() {
|
|||||||
strcpy(fileName, "Cart.brm");
|
strcpy(fileName, "Cart.brm");
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sd.chdir();
|
sd.chdir();
|
||||||
sprintf(folder, "MD/RAM/%d", foldern);
|
sprintf(folder, "MD/RAM/%d", foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
@ -1842,7 +1842,7 @@ void readBram_MD() {
|
|||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
println_Msg(F("Reading..."));
|
println_Msg(F("Reading..."));
|
||||||
display_Update();
|
display_Update();
|
||||||
|
@ -1424,13 +1424,13 @@ void readMPK() {
|
|||||||
sd.chdir("N64/MPK");
|
sd.chdir("N64/MPK");
|
||||||
|
|
||||||
// Get name, add extension and convert to char array for sd lib
|
// Get name, add extension and convert to char array for sd lib
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(fileName, "%d", foldern);
|
sprintf(fileName, "%d", foldern);
|
||||||
strcat(fileName, ".mpk");
|
strcat(fileName, ".mpk");
|
||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
//open file on sd card
|
//open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
@ -1980,14 +1980,14 @@ void readEeprom() {
|
|||||||
strcat(fileName, ".eep");
|
strcat(fileName, ".eep");
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "N64/SAVE/%s/%d", romName, foldern);
|
sprintf(folder, "N64/SAVE/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
// Open file on sd card
|
// Open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
@ -2174,14 +2174,14 @@ void readSram(unsigned long sramSize, byte flashramType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "N64/SAVE/%s/%d", romName, foldern);
|
sprintf(folder, "N64/SAVE/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
// Open file on sd card
|
// Open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
@ -2581,7 +2581,7 @@ void readRom_N64() {
|
|||||||
strcat(fileName, ".Z64");
|
strcat(fileName, ".Z64");
|
||||||
|
|
||||||
// create a new folder
|
// create a new folder
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "N64/ROM/%s/%d", romName, foldern);
|
sprintf(folder, "N64/ROM/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
@ -2594,7 +2594,7 @@ void readRom_N64() {
|
|||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
readn64rom:
|
readn64rom:
|
||||||
// Open file on sd card
|
// Open file on sd card
|
||||||
@ -3710,7 +3710,7 @@ void resetGameshark_N64() {
|
|||||||
// Read rom and save to the SD card
|
// Read rom and save to the SD card
|
||||||
void backupGameshark_N64() {
|
void backupGameshark_N64() {
|
||||||
// create a new folder
|
// create a new folder
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(fileName, "GS%d", foldern);
|
sprintf(fileName, "GS%d", foldern);
|
||||||
strcat(fileName, ".z64");
|
strcat(fileName, ".z64");
|
||||||
sd.mkdir("N64/ROM/Gameshark", true);
|
sd.mkdir("N64/ROM/Gameshark", true);
|
||||||
@ -3724,7 +3724,7 @@ void backupGameshark_N64() {
|
|||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
// Open file on sd card
|
// Open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
|
@ -250,14 +250,14 @@ void sfmFlashMenu() {
|
|||||||
numBanks = 64;
|
numBanks = 64;
|
||||||
|
|
||||||
// Get name, add extension and convert to char array for sd lib
|
// Get name, add extension and convert to char array for sd lib
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(fileName, "SFM%d", foldern);
|
sprintf(fileName, "SFM%d", foldern);
|
||||||
strcat(fileName, ".bin");
|
strcat(fileName, ".bin");
|
||||||
sd.mkdir("NP", true);
|
sd.mkdir("NP", true);
|
||||||
sd.chdir("NP");
|
sd.chdir("NP");
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
// Read flash
|
// Read flash
|
||||||
readFlash_SFM();
|
readFlash_SFM();
|
||||||
@ -1351,7 +1351,7 @@ void readMapping() {
|
|||||||
controlIn_SFM();
|
controlIn_SFM();
|
||||||
|
|
||||||
// Get name, add extension and convert to char array for sd lib
|
// Get name, add extension and convert to char array for sd lib
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(fileName, "NP%d", foldern);
|
sprintf(fileName, "NP%d", foldern);
|
||||||
strcat(fileName, ".MAP");
|
strcat(fileName, ".MAP");
|
||||||
sd.mkdir("NP", true);
|
sd.mkdir("NP", true);
|
||||||
@ -1359,7 +1359,7 @@ void readMapping() {
|
|||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
//open file on sd card
|
//open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
@ -2035,14 +2035,14 @@ void readROM_GBM(word numBanks) {
|
|||||||
display_Update();
|
display_Update();
|
||||||
|
|
||||||
// Get name, add extension and convert to char array for sd lib
|
// Get name, add extension and convert to char array for sd lib
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(fileName, "GBM%d", foldern);
|
sprintf(fileName, "GBM%d", foldern);
|
||||||
strcat(fileName, ".bin");
|
strcat(fileName, ".bin");
|
||||||
sd.mkdir("NP", true);
|
sd.mkdir("NP", true);
|
||||||
sd.chdir("NP");
|
sd.chdir("NP");
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
// Open file on sd card
|
// Open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
@ -2421,14 +2421,14 @@ void readMapping_GBM() {
|
|||||||
display_Update();
|
display_Update();
|
||||||
|
|
||||||
// Get name, add extension and convert to char array for sd lib
|
// Get name, add extension and convert to char array for sd lib
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(fileName, "GBM%d", foldern);
|
sprintf(fileName, "GBM%d", foldern);
|
||||||
strcat(fileName, ".map");
|
strcat(fileName, ".map");
|
||||||
sd.mkdir("NP", true);
|
sd.mkdir("NP", true);
|
||||||
sd.chdir("NP");
|
sd.chdir("NP");
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
// Open file on sd card
|
// Open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
|
@ -549,7 +549,7 @@ void read_tennokoe_bank_PCE(void)
|
|||||||
strcat(fileName, ".sav");
|
strcat(fileName, ".sav");
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "PCE/ROM/%s/%d", romName, foldern);
|
sprintf(folder, "PCE/ROM/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
@ -559,7 +559,7 @@ void read_tennokoe_bank_PCE(void)
|
|||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
//open file on sd card
|
//open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
@ -718,7 +718,7 @@ void read_rom_PCE(void)
|
|||||||
strcat(fileName, ".pce");
|
strcat(fileName, ".pce");
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "PCE/ROM/%s/%d", romName, foldern);
|
sprintf(folder, "PCE/ROM/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
@ -728,7 +728,7 @@ void read_rom_PCE(void)
|
|||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
//open file on sd card
|
//open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
|
@ -238,7 +238,7 @@ void readROM_SMS() {
|
|||||||
strcat(fileName, ".SMS");
|
strcat(fileName, ".SMS");
|
||||||
|
|
||||||
// create a new folder
|
// create a new folder
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "SMS/ROM/%s/%d", romName, foldern);
|
sprintf(folder, "SMS/ROM/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
@ -251,7 +251,7 @@ void readROM_SMS() {
|
|||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
// Open file on sd card
|
// Open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
|
@ -1010,7 +1010,7 @@ boolean compare_checksum() {
|
|||||||
strcat(fileName, ".sfc");
|
strcat(fileName, ".sfc");
|
||||||
|
|
||||||
// last used rom folder
|
// last used rom folder
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "SNES/ROM/%s/%d", romName, foldern - 1);
|
sprintf(folder, "SNES/ROM/%s/%d", romName, foldern - 1);
|
||||||
|
|
||||||
char calcsumStr[5];
|
char calcsumStr[5];
|
||||||
@ -1042,7 +1042,7 @@ void readROM_SNES() {
|
|||||||
strcat(fileName, ".sfc");
|
strcat(fileName, ".sfc");
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "SNES/ROM/%s/%d", romName, foldern);
|
sprintf(folder, "SNES/ROM/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
@ -1056,7 +1056,7 @@ void readROM_SNES() {
|
|||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
//open file on sd card
|
//open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
@ -1405,14 +1405,14 @@ void readSRAM () {
|
|||||||
strcat(fileName, ".srm");
|
strcat(fileName, ".srm");
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "SNES/SAVE/%s/%d", romName, foldern);
|
sprintf(folder, "SNES/SAVE/%s/%d", romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
//open file on sd card
|
//open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
|
@ -74,7 +74,7 @@ void readROM_SV() {
|
|||||||
strcpy(fileName, "MEMPACK.sfc");
|
strcpy(fileName, "MEMPACK.sfc");
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(10, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "SNES/ROM/%s/%d", "MEMPACK", foldern);
|
sprintf(folder, "SNES/ROM/%s/%d", "MEMPACK", foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
@ -88,7 +88,7 @@ void readROM_SV() {
|
|||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(10, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
|
||||||
//open file on sd card
|
//open file on sd card
|
||||||
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user