mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-27 23:14:14 +01:00
pad the extra space like the retrode does when segaSram16bit is 2
This commit is contained in:
parent
f3b2fe8252
commit
d07d80a4b7
@ -790,11 +790,6 @@ void getCartInfo_MD() {
|
|||||||
sramBase = sramBase >> 1;
|
sramBase = sramBase >> 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (segaSram16bit == 2) { // 64KB
|
|
||||||
sramBase = 0x200000;
|
|
||||||
sramEnd = 0x20FFFF;
|
|
||||||
sramSize = 1UL << 15; // sramSize is the number of 2 byte words
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get name
|
// Get name
|
||||||
@ -1160,6 +1155,17 @@ void readSram_MD() {
|
|||||||
else
|
else
|
||||||
myFile.write(sdBuffer, 256);
|
myFile.write(sdBuffer, 256);
|
||||||
}
|
}
|
||||||
|
if (segaSram16bit == 2) {
|
||||||
|
// pad to 64KB
|
||||||
|
for (int i = 0; i < 512; i++) {
|
||||||
|
sdBuffer[i] = 0xFF;
|
||||||
|
}
|
||||||
|
unsigned long padsize = (1UL << 16) - (sramSize << 1);
|
||||||
|
unsigned long padblockcount = padsize >> 9; // number of 512 byte blocks
|
||||||
|
for (int i = 0; i < padblockcount; i++) {
|
||||||
|
myFile.write(sdBuffer, 512);
|
||||||
|
}
|
||||||
|
}
|
||||||
// Close the file:
|
// Close the file:
|
||||||
myFile.close();
|
myFile.close();
|
||||||
print_Msg(F("Saved to "));
|
print_Msg(F("Saved to "));
|
||||||
|
Loading…
Reference in New Issue
Block a user