aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorsanni <[email protected]>2024-09-16 10:36:54 +0200
committersanni <[email protected]>2024-09-16 10:36:54 +0200
commit4f427c0ce4f5af0832d790388113c20e4d88c21c (patch)
treee73919531d19967cbd050c4d95fd2f69bc6f9d73
parent7ad07067c906fe99bfaa96d0ee8309bca131b241 (diff)
downloadcartreader-4f427c0ce4f5af0832d790388113c20e4d88c21c.tar.gz
cartreader-4f427c0ce4f5af0832d790388113c20e4d88c21c.zip
GB: Fix flashing MBC0
-rw-r--r--Cart_Reader/GB.ino7
1 files changed, 4 insertions, 3 deletions
diff --git a/Cart_Reader/GB.ino b/Cart_Reader/GB.ino
index 036fe1c..bbbf6d9 100644
--- a/Cart_Reader/GB.ino
+++ b/Cart_Reader/GB.ino
@@ -2147,21 +2147,22 @@ void writeFlash_GB(byte MBC, boolean commandSet, boolean flashErase) {
}
else if (MBC == 0) {
- if (fileSize > 0x8000)
- print_FatalError(file_too_big_STR);
if (audioWE)
println_Msg(F("Writing flash (Audio)"));
else
println_Msg(F("Writing flash (WR)"));
display_Update();
+ // Limit file size to 32KB
+ romBanks = 2;
+
// Write flash
//Initialize progress bar
uint32_t processedProgressBar = 0;
uint32_t totalProgressBar = (uint32_t)(romBanks)*16384;
draw_progressbar(0, totalProgressBar);
- for (unsigned int currAddr = 0x4000; currAddr < fileSize; currAddr += 512) {
+ for (unsigned int currAddr = 0; currAddr < 0x7FFF; currAddr += 512) {
myFile.read(sdBuffer, 512);
for (int currByte = 0; currByte < 512; currByte++) {