mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-14 08:55:06 +01:00
Merge pull request #654 from nsx0r/patch-44
[WIP] solving mappers with bus conflicts
This commit is contained in:
commit
55964248b6
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user