Skip to content

Commit

Permalink
GB: Fix flashing MBC0
Browse files Browse the repository at this point in the history
  • Loading branch information
sanni committed Sep 16, 2024
1 parent 7ad0706 commit 4f427c0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Cart_Reader/GB.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 4f427c0

Please sign in to comment.