Previous 199869 Revisions Next

r21227 Wednesday 20th February, 2013 at 19:44:17 UTC by Angelo Salese
SH-2: watchdog i/f is quite exotic, implement it so it can be debugged properly
[src/emu/cpu/sh2]sh2comn.c sh2comn.h
[src/emu/machine]stvcd.c

trunk/src/emu/cpu/sh2/sh2comn.c
r21226r21227
571571
572572      // Watchdog
573573   case 0x20: // WTCNT, RSTCSR
574      if((sh2->m[0x20] & 0xff000000) == 0x5a000000)
575         sh2->wtcnt = (sh2->m[0x20] >> 16) & 0xff;
576
577      if((sh2->m[0x20] & 0xff000000) == 0xa5000000)
578      {
579         /*
580         WTCSR
581         x--- ---- Overflow in IT mode
582         -x-- ---- Timer mode (0: IT 1: watchdog)
583         --x- ---- Timer enable
584         ---1 1---
585         ---- -xxx Clock select
586         */
587
588         sh2->wtcsr = (sh2->m[0x20] >> 16) & 0xff;
589      }
590
591      if((sh2->m[0x20] & 0x0000ff00) == 0x00005a00)
592      {
593         // -x-- ---- RSTE (1: resets wtcnt when overflows 0: no reset)
594         // --x- ---- RSTS (0: power-on reset 1: Manual reset)
595         // ...
596      }
597
598      if((sh2->m[0x20] & 0x0000ff00) == 0x0000a500)
599      {
600         // clear WOVF
601         // ...
602      }
603
604
605
574606      break;
575607
576608      // Standby and cache
r21226r21227
729761   case 0x06: // ICR
730762      return sh2->icr << 16;
731763
764   case 0x20:
765      return (((sh2->wtcsr | 0x18) & 0xff) << 24)  | ((sh2->wtcnt & 0xff) << 16);
766
732767   case 0x24: // SBYCR, CCR
733768      return sh2->m[0x24] & ~0x3000; /* bit 4-5 of CCR are always zero */
734769
r21226r21227
10291064   device->save_item(NAME(sh2->internal_irq_vector));
10301065   device->save_item(NAME(sh2->dma_timer_active));
10311066   device->save_item(NAME(sh2->dma_irq));
1067   device->save_item(NAME(sh2->wtcnt));
1068   device->save_item(NAME(sh2->wtcsr));
10321069}
trunk/src/emu/cpu/sh2/sh2comn.h
r21226r21227
146146   UINT32 active_dma_src[2];
147147   UINT32 active_dma_dst[2];
148148   UINT32 active_dma_count[2];
149   UINT16 wtcnt;
150   UINT8 wtcsr;
149151
150152   int     is_slave, cpu_type;
151153   int  (*dma_callback_kludge)(device_t *device, UINT32 src, UINT32 dst, UINT32 data, int size);
trunk/src/emu/machine/stvcd.c
r21226r21227
796796            cr1 = cd_stat;
797797            cr2 = 0;
798798            cr3 = 0;
799            if(cr1 & 0xff || cr2 || cr3 & 0xff || cr4)
800               printf("Get # sectors used with params %04x %04x %04x %04x\n",cr1,cr2,cr3,cr4);
799801
800802            // is the partition empty?
801803            if (partitions[bufnum].size == -1)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team