mirror of
https://github.com/sanni/cartreader.git
synced 2024-12-25 12:31:54 +01:00
V2.9: Fix writing MBC3 flashcart
This commit is contained in:
parent
94a0d9ed1d
commit
eee9b165a0
@ -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
|
||||
|
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user