mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-23 13:09:17 +01:00
Revert NES CreateRAMFileInSD function to previous version
This commit is contained in:
parent
3a2db439be
commit
0489df7bd4
@ -2081,8 +2081,10 @@ void setup() {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_VSELECT
|
||||
// Set power to low to protect carts
|
||||
setVoltage(VOLTS_SET_3V3);
|
||||
#endif
|
||||
|
||||
#ifdef enable_OLED
|
||||
display.begin();
|
||||
|
@ -267,7 +267,7 @@
|
||||
* other than HW5 and HW3.
|
||||
*/
|
||||
|
||||
#define ENABLE_UPDATER
|
||||
//#define ENABLE_UPDATER
|
||||
|
||||
/****/
|
||||
|
||||
|
@ -1178,8 +1178,35 @@ void CreateCHRFileInSD() {
|
||||
myFile = createNewFile("CHR", "bin");
|
||||
}
|
||||
|
||||
//createNewFile fails to dump RAM if ROM isn't dumped first
|
||||
//void CreateRAMFileInSD() {
|
||||
//myFile = createNewFile("RAM", "bin");
|
||||
//}
|
||||
//Temporary fix
|
||||
void CreateRAMFileInSD() {
|
||||
myFile = createNewFile("RAM", "bin");
|
||||
char fileCount[3];
|
||||
strcpy(fileName, "RAM");
|
||||
strcat(fileName, ".bin");
|
||||
for (byte i = 0; i < 100; i++) {
|
||||
if (!sd.exists(fileName)) {
|
||||
myFile = sd.open(fileName, O_RDWR | O_CREAT);
|
||||
break;
|
||||
}
|
||||
sprintf(fileCount, "%02d", i);
|
||||
strcpy(fileName, "RAM.");
|
||||
strcat(fileName, fileCount);
|
||||
strcat(fileName, ".bin");
|
||||
}
|
||||
if (!myFile) {
|
||||
LED_RED_ON;
|
||||
|
||||
display_Clear();
|
||||
println_Msg(F("RAM FILE FAILED!"));
|
||||
display_Update();
|
||||
//print_Error(F("SD Error"), true);
|
||||
|
||||
LED_RED_OFF;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef nointro
|
||||
|
Loading…
Reference in New Issue
Block a user