From 478f9c6a277865cec26f0c38bc50d1949383576b Mon Sep 17 00:00:00 2001 From: sanni Date: Thu, 20 Sep 2018 02:30:23 +0200 Subject: [PATCH] V1.8: Disable SRAM when flashing LoROM repro [Imgur](https://i.imgur.com/YSI1xRq.jpg) --- Cart_Reader/Cart_Reader.ino | 6 +++--- Cart_Reader/FLASH.ino | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Cart_Reader/Cart_Reader.ino b/Cart_Reader/Cart_Reader.ino index bb9fc10..80129c0 100644 --- a/Cart_Reader/Cart_Reader.ino +++ b/Cart_Reader/Cart_Reader.ino @@ -2,8 +2,8 @@ Cartridge Reader for Arduino Mega2560 Author: sanni - Date: 12-09-2018 - Version: 1.7 + Date: 20-09-2018 + Version: 1.8 SD lib: https://github.com/greiman/SdFat LCD lib: https://github.com/adafruit/Adafruit_SSD1306 @@ -35,7 +35,7 @@ infinest - help with GB Memory cart **********************************************************************************/ -char ver[5] = "1.7"; +char ver[5] = "1.8"; /****************************************** Define Starting Point diff --git a/Cart_Reader/FLASH.ino b/Cart_Reader/FLASH.ino index 5d2b4b0..97840dd 100644 --- a/Cart_Reader/FLASH.ino +++ b/Cart_Reader/FLASH.ino @@ -53,7 +53,7 @@ static const char epromMenuItem5[] PROGMEM = "Reset"; static const char* const menuOptionsEprom[] PROGMEM = {epromMenuItem1, epromMenuItem2, epromMenuItem3, epromMenuItem4, epromMenuItem5}; void flashMenu() { - // create menu with title and 4 options to choose from + // create menu with title and 3 options to choose from unsigned char flashSlot; // Copy menuOptions out of progmem convertPgm(menuOptionsFlash, 3); @@ -678,6 +678,8 @@ void writeByte_Flash(unsigned long myAddress, byte myData) { } else { PORTK = (myAddress >> 8) & 0x7F; + // Set A15(PK7) HIGH to disable SRAM + PORTK |= (1 << 7); PORTL = (myAddress >> 15) & 0xFF; } PORTC = myData; @@ -707,6 +709,8 @@ byte readByte_Flash(unsigned long myAddress) { } else { PORTK = (myAddress >> 8) & 0x7F; + // Set A15(PK7) HIGH to disable SRAM + PORTK |= (1 << 7); PORTL = (myAddress >> 15) & 0xFF; } @@ -890,7 +894,7 @@ void busyCheck29F032(byte c) { // Setting OE(PH1) CE(PH6)LOW PORTH &= ~((1 << 1) | (1 << 6)); - // Setting WE(PH4) WE_SNES HIGH + // Setting WE(PH4) WE_SNES(PH5) HIGH PORTH |= (1 << 4) | (1 << 5); //When the Embedded Program algorithm is complete, the device outputs the datum programmed to D7