mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-13 08:25:05 +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
|
Cartridge Reader for Arduino Mega2560
|
||||||
|
|
||||||
Author: sanni
|
Author: sanni
|
||||||
Date: 18-02-2019
|
Date: 01-03-2019
|
||||||
Version: 2.8
|
Version: 2.9
|
||||||
|
|
||||||
SD lib: https://github.com/greiman/SdFat
|
SD lib: https://github.com/greiman/SdFat
|
||||||
LCD lib: https://github.com/adafruit/Adafruit_SSD1306
|
LCD lib: https://github.com/adafruit/Adafruit_SSD1306
|
||||||
@ -37,7 +37,7 @@
|
|||||||
vogelfreiheit - N64 flashram fix
|
vogelfreiheit - N64 flashram fix
|
||||||
|
|
||||||
**********************************************************************************/
|
**********************************************************************************/
|
||||||
char ver[5] = "2.8";
|
char ver[5] = "2.9";
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
Define Starting Point
|
Define Starting Point
|
||||||
|
@ -858,19 +858,21 @@ void writeFlash_GB(byte MBC) {
|
|||||||
dataOut();
|
dataOut();
|
||||||
|
|
||||||
uint16_t currAddr = 0;
|
uint16_t currAddr = 0;
|
||||||
|
uint16_t endAddr = 0x3FFF;
|
||||||
|
|
||||||
for (int currBank = 1; currBank < romBanks; currBank++) {
|
for (int currBank = 0; currBank < romBanks; currBank++) {
|
||||||
// Blink led
|
// Blink led
|
||||||
PORTB ^= (1 << 4);
|
PORTB ^= (1 << 4);
|
||||||
|
|
||||||
// Set ROM bank
|
// Set ROM bank
|
||||||
writeByte_GB(0x2100, currBank);
|
writeByte_GB(0x2100, currBank);
|
||||||
|
|
||||||
if (currBank > 1) {
|
if (currBank > 0) {
|
||||||
currAddr = 0x4000;
|
currAddr = 0x4000;
|
||||||
|
endAddr = 0x7FFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (currAddr <= 0x7FFF) {
|
while (currAddr <= endAddr) {
|
||||||
myFile.read(sdBuffer, 512);
|
myFile.read(sdBuffer, 512);
|
||||||
|
|
||||||
for (int currByte = 0; currByte < 512; currByte++) {
|
for (int currByte = 0; currByte < 512; currByte++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user