diff options
Diffstat (limited to 'src/devices/imagedev')
31 files changed, 438 insertions, 88 deletions
diff --git a/src/devices/imagedev/avivideo.h b/src/devices/imagedev/avivideo.h index 7d4c1bc5fa7..0d1c4a26f2d 100644 --- a/src/devices/imagedev/avivideo.h +++ b/src/devices/imagedev/avivideo.h @@ -32,14 +32,14 @@ public: // image-level overrides virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_VIDEO; } virtual bool is_readable() const noexcept override { return true; } virtual bool is_writeable() const noexcept override { return false; } virtual bool is_creatable() const noexcept override { return false; } - virtual bool must_be_loaded() const noexcept override { return false; } virtual bool is_reset_on_load() const noexcept override { return false; } virtual const char *file_extensions() const noexcept override { return "avi"; } + virtual const char *image_type_name() const noexcept override { return "vidfile"; } + virtual const char *image_brief_type_name() const noexcept override { return "vid"; } bitmap_argb32 &get_frame() { return *m_frame; } diff --git a/src/devices/imagedev/bitbngr.h b/src/devices/imagedev/bitbngr.h index ad9e45e1d86..19cbea3bc09 100644 --- a/src/devices/imagedev/bitbngr.h +++ b/src/devices/imagedev/bitbngr.h @@ -25,16 +25,15 @@ public: virtual void call_unload() override; // image device - virtual iodevice_t image_type() const noexcept override { return IO_SERIAL; } virtual bool is_readable() const noexcept override { return true; } virtual bool is_writeable() const noexcept override { return !m_is_readonly; } virtual bool is_creatable() const noexcept override { return !m_is_readonly; } - virtual bool must_be_loaded() const noexcept override { return false; } virtual bool is_reset_on_load() const noexcept override { return false; } + virtual bool support_command_line_image_creation() const noexcept override { return !m_is_readonly; } virtual const char *image_interface() const noexcept override { return m_interface; } virtual const char *file_extensions() const noexcept override { return ""; } - virtual const char *custom_instance_name() const noexcept override { return "bitbanger"; } - virtual const char *custom_brief_instance_name() const noexcept override { return "bitb"; } + virtual const char *image_type_name() const noexcept override { return "bitbanger"; } + virtual const char *image_brief_type_name() const noexcept override { return "bitb"; } void output(uint8_t data); uint32_t input(void *buffer, uint32_t length); diff --git a/src/devices/imagedev/cartrom.cpp b/src/devices/imagedev/cartrom.cpp new file mode 100644 index 00000000000..7b357817bbe --- /dev/null +++ b/src/devices/imagedev/cartrom.cpp @@ -0,0 +1,30 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/********************************************************************* + + cartrom.cpp + + Base classes for ROM and cartridge ROM image devices. + +*********************************************************************/ + +#include "emu.h" +#include "cartrom.h" + +#include "softlist_dev.h" + + +device_rom_image_interface::device_rom_image_interface(const machine_config &mconfig, device_t &device) + : device_image_interface(mconfig, device) +{ +} + +device_cartrom_image_interface::device_cartrom_image_interface(const machine_config &mconfig, device_t &device) + : device_rom_image_interface(mconfig, device) +{ +} + +const software_list_loader &device_rom_image_interface::get_software_list_loader() const +{ + return rom_software_list_loader::instance(); +} diff --git a/src/devices/imagedev/cartrom.h b/src/devices/imagedev/cartrom.h new file mode 100644 index 00000000000..851f7238892 --- /dev/null +++ b/src/devices/imagedev/cartrom.h @@ -0,0 +1,55 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/********************************************************************* + + cartrom.h + + Base classes for ROM and cartridge ROM image devices. + +*********************************************************************/ + +#ifndef MAME_DEVICES_IMAGEDEV_CARTROM_H +#define MAME_DEVICES_IMAGEDEV_CARTROM_H + +#pragma once + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> device_rom_image_interface + +class device_rom_image_interface : public device_image_interface +{ +public: + // image-level overrides + virtual bool is_readable() const noexcept override { return true; } + virtual bool is_writeable() const noexcept override { return false; } + virtual bool is_creatable() const noexcept override { return false; } + virtual const char *image_type_name() const noexcept override { return "romimage"; } + virtual const char *image_brief_type_name() const noexcept override { return "rom"; } + +protected: + // construction/destruction + device_rom_image_interface(const machine_config &mconfig, device_t &device); + + // device_image_interface implementation + virtual const software_list_loader &get_software_list_loader() const override; +}; + +// ======================> device_cartrom_image_interface + +class device_cartrom_image_interface : public device_rom_image_interface +{ +public: + // image-level overrides + virtual const char *image_type_name() const noexcept override { return "cartridge"; } + virtual const char *image_brief_type_name() const noexcept override { return "cart"; } + +protected: + // construction/destruction + device_cartrom_image_interface(const machine_config &mconfig, device_t &device); +}; + +#endif // MAME_DEVICES_IMAGEDEV_CARTROM_H diff --git a/src/devices/imagedev/cassette.cpp b/src/devices/imagedev/cassette.cpp index 338f1ed7413..2bf7c2a4808 100644 --- a/src/devices/imagedev/cassette.cpp +++ b/src/devices/imagedev/cassette.cpp @@ -10,6 +10,7 @@ #include "emu.h" #include "cassette.h" +#include "softlist_dev.h" #include "formats/imageutl.h" @@ -242,6 +243,11 @@ void cassette_image_device::device_start() stream_alloc(0, m_stereo? 2:1, machine().sample_rate()); } +const software_list_loader &cassette_image_device::get_software_list_loader() const +{ + return image_software_list_loader::instance(); +} + image_init_result cassette_image_device::call_create(int format_type, util::option_resolution *format_options) { return internal_load(true); diff --git a/src/devices/imagedev/cassette.h b/src/devices/imagedev/cassette.h index 48e10cdbdb4..ad71e062e70 100644 --- a/src/devices/imagedev/cassette.h +++ b/src/devices/imagedev/cassette.h @@ -12,7 +12,6 @@ #define MAME_DEVICES_IMAGEDEV_CASSETTE_H #include "formats/cassimg.h" -#include "softlist_dev.h" enum cassette_state @@ -64,15 +63,14 @@ public: virtual void call_unload() override; virtual std::string call_display() override; - virtual iodevice_t image_type() const noexcept override { return IO_CASSETTE; } - 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; } virtual const char *image_interface() const noexcept override { return m_interface; } virtual const char *file_extensions() const noexcept override { return m_extension_list; } + virtual const char *image_type_name() const noexcept override { return "cassette"; } + virtual const char *image_brief_type_name() const noexcept override { return "cass"; } double input(); void output(double value); @@ -112,7 +110,7 @@ protected: virtual const bool use_software_list_file_extension_for_filetype() const override { return true; } // device_image_interface implementation - virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } + virtual const software_list_loader &get_software_list_loader() const override; void update(); diff --git a/src/devices/imagedev/chd_cd.h b/src/devices/imagedev/chd_cd.h index ade4b4d07d3..e93b7969c62 100644 --- a/src/devices/imagedev/chd_cd.h +++ b/src/devices/imagedev/chd_cd.h @@ -36,15 +36,14 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CDROM; } - virtual bool is_readable() const noexcept override { return true; } virtual bool is_writeable() const noexcept override { return false; } virtual bool is_creatable() const noexcept override { return false; } - virtual bool must_be_loaded() const noexcept override { return false; } virtual bool is_reset_on_load() const noexcept override { return false; } virtual const char *image_interface() const noexcept override { return m_interface; } virtual const char *file_extensions() const noexcept override { return m_extension_list; } + virtual const char *image_type_name() const noexcept override { return "cdrom"; } + virtual const char *image_brief_type_name() const noexcept override { return "cdrm"; } // specific implementation cdrom_file *get_cdrom_file() { return m_cdrom_handle; } diff --git a/src/devices/imagedev/diablo.cpp b/src/devices/imagedev/diablo.cpp index cdc7665f61d..d14c53ef7f2 100644 --- a/src/devices/imagedev/diablo.cpp +++ b/src/devices/imagedev/diablo.cpp @@ -34,8 +34,7 @@ DEFINE_DEVICE_TYPE(DIABLO, diablo_image_device, "diablo_image", "Diablo") //------------------------------------------------- diablo_image_device::diablo_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, DIABLO, tag, owner, clock), - device_image_interface(mconfig, *this), + : harddisk_image_base_device(mconfig, DIABLO, tag, owner, clock), m_chd(nullptr), m_hard_disk_handle(nullptr), m_device_image_load(*this), diff --git a/src/devices/imagedev/diablo.h b/src/devices/imagedev/diablo.h index c541573f5f5..14e3d9c2fc3 100644 --- a/src/devices/imagedev/diablo.h +++ b/src/devices/imagedev/diablo.h @@ -9,7 +9,7 @@ #pragma once -#include "harddisk.h" +#include "harddriv.h" #include "softlist_dev.h" #define DIABLO_TAG(id) "diablo"#id @@ -20,7 +20,7 @@ // ======================> diablo_image_device -class diablo_image_device : public device_t, public device_image_interface +class diablo_image_device : public harddisk_image_base_device { public: // construction/destruction @@ -36,13 +36,7 @@ public: virtual image_init_result call_create(int create_format, util::option_resolution *create_args) override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_HARDDISK; } - - 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 false; } - virtual bool must_be_loaded() const noexcept override { return false; } - virtual bool is_reset_on_load() const noexcept override { return false; } + virtual bool image_is_chd_type() const noexcept override { return true; } virtual const char *image_interface() const noexcept override { return m_interface; } virtual const char *file_extensions() const noexcept override { return "chd,dsk"; } virtual const util::option_guide &create_option_guide() const override; diff --git a/src/devices/imagedev/flopdrv.cpp b/src/devices/imagedev/flopdrv.cpp index 1188519d648..50214966b42 100644 --- a/src/devices/imagedev/flopdrv.cpp +++ b/src/devices/imagedev/flopdrv.cpp @@ -15,6 +15,7 @@ #include "emu.h" #include "flopdrv.h" +#include "softlist_dev.h" #include "formats/imageutl.h" @@ -719,6 +720,11 @@ void legacy_floppy_image_device::device_config_complete() } } +const software_list_loader &legacy_floppy_image_device::get_software_list_loader() const +{ + return image_software_list_loader::instance(); +} + image_init_result legacy_floppy_image_device::call_create(int format_type, util::option_resolution *format_options) { return internal_floppy_device_load(true, format_type, format_options); diff --git a/src/devices/imagedev/flopdrv.h b/src/devices/imagedev/flopdrv.h index 43e3497445e..7582d156285 100644 --- a/src/devices/imagedev/flopdrv.h +++ b/src/devices/imagedev/flopdrv.h @@ -8,7 +8,6 @@ #pragma once #include "formats/flopimg_legacy.h" -#include "softlist_dev.h" #define FLOPPY_TYPE_REGULAR 0 #define FLOPPY_TYPE_APPLE 1 @@ -107,15 +106,14 @@ public: virtual image_init_result call_create(int format_type, util::option_resolution *format_options) override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_FLOPPY; } - 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; - virtual bool must_be_loaded() const noexcept override { return false; } virtual bool is_reset_on_load() const noexcept override { return false; } virtual const char *image_interface() const noexcept override; virtual const char *file_extensions() const noexcept override { return m_extension_list; } + virtual const char *image_type_name() const noexcept override { return "floppydisk"; } + virtual const char *image_brief_type_name() const noexcept override { return "flop"; } virtual const util::option_guide &create_option_guide() const override { return floppy_option_guide(); } floppy_image_legacy *flopimg_get_image(); @@ -172,7 +170,7 @@ protected: virtual void device_start() override; // device_image_interface implementation - virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } + virtual const software_list_loader &get_software_list_loader() const override; /* callbacks */ devcb_write_line m_out_idx_func; diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp index 0d8d75b9279..180e736fea6 100644 --- a/src/devices/imagedev/floppy.cpp +++ b/src/devices/imagedev/floppy.cpp @@ -24,7 +24,7 @@ #include "formats/fs_unformatted.h" #include "formats/fsblk_vec.h" -#include "screen.h" +#include "softlist_dev.h" #include "speaker.h" #include "formats/imageutl.h" @@ -428,6 +428,11 @@ void floppy_image_device::device_config_complete() register_formats(); } +const software_list_loader &floppy_image_device::get_software_list_loader() const +{ + return image_software_list_loader::instance(); +} + //------------------------------------------------- // device_start - device-specific startup diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h index fe878bf6d2d..b68c7327f1d 100644 --- a/src/devices/imagedev/floppy.h +++ b/src/devices/imagedev/floppy.h @@ -14,7 +14,6 @@ #include "formats/flopimg.h" #include "formats/fsmgr.h" #include "sound/samples.h" -#include "softlist_dev.h" #include "screen.h" class floppy_sound_device; @@ -94,14 +93,14 @@ public: virtual void call_unload() override; virtual image_init_result call_create(int format_type, util::option_resolution *format_options) override; virtual const char *image_interface() const noexcept override = 0; - virtual iodevice_t image_type() const noexcept override { return IO_FLOPPY; } 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; } virtual const char *file_extensions() const noexcept override { return extension_list; } + virtual const char *image_type_name() const noexcept override { return "floppydisk"; } + virtual const char *image_brief_type_name() const noexcept override { return "flop"; } void setup_write(floppy_image_format_t *output_format); void setup_load_cb(load_cb cb); @@ -176,7 +175,7 @@ protected: virtual void device_add_mconfig(machine_config &config) override; // device_image_interface implementation - virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } + virtual const software_list_loader &get_software_list_loader() const override; virtual void track_changed(); virtual void setup_characteristics() = 0; diff --git a/src/devices/imagedev/harddriv.cpp b/src/devices/imagedev/harddriv.cpp index ff623d58150..f06f464f8b4 100644 --- a/src/devices/imagedev/harddriv.cpp +++ b/src/devices/imagedev/harddriv.cpp @@ -39,6 +39,16 @@ static char const *const hd_option_spec = DEFINE_DEVICE_TYPE(HARDDISK, harddisk_image_device, "harddisk_image", "Harddisk") //------------------------------------------------- +// harddisk_image_base_device - constructor +//------------------------------------------------- + +harddisk_image_base_device::harddisk_image_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, type, tag, owner, clock), + device_image_interface(mconfig, *this) +{ +} + +//------------------------------------------------- // harddisk_image_device - constructor //------------------------------------------------- @@ -50,9 +60,9 @@ harddisk_image_device::harddisk_image_device(const machine_config &mconfig, cons //------------------------------------------------- // harddisk_image_device - constructor for subclasses //------------------------------------------------- + harddisk_image_device::harddisk_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, type, tag, owner, clock), - device_image_interface(mconfig, *this), + : harddisk_image_base_device(mconfig, type, tag, owner, clock), m_chd(nullptr), m_hard_disk_handle(nullptr), m_device_image_load(*this), diff --git a/src/devices/imagedev/harddriv.h b/src/devices/imagedev/harddriv.h index 032d449ad68..93eb4e3c19f 100644 --- a/src/devices/imagedev/harddriv.h +++ b/src/devices/imagedev/harddriv.h @@ -18,10 +18,26 @@ TYPE DEFINITIONS ***************************************************************************/ +// ======================> harddisk_image_base_device + +class harddisk_image_base_device : public device_t, public device_image_interface +{ +protected: + // construction/destruction + harddisk_image_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + // image-level overrides + 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 false; } + virtual bool is_reset_on_load() const noexcept override { return false; } + virtual const char *image_type_name() const noexcept override { return "harddisk"; } + virtual const char *image_brief_type_name() const noexcept override { return "hard"; } +}; + // ======================> harddisk_image_device -class harddisk_image_device : public device_t, - public device_image_interface +class harddisk_image_device : public harddisk_image_base_device { public: // construction/destruction @@ -42,13 +58,7 @@ public: virtual image_init_result call_create(int create_format, util::option_resolution *create_args) override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_HARDDISK; } - - virtual bool is_readable() const noexcept override { return 1; } - virtual bool is_writeable() const noexcept override { return 1; } - virtual bool is_creatable() const noexcept override { return 0; } - virtual bool must_be_loaded() const noexcept override { return 0; } - virtual bool is_reset_on_load() const noexcept override { return 0; } + virtual bool image_is_chd_type() const noexcept override { return true; } virtual const char *image_interface() const noexcept override { return m_interface; } virtual const char *file_extensions() const noexcept override { return "chd,hd,hdv,2mg,hdi"; } virtual const util::option_guide &create_option_guide() const override; diff --git a/src/devices/imagedev/magtape.cpp b/src/devices/imagedev/magtape.cpp new file mode 100644 index 00000000000..dd1754ff4e3 --- /dev/null +++ b/src/devices/imagedev/magtape.cpp @@ -0,0 +1,35 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/********************************************************************* + + magtape.cpp + + Base classes for magnetic tape image devices. + + TODO: figure out how to best differentiate actual devices. + Perhaps multiple microtape types should be completely split from + both each other and 7-track/9-track magnetic tape? + +*********************************************************************/ + +#include "emu.h" +#include "magtape.h" + +#include "softlist_dev.h" + + +magtape_image_device::magtape_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, type, tag, owner, clock) + , device_image_interface(mconfig, *this) +{ +} + +microtape_image_device::microtape_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : magtape_image_device(mconfig, type, tag, owner, clock) +{ +} + +const software_list_loader &magtape_image_device::get_software_list_loader() const +{ + return image_software_list_loader::instance(); +} diff --git a/src/devices/imagedev/magtape.h b/src/devices/imagedev/magtape.h new file mode 100644 index 00000000000..5834573240c --- /dev/null +++ b/src/devices/imagedev/magtape.h @@ -0,0 +1,55 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/********************************************************************* + + magtape.h + + Base classes for magnetic tape image devices. + +*********************************************************************/ + +#ifndef MAME_DEVICES_IMAGEDEV_MAGTAPE_H +#define MAME_DEVICES_IMAGEDEV_MAGTAPE_H + +#pragma once + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> magtape_image_device + +class magtape_image_device : public device_t, public device_image_interface +{ +public: + // image-level overrides + 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 is_reset_on_load() const noexcept override { return false; } + virtual const char *image_type_name() const noexcept override { return "magtape"; } + virtual const char *image_brief_type_name() const noexcept override { return "mtap"; } + +protected: + // construction/destruction + magtape_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + // device_image_interface implementation + virtual const software_list_loader &get_software_list_loader() const override; +}; + +// ======================> microtape_image_device + +class microtape_image_device : public magtape_image_device +{ +protected: + // construction/destruction + microtape_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + // image-level overrides + virtual const char *image_type_name() const noexcept override { return "microtape"; } + virtual const char *image_brief_type_name() const noexcept override { return "utap"; } +}; + +#endif // MAME_DEVICES_IMAGEDEV_MAGTAPE_H diff --git a/src/devices/imagedev/memcard.cpp b/src/devices/imagedev/memcard.cpp new file mode 100644 index 00000000000..a01a2375a12 --- /dev/null +++ b/src/devices/imagedev/memcard.cpp @@ -0,0 +1,18 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/********************************************************************* + + memcard.cpp + + Base class for memory card image devices. + +*********************************************************************/ + +#include "emu.h" +#include "memcard.h" + + +device_memcard_image_interface::device_memcard_image_interface(const machine_config &mconfig, device_t &device) + : device_image_interface(mconfig, device) +{ +} diff --git a/src/devices/imagedev/memcard.h b/src/devices/imagedev/memcard.h new file mode 100644 index 00000000000..33ff6a4a62d --- /dev/null +++ b/src/devices/imagedev/memcard.h @@ -0,0 +1,38 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/********************************************************************* + + memcard.h + + Base class for memory card image devices. + +*********************************************************************/ + +#ifndef MAME_DEVICES_IMAGEDEV_MEMCARD_H +#define MAME_DEVICES_IMAGEDEV_MEMCARD_H + +#pragma once + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> device_memcard_image_interface + +class device_memcard_image_interface : public device_image_interface +{ +public: + // image-level overrides + 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 const char *image_type_name() const noexcept override { return "memcard"; } + virtual const char *image_brief_type_name() const noexcept override { return "memc"; } + +protected: + // construction/destruction + device_memcard_image_interface(const machine_config &mconfig, device_t &device); +}; + +#endif // MAME_DEVICES_IMAGEDEV_MEMCARD_H diff --git a/src/devices/imagedev/microdrv.cpp b/src/devices/imagedev/microdrv.cpp index 854b8d55197..000cca82b78 100644 --- a/src/devices/imagedev/microdrv.cpp +++ b/src/devices/imagedev/microdrv.cpp @@ -46,8 +46,7 @@ DEFINE_DEVICE_TYPE(MICRODRIVE, microdrive_image_device, "microdrive_image", "Sin //------------------------------------------------- microdrive_image_device::microdrive_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, MICRODRIVE, tag, owner, clock), - device_image_interface(mconfig, *this), + microtape_image_device(mconfig, MICRODRIVE, tag, owner, clock), m_write_comms_out(*this) { } diff --git a/src/devices/imagedev/microdrv.h b/src/devices/imagedev/microdrv.h index d43daba70fb..09b0cd193fd 100644 --- a/src/devices/imagedev/microdrv.h +++ b/src/devices/imagedev/microdrv.h @@ -13,7 +13,7 @@ #pragma once -#include "softlist_dev.h" +#include "magtape.h" //************************************************************************** @@ -30,8 +30,7 @@ // ======================> microdrive_image_device -class microdrive_image_device : public device_t, - public device_image_interface +class microdrive_image_device : public microtape_image_device { public: // construction/destruction @@ -44,13 +43,7 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - 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 false; } - virtual bool must_be_loaded() const noexcept override { return false; } - virtual bool is_reset_on_load() const noexcept override { return false; } virtual const char *image_interface() const noexcept override { return "ql_cass"; } virtual const char *file_extensions() const noexcept override { return "mdv,mdr"; } @@ -69,9 +62,6 @@ protected: virtual void device_start() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - // device_image_interface implementation - virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } - private: devcb_write_line m_write_comms_out; diff --git a/src/devices/imagedev/midiin.h b/src/devices/imagedev/midiin.h index 70bc5987637..40fe70b3ef6 100644 --- a/src/devices/imagedev/midiin.h +++ b/src/devices/imagedev/midiin.h @@ -35,14 +35,14 @@ public: virtual void call_unload() override; // image device - virtual iodevice_t image_type() const noexcept override { return IO_MIDIIN; } virtual bool is_readable() const noexcept override { return true; } virtual bool is_writeable() const noexcept override { return false; } virtual bool is_creatable() const noexcept override { return false; } - virtual bool must_be_loaded() const noexcept override { return false; } virtual bool is_reset_on_load() const noexcept override { return false; } virtual const char *file_extensions() const noexcept override { return "mid"; } virtual bool core_opens_image_file() const noexcept override { return false; } + virtual const char *image_type_name() const noexcept override { return "midiin"; } + virtual const char *image_brief_type_name() const noexcept override { return "min"; } protected: // device-level overrides diff --git a/src/devices/imagedev/midiout.h b/src/devices/imagedev/midiout.h index aaba05de929..0701c9b3d83 100644 --- a/src/devices/imagedev/midiout.h +++ b/src/devices/imagedev/midiout.h @@ -33,14 +33,14 @@ public: virtual void call_unload() override; // image device - virtual iodevice_t image_type() const noexcept override { return IO_MIDIOUT; } virtual bool is_readable() const noexcept override { return false; } virtual bool is_writeable() const noexcept override { return true; } virtual bool is_creatable() const noexcept override { return false; } - virtual bool must_be_loaded() const noexcept override { return false; } virtual bool is_reset_on_load() const noexcept override { return false; } virtual const char *file_extensions() const noexcept override { return "mid"; } virtual bool core_opens_image_file() const noexcept override { return false; } + virtual const char *image_type_name() const noexcept override { return "midiout"; } + virtual const char *image_brief_type_name() const noexcept override { return "mout"; } virtual void tx(uint8_t state) { rx_w(state); } diff --git a/src/devices/imagedev/papertape.cpp b/src/devices/imagedev/papertape.cpp new file mode 100644 index 00000000000..f8cea6b2996 --- /dev/null +++ b/src/devices/imagedev/papertape.cpp @@ -0,0 +1,38 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/********************************************************************* + + papertape.cpp + + Base classes for paper tape reader and punch devices. + + TODO: move some actual implementation here + +*********************************************************************/ + +#include "emu.h" +#include "papertape.h" + +#include "softlist_dev.h" + + +paper_tape_image_device::paper_tape_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, type, tag, owner, clock) + , device_image_interface(mconfig, *this) +{ +} + +paper_tape_reader_device::paper_tape_reader_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : paper_tape_image_device(mconfig, type, tag, owner, clock) +{ +} + +paper_tape_punch_device::paper_tape_punch_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : paper_tape_image_device(mconfig, type, tag, owner, clock) +{ +} + +const software_list_loader &paper_tape_reader_device::get_software_list_loader() const +{ + return image_software_list_loader::instance(); +} diff --git a/src/devices/imagedev/papertape.h b/src/devices/imagedev/papertape.h new file mode 100644 index 00000000000..a0fa6b9cada --- /dev/null +++ b/src/devices/imagedev/papertape.h @@ -0,0 +1,71 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/********************************************************************* + + papertape.h + + Base classes for paper tape reader and punch devices. + +*********************************************************************/ + +#ifndef MAME_DEVICES_IMAGEDEV_PAPERTAPE_H +#define MAME_DEVICES_IMAGEDEV_PAPERTAPE_H + +#pragma once + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> paper_tape_image_device + +class paper_tape_image_device : public device_t, public device_image_interface +{ +public: + // image-level overrides + virtual const char *image_type_name() const noexcept override { return "punchtape"; } + virtual const char *image_brief_type_name() const noexcept override { return "ptap"; } + +protected: + // construction/destruction + paper_tape_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); +}; + +// ======================> paper_tape_reader_device + +class paper_tape_reader_device : public paper_tape_image_device +{ +public: + // image-level overrides + virtual bool is_readable() const noexcept override { return true; } + virtual bool is_writeable() const noexcept override { return false; } + virtual bool is_creatable() const noexcept override { return false; } + virtual bool is_reset_on_load() const noexcept override { return false; } + +protected: + // construction/destruction + paper_tape_reader_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + + // device_image_interface implementation + virtual const software_list_loader &get_software_list_loader() const override; +}; + +// ======================> paper_tape_punch_device + +class paper_tape_punch_device : public paper_tape_image_device +{ +public: + // image-level overrides + virtual bool is_readable() const noexcept override { return false; } + virtual bool is_writeable() const noexcept override { return true; } + virtual bool is_creatable() const noexcept override { return true; } + virtual bool is_reset_on_load() const noexcept override { return false; } + virtual bool support_command_line_image_creation() const noexcept override { return true; } + +protected: + // construction/destruction + paper_tape_punch_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); +}; + +#endif // MAME_DEVICES_IMAGEDEV_PAPERTAPE_H diff --git a/src/devices/imagedev/picture.h b/src/devices/imagedev/picture.h index 1780a563318..23fa72d686a 100644 --- a/src/devices/imagedev/picture.h +++ b/src/devices/imagedev/picture.h @@ -32,14 +32,14 @@ public: // image-level overrides virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_PICTURE; } virtual bool is_readable() const noexcept override { return true; } virtual bool is_writeable() const noexcept override { return false; } virtual bool is_creatable() const noexcept override { return false; } - virtual bool must_be_loaded() const noexcept override { return false; } virtual bool is_reset_on_load() const noexcept override { return false; } virtual const char *file_extensions() const noexcept override { return "png"; } + virtual const char *image_type_name() const noexcept override { return "picture"; } + virtual const char *image_brief_type_name() const noexcept override { return "pic"; } const bitmap_argb32 &get_bitmap() { return m_picture; } diff --git a/src/devices/imagedev/printer.h b/src/devices/imagedev/printer.h index 84f3efb4002..509ecc43ef2 100644 --- a/src/devices/imagedev/printer.h +++ b/src/devices/imagedev/printer.h @@ -35,13 +35,13 @@ public: virtual void call_unload() override; // image device - virtual iodevice_t image_type() const noexcept override { return IO_PRINTER; } virtual bool is_readable() const noexcept override { return false; } 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; } virtual const char *file_extensions() const noexcept override { return "prn"; } + virtual const char *image_type_name() const noexcept override { return "printout"; } + virtual const char *image_brief_type_name() const noexcept override { return "prin"; } // specific implementation diff --git a/src/devices/imagedev/snapquik.cpp b/src/devices/imagedev/snapquik.cpp index 4ac355f6cf4..1940fc7a834 100644 --- a/src/devices/imagedev/snapquik.cpp +++ b/src/devices/imagedev/snapquik.cpp @@ -11,6 +11,8 @@ #include "emu.h" #include "snapquik.h" +#include "softlist_dev.h" + // device type definition DEFINE_DEVICE_TYPE(SNAPSHOT, snapshot_image_device, "snapsot_image", "Snapshot") @@ -47,6 +49,8 @@ snapshot_image_device::~snapshot_image_device() TIMER_CALLBACK_MEMBER(snapshot_image_device::process_snapshot_or_quickload) { + check_for_file(); + /* invoke the load */ m_load(*this); } @@ -73,6 +77,12 @@ image_init_result snapshot_image_device::call_load() return image_init_result::PASS; } +const software_list_loader &snapshot_image_device::get_software_list_loader() const +{ + return image_software_list_loader::instance(); +} + + // device type definition DEFINE_DEVICE_TYPE(QUICKLOAD, quickload_image_device, "quickload", "Quickload") diff --git a/src/devices/imagedev/snapquik.h b/src/devices/imagedev/snapquik.h index c51e464ed7e..f312e4d4f39 100644 --- a/src/devices/imagedev/snapquik.h +++ b/src/devices/imagedev/snapquik.h @@ -13,8 +13,6 @@ #pragma once -#include "softlist_dev.h" - // ======================> snapshot_image_device class snapshot_image_device : public device_t, public device_image_interface @@ -36,15 +34,15 @@ public: // image-level overrides virtual image_init_result call_load() override; - virtual iodevice_t image_type() const noexcept override { return IO_SNAPSHOT; } virtual bool is_readable() const noexcept override { return true; } virtual bool is_writeable() const noexcept override { return false; } virtual bool is_creatable() const noexcept override { return false; } - virtual bool must_be_loaded() const noexcept override { return false; } virtual bool is_reset_on_load() const noexcept override { return false; } virtual const char *image_interface() const noexcept override { return m_interface; } virtual const char *file_extensions() const noexcept override { return m_file_extensions; } + virtual const char *image_type_name() const noexcept override { return "snapshot"; } + virtual const char *image_brief_type_name() const noexcept override { return "dump"; } void set_extensions(const char *ext) { m_file_extensions = ext; } void set_delay(attotime delay) { m_delay = delay; } @@ -57,7 +55,7 @@ protected: virtual void device_start() override; // device_image_interface implementation - virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } + virtual const software_list_loader &get_software_list_loader() const override; TIMER_CALLBACK_MEMBER(process_snapshot_or_quickload); @@ -85,7 +83,8 @@ public: } quickload_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0U); - virtual iodevice_t image_type() const noexcept override { return IO_QUICKLOAD; } + virtual const char *image_type_name() const noexcept override { return "quickload"; } + virtual const char *image_brief_type_name() const noexcept override { return "quik"; } }; // device type definition diff --git a/src/devices/imagedev/wafadrive.cpp b/src/devices/imagedev/wafadrive.cpp index 658e845cb74..237e809075b 100644 --- a/src/devices/imagedev/wafadrive.cpp +++ b/src/devices/imagedev/wafadrive.cpp @@ -24,8 +24,7 @@ DEFINE_DEVICE_TYPE(WAFADRIVE_IMAGE, wafadrive_image_device, "wafadrive_image", " //------------------------------------------------- wafadrive_image_device::wafadrive_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, WAFADRIVE_IMAGE, tag, owner, clock), - device_image_interface(mconfig, *this) + microtape_image_device(mconfig, WAFADRIVE_IMAGE, tag, owner, clock) { } diff --git a/src/devices/imagedev/wafadrive.h b/src/devices/imagedev/wafadrive.h index ee1c70acd0b..532288dcba9 100644 --- a/src/devices/imagedev/wafadrive.h +++ b/src/devices/imagedev/wafadrive.h @@ -12,7 +12,7 @@ #ifndef MAME_DEVICES_IMAGEDEV_WAFADRIVE_H #define MAME_DEVICES_IMAGEDEV_WAFADRIVE_H -#include "softlist_dev.h" +#include "magtape.h" #pragma once @@ -22,8 +22,7 @@ // ======================> microdrive_image_device -class wafadrive_image_device : public device_t, - public device_image_interface +class wafadrive_image_device : public microtape_image_device { public: // construction/destruction @@ -34,22 +33,13 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_MAGTAPE; } // what are these classed as? they're infinite loop tapes, in a cartridge shell that operate like discs - - 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 false; } // should be (although would need a way to specify size) - virtual bool must_be_loaded() const noexcept override { return false; } - virtual bool is_reset_on_load() const noexcept override { return false; } virtual const char *image_interface() const noexcept override { return "wafadrive_cart"; } virtual const char *file_extensions() const noexcept override { return "wdr"; } protected: // device-level overrides virtual void device_start() override; - - // device_image_interface implementation - virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } }; |