Previous 199869 Revisions Next

r21474 Wednesday 27th February, 2013 at 23:42:45 UTC by Angelo Salese
Fixed SLEEP opcode in non-DRC SH-2 [Angelo Salese]
[src/emu/cpu/sh2]sh2.c sh2comn.c sh2comn.h

trunk/src/emu/cpu/sh2/sh2.c
r21473r21474
15731573/*  SLEEP */
15741574INLINE void SLEEP(sh2_state *sh2)
15751575{
1576   sh2->pc -= 2;
1576   if(sh2->sleep_mode != 2)
1577      sh2->pc -= 2;
15771578   sh2->icount -= 2;
15781579   /* Wait_for_exception; */
1580   if(sh2->sleep_mode == 0)
1581      sh2->sleep_mode = 1;
1582   else if(sh2->sleep_mode == 2)
1583      sh2->sleep_mode = 0;
15791584}
15801585
15811586/*  STC     SR,Rn */
r21473r21474
22142219   sh2->pc = RL(sh2, 0);
22152220   sh2->r[15] = RL(sh2, 4);
22162221   sh2->sr = I;
2222   sh2->sleep_mode = 0;
22172223
22182224   sh2->internal_irq_level = -1;
22192225}
trunk/src/emu/cpu/sh2/sh2comn.h
r21473r21474
149149   UINT16 wtcnt;
150150   UINT8 wtcsr;
151151
152   UINT8 sleep_mode;
153
152154   int     is_slave, cpu_type;
153155   int  (*dma_callback_kludge)(device_t *device, UINT32 src, UINT32 dst, UINT32 data, int size);
154156   int  (*dma_callback_fifo_data_available)(device_t *device, UINT32 src, UINT32 dst, UINT32 data, int size);
trunk/src/emu/cpu/sh2/sh2comn.c
r21473r21474
982982
983983   /* fetch PC */
984984   sh2->pc = RL( sh2, sh2->vbr + vector * 4 );
985   if(sh2->sleep_mode == 1) { sh2->sleep_mode = 2; }
985986   #endif
986987}
987988
r21473r21474
10661067   device->save_item(NAME(sh2->dma_irq));
10671068   device->save_item(NAME(sh2->wtcnt));
10681069   device->save_item(NAME(sh2->wtcsr));
1070   device->save_item(NAME(sh2->sleep_mode));
10691071}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team