summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/cpu/sm510/sm510base.cpp19
-rw-r--r--src/devices/cpu/sm510/sm510base.h19
-rw-r--r--src/devices/cpu/sm510/sm590.h7
3 files changed, 10 insertions, 35 deletions
diff --git a/src/devices/cpu/sm510/sm510base.cpp b/src/devices/cpu/sm510/sm510base.cpp
index 203031f2770..c260c07667b 100644
--- a/src/devices/cpu/sm510/sm510base.cpp
+++ b/src/devices/cpu/sm510/sm510base.cpp
@@ -32,8 +32,6 @@ enum
void sm510_base_device::device_start()
{
- assert(SM510_INPUT_LINE_K1 == 0);
-
m_program = &space(AS_PROGRAM);
m_data = &space(AS_DATA);
m_prgmask = (1 << m_prgwidth) - 1;
@@ -67,8 +65,7 @@ void sm510_base_device::device_start()
m_div = 0;
m_1s = false;
m_1s_rise = false;
- m_k_rise = false;
- std::fill_n(m_k_input, std::size(m_k_input), 0);
+ m_ext_wakeup = false;
m_l = 0;
m_x = 0;
m_y = 0;
@@ -102,8 +99,7 @@ void sm510_base_device::device_start()
save_item(NAME(m_div));
save_item(NAME(m_1s));
save_item(NAME(m_1s_rise));
- save_item(NAME(m_k_rise));
- save_item(NAME(m_k_input));
+ save_item(NAME(m_ext_wakeup));
save_item(NAME(m_l));
save_item(NAME(m_x));
save_item(NAME(m_y));
@@ -251,14 +247,10 @@ void sm510_base_device::init_divider()
void sm510_base_device::execute_set_input(int line, int state)
{
- if (!valid_wakeup_line(line))
+ if (line != SM510_EXT_WAKEUP_LINE)
return;
- // rising edge of any K input
- if (state && !m_k_input[line])
- m_k_rise = true;
-
- m_k_input[line] = state;
+ m_ext_wakeup = bool(state);
}
void sm510_base_device::do_interrupt()
@@ -292,8 +284,7 @@ void sm510_base_device::execute_run()
while (m_icount > 0)
{
// in halt mode, wake up after 1S signal or K input
- bool wakeup = m_k_rise || m_1s_rise;
- m_k_rise = false;
+ bool wakeup = m_ext_wakeup || m_1s_rise;
m_1s_rise = false;
if (m_halt)
diff --git a/src/devices/cpu/sm510/sm510base.h b/src/devices/cpu/sm510/sm510base.h
index adcf9a881f1..4cfdaa2c715 100644
--- a/src/devices/cpu/sm510/sm510base.h
+++ b/src/devices/cpu/sm510/sm510base.h
@@ -16,15 +16,9 @@
// I/O ports setup
-// when in halt state, any K input going high can wake up the CPU,
-// driver is required to use set_input_line(SM510_INPUT_LINE_K1/K2/K3/K4, state)
-enum
-{
- SM510_INPUT_LINE_K1 = 0,
- SM510_INPUT_LINE_K2,
- SM510_INPUT_LINE_K3,
- SM510_INPUT_LINE_K4
-};
+// when in halt state, any active K input can wake up the CPU,
+// driver is required to use set_input_line(SM510_EXT_WAKEUP_LINE, state)
+#define SM510_EXT_WAKEUP_LINE 0
// ACL input pin
#define SM510_INPUT_LINE_ACL INPUT_LINE_RESET
@@ -97,8 +91,7 @@ protected:
virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * m_clk_div); } // "
virtual u32 execute_min_cycles() const noexcept override { return 1; }
virtual u32 execute_max_cycles() const noexcept override { return 3+1; }
- virtual u32 execute_input_lines() const noexcept override { return 4; }
- virtual bool execute_input_edge_triggered(int inputnum) const noexcept override { return valid_wakeup_line(inputnum); }
+ virtual u32 execute_input_lines() const noexcept override { return 1; }
virtual void execute_set_input(int line, int state) override;
virtual void execute_run() override;
@@ -115,7 +108,6 @@ protected:
virtual void reset_vector() { do_branch(3, 7, 0); }
virtual void wakeup_vector() { do_branch(1, 0, 0); } // after halt
- virtual bool valid_wakeup_line(int line) const { return (line >= 0 && line < 4); }
int m_prgwidth;
int m_datawidth;
@@ -140,8 +132,7 @@ protected:
u8 m_r;
u8 m_r_out;
int m_r_mask_option;
- int m_k_input[4];
- bool m_k_rise;
+ bool m_ext_wakeup;
bool m_halt;
int m_clk_div;
diff --git a/src/devices/cpu/sm510/sm590.h b/src/devices/cpu/sm510/sm590.h
index f6b7416d044..5a0023642c8 100644
--- a/src/devices/cpu/sm510/sm590.h
+++ b/src/devices/cpu/sm510/sm590.h
@@ -12,12 +12,6 @@
#include "sm510base.h"
-// I/O ports setup
-
-// It does not have K pins, but can wake up after halt on R2.2
-#define SM590_INPUT_LINE_R22 SM510_INPUT_LINE_K3
-
-
// pinout reference
/*
@@ -115,7 +109,6 @@ protected:
virtual void reset_vector() override { do_branch(0, 0, 0); }
virtual void wakeup_vector() override { do_branch(0, 1, 0); }
- virtual bool valid_wakeup_line(int line) const override { return (line == SM590_INPUT_LINE_R22); }
// opcode handlers
// 00-3f