From 9775b2c854592f3e0eeea181033da084adb9845a Mon Sep 17 00:00:00 2001 From: sanni Date: Thu, 8 Aug 2024 17:16:20 +0200 Subject: [PATCH] Update FLASH.ino --- Cart_Reader/FLASH.ino | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Cart_Reader/FLASH.ino b/Cart_Reader/FLASH.ino index 6089363..e7a6fb4 100644 --- a/Cart_Reader/FLASH.ino +++ b/Cart_Reader/FLASH.ino @@ -1091,6 +1091,14 @@ byte readByte_Flash(unsigned long myAddress) { PORTK = (myAddress >> 8) & 0xFF; // A16-A23 PORTL = (myAddress >> 16) & 0xFF; + // Set PL7 to value of PL6 + if (!(((myAddress >> 16) & 0xFF) & 0x40)) { + // if PL6 is 0 set PL7 to 0 + PORTL &= ~(1 << 7); + } else if (((myAddress >> 16) & 0xFF) & 0x40) { + // if PL6 is 1 set PL7 to 1 + PORTL |= (1 << 7); + } // Switch SNES BA6(PL6) to HIGH to disable SRAM PORTL |= (1 << 6); }