summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/hmcs40/hmcs40.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/hmcs40/hmcs40.h')
-rw-r--r--src/devices/cpu/hmcs40/hmcs40.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/devices/cpu/hmcs40/hmcs40.h b/src/devices/cpu/hmcs40/hmcs40.h
index ffc480395f4..eb4592653db 100644
--- a/src/devices/cpu/hmcs40/hmcs40.h
+++ b/src/devices/cpu/hmcs40/hmcs40.h
@@ -82,8 +82,8 @@ class hmcs40_cpu_device : public cpu_device
{
public:
// max 8 4-bit R ports
- template <std::size_t Bit> auto read_r() { return m_read_r[Bit].bind(); }
- template <std::size_t Bit> auto write_r() { return m_write_r[Bit].bind(); }
+ template <std::size_t N> auto read_r() { return m_read_r[N].bind(); }
+ template <std::size_t N> auto write_r() { return m_write_r[N].bind(); }
// 16-bit discrete
auto read_d() { return m_read_d.bind(); }
@@ -111,7 +111,7 @@ protected:
virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle
virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } // "
virtual u32 execute_min_cycles() const noexcept override { return 1; }
- virtual u32 execute_max_cycles() const noexcept override { return 2; }
+ virtual u32 execute_max_cycles() const noexcept override { return 2+1; } // max 2 + interrupt
virtual u32 execute_input_lines() const noexcept override { return 2+1; } // 3rd one is internal
virtual void execute_set_input(int line, int state) override;
virtual void execute_run() override;
@@ -134,24 +134,26 @@ protected:
address_space *m_program;
address_space *m_data;
- int m_pcwidth; // Program Counter bit-width
- int m_prgwidth;
- int m_datawidth;
+ int m_icount;
+ int m_state_count;
+
+ int const m_pcwidth; // Program Counter bit-width
+ int const m_prgwidth;
+ int const m_datawidth;
+ int const m_family; // MCU family (42-47)
+ u16 const m_polarity; // i/o polarity (pmos vs cmos)
+ int const m_stack_levels; // number of callstack levels
int m_pcmask;
int m_prgmask;
int m_datamask;
- int m_family; // MCU family (42-47)
- u16 m_polarity; // i/o polarity (pmos vs cmos)
- int m_stack_levels; // number of callstack levels
u16 m_stack[4]; // max 4
u16 m_op; // current opcode
u16 m_prev_op;
u8 m_i; // 4-bit immediate opcode param
int m_eint_line; // which input_line caused an interrupt
- emu_timer *m_timer;
int m_halt; // internal HLT state
- attotime m_timer_halted_remain;
- int m_icount;
+ u8 m_prescaler; // internal timer prescaler
+ bool m_block_int; // block interrupt on next cycle
u16 m_pc; // Program Counter
u16 m_prev_pc;
@@ -194,8 +196,7 @@ protected:
virtual int read_d(int index);
virtual void write_d(int index, int state);
- void reset_prescaler();
- TIMER_CALLBACK_MEMBER( simple_timer_cb );
+ void cycle();
void increment_tc();
void do_interrupt();