diff options
Diffstat (limited to 'src/devices/cpu/hphybrid/hphybrid.h')
-rw-r--r-- | src/devices/cpu/hphybrid/hphybrid.h | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/src/devices/cpu/hphybrid/hphybrid.h b/src/devices/cpu/hphybrid/hphybrid.h index db704d1d2fe..48b8e37b59c 100644 --- a/src/devices/cpu/hphybrid/hphybrid.h +++ b/src/devices/cpu/hphybrid/hphybrid.h @@ -47,17 +47,21 @@ #define HP_IOADDR_IC_SHIFT 0 // Compose an I/O address from PA & IC -inline constexpr unsigned HP_MAKE_IOADDR(unsigned pa , unsigned ic) { return ((pa << HP_IOADDR_PA_SHIFT) | (ic << HP_IOADDR_IC_SHIFT)); } +constexpr unsigned HP_MAKE_IOADDR(unsigned pa , unsigned ic) { return ((pa << HP_IOADDR_PA_SHIFT) | (ic << HP_IOADDR_IC_SHIFT)); } class hp_hybrid_cpu_device : public cpu_device { public: - DECLARE_WRITE_LINE_MEMBER(dmar_w); - DECLARE_WRITE_LINE_MEMBER(halt_w); - DECLARE_WRITE_LINE_MEMBER(status_w); - DECLARE_WRITE_LINE_MEMBER(flag_w); + using stm_delegate = device_delegate<void (uint8_t)>; + using opcode_delegate = device_delegate<void (uint16_t)>; + using int_delegate = device_delegate<uint8_t (offs_t)>; - uint8_t pa_r() const; + void dmar_w(int state); + void halt_w(int state); + void status_w(int state); + void flag_w(int state); + + uint8_t pa_r() const { return m_reg_PA[0]; } auto pa_changed_cb() { return m_pa_changed_func.bind(); } @@ -82,10 +86,13 @@ public: }; // Called at start of each memory access - auto stm_cb() { return m_stm_func.bind(); } + template <typename... T> void set_stm_cb(T &&... args) { m_stm_func.set(std::forward<T>(args)...); } // Tap into fetched opcodes - auto opcode_cb() { return m_opcode_func.bind(); } + template <typename... T> void set_opcode_cb(T &&... args) { m_opcode_func.set(std::forward<T>(args)...); } + + // Acknowledge interrupts + template <typename... T> void set_int_cb(T &&... args) { m_int_func.set(std::forward<T>(args)...); } protected: hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t addrwidth); @@ -157,8 +164,9 @@ protected: devcb_write8 m_pa_changed_func; uint8_t m_last_pa; - devcb_write16 m_opcode_func; - devcb_write8 m_stm_func; + opcode_delegate m_opcode_func; + stm_delegate m_stm_func; + int_delegate m_int_func; int m_icount; uint32_t m_addr_mask; @@ -194,14 +202,14 @@ protected: uint16_t m_reg_r26; // R26 register uint16_t m_reg_r27; // R27 register - address_space *m_program; + memory_access<22, 1, -1, ENDIANNESS_BIG>::cache m_cache; + memory_access<22, 1, -1, ENDIANNESS_BIG>::specific m_program; + memory_access< 6, 1, -1, ENDIANNESS_BIG>::specific m_io; private: address_space_config m_program_config; address_space_config m_io_config; - memory_access_cache<1, -1, ENDIANNESS_BIG> *m_cache; - address_space *m_io; uint32_t get_ea(uint16_t opcode); void do_add(uint16_t& addend1 , uint16_t addend2); |