diff options
Diffstat (limited to 'src/devices/bus/ti99x/990_tap.cpp')
-rw-r--r-- | src/devices/bus/ti99x/990_tap.cpp | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/devices/bus/ti99x/990_tap.cpp b/src/devices/bus/ti99x/990_tap.cpp index 917c736fe11..58f3619c101 100644 --- a/src/devices/bus/ti99x/990_tap.cpp +++ b/src/devices/bus/ti99x/990_tap.cpp @@ -33,6 +33,11 @@ #include "emu.h" #include "990_tap.h" +#include "imagedev/magtape.h" + +#include <algorithm> +#include <iterator> + enum { w0_offline = 0x8000, @@ -887,28 +892,20 @@ void tap_990_device::write(offs_t offset, uint16_t data, uint16_t mem_mask) } } -class ti990_tape_image_device : public device_t, - public device_image_interface +class ti990_tape_image_device : public magtape_image_device { public: // construction/destruction ti990_tape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // image-level overrides - virtual iodevice_t image_type() const noexcept override { return IO_MAGTAPE; } - - virtual bool is_readable() const noexcept override { return true; } - virtual bool is_writeable() const noexcept override { return true; } - virtual bool is_creatable() const noexcept override { return true; } - virtual bool must_be_loaded() const noexcept override { return false; } - virtual bool is_reset_on_load() const noexcept override { return false; } + // device_image_interface implementation virtual const char *file_extensions() const noexcept override { return "tap"; } - virtual image_init_result call_load() override; + virtual std::pair<std::error_condition, std::string> call_load() override; virtual void call_unload() override; protected: - // device-level overrides + // device_t implementation virtual void device_start() override; private: @@ -918,7 +915,7 @@ private: DEFINE_DEVICE_TYPE(TI990_TAPE, ti990_tape_image_device, "ti990_tape_image", "TI-990 Magnetic Tape") ti990_tape_image_device::ti990_tape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, TI990_TAPE, tag, owner, clock), device_image_interface(mconfig, *this) + : magtape_image_device(mconfig, TI990_TAPE, tag, owner, clock) { } @@ -941,12 +938,12 @@ int ti990_tape_image_device::tape_get_id() /* Open a tape image */ -image_init_result ti990_tape_image_device::call_load() +std::pair<std::error_condition, std::string> ti990_tape_image_device::call_load() { tap_990_device* tpc = downcast<tap_990_device*>(owner()); tpc->set_tape(tape_get_id(), this, true, false, is_readonly()); - return image_init_result::PASS; + return std::make_pair(std::error_condition(), std::string()); } /* @@ -974,8 +971,7 @@ tap_990_device::tap_990_device(const machine_config &mconfig, const char *tag, d void tap_990_device::device_start() { - m_int_line.resolve(); - memset(m_w, 0, sizeof(m_w)); + std::fill(std::begin(m_w), std::end(m_w), 0); // The PE bit is always set for the MT3200 (but not MT1600) // According to MT3200 manual, w7 bit #4 (reserved) is always set |