mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-13 08:25:05 +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;
|
||||
bool busConflict = false;
|
||||
|
||||
if (myFile) {
|
||||
switch (mapper) {
|
||||
@ -2531,13 +2532,27 @@ void readPRG(boolean readrom) {
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: // 128K/256K
|
||||
for (int i = 0; i < 8; i++) { // 128K/256K
|
||||
write_prg_byte(0x8000, i);
|
||||
for (word address = 0x0; address < (((word)prgsize - 3) * 0x4000) + 0x4000; address += 512) {
|
||||
case 2: // bus conflicts - fixed last bank
|
||||
banks = int_pow(2, prgsize);
|
||||
busConflict = true;
|
||||
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);
|
||||
}
|
||||
}
|
||||
for (word address = 0x4000; address < 0x8000; address += 512) {
|
||||
dumpPRG(base, address);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
|
Loading…
Reference in New Issue
Block a user