diff options
Diffstat (limited to 'src/devices/cpu/pdp1/pdp1.h')
-rw-r--r-- | src/devices/cpu/pdp1/pdp1.h | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/src/devices/cpu/pdp1/pdp1.h b/src/devices/cpu/pdp1/pdp1.h index 1c2d5c7eea3..f1a4e934236 100644 --- a/src/devices/cpu/pdp1/pdp1.h +++ b/src/devices/cpu/pdp1/pdp1.h @@ -20,20 +20,8 @@ enum }; -typedef void (*pdp1_extern_iot_func)(device_t *device, int op2, int nac, int mb, int *io, int ac); -typedef void (*pdp1_read_binary_word_func)(device_t *device); -typedef void (*pdp1_io_sc_func)(device_t *device); - - struct pdp1_reset_param_t { - /* callbacks for iot instructions (required for any I/O) */ - pdp1_extern_iot_func extern_iot[64]; - /* read a word from the perforated tape reader (required for read-in mode) */ - pdp1_read_binary_word_func read_binary_word; - /* callback called when sc is pulsed: IO devices should reset */ - pdp1_io_sc_func io_sc_callback; - /* 0: no extend support, 1: extend with 15-bit address, 2: extend with 16-bit address */ int extend_support; /* 1 to use hardware multiply/divide (MUL, DIV) instead of MUS, DIS */ @@ -45,10 +33,12 @@ struct pdp1_reset_param_t #define IOT_NO_COMPLETION_PULSE -1 -class pdp1_device : public cpu_device - , public pdp1_reset_param_t +class pdp1_device : public cpu_device, public pdp1_reset_param_t { public: + typedef device_delegate<void (int op2, int nac, int mb, int &io, int ac)> iot_delegate; + typedef device_delegate<void ()> io_sc_delegate; + enum opcode { AND = 001, @@ -83,14 +73,16 @@ public: // construction/destruction pdp1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + template <int I, typename... T> void set_iot_callback(T &&... args) { m_extern_iot[I].set(std::forward<T>(args)...); } + template <typename... T> void set_io_sc_callback(T &&... args) { m_io_sc_callback.set(std::forward<T>(args)...); } void set_reset_param(const pdp1_reset_param_t *param) { m_reset_param = param; } void pulse_start_clear(); void io_complete() { m_ios = 1; } - void pdp1_null_iot(int op2, int nac, int mb, int *io, int ac); - void pdp1_lem_eem_iot(int op2, int nac, int mb, int *io, int ac); - void pdp1_sbs_iot(int op2, int nac, int mb, int *io, int ac); - void pdp1_type_20_sbs_iot(int op2, int nac, int mb, int *io, int ac); + void null_iot(int op2, int nac, int mb, int &io, int ac); + void lem_eem_iot(int op2, int nac, int mb, int &io, int ac); + void sbs_iot(int op2, int nac, int mb, int &io, int ac); + void type_20_sbs_iot(int op2, int nac, int mb, int &io, int ac); protected: // device-level overrides @@ -167,11 +159,9 @@ private: int m_no_sequence_break; /* disable sequence break recognition for one cycle */ /* callbacks for iot instructions (required for any I/O) */ - pdp1_extern_iot_func m_extern_iot[64]; - /* read a word from the perforated tape reader (required for read-in mode) */ - pdp1_read_binary_word_func m_read_binary_word; + iot_delegate::array<64> m_extern_iot; /* callback called when sc is pulsed: IO devices should reset */ - pdp1_io_sc_func m_io_sc_callback; + io_sc_delegate m_io_sc_callback; /* 0: no extend support, 1: extend with 15-bit address, 2: extend with 16-bit address */ int m_extend_support; |