Previous 15994 Revisions Next

r14568 Wednesday 22nd February, 2012 at 07:40:14 UTC by Olivier Galibert
680x0: Not checking fc in TTx translation? That's a patchin' [O. Galibert]
[src/emu/cpu/m68000]m68kmmu.h

src/emu/cpu/m68000/m68kmmu.h
r14567r14568
253253      // transparent translation register 0 enabled
254254      UINT32 address_base = m68k->mmu_tt0 & 0xff000000;
255255      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))
257257      {
258258//          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);
259259         return addr_in;
r14567r14568
265265      // transparent translation register 1 enabled
266266      UINT32 address_base = m68k->mmu_tt1 & 0xff000000;
267267      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))
269269      {
270270//          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);
271271         return addr_in;
r14567r14568
335335   bbits = (m68k->mmu_tc >> 8) & 0xf;
336336   cbits = (m68k->mmu_tc >> 4) & 0xf;
337337
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);
339339
340340   // get table A offset
341341   tofs = (addr_in<<is)>>(32-abits);
r14567r14568
547547
548548   if (tt0 & 0x8000)
549549   {
550      static int fcmask[4] = { 4, 4, 0, 0 };
551      static int fcmatch[4] = { 0, 4, 0, 0 };
550552      UINT32 mask = (tt0>>16) & 0xff;
551553      mask ^= 0xff;
552554      mask <<= 24;
553555
554      if ((addr_in & mask) == (tt0 & mask))
556      if ((addr_in & mask) == (tt0 & mask) && (fc & fcmask[(tt0 >> 13) & 3]) == fcmatch[(tt0 >> 13) & 3])
555557      {
556558         //          fprintf(stderr, "TT0 match on address %08x (TT0 = %08x, mask = %08x)\n", addr_in, tt0, mask);
557559         if ((tt0 & 4) && !m68k->mmu_tmp_rw && !ptest)   // write protect?
r14567r14568
568570
569571   if (tt1 & 0x8000)
570572   {
573      static int fcmask[4] = { 4, 4, 0, 0 };
574      static int fcmatch[4] = { 0, 4, 0, 0 };
571575      UINT32 mask = (tt1>>16) & 0xff;
572576      mask ^= 0xff;
573577      mask <<= 24;
574578
575      if ((addr_in & mask) == (tt1 & mask))
579      if ((addr_in & mask) == (tt1 & mask) && (fc & fcmask[(tt1 >> 13) & 3]) == fcmatch[(tt1 >> 13) & 3])
576580      {
577581         //          fprintf(stderr, "TT1 match on address %08x (TT0 = %08x, mask = %08x)\n", addr_in, tt1, mask);
578582         if ((tt1 & 4) && !m68k->mmu_tmp_rw && !ptest)   // write protect?

Previous 15994 Revisions Next


© 1998-2018 The MESS Team