diff --git a/src/mame/drivers/model1.cpp b/src/mame/drivers/model1.cpp index 411311e8692..772732ad2c3 100644 --- a/src/mame/drivers/model1.cpp +++ b/src/mame/drivers/model1.cpp @@ -784,11 +784,24 @@ READ16_MEMBER(model1_state::network_ctl_r) if(offset) return 0x40; else - return 0x00; + return m_io_command; } WRITE16_MEMBER(model1_state::network_ctl_w) { + if (offset == 0) + { + m_io_command = data & 0xff; + + // totally made up; proper emulation of I/O board needed + // (command 3 is EEPROM write, so should take a lot longer) + m_io_timer->adjust(data == 3 ? attotime::from_msec(100) : attotime::from_usec(10)); + } +} + +TIMER_DEVICE_CALLBACK_MEMBER(model1_state::io_command_acknowledge) +{ + m_io_command = 0; } WRITE16_MEMBER(model1_state::md1_w) @@ -1605,6 +1618,7 @@ static MACHINE_CONFIG_START( model1 ) MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(model1_state,irq_callback) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model1_state, model1_interrupt, "screen", 0, 1) + MCFG_TIMER_DRIVER_ADD("iotimer", model1_state, io_command_acknowledge) MCFG_MACHINE_START_OVERRIDE(model1_state,model1) MCFG_MACHINE_RESET_OVERRIDE(model1_state,model1) @@ -1654,7 +1668,9 @@ static MACHINE_CONFIG_START( model1_vr ) MCFG_CPU_PROGRAM_MAP(model1_vr_mem) MCFG_CPU_IO_MAP(model1_vr_io) MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(model1_state,irq_callback) + MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model1_state, model1_interrupt, "screen", 0, 1) + MCFG_TIMER_DRIVER_ADD("iotimer", model1_state, io_command_acknowledge) MCFG_CPU_ADD("tgp", MB86233, 16000000) MCFG_CPU_PROGRAM_MAP(model1_vr_tgp_map) diff --git a/src/mame/includes/model1.h b/src/mame/includes/model1.h index 0c5fa94cb12..c4e4d10f86a 100644 --- a/src/mame/includes/model1.h +++ b/src/mame/includes/model1.h @@ -38,6 +38,7 @@ public: , m_dsbz80(*this, DSBZ80_TAG) , m_tgp(*this, "tgp") , m_screen(*this, "screen") + , m_io_timer(*this, "iotimer") , m_mr2(*this, "mr2") , m_mr(*this, "mr") , m_display_list0(*this, "display_list0") @@ -58,6 +59,7 @@ public: DECLARE_READ16_MEMBER(network_ctl_r); DECLARE_WRITE16_MEMBER(network_ctl_w); + TIMER_DEVICE_CALLBACK_MEMBER(io_command_acknowledge); DECLARE_READ16_MEMBER(io_r); DECLARE_WRITE16_MEMBER(io_w); @@ -188,6 +190,8 @@ private: bool m_dump; bool m_swa; + uint8_t m_io_command; + // Devices required_device m_maincpu; // V60 required_device m_m1audio; // Model 1 standard sound board @@ -196,6 +200,7 @@ private: optional_device m_dsbz80; // Digital Sound Board optional_device m_tgp; required_device m_screen; + required_device m_io_timer; required_shared_ptr m_mr2; required_shared_ptr m_mr; diff --git a/src/mame/machine/model1.cpp b/src/mame/machine/model1.cpp index f763ab83701..57be8288de5 100644 --- a/src/mame/machine/model1.cpp +++ b/src/mame/machine/model1.cpp @@ -1942,6 +1942,7 @@ WRITE16_MEMBER(model1_state::model1_tgp_copro_ram_w) MACHINE_START_MEMBER(model1_state,model1) { m_ram_data = std::make_unique(0x10000); + m_io_command = 0; save_pointer(NAME(m_ram_data.get()), 0x10000); save_item(NAME(m_ram_adr)); @@ -1959,6 +1960,7 @@ MACHINE_START_MEMBER(model1_state,model1) save_item(NAME(m_mat_stack_pos)); save_item(NAME(m_acc)); save_item(NAME(m_list_length)); + save_item(NAME(m_io_command)); } void model1_state::tgp_reset(bool swa)