Update LEAP.ino - even simpler solution

Update LEAP.ino - even simpler solution
This commit is contained in:
nsx0r 2024-11-09 07:38:32 +00:00 committed by GitHub
parent f1c023e6bb
commit 464a573074
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -103,7 +103,7 @@ byte leapsize;
byte newleapsize; byte newleapsize;
byte tempbyte; byte tempbyte;
char tempword; word tempword;
word ptrword; word ptrword;
word tempcheck; word tempcheck;
@ -361,7 +361,7 @@ void checkStart_LEAP()
OE_LOW; OE_LOW;
CE_LOW; CE_LOW;
BYTE_HIGH; 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))) { if ((LEAP[0] == ((tempword >> 0x8) & 0xFF)) && (LEAP[1] == (tempword & 0xFF))) {
tempword = read_rom_word_LEAP(0x1); tempword = read_rom_word_LEAP(0x1);
findTable_LEAP(0x4, 0xA2); findTable_LEAP(0x4, 0xA2);
@ -383,7 +383,7 @@ void findTable_LEAP(unsigned long startAddr, unsigned long endAddr)
delay(500); delay(500);
CE_LOW; CE_LOW;
for (unsigned long addr = startAddr; addr < endAddr; addr +=2) { 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))) { if ((TBL[0] == ((tempword >> 0x8) & 0xFF))&&(TBL[1] == (tempword & 0xFF))) {
tempword = read_rom_word_LEAP(addr + 1); tempword = read_rom_word_LEAP(addr + 1);
if ((TBL[2] == ((tempword >> 0x8) & 0xFF))&&(TBL[3] == (tempword & 0xFF))) { if ((TBL[2] == ((tempword >> 0x8) & 0xFF))&&(TBL[3] == (tempword & 0xFF))) {
@ -400,7 +400,7 @@ void readTable_LEAP(unsigned long startAddr, unsigned long endAddr)
delay(500); delay(500);
CE_LOW; CE_LOW;
for (unsigned long addr = startAddr; addr < endAddr; addr++) { 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))) { if ((TXT[0] == ((tempword >> 0x8) & 0xFF))&&(TXT[1] == (tempword & 0xFF))) {
tempword = read_rom_word_LEAP(addr + 1); tempword = read_rom_word_LEAP(addr + 1);
if ((TXT[2] == ((tempword >> 0x8) & 0xFF))&&(TXT[3] == (tempword & 0xFF))) { // Text Block Marker Found if ((TXT[2] == ((tempword >> 0x8) & 0xFF))&&(TXT[3] == (tempword & 0xFF))) { // Text Block Marker Found
@ -465,7 +465,7 @@ void readROM_LEAP()
for (unsigned long address = 0; address < 0x200000; address += 256) { // 4MB for (unsigned long address = 0; address < 0x200000; address += 256) { // 4MB
for (unsigned int x = 0; x < 256; x++) { 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] = (tempword >> 0x8) & 0xFF;
sdBuffer[(x * 2) + 1] = tempword & 0xFF; sdBuffer[(x * 2) + 1] = tempword & 0xFF;
} }
@ -474,7 +474,7 @@ void readROM_LEAP()
if (leapsize > 0) { if (leapsize > 0) {
for (unsigned long address = 0x200000; address < 0x400000; address += 256) { // +4MB = 8MB for (unsigned long address = 0x200000; address < 0x400000; address += 256) { // +4MB = 8MB
for (unsigned int x = 0; x < 256; x++) { 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] = (tempword >> 0x8) & 0xFF;
sdBuffer[(x * 2) + 1] = tempword & 0xFF; sdBuffer[(x * 2) + 1] = tempword & 0xFF;
} }
@ -483,7 +483,7 @@ void readROM_LEAP()
if (leapsize > 1) { if (leapsize > 1) {
for (unsigned long address = 0x400000; address < 0x800000; address += 256) { // +8MB = 16MB for (unsigned long address = 0x400000; address < 0x800000; address += 256) { // +8MB = 16MB
for (unsigned int x = 0; x < 256; x++) { 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] = (tempword >> 0x8) & 0xFF;
sdBuffer[(x * 2) + 1] = tempword & 0xFF; sdBuffer[(x * 2) + 1] = tempword & 0xFF;
} }