src/emu/cpu/m68000/m68kmmu.h
| r14567 | r14568 | |
| 253 | 253 | // transparent translation register 0 enabled |
| 254 | 254 | UINT32 address_base = m68k->mmu_tt0 & 0xff000000; |
| 255 | 255 | UINT32 address_mask = ((m68k->mmu_tt0 << 8) & 0xff000000) ^ 0xff000000; |
| 256 | | if ((addr_in & address_mask) == address_base) |
| 256 | if ((addr_in & address_mask) == address_base && (fc & ~m68k->mmu_tt0) == ((m68k->mmu_tt0 >> 4) & 7)) |
| 257 | 257 | { |
| 258 | 258 | // printf("PMMU: pc=%x TT0 fc=%x addr_in=%08x address_mask=%08x address_base=%08x\n", m68k->ppc, fc, addr_in, address_mask, address_base); |
| 259 | 259 | return addr_in; |
| r14567 | r14568 | |
| 265 | 265 | // transparent translation register 1 enabled |
| 266 | 266 | UINT32 address_base = m68k->mmu_tt1 & 0xff000000; |
| 267 | 267 | UINT32 address_mask = ((m68k->mmu_tt1 << 8) & 0xff000000) ^ 0xff000000; |
| 268 | | if ((addr_in & address_mask) == address_base) |
| 268 | if ((addr_in & address_mask) == address_base && (fc & ~m68k->mmu_tt1) == ((m68k->mmu_tt1 >> 4) & 7)) |
| 269 | 269 | { |
| 270 | 270 | // printf("PMMU: pc=%x TT1 fc=%x addr_in=%08x address_mask=%08x address_base=%08x\n", m68k->ppc, fc, addr_in, address_mask, address_base); |
| 271 | 271 | return addr_in; |
| r14567 | r14568 | |
| 335 | 335 | bbits = (m68k->mmu_tc >> 8) & 0xf; |
| 336 | 336 | cbits = (m68k->mmu_tc >> 4) & 0xf; |
| 337 | 337 | |
| 338 | | // printf("PMMU: tcr %08x limit %08x aptr %08x is %x abits %d bbits %d cbits %d\n", m68k->mmu_tc, root_limit, root_aptr, is, abits, bbits, cbits); |
| 338 | // printf("PMMU: tcr %08x limit %08x aptr %08x is %x abits %d bbits %d cbits %d\n", m68k->mmu_tc, root_limit, root_aptr, is, abits, bbits, cbits); |
| 339 | 339 | |
| 340 | 340 | // get table A offset |
| 341 | 341 | tofs = (addr_in<<is)>>(32-abits); |
| r14567 | r14568 | |
| 547 | 547 | |
| 548 | 548 | if (tt0 & 0x8000) |
| 549 | 549 | { |
| 550 | static int fcmask[4] = { 4, 4, 0, 0 }; |
| 551 | static int fcmatch[4] = { 0, 4, 0, 0 }; |
| 550 | 552 | UINT32 mask = (tt0>>16) & 0xff; |
| 551 | 553 | mask ^= 0xff; |
| 552 | 554 | mask <<= 24; |
| 553 | 555 | |
| 554 | | if ((addr_in & mask) == (tt0 & mask)) |
| 556 | if ((addr_in & mask) == (tt0 & mask) && (fc & fcmask[(tt0 >> 13) & 3]) == fcmatch[(tt0 >> 13) & 3]) |
| 555 | 557 | { |
| 556 | 558 | // fprintf(stderr, "TT0 match on address %08x (TT0 = %08x, mask = %08x)\n", addr_in, tt0, mask); |
| 557 | 559 | if ((tt0 & 4) && !m68k->mmu_tmp_rw && !ptest) // write protect? |
| r14567 | r14568 | |
| 568 | 570 | |
| 569 | 571 | if (tt1 & 0x8000) |
| 570 | 572 | { |
| 573 | static int fcmask[4] = { 4, 4, 0, 0 }; |
| 574 | static int fcmatch[4] = { 0, 4, 0, 0 }; |
| 571 | 575 | UINT32 mask = (tt1>>16) & 0xff; |
| 572 | 576 | mask ^= 0xff; |
| 573 | 577 | mask <<= 24; |
| 574 | 578 | |
| 575 | | if ((addr_in & mask) == (tt1 & mask)) |
| 579 | if ((addr_in & mask) == (tt1 & mask) && (fc & fcmask[(tt1 >> 13) & 3]) == fcmatch[(tt1 >> 13) & 3]) |
| 576 | 580 | { |
| 577 | 581 | // fprintf(stderr, "TT1 match on address %08x (TT0 = %08x, mask = %08x)\n", addr_in, tt1, mask); |
| 578 | 582 | if ((tt1 & 4) && !m68k->mmu_tmp_rw && !ptest) // write protect? |