mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-14 17:05:08 +01:00
Fixes Loopy SRAM dumping
This commit is contained in:
parent
6210ac1324
commit
a334129e2a
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user