V2.9: Fix writing MBC3 flashcart

This commit is contained in:
sanni 2019-03-01 19:16:33 +01:00
parent 94a0d9ed1d
commit eee9b165a0
2 changed files with 8 additions and 6 deletions

View File

@ -2,8 +2,8 @@
Cartridge Reader for Arduino Mega2560
Author: sanni
Date: 18-02-2019
Version: 2.8
Date: 01-03-2019
Version: 2.9
SD lib: https://github.com/greiman/SdFat
LCD lib: https://github.com/adafruit/Adafruit_SSD1306
@ -37,7 +37,7 @@
vogelfreiheit - N64 flashram fix
**********************************************************************************/
char ver[5] = "2.8";
char ver[5] = "2.9";
/******************************************
Define Starting Point

View File

@ -858,19 +858,21 @@ void writeFlash_GB(byte MBC) {
dataOut();
uint16_t currAddr = 0;
uint16_t endAddr = 0x3FFF;
for (int currBank = 1; currBank < romBanks; currBank++) {
for (int currBank = 0; currBank < romBanks; currBank++) {
// Blink led
PORTB ^= (1 << 4);
// Set ROM bank
writeByte_GB(0x2100, currBank);
if (currBank > 1) {
if (currBank > 0) {
currAddr = 0x4000;
endAddr = 0x7FFF;
}
while (currAddr <= 0x7FFF) {
while (currAddr <= endAddr) {
myFile.read(sdBuffer, 512);
for (int currByte = 0; currByte < 512; currByte++) {