Previous 199869 Revisions Next

r20399 Tuesday 22nd January, 2013 at 02:19:07 UTC by Angelo Salese
Some notes on SH-2 Cache functionality, nw
[src/emu/cpu/sh2]sh2comn.c

trunk/src/emu/cpu/sh2/sh2comn.c
r20398r20399
2626
2727INLINE UINT32 RL(sh2_state *sh2, offs_t A)
2828{
29   if (A >= 0xe0000000)
29   if (A >= 0xe0000000) /* I/O */
3030      return sh2_internal_r(*sh2->internal, (A & 0x1fc)>>2, 0xffffffff);
3131
32   if (A >= 0xc0000000)
32   if (A >= 0xc0000000) /* Cache Data Array */
3333      return sh2->program->read_dword(A);
3434
35   if (A >= 0x40000000)
35   /*   0x60000000 Cache Address Data Array */
36
37   if (A >= 0x40000000) /* Cache Associative Purge Area */
3638      return 0xa5a5a5a5;
3739
40   /* 0x20000000 no Cache */
41   /* 0x00000000 read thru Cache if CE bit is 1 */
3842   return sh2->program->read_dword(A & AM);
3943}
4044
4145INLINE void WL(sh2_state *sh2, offs_t A, UINT32 V)
4246{
43   if (A >= 0xe0000000)
47   if (A >= 0xe0000000) /* I/O */
4448   {
4549      sh2_internal_w(*sh2->internal, (A & 0x1fc)>>2, V, 0xffffffff);
4650      return;
4751   }
4852
49   if (A >= 0xc0000000)
53   if (A >= 0xc0000000) /* Cache Data Array */
5054   {
5155      sh2->program->write_dword(A,V);
5256      return;
5357   }
5458
55   if (A >= 0x40000000)
59   /*   0x60000000 Cache Address Data Array */
60
61   if (A >= 0x40000000) /* Cache Associative Purge Area */
5662      return;
5763
64   /* 0x20000000 no Cache */
65   /* 0x00000000 read thru Cache if CE bit is 1 */
5866   sh2->program->write_dword(A & AM,V);
5967}
6068
r20398r20399
566574
567575      // Standby and cache
568576   case 0x24: // SBYCR, CCR
577      /*
578         CCR
579         xx-- ---- ---- ---- Way 0/1
580         ---x ---- ---- ---- Cache Purge (CP)
581         ---- x--- ---- ---- Two-Way Mode (TW)
582         ---- -x-- ---- ---- Data Replacement Disable (OD)
583         ---- --x- ---- ---- Instruction Replacement Disable (ID)
584         ---- ---x ---- ---- Cache Enable (CE)
585      */
569586      break;
570587
571588      // Interrupt vectors cont.
r20398r20399
711728   case 0x06: // ICR
712729      return sh2->icr << 16;
713730
731   case 0x24: // SBYCR, CCR
732      return sh2->m[0x24] & ~0x3000; /* bit 4-5 of CCR are always zero */
733
714734   case 0x38: // ICR, IPRA
715735      return (sh2->m[0x38] & 0x7fffffff) | (sh2->nmi_line_state == ASSERT_LINE ? 0 : 0x80000000);
716736

Previous 199869 Revisions Next


© 1997-2024 The MAME Team