mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-23 21:19:16 +01:00
[WIP] solving mappers with bus conflicts
solving mappers with bus conflicts, mapper 2 is fixed, more to come after more testing
This commit is contained in:
parent
93fba20d62
commit
95e795023d
@ -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(0x8000 + 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:
|
||||||
|
Loading…
Reference in New Issue
Block a user