diff options
Diffstat (limited to 'src/emu/cpu/s2650')
-rw-r--r-- | src/emu/cpu/s2650/s2650.c | 7 | ||||
-rw-r--r-- | src/emu/cpu/s2650/s2650.h | 9 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/emu/cpu/s2650/s2650.c b/src/emu/cpu/s2650/s2650.c index 0d3325c8be2..02a8b495d79 100644 --- a/src/emu/cpu/s2650/s2650.c +++ b/src/emu/cpu/s2650/s2650.c @@ -34,7 +34,8 @@ const device_type S2650 = &device_creator<s2650_device>; s2650_device::s2650_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : cpu_device(mconfig, S2650, "S2650", tag, owner, clock, "s2650", __FILE__ ) , m_program_config("program", ENDIANNESS_LITTLE, 8, 15) - , m_io_config("io", ENDIANNESS_LITTLE, 8, 9) + , m_io_config("io", ENDIANNESS_LITTLE, 8, 9), + m_flag_handler(*this) { } @@ -151,7 +152,7 @@ inline void s2650_device::set_psu(UINT8 new_val) m_psu = new_val; if ((new_val ^ old) & FO) - m_io->write_byte(S2650_FO_PORT, (new_val & FO) ? 1 : 0); + m_flag_handler((new_val & FO) ? 1 : 0); } inline UINT8 s2650_device::get_sp() @@ -781,6 +782,8 @@ static void BRA_EA(void) _BRA_EA() void s2650_device::device_start() { + m_flag_handler.resolve_safe(); + m_program = &space(AS_PROGRAM); m_direct = &m_program->direct(); m_io = &space(AS_IO); diff --git a/src/emu/cpu/s2650/s2650.h b/src/emu/cpu/s2650/s2650.h index 1ba21d8fcc5..9137324ce11 100644 --- a/src/emu/cpu/s2650/s2650.h +++ b/src/emu/cpu/s2650/s2650.h @@ -18,13 +18,15 @@ enum S2650_CTRL_PORT = 0x0100, /* M/~IO=0 D/~C=0 E/~NE=0 */ S2650_DATA_PORT = 0x0101, /* M/~IO=0 D/~C=1 E/~NE=0 */ S2650_SENSE_PORT = 0x0102, /* Fake Sense Line */ - S2650_FO_PORT = 0x0103 /* Fake FO Line */ }; extern const device_type S2650; +#define MCFG_S2650_FLAG_HANDLER(_devcb) \ + devcb = &s2650_device::set_flag_handler(*device, DEVCB2_##_devcb); + class s2650_device : public cpu_device { public: @@ -33,6 +35,9 @@ public: DECLARE_WRITE_LINE_MEMBER(write_sense); + // static configuration helpers + template<class _Object> static devcb2_base &set_flag_handler(device_t &device, _Object object) { return downcast<s2650_device &>(device).m_flag_handler.set_callback(object); } + protected: // device-level overrides virtual void device_start(); @@ -66,6 +71,8 @@ private: address_space_config m_program_config; address_space_config m_io_config; + devcb2_write_line m_flag_handler; + UINT16 m_ppc; /* previous program counter (page + iar) */ UINT16 m_page; /* 8K page select register (A14..A13) */ UINT16 m_iar; /* instruction address register (A12..A0) */ |