diff options
Diffstat (limited to 'src/devices/bus/ti99x/990_tap.h')
-rw-r--r-- | src/devices/bus/ti99x/990_tap.h | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/devices/bus/ti99x/990_tap.h b/src/devices/bus/ti99x/990_tap.h index 887cfd4bab6..9b256156ca2 100644 --- a/src/devices/bus/ti99x/990_tap.h +++ b/src/devices/bus/ti99x/990_tap.h @@ -3,25 +3,20 @@ /* 990_tap.h: include file for 990_tap.c */ +#ifndef MAME_BUS_TI99X_990_TAP_H +#define MAME_BUS_TI99X_990_TAP_H -extern const device_type TI990_TAPE_CTRL; -#define MAX_TAPE_UNIT 4 +#pragma once -struct tape_unit_t -{ - device_image_interface *img; // image descriptor - bool bot; // true if we are at the beginning of tape - bool eot; // true if we are at the end of tape - bool wp; // true if tape is write-protected -}; +DECLARE_DEVICE_TYPE(TI990_TAPE_CTRL, tap_990_device) class tap_990_device : public device_t { public: tap_990_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template<class _Object> static devcb_base &static_set_int_callback(device_t &device, _Object object) + template <class Object> static devcb_base &static_set_int_callback(device_t &device, Object &&cb) { - return downcast<tap_990_device &>(device).m_int_line.set_callback(object); + return downcast<tap_990_device &>(device).m_int_line.set_callback(std::forward<Object>(cb)); } DECLARE_READ16_MEMBER( read ); @@ -41,6 +36,16 @@ protected: virtual machine_config_constructor device_mconfig_additions() const override; private: + static constexpr unsigned MAX_TAPE_UNIT = 4; + + struct tape_unit_t + { + device_image_interface *img; // image descriptor + bool bot; // true if we are at the beginning of tape + bool eot; // true if we are at the end of tape + bool wp; // true if tape is write-protected + }; + int cur_tape_unit(); void update_interrupt(); void cmd_read_binary_forward(); @@ -60,3 +65,5 @@ private: #define MCFG_TI990_TAPE_INT_HANDLER( _intcallb ) \ devcb = &tap_990_device::static_set_int_callback( *device, DEVCB_##_intcallb ); + +#endif // MAME_BUS_TI99X_990_TAP_H |