Merge pull request #654 from nsx0r/patch-44

[WIP] solving mappers with bus conflicts
This commit is contained in:
sanni 2022-12-11 11:01:34 +01:00 committed by GitHub
commit 55964248b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2497,6 +2497,7 @@ void readPRG(boolean readrom) {
} }
word base = 0x8000; word base = 0x8000;
bool busConflict = false;
if (myFile) { if (myFile) {
switch (mapper) { switch (mapper) {
@ -2531,13 +2532,27 @@ void readPRG(boolean readrom) {
} }
break; break;
case 2: // 128K/256K case 2: // bus conflicts - fixed last bank
for (int i = 0; i < 8; i++) { // 128K/256K banks = int_pow(2, prgsize);
write_prg_byte(0x8000, i); busConflict = true;
for (word address = 0x0; address < (((word)prgsize - 3) * 0x4000) + 0x4000; address += 512) { for (int i = 0; i < banks-1; i++) {
for (int x = 0; x < 0x4000; x++) {
if (read_prg_byte(0xC000 + x) == i) {
write_prg_byte(0xC000 + x, i);
busConflict = false;
break;
}
}
if (busConflict) {
write_prg_byte(0xC000 + i, i);
}
for (word address = 0x0; address < 0x4000; address += 512) {
dumpPRG(base, address); dumpPRG(base, address);
} }
} }
for (word address = 0x4000; address < 0x8000; address += 512) {
dumpPRG(base, address);
}
break; break;
case 4: case 4: