Previous 199869 Revisions Next

r22649 Thursday 2nd May, 2013 at 22:22:19 UTC by David Haywood
more of the same (nw)
[src/emu/machine]mcf5206e.c mcf5206e.h

trunk/src/emu/machine/mcf5206e.c
r22648r22649
5959   AM_RANGE(0x1e4, 0x1e7) AM_READWRITE8(MFDR_r, MFDR_w, 0xffffffff)
6060   AM_RANGE(0x1e8, 0x1eb) AM_READWRITE8(MBCR_r, MBCR_w, 0xffffffff)
6161   AM_RANGE(0x1ec, 0x1ef) AM_READWRITE8(MBSR_r, MBSR_w, 0xffffffff)
62   AM_RANGE(0x1f0, 0x1f3) AM_READWRITE8(MBDR_r, MBDR_w, 0xffffffff)
6263ADDRESS_MAP_END
6364
6465
r22648r22649
528529
529530READ8_MEMBER( mcf5206e_peripheral_device::MBSR_r)
530531{
531   static int hack = 0x00;
532   int hack = 0x00;
532533
533534   switch (offset)
534535   {
r22648r22649
536537   {
537538      hack ^= (machine().rand()&0xff);
538539      debuglog("%s: MBSR_r\n", this->machine().describe_context());
539      return m_MBSR | hack; // will loop on this after a while
540      return m_MBSR ^ hack; // will loop on this after a while
540541   }
541542   case 1:
542543   case 2:
r22648r22649
567568
568569
569570
571
572READ8_MEMBER( mcf5206e_peripheral_device::MBDR_r)
573{
574   int hack = 0x00;
575
576   switch (offset)
577   {
578   case 0:
579   {
580      hack ^= (machine().rand()&0xff);
581      debuglog("%s: MBDR_r\n", this->machine().describe_context());
582      return m_MBDR ^ hack;
583   }
584   case 1:
585   case 2:
586   case 3:
587      debuglog("%s: invalid MBDR_r %d\n", this->machine().describe_context(), offset);
588      return 0;
589   }
590
591   return 0;
592}
593
594WRITE8_MEMBER( mcf5206e_peripheral_device::MBDR_w)
595{
596   switch (offset)
597   {
598   case 0:
599      m_MBDR = data;
600      debuglog("%s: MBDR_w %02x\n", this->machine().describe_context(), data);
601      break;
602   case 1:
603   case 2:
604   case 3:
605      debuglog("%s: invalid MBDR_w %d, %02x\n", this->machine().describe_context(), offset, data);
606      break;
607
608   }
609}
610
611
612
570613READ16_MEMBER( mcf5206e_peripheral_device::IMR_r)
571614{
572615   switch (offset)
r22648r22649
614657   // technically we should do the vector check in the IRQ callback as well as various checks based on the IRQ masks before asserting the interrupt
615658   if (ICR & 0x80) // AVEC
616659   {
617      m_cpu->set_input_line((ICR&0x1c)>>2, HOLD_LINE);
660      if (!(m_IMR & 0x0200)) m_cpu->set_input_line((ICR&0x1c)>>2, HOLD_LINE);
618661   }
619662
620663   debuglog("timer1_callback\n");
r22648r22649
903946
904947   m_IMR = 0x3FFE;
905948
949   m_MFDR = 0x00;
906950   m_MBCR = 0x00;
907951   m_MBSR = 0x00;
952   m_MBDR = 0x00;
908953}
909954
910955/*
r22648r22649
10251070$1E4*-                  MFDR        8       M-Bus Frequency Divider Register                    00                                                  R/W
10261071$1E8*-                  MBCR        8       M-Bus Control Register                              00                                                  R/W
10271072$1EC*-                  MBSR        8       M-Bus Status Register                               00                                                  R/W
1028$1F0                    MBDR        8       M-Bus Data I/O Register                             00                                                  R/W
1073$1F0*-                  MBDR        8       M-Bus Data I/O Register                             00                                                  R/W
10291074------------ DMA Controller -----------
10301075$200                    DMASAR0     32      Source Address Register 0                           00                                                  R/W
10311076$204                    DMADAR0     32      Destination Address Register 0                      00                                                  R/W
trunk/src/emu/machine/mcf5206e.h
r22648r22649
151151   DECLARE_WRITE8_MEMBER( MBSR_w );
152152   DECLARE_READ8_MEMBER( MFDR_r );
153153   DECLARE_WRITE8_MEMBER( MFDR_w );
154   DECLARE_READ8_MEMBER( MBDR_r );
155   DECLARE_WRITE8_MEMBER( MBDR_w );
154156   
155157
156158   
r22648r22649
197199   UINT8 m_MBCR;
198200   UINT8 m_MBSR;
199201   UINT8 m_MFDR;
202   UINT8 m_MBDR;
200203
201204   UINT32 m_coldfire_regs[0x400/4];
202205

Previous 199869 Revisions Next


© 1997-2024 The MAME Team