diff options
Diffstat (limited to 'src/mame/machine/tait8741.cpp')
-rw-r--r-- | src/mame/machine/tait8741.cpp | 180 |
1 files changed, 0 insertions, 180 deletions
diff --git a/src/mame/machine/tait8741.cpp b/src/mame/machine/tait8741.cpp index 612831749f7..3ea6607b1b0 100644 --- a/src/mame/machine/tait8741.cpp +++ b/src/mame/machine/tait8741.cpp @@ -332,183 +332,3 @@ uint8_t taito8741_4pack_device::port_read(int num, int offset) default : return 0; } } - -/**************************************************************************** - -joshi Vollyball set. - - Only the chip of the communication between MAIN and the SUB. - For the I/O, there may be I8741 of the addition. - - MCU code is not dumped. - There is some HACK operation because the emulation is imperfect. - -****************************************************************************/ - -const device_type JOSVOLLY8741_4PACK = &device_creator<josvolly8741_4pack_device>; - -josvolly8741_4pack_device::josvolly8741_4pack_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, JOSVOLLY8741_4PACK, "I8741 MCU Simulation (Joshi Volleyball)", tag, owner, clock, "josvolly8741_4pack", __FILE__), - m_port_handler_0_r(*this), - m_port_handler_1_r(*this), - m_port_handler_2_r(*this), - m_port_handler_3_r(*this) -{ -} - -void josvolly8741_4pack_device::device_start() -{ - m_port_handler_0_r.resolve_safe(0); - m_port_handler_1_r.resolve_safe(0); - m_port_handler_2_r.resolve_safe(0); - m_port_handler_3_r.resolve_safe(0); - - for (int i = 0; i < 4; i++) - { - save_item(NAME(m_i8741[i].cmd), i); - save_item(NAME(m_i8741[i].sts), i); - save_item(NAME(m_i8741[i].txd), i); - //save_item(NAME(m_i8741[i].outport), i); //currently initialized to 0xff, never changed - save_item(NAME(m_i8741[i].rxd), i); - save_item(NAME(m_i8741[i].rst), i); - }; - - save_item(NAME(m_nmi_enable)); -} - - -void josvolly8741_4pack_device::device_reset() -{ - m_nmi_enable = 0; - - for(auto & elem : m_i8741) - { - elem.cmd = 0; - elem.sts = 0; // 0xf0; /* init flag */ - elem.txd = 0; - elem.outport = 0xff; - elem.rxd = 0; - - elem.rst = 1; - } -} - -/* transmit data finish callback */ -TIMER_CALLBACK_MEMBER( josvolly8741_4pack_device::tx ) -{ - int num = param; - JV8741 *src = &m_i8741[num]; - JV8741 *dst = &m_i8741[src->connect]; - - dst->rxd = src->txd; - - src->sts &= ~0x02; /* TX full ? */ - dst->sts |= 0x01; /* RX ready ? */ -} - -void josvolly8741_4pack_device::update(int num) -{ - if( (m_i8741[num].sts & 0x02) ) - { - /* transmit data */ - machine().scheduler().timer_set (attotime::from_usec(1), timer_expired_delegate(FUNC(josvolly8741_4pack_device::tx),this), num); - } -} - -void josvolly8741_4pack_device::write(int num, int offset, int data) -{ - JV8741 *mcu = &m_i8741[num]; - - if(offset==1) - { - LOG(("%s:8741[%d] CW %02X\n", machine().describe_context(), num, data)); - - /* read pointer */ - mcu->cmd = data; - /* CMD */ - switch(data) - { - case 0: - mcu->txd = data ^ 0x40; - mcu->sts |= 0x02; - break; - case 1: - mcu->txd = data ^ 0x40; - mcu->sts |= 0x02; -#if 1 - /* ?? */ - mcu->rxd = 0; /* SBSTS ( DIAG ) , killed */ - mcu->sts |= 0x01; /* RD ready */ -#endif - break; - case 2: -#if 1 - mcu->rxd = port_read(1); - mcu->sts |= 0x01; /* RD ready */ -#endif - break; - case 3: /* normal mode ? */ - break; - - case 0xf0: /* clear main sts ? */ - mcu->txd = data ^ 0x40; - mcu->sts |= 0x02; - break; - } - } - else - { - /* data */ - LOG(("%s:8741[%d] DW %02X\n", machine().describe_context(), num, data)); - - mcu->txd = data ^ 0x40; /* parity reverce ? */ - mcu->sts |= 0x02; /* TXD busy */ -#if 1 - /* interrupt ? */ - if(num == 0) - { - if(m_nmi_enable) - { - machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); - m_nmi_enable = 0; - } - } -#endif - } - update(num); -} - -uint8_t josvolly8741_4pack_device::read(int num,int offset) -{ - JV8741 *mcu = &m_i8741[num]; - int ret; - - if(offset==1) - { - if(mcu->rst) - mcu->rxd = port_read(num); /* port in */ - ret = mcu->sts; - LOG(("%s:8741[%d] SR %02X\n",machine().describe_context(),num,ret)); - } - else - { - /* clear status port */ - mcu->sts &= ~0x01; /* RD ready */ - ret = mcu->rxd; - LOG(("%s:8741[%d] DR %02X\n",machine().describe_context(),num,ret)); - mcu->rst = 0; - } - return ret; -} - -uint8_t josvolly8741_4pack_device::port_read(int num) -{ - switch(num) - { - case 0 : return m_port_handler_0_r(0); - case 1 : return m_port_handler_1_r(0); - case 2 : return m_port_handler_2_r(0); - case 3 : return m_port_handler_3_r(0); - default : return 0; - } -} |