Fixes Loopy SRAM dumping

This commit is contained in:
Roger Braunstein 2023-07-15 23:15:19 -07:00
parent 6210ac1324
commit a334129e2a

View File

@ -119,8 +119,8 @@ void setup_LOOPY() {
// Base Menu // Base Menu
static const char loopyMenuItem0[] PROGMEM = "Refresh Cart"; static const char loopyMenuItem0[] PROGMEM = "Refresh Cart";
static const char loopyMenuItem1[] PROGMEM = "Read ROM"; static const char loopyMenuItem1[] PROGMEM = "Read ROM";
static const char loopyMenuItem2[] PROGMEM = "Read SRAM"; static const char loopyMenuItem2[] PROGMEM = "Backup SRAM";
static const char loopyMenuItem3[] PROGMEM = "Write SRAM"; static const char loopyMenuItem3[] PROGMEM = "Restore SRAM";
static const char loopyMenuItem4[] PROGMEM = "Format SRAM"; static const char loopyMenuItem4[] PROGMEM = "Format SRAM";
static const char* const menuOptionsLOOPY[] PROGMEM = { loopyMenuItem0, loopyMenuItem1, loopyMenuItem2, loopyMenuItem3, loopyMenuItem4, string_reset2 }; static const char* const menuOptionsLOOPY[] PROGMEM = { loopyMenuItem0, loopyMenuItem1, loopyMenuItem2, loopyMenuItem3, loopyMenuItem4, string_reset2 };
@ -607,12 +607,7 @@ void writeSRAM_LOOPY() {
dataIn_LOOPY(); dataIn_LOOPY();
sprintf(filePath, "%s/%s", filePath, fileName); sprintf(filePath, "%s/%s", filePath, fileName);
//println_Msg(F("Writing...")); println_Msg(F("Restoring SRAM from"));
char str[16];
sprintf(str, "Writing %ld bytes to", sramSize);
println_Msg(str);
println_Msg(filePath); println_Msg(filePath);
display_Update(); display_Update();
@ -686,7 +681,8 @@ void readSRAM_LOOPY() {
const size_t sdBufferSize = 512; const size_t sdBufferSize = 512;
for (unsigned long ptr = 0; ptr < sramSize;) { for (unsigned long ptr = 0; ptr < sramSize;) {
sdBuffer[ptr++ % sdBufferSize] = readByte_LOOPY(ptr); uint8_t b = readByte_LOOPY(ptr);
sdBuffer[ptr++ % sdBufferSize] = b;
if (ptr % sdBufferSize == 0) { if (ptr % sdBufferSize == 0) {
myFile.write(sdBuffer, sdBufferSize); myFile.write(sdBuffer, sdBufferSize);
blinkLED(); blinkLED();
@ -699,7 +695,6 @@ void readSRAM_LOOPY() {
myFile.close(); myFile.close();
print_Msg(F("Saved to ")); print_Msg(F("Saved to "));
print_Msg(folder); print_Msg(folder);
println_Msg(F("/"));
display_Update(); display_Update();
} }