[NES] Fixed mapper 3 CHR bus conflict

Fixed mapper 3 CHR bus conflict
This commit is contained in:
nsx0r 2023-04-15 11:42:35 +02:00 committed by GitHub
parent 3ed9b9d730
commit e47f935b2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3735,13 +3735,15 @@ void readCHR(boolean readrom) {
}
break;
case 3: // 8K/16K/32K
case 66: // 16K/32K
case 70:
case 152: // 128K
case 3: // 8K/16K/32K - bus conflicts
banks = int_pow(2, chrsize) / 2;
for (int i = 0; i < banks; i++) { // 8K Banks
write_prg_byte(0x8000, i); // CHR Bank 0
for (int i = 0; i < banks; i++) {
for (int x = 0; x < 0x2000; x++) {
if (read_prg_byte(0x8000 + x) == i) {
write_prg_byte(0x8000 + x, i);
break;
}
}
for (word address = 0x0; address < 0x2000; address += 512) {
dumpCHR(address);
}
@ -4159,6 +4161,18 @@ void readCHR(boolean readrom) {
}
}
break;
case 66: // 16K/32K
case 70:
case 152: // 128K
banks = int_pow(2, chrsize) / 2;
for (int i = 0; i < banks; i++) { // 8K Banks
write_prg_byte(0x8000, i); // CHR Bank 0
for (word address = 0x0; address < 0x2000; address += 512) {
dumpCHR(address);
}
}
break;
case 67: // 128K
banks = int_pow(2, chrsize) * 2;