| 149 | } |
| 150 | |
| 151 | static void Sync(void) { |
| 152 | chrSync(); |
| 153 | setprg4r(0x10, 0x6000, (regs[0] & 1) | (regs[0] >> 2)); // two 4K banks are identical, either internal or excernal |
| 154 | setprg4r(0x10, 0x7000, (regs[1] & 1) | (regs[1] >> 2)); // SRAMs may be mapped in any bank independently |
| 155 | if (PRGptr[1] == NULL) { // for iNES 2.0 version it even more hacky lol |
| 156 | setprg8(0x8000, (regs[2] & 0x3F) + ((regs[2] & 0x40) >> 2)); |
| 157 | setprg8(0xA000, (regs[3] & 0x3F) + ((regs[3] & 0x40) >> 2)); |
| 158 | setprg8(0xC000, (regs[4] & 0x3F) + ((regs[4] & 0x40) >> 2)); |
| 159 | setprg8(0xE000, 0x10 + 0x3F); |
| 160 | } else { |
| 161 | setprg8r((regs[2] >> 6) & 1, 0x8000, (regs[2] & 0x3F)); |
| 162 | setprg8r((regs[3] >> 6) & 1, 0xA000, (regs[3] & 0x3F)); |
| 163 | setprg8r((regs[4] >> 6) & 1, 0xC000, (regs[4] & 0x3F)); |
| 164 | setprg8r(1, 0xE000, ~0); // always sees the last bank of the external cart, so can't be booted without it. |
| 165 | } |
| 166 | setmirror(((regs[0xA]&2)>>1)^1); |
| 167 | } |
| 168 | |
| 169 | static DECLFW(QTAiWrite) { |
| 170 | regs[(A & 0x0F00) >> 8] = V; // IRQ pretty the same as in other VRC mappers by Konami |