diff options
author | Vas Crabb <vas@vastheman.com> | 2017-07-07 00:42:13 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2017-07-07 00:42:28 +1000 |
commit | 79df3e41667f5b34510953b69b769ace454f342b (patch) | |
tree | 81e6032836fd85b947fd6c27bf01450584622014 | |
parent | aebc6a514006adfe80d5efdcb29907e078b4e42a (diff) |
intlc440: one more front panel switch (nw)
-rw-r--r-- | src/devices/cpu/mcs40/mcs40.cpp | 9 | ||||
-rw-r--r-- | src/mame/drivers/intellec4.cpp | 73 | ||||
-rw-r--r-- | src/mame/layout/intlc440.lay | 32 |
3 files changed, 76 insertions, 38 deletions
diff --git a/src/devices/cpu/mcs40/mcs40.cpp b/src/devices/cpu/mcs40/mcs40.cpp index 577e4b01ac4..de990519268 100644 --- a/src/devices/cpu/mcs40/mcs40.cpp +++ b/src/devices/cpu/mcs40/mcs40.cpp @@ -681,12 +681,9 @@ inline void mcs40_cpu_device_base::do_m2() } m_resume = m_stop_latch && (CLEAR_LINE == m_stp); m_stop_latch = CLEAR_LINE != m_stp; - if (!m_stop_ff) - { - if (cycle::IN != m_cycle) - pc() = (pc() + 1) & 0x0fff; - m_rom_addr = pc(); - } + if (!m_stop_ff && (cycle::IN != m_cycle)) + pc() = (pc() + 1) & 0x0fff; + m_rom_addr = pc(); if (!m_bus_cycle_cb.isnull()) m_bus_cycle_cb(phase::M2, 1U, read & 0x0fU); } diff --git a/src/mame/drivers/intellec4.cpp b/src/mame/drivers/intellec4.cpp index 75955064eec..a96b7605e48 100644 --- a/src/mame/drivers/intellec4.cpp +++ b/src/mame/drivers/intellec4.cpp @@ -30,7 +30,7 @@ public: , m_ram_port_banks(*this, "mpbank") , m_bus(*this, "bus") , m_tty(*this, "tty") - , m_ram(*this, "ram") + , m_ram(*this, "ram"), m_memory(*this, "memory"), m_status(*this, "status") , m_sw_mode(*this, "MODE") , m_sw_control(*this, "CONTROL") , m_sw_addr_data(*this, "ADDRDAT") @@ -64,6 +64,7 @@ public: DECLARE_INPUT_CHANGED_MEMBER(sw_stop); DECLARE_INPUT_CHANGED_MEMBER(sw_single_step); DECLARE_INPUT_CHANGED_MEMBER(sw_reset); + DECLARE_INPUT_CHANGED_MEMBER(sw_reset_mode); DECLARE_INPUT_CHANGED_MEMBER(sw_mon); DECLARE_INPUT_CHANGED_MEMBER(sw_ram); DECLARE_INPUT_CHANGED_MEMBER(sw_prom); @@ -94,6 +95,7 @@ private: BIT_SW_STOP = 0, BIT_SW_SINGLE_STEP, BIT_SW_RESET, + BIT_SW_RESET_MODE, BIT_SW_MON, BIT_SW_RAM, BIT_SW_PROM, @@ -106,26 +108,12 @@ private: BIT_SW_CMA_ENABLE, BIT_SW_CMA_WRITE }; - enum : ioport_value - { - MASK_SW_STOP = 1U << BIT_SW_STOP, - MASK_SW_SINGLE_STEP = 1U << BIT_SW_SINGLE_STEP, - MASK_SW_RESET = 1U << BIT_SW_RESET, - MASK_SW_MON = 1U << BIT_SW_MON, - MASK_SW_RAM = 1U << BIT_SW_RAM, - MASK_SW_PROM = 1U << BIT_SW_PROM, - - MASK_SW_DECR = 1U << BIT_SW_DECR, - MASK_SW_INCR = 1U << BIT_SW_INCR, - MASK_SW_LOAD = 1U << BIT_SW_LOAD, - MASK_SW_CMA_ENABLE = 1U << BIT_SW_CMA_ENABLE, - MASK_SW_CMA_WRITE = 1U << BIT_SW_CMA_WRITE - }; TIMER_CALLBACK_MEMBER(single_step_expired); TIMER_CALLBACK_MEMBER(reset_expired); void trigger_reset(); + void check_4002_reset(); void reset_panel(); void display_address(u16 value, u16 mask); void display_instruction(u8 value, u8 mask); @@ -138,7 +126,7 @@ private: required_device<bus::intellec4::univ_bus_device> m_bus; required_device<rs232_port_device> m_tty; - required_shared_ptr<u8> m_ram; + required_shared_ptr<u8> m_ram, m_memory, m_status; required_ioport m_sw_mode, m_sw_control, m_sw_addr_data, m_sw_passes; @@ -167,7 +155,7 @@ private: // current state of mode switches bool m_sw_stop = false; - bool m_sw_reset = false; + bool m_sw_reset = false, m_sw_reset_mode = false; bool m_sw_mon = false, m_sw_ram = false, m_sw_prom = false; bool m_sw_run = false; }; @@ -352,7 +340,8 @@ WRITE_LINE_MEMBER(intellec4_40_state::bus_test) WRITE_LINE_MEMBER(intellec4_40_state::bus_reset_4002) { - // FIXME: this will clear 4002 RAMs (data space) + m_bus_reset_4002 = 0 == state; + check_4002_reset(); } WRITE_LINE_MEMBER(intellec4_40_state::bus_user_reset) @@ -399,6 +388,16 @@ INPUT_CHANGED_MEMBER(intellec4_40_state::sw_reset) m_sw_reset = !bool(newval); } +INPUT_CHANGED_MEMBER(intellec4_40_state::sw_reset_mode) +{ + m_sw_reset_mode = bool(newval); + if (m_cpu_reset) + { + m_bus->reset_4002_in(m_sw_reset_mode ? 0 : 1); + check_4002_reset(); + } +} + INPUT_CHANGED_MEMBER(intellec4_40_state::sw_mon) { if (oldval && !newval) @@ -580,6 +579,7 @@ void intellec4_40_state::driver_start() save_item(NAME(m_sw_stop)); save_item(NAME(m_sw_reset)); + save_item(NAME(m_sw_reset_mode)); save_item(NAME(m_sw_mon)); save_item(NAME(m_sw_ram)); save_item(NAME(m_sw_run)); @@ -595,6 +595,7 @@ void intellec4_40_state::driver_reset() ioport_value const sw_mode(m_sw_mode->read()), sw_control(m_sw_control->read()); m_sw_stop = BIT(~sw_mode, BIT_SW_STOP); m_sw_reset = BIT(~sw_mode, BIT_SW_RESET); + m_sw_reset_mode = BIT( sw_mode, BIT_SW_RESET_MODE); m_sw_mon = BIT(~sw_mode, BIT_SW_MON); m_sw_ram = BIT(~sw_mode, BIT_SW_RAM); m_sw_prom = BIT(~sw_mode, BIT_SW_PROM); @@ -625,6 +626,7 @@ void intellec4_40_state::driver_reset() m_bus->test_in(1); m_bus->stop_in((m_sw_stop && !m_single_step) ? 0 : 1); m_bus->cpu_reset_in(m_cpu_reset ? 0 : 1); + m_bus->reset_4002_in((m_cpu_reset && m_sw_reset_mode) ? 0 : 1); // set front panel LEDs machine().output().set_value("led_status_ptr_valid", m_pointer_valid); @@ -654,7 +656,11 @@ TIMER_CALLBACK_MEMBER(intellec4_40_state::reset_expired) m_cpu_reset = false; m_cpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); m_bus->cpu_reset_in(1); - // FIXME: can cause 4002 reset as well + if (m_sw_reset_mode) + { + m_bus->reset_4002_in(1); + check_4002_reset(); + } } } @@ -672,11 +678,25 @@ void intellec4_40_state::trigger_reset() m_cpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); m_bus->cpu_reset_in(0); reset_panel(); - // FIXME: can cause 4002 reset as well + if (m_sw_reset_mode) + { + m_bus->reset_4002_in(0); + check_4002_reset(); + } } } } +void intellec4_40_state::check_4002_reset() +{ + // FIXME: this really takes multiple cycles to erase, and prevents writes while held + if ((m_cpu_reset && m_sw_reset_mode) || m_bus_reset_4002) + { + std::fill_n(&m_memory[0], m_memory.bytes(), 0U); + std::fill_n(&m_status[0], m_memory.bytes(), 0U); + } +} + void intellec4_40_state::reset_panel() { if (!m_panel_reset) @@ -851,7 +871,7 @@ ADDRESS_MAP_END ADDRESS_MAP_START(mod40_ram_memory, mcs40_cpu_device_base::AS_RAM_MEMORY, 8, intellec4_40_state) ADDRESS_MAP_UNMAP_LOW - AM_RANGE(0x0000, 0x00ff) AM_RAM // 4 * 4002 + AM_RANGE(0x0000, 0x00ff) AM_RAM AM_SHARE("memory") // 4 * 4002 ADDRESS_MAP_END ADDRESS_MAP_START(mod40_rom_ports, mcs40_cpu_device_base::AS_ROM_PORTS, 8, intellec4_40_state) @@ -861,7 +881,7 @@ ADDRESS_MAP_END ADDRESS_MAP_START(mod40_ram_status, mcs40_cpu_device_base::AS_RAM_STATUS, 8, intellec4_40_state) ADDRESS_MAP_UNMAP_LOW - AM_RANGE(0x0000, 0x003f) AM_RAM // 4 * 4002 + AM_RANGE(0x0000, 0x003f) AM_RAM AM_SHARE("status") // 4 * 4002 ADDRESS_MAP_END ADDRESS_MAP_START(mod40_ram_ports, mcs40_cpu_device_base::AS_RAM_PORTS, 8, intellec4_40_state) @@ -937,9 +957,10 @@ INPUT_PORTS_START(intlc440) PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_TOGGLE PORT_NAME("STOP") PORT_CODE(KEYCODE_LEFT) PORT_CHANGED_MEMBER(DEVICE_SELF, intellec4_40_state, sw_stop, 0) PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("SINGLE STEP") PORT_CODE(KEYCODE_RIGHT) PORT_CHANGED_MEMBER(DEVICE_SELF, intellec4_40_state, sw_single_step, 0) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("RESET") PORT_CHANGED_MEMBER(DEVICE_SELF, intellec4_40_state, sw_reset, 0) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("MON") PORT_CODE(KEYCODE_1_PAD) PORT_CHANGED_MEMBER(DEVICE_SELF, intellec4_40_state, sw_mon, 0) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("RAM") PORT_CODE(KEYCODE_2_PAD) PORT_CHANGED_MEMBER(DEVICE_SELF, intellec4_40_state, sw_ram, 0) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("PROM") PORT_CODE(KEYCODE_3_PAD) PORT_CHANGED_MEMBER(DEVICE_SELF, intellec4_40_state, sw_prom, 0) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_TOGGLE PORT_NAME("RESET MODE") PORT_CHANGED_MEMBER(DEVICE_SELF, intellec4_40_state, sw_reset_mode, 0) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("MON") PORT_CODE(KEYCODE_1_PAD) PORT_CHANGED_MEMBER(DEVICE_SELF, intellec4_40_state, sw_mon, 0) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("RAM") PORT_CODE(KEYCODE_2_PAD) PORT_CHANGED_MEMBER(DEVICE_SELF, intellec4_40_state, sw_ram, 0) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("PROM") PORT_CODE(KEYCODE_3_PAD) PORT_CHANGED_MEMBER(DEVICE_SELF, intellec4_40_state, sw_prom, 0) PORT_START("CONTROL") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_TOGGLE PORT_NAME("RUN") PORT_CHANGED_MEMBER(DEVICE_SELF, intellec4_40_state, sw_run, 0) diff --git a/src/mame/layout/intlc440.lay b/src/mame/layout/intlc440.lay index dfd92980b81..f41271d5371 100644 --- a/src/mame/layout/intlc440.lay +++ b/src/mame/layout/intlc440.lay @@ -90,6 +90,7 @@ Intel INTELLEC® 4/MOD 40 layout <element name="label_write"><text string="WRITE"><color red="1.0" green="1.0" blue="1.0" /></text></element> <element name="label_reset"><text string="RESET"><color red="1.0" green="1.0" blue="1.0" /></text></element> + <element name="label_reset_mode"><text string="MODE"><color red="1.0" green="1.0" blue="1.0" /></text></element> <element name="label_address"> <text string="ADDRESS" align="1"><color red="1.0" green="1.0" blue="1.0" /></text> @@ -120,6 +121,13 @@ Intel INTELLEC® 4/MOD 40 layout <text string="DISABLE" align="2"><color red="1.0" green="1.0" blue="1.0" /></text> </element> + <element name="label_system"> + <text string="SYSTEM" align="1"><color red="1.0" green="1.0" blue="1.0" /></text> + </element> + <element name="label_cpu"> + <text string="CPU" align="1"><color red="1.0" green="1.0" blue="1.0" /></text> + </element> + <element name="label_addr_data"> <text string="ADDRESS/DATA" align="1"><color red="1.0" green="1.0" blue="1.0" /></text> </element> @@ -259,6 +267,9 @@ Intel INTELLEC® 4/MOD 40 layout <cpanel element="label_reset_ctrl"><bounds left="664" top="296" right="724" bottom="304" /></cpanel> <cpanel element="label_reset"><bounds left="666" top="312" right="691" bottom="319" /></cpanel> + <cpanel element="label_reset_mode"><bounds left="697" top="312" right="722" bottom="319" /></cpanel> + <cpanel element="label_system"><bounds left="727" top="321" right="783" bottom="328" /></cpanel> + <cpanel element="label_cpu"><bounds left="727" top="361" right="783" bottom="368" /></cpanel> <cpanel name="led_address_a3_3" element="led"> <bounds left="81" top="79" right="92" bottom="86" /> @@ -442,13 +453,13 @@ Intel INTELLEC® 4/MOD 40 layout <bounds left="479" top="240" right="504" bottom="286" /> </cpanel> - <cpanel element="switch" inputtag="MODE" inputmask="0x0008"> + <cpanel element="switch" inputtag="MODE" inputmask="0x0010"> <bounds left="573" top="240" right="598" bottom="286" /> </cpanel> - <cpanel element="switch" inputtag="MODE" inputmask="0x0010"> + <cpanel element="switch" inputtag="MODE" inputmask="0x0020"> <bounds left="604" top="240" right="629" bottom="286" /> </cpanel> - <cpanel element="switch" inputtag="MODE" inputmask="0x0020"> + <cpanel element="switch" inputtag="MODE" inputmask="0x0040"> <bounds left="635" top="240" right="660" bottom="286" /> </cpanel> @@ -498,6 +509,9 @@ Intel INTELLEC® 4/MOD 40 layout <cpanel element="switch" inputtag="MODE" inputmask="0x0004"> <bounds left="666" top="322" right="691" bottom="368" /> </cpanel> + <cpanel element="switch" inputtag="MODE" inputmask="0x0008"> + <bounds left="697" top="322" right="722" bottom="368" /> + </cpanel> <screen index="0"><bounds left="0" top="400" right="1000" bottom="1150" /></screen> </view> @@ -622,6 +636,9 @@ Intel INTELLEC® 4/MOD 40 layout <cpanel element="label_reset_ctrl"><bounds left="664" top="296" right="724" bottom="304" /></cpanel> <cpanel element="label_reset"><bounds left="666" top="312" right="691" bottom="319" /></cpanel> + <cpanel element="label_reset_mode"><bounds left="697" top="312" right="722" bottom="319" /></cpanel> + <cpanel element="label_system"><bounds left="727" top="321" right="783" bottom="328" /></cpanel> + <cpanel element="label_cpu"><bounds left="727" top="361" right="783" bottom="368" /></cpanel> <cpanel name="led_address_a3_3" element="led"> <bounds left="81" top="79" right="92" bottom="86" /> @@ -805,13 +822,13 @@ Intel INTELLEC® 4/MOD 40 layout <bounds left="479" top="240" right="504" bottom="286" /> </cpanel> - <cpanel element="switch" inputtag="MODE" inputmask="0x0008"> + <cpanel element="switch" inputtag="MODE" inputmask="0x0010"> <bounds left="573" top="240" right="598" bottom="286" /> </cpanel> - <cpanel element="switch" inputtag="MODE" inputmask="0x0010"> + <cpanel element="switch" inputtag="MODE" inputmask="0x0020"> <bounds left="604" top="240" right="629" bottom="286" /> </cpanel> - <cpanel element="switch" inputtag="MODE" inputmask="0x0020"> + <cpanel element="switch" inputtag="MODE" inputmask="0x0040"> <bounds left="635" top="240" right="660" bottom="286" /> </cpanel> @@ -861,5 +878,8 @@ Intel INTELLEC® 4/MOD 40 layout <cpanel element="switch" inputtag="MODE" inputmask="0x0004"> <bounds left="666" top="322" right="691" bottom="368" /> </cpanel> + <cpanel element="switch" inputtag="MODE" inputmask="0x0008"> + <bounds left="697" top="322" right="722" bottom="368" /> + </cpanel> </view> </mamelayout> |