Skip to content

Commit

Permalink
Update LEAP.ino - even simpler solution
Browse files Browse the repository at this point in the history
Update LEAP.ino - even simpler solution
  • Loading branch information
nsx0r authored Nov 9, 2024
1 parent f1c023e commit 464a573
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Cart_Reader/LEAP.ino
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ byte leapsize;
byte newleapsize;

byte tempbyte;
char tempword;
word tempword;
word ptrword;
word tempcheck;

Expand Down Expand Up @@ -361,7 +361,7 @@ void checkStart_LEAP()
OE_LOW;
CE_LOW;
BYTE_HIGH;
word tempword = read_rom_word_LEAP(0x0);
tempword = read_rom_word_LEAP(0x0);
if ((LEAP[0] == ((tempword >> 0x8) & 0xFF)) && (LEAP[1] == (tempword & 0xFF))) {
tempword = read_rom_word_LEAP(0x1);
findTable_LEAP(0x4, 0xA2);
Expand All @@ -383,7 +383,7 @@ void findTable_LEAP(unsigned long startAddr, unsigned long endAddr)
delay(500);
CE_LOW;
for (unsigned long addr = startAddr; addr < endAddr; addr +=2) {
word tempword = read_rom_word_LEAP(addr);
tempword = read_rom_word_LEAP(addr);
if ((TBL[0] == ((tempword >> 0x8) & 0xFF))&&(TBL[1] == (tempword & 0xFF))) {
tempword = read_rom_word_LEAP(addr + 1);
if ((TBL[2] == ((tempword >> 0x8) & 0xFF))&&(TBL[3] == (tempword & 0xFF))) {
Expand All @@ -400,7 +400,7 @@ void readTable_LEAP(unsigned long startAddr, unsigned long endAddr)
delay(500);
CE_LOW;
for (unsigned long addr = startAddr; addr < endAddr; addr++) {
word tempword = read_rom_word_LEAP(addr);
tempword = read_rom_word_LEAP(addr);
if ((TXT[0] == ((tempword >> 0x8) & 0xFF))&&(TXT[1] == (tempword & 0xFF))) {
tempword = read_rom_word_LEAP(addr + 1);
if ((TXT[2] == ((tempword >> 0x8) & 0xFF))&&(TXT[3] == (tempword & 0xFF))) { // Text Block Marker Found
Expand Down Expand Up @@ -465,7 +465,7 @@ void readROM_LEAP()

for (unsigned long address = 0; address < 0x200000; address += 256) { // 4MB
for (unsigned int x = 0; x < 256; x++) {
word tempword = read_rom_word_LEAP(address + x);
tempword = read_rom_word_LEAP(address + x);
sdBuffer[x * 2] = (tempword >> 0x8) & 0xFF;
sdBuffer[(x * 2) + 1] = tempword & 0xFF;
}
Expand All @@ -474,7 +474,7 @@ void readROM_LEAP()
if (leapsize > 0) {
for (unsigned long address = 0x200000; address < 0x400000; address += 256) { // +4MB = 8MB
for (unsigned int x = 0; x < 256; x++) {
word tempword = read_rom_word_LEAP(address + x);
tempword = read_rom_word_LEAP(address + x);
sdBuffer[x * 2] = (tempword >> 0x8) & 0xFF;
sdBuffer[(x * 2) + 1] = tempword & 0xFF;
}
Expand All @@ -483,7 +483,7 @@ void readROM_LEAP()
if (leapsize > 1) {
for (unsigned long address = 0x400000; address < 0x800000; address += 256) { // +8MB = 16MB
for (unsigned int x = 0; x < 256; x++) {
word tempword = read_rom_word_LEAP(address + x);
tempword = read_rom_word_LEAP(address + x);
sdBuffer[x * 2] = (tempword >> 0x8) & 0xFF;
sdBuffer[(x * 2) + 1] = tempword & 0xFF;
}
Expand Down

0 comments on commit 464a573

Please sign in to comment.