From 23bbd37da65e7d9783b8fa697039fa85257fa6de Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 6 Jan 2022 20:59:02 -0500 Subject: [PATCH] device_image_interface: Interface overhaul - Remove the iodevice_t classification, which was not used that much and was incomplete anyway. Image device implementations must now provide their own instance names and brief instance names. Several new parent classes have been created to make it easier to use the old standard names. - Change must_be_loaded from a pure virtual function to be overridden in implementations to a getter for a base class property that can be set on the host side (as was formerly made possible for NES, MD and "generic" cartridge slots) but defaults to false for all types. This restrictive property has been unset for a small number of cases. - Create parent classes for paper tape and magnetic tape devices. At present these are dummy classes that do little to nothing, but may help unify implementations in the future. - Change several member functions to take std::string_view parameters rather than const std::string & or const char *. - Make update_names take into account brief names, as discussed in PR #2555. - Remove the obsolete uses_file_extension function (which used thread-unsafe strtok). * portfolio_ccm_slot: Change image type from "cartridge" to "memcard" * i7220, datapack: Add custom instance names that weren't there before * pc11: Add note --- scripts/src/machine.lua | 8 + src/devices/bus/a7800/a78_slot.cpp | 2 +- src/devices/bus/a7800/a78_slot.h | 12 +- src/devices/bus/a800/a800_slot.cpp | 2 +- src/devices/bus/a800/a800_slot.h | 12 +- src/devices/bus/adam/exp.cpp | 2 +- src/devices/bus/adam/exp.h | 11 +- src/devices/bus/apf/slot.cpp | 2 +- src/devices/bus/apf/slot.h | 11 +- src/devices/bus/aquarius/slot.cpp | 2 +- src/devices/bus/aquarius/slot.h | 12 +- src/devices/bus/arcadia/slot.cpp | 2 +- src/devices/bus/arcadia/slot.h | 12 +- src/devices/bus/astrocde/slot.cpp | 2 +- src/devices/bus/astrocde/slot.h | 10 +- src/devices/bus/bbc/rom/slot.cpp | 2 +- src/devices/bus/bbc/rom/slot.h | 12 +- src/devices/bus/c64/exp.cpp | 2 +- src/devices/bus/c64/exp.h | 11 +- src/devices/bus/cbm2/exp.cpp | 2 +- src/devices/bus/cbm2/exp.h | 11 +- src/devices/bus/chanf/slot.cpp | 2 +- src/devices/bus/chanf/slot.h | 12 +- src/devices/bus/coco/cococart.cpp | 2 +- src/devices/bus/coco/cococart.h | 11 +- src/devices/bus/coleco/cartridge/exp.cpp | 2 +- src/devices/bus/coleco/cartridge/exp.h | 11 +- src/devices/bus/cpc/cpc_rom.cpp | 2 +- src/devices/bus/cpc/cpc_rom.h | 9 +- src/devices/bus/crvision/slot.cpp | 2 +- src/devices/bus/crvision/slot.h | 12 +- src/devices/bus/ekara/slot.cpp | 2 +- src/devices/bus/ekara/slot.h | 12 +- src/devices/bus/electron/cart/slot.cpp | 2 +- src/devices/bus/electron/cart/slot.h | 11 +- src/devices/bus/gamate/slot.cpp | 2 +- src/devices/bus/gamate/slot.h | 12 +- src/devices/bus/gameboy/gb_slot.cpp | 2 +- src/devices/bus/gameboy/gb_slot.h | 12 +- src/devices/bus/gba/gba_slot.cpp | 2 +- src/devices/bus/gba/gba_slot.h | 12 +- src/devices/bus/generic/slot.cpp | 3 +- src/devices/bus/generic/slot.h | 20 +-- src/devices/bus/ieee488/grid2102.h | 8 +- src/devices/bus/intellec4/insdatastor.cpp | 6 +- src/devices/bus/intellec4/prommemory.cpp | 6 +- src/devices/bus/intellec4/tapereader.cpp | 16 +- src/devices/bus/intv/slot.cpp | 2 +- src/devices/bus/intv/slot.h | 12 +- src/devices/bus/iq151/iq151.cpp | 2 +- src/devices/bus/iq151/iq151.h | 12 +- src/devices/bus/isa/omti8621.cpp | 18 +- src/devices/bus/isa/sc499.cpp | 3 +- src/devices/bus/isa/sc499.h | 17 +- src/devices/bus/jakks_gamekey/slot.cpp | 2 +- src/devices/bus/jakks_gamekey/slot.h | 12 +- src/devices/bus/kc/kc.cpp | 2 +- src/devices/bus/kc/kc.h | 13 +- src/devices/bus/m5/slot.cpp | 2 +- src/devices/bus/m5/slot.h | 12 +- src/devices/bus/mc10/mc10_cart.cpp | 2 +- src/devices/bus/mc10/mc10_cart.h | 11 +- src/devices/bus/megadrive/md_slot.cpp | 5 +- src/devices/bus/megadrive/md_slot.h | 15 +- src/devices/bus/msx_slot/cartridge.cpp | 2 +- src/devices/bus/msx_slot/cartridge.h | 18 +- src/devices/bus/neogeo/slot.cpp | 2 +- src/devices/bus/neogeo/slot.h | 12 +- src/devices/bus/nes/aladdin.cpp | 2 +- src/devices/bus/nes/aladdin.h | 12 +- src/devices/bus/nes/datach.cpp | 2 +- src/devices/bus/nes/datach.h | 12 +- src/devices/bus/nes/karastudio.cpp | 2 +- src/devices/bus/nes/karastudio.h | 12 +- src/devices/bus/nes/nes_slot.cpp | 3 +- src/devices/bus/nes/nes_slot.h | 15 +- src/devices/bus/nes/sunsoft_dcs.cpp | 2 +- src/devices/bus/nes/sunsoft_dcs.h | 12 +- src/devices/bus/nubus/nubus_image.cpp | 7 +- src/devices/bus/odyssey2/slot.cpp | 2 +- src/devices/bus/odyssey2/slot.h | 12 +- src/devices/bus/pce/pce_slot.cpp | 2 +- src/devices/bus/pce/pce_slot.h | 12 +- src/devices/bus/plus4/exp.cpp | 2 +- src/devices/bus/plus4/exp.h | 11 +- src/devices/bus/pofo/ccm.cpp | 14 +- src/devices/bus/pofo/ccm.h | 12 +- src/devices/bus/psx/memcard.cpp | 2 +- src/devices/bus/psx/memcard.h | 10 +- src/devices/bus/qbus/pc11.cpp | 5 +- src/devices/bus/qbus/pc11.h | 13 +- src/devices/bus/ql/rom.cpp | 3 +- src/devices/bus/ql/rom.h | 11 +- src/devices/bus/saturn/sat_slot.cpp | 2 +- src/devices/bus/saturn/sat_slot.h | 12 +- src/devices/bus/scv/slot.cpp | 2 +- src/devices/bus/scv/slot.h | 12 +- src/devices/bus/sdk85/memexp.cpp | 2 +- src/devices/bus/sdk85/memexp.h | 11 +- src/devices/bus/sega8/sega8_slot.cpp | 2 +- src/devices/bus/sega8/sega8_slot.h | 25 +-- src/devices/bus/snes/snes_slot.cpp | 2 +- src/devices/bus/snes/snes_slot.h | 14 +- src/devices/bus/ti99/gromport/cartridges.cpp | 2 +- src/devices/bus/ti99/gromport/cartridges.h | 10 +- src/devices/bus/ti99/peb/ti_rs232.h | 10 +- src/devices/bus/ti99x/990_tap.cpp | 14 +- src/devices/bus/vboy/slot.cpp | 2 +- src/devices/bus/vboy/slot.h | 12 +- src/devices/bus/vc4000/slot.cpp | 2 +- src/devices/bus/vc4000/slot.h | 12 +- src/devices/bus/vcs/vcs_slot.cpp | 2 +- src/devices/bus/vcs/vcs_slot.h | 12 +- src/devices/bus/vectrex/slot.cpp | 2 +- src/devices/bus/vectrex/slot.h | 12 +- src/devices/bus/vic10/exp.cpp | 2 +- src/devices/bus/vic10/exp.h | 11 +- src/devices/bus/vic20/exp.cpp | 2 +- src/devices/bus/vic20/exp.h | 11 +- src/devices/bus/vidbrain/exp.cpp | 2 +- src/devices/bus/vidbrain/exp.h | 11 +- src/devices/bus/vsmile/vsmile_slot.cpp | 2 +- src/devices/bus/vsmile/vsmile_slot.h | 12 +- src/devices/bus/wswan/slot.cpp | 2 +- src/devices/bus/wswan/slot.h | 12 +- src/devices/bus/z88/z88.cpp | 2 +- src/devices/bus/z88/z88.h | 12 +- src/devices/imagedev/avivideo.h | 4 +- src/devices/imagedev/bitbngr.h | 7 +- src/devices/imagedev/cartrom.cpp | 30 ++++ src/devices/imagedev/cartrom.h | 55 ++++++ src/devices/imagedev/cassette.cpp | 6 + src/devices/imagedev/cassette.h | 8 +- src/devices/imagedev/chd_cd.h | 5 +- src/devices/imagedev/diablo.cpp | 3 +- src/devices/imagedev/diablo.h | 12 +- src/devices/imagedev/flopdrv.cpp | 6 + src/devices/imagedev/flopdrv.h | 8 +- src/devices/imagedev/floppy.cpp | 7 +- src/devices/imagedev/floppy.h | 7 +- src/devices/imagedev/harddriv.cpp | 14 +- src/devices/imagedev/harddriv.h | 28 ++- src/devices/imagedev/magtape.cpp | 35 ++++ src/devices/imagedev/magtape.h | 55 ++++++ src/devices/imagedev/memcard.cpp | 18 ++ src/devices/imagedev/memcard.h | 38 ++++ src/devices/imagedev/microdrv.cpp | 3 +- src/devices/imagedev/microdrv.h | 14 +- src/devices/imagedev/midiin.h | 4 +- src/devices/imagedev/midiout.h | 4 +- src/devices/imagedev/papertape.cpp | 38 ++++ src/devices/imagedev/papertape.h | 71 ++++++++ src/devices/imagedev/picture.h | 4 +- src/devices/imagedev/printer.h | 4 +- src/devices/imagedev/snapquik.cpp | 10 ++ src/devices/imagedev/snapquik.h | 11 +- src/devices/imagedev/wafadrive.cpp | 3 +- src/devices/imagedev/wafadrive.h | 14 +- src/devices/machine/ds6417.cpp | 2 +- src/devices/machine/ds6417.h | 12 +- src/devices/machine/hp_dc100_tape.cpp | 3 +- src/devices/machine/hp_dc100_tape.h | 11 +- src/devices/machine/i7220.h | 5 +- src/devices/machine/smartmed.cpp | 9 +- src/devices/machine/smartmed.h | 11 +- src/emu/diimage.cpp | 180 +++---------------- src/emu/diimage.h | 74 ++------ src/mame/drivers/a2600.cpp | 2 +- src/mame/drivers/arcadia.cpp | 2 +- src/mame/drivers/gridcomp.cpp | 1 + src/mame/drivers/megadriv.cpp | 8 +- src/mame/drivers/nes.cpp | 2 +- src/mame/drivers/odyssey2.cpp | 4 +- src/mame/drivers/pce.cpp | 6 +- src/mame/drivers/pdp1.cpp | 6 +- src/mame/drivers/psion.cpp | 2 +- src/mame/drivers/segapico.cpp | 6 +- src/mame/drivers/sg1000.cpp | 7 +- src/mame/drivers/sms.cpp | 2 +- src/mame/drivers/snes.cpp | 1 + src/mame/drivers/tm990189.cpp | 6 +- src/mame/drivers/tx0.cpp | 50 ++---- src/mame/drivers/vboy.cpp | 1 + src/mame/drivers/vic10.cpp | 1 + src/mame/drivers/wswan.cpp | 2 + src/mame/includes/apollo.h | 7 +- src/mame/includes/pdp1.h | 31 +--- src/mame/machine/apexc.cpp | 6 +- src/mame/machine/apexc.h | 25 +-- src/mame/machine/coco_vhd.h | 5 +- src/mame/machine/fmt_icmem.cpp | 2 +- src/mame/machine/fmt_icmem.h | 10 +- src/mame/machine/hp48_port.h | 7 +- src/mame/machine/hp80_optrom.cpp | 2 +- src/mame/machine/hp80_optrom.h | 10 +- src/mame/machine/hp9825_optrom.cpp | 2 +- src/mame/machine/hp9825_optrom.h | 10 +- src/mame/machine/hp9845_optrom.cpp | 2 +- src/mame/machine/hp9845_optrom.h | 10 +- src/mame/machine/hp_ipc_optrom.cpp | 2 +- src/mame/machine/hp_ipc_optrom.h | 10 +- src/mame/machine/hyperscan_card.cpp | 9 +- src/mame/machine/hyperscan_card.h | 10 +- src/mame/machine/imm6_76.h | 6 +- src/mame/machine/ng_memcard.cpp | 2 +- src/mame/machine/ng_memcard.h | 9 +- src/mame/machine/pce220_ser.h | 6 +- src/mame/machine/pgm2_memcard.cpp | 2 +- src/mame/machine/pgm2_memcard.h | 10 +- src/mame/machine/psion_pack.cpp | 14 +- src/mame/machine/psion_pack.h | 13 +- src/mame/machine/x68k_hdc.cpp | 3 +- src/mame/machine/x68k_hdc.h | 16 +- src/osd/modules/debugger/debugimgui.cpp | 7 +- 214 files changed, 876 insertions(+), 1274 deletions(-) create mode 100644 src/devices/imagedev/cartrom.cpp create mode 100644 src/devices/imagedev/cartrom.h create mode 100644 src/devices/imagedev/magtape.cpp create mode 100644 src/devices/imagedev/magtape.h create mode 100644 src/devices/imagedev/memcard.cpp create mode 100644 src/devices/imagedev/memcard.h create mode 100644 src/devices/imagedev/papertape.cpp create mode 100644 src/devices/imagedev/papertape.h diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua index 8900f14a108..4bb5410edc9 100644 --- a/scripts/src/machine.lua +++ b/scripts/src/machine.lua @@ -37,6 +37,8 @@ files { files { MAME_DIR .. "src/devices/imagedev/bitbngr.cpp", MAME_DIR .. "src/devices/imagedev/bitbngr.h", + MAME_DIR .. "src/devices/imagedev/cartrom.cpp", + MAME_DIR .. "src/devices/imagedev/cartrom.h", MAME_DIR .. "src/devices/imagedev/cassette.cpp", MAME_DIR .. "src/devices/imagedev/cassette.h", MAME_DIR .. "src/devices/imagedev/chd_cd.cpp", @@ -49,6 +51,10 @@ files { MAME_DIR .. "src/devices/imagedev/floppy.h", MAME_DIR .. "src/devices/imagedev/harddriv.cpp", MAME_DIR .. "src/devices/imagedev/harddriv.h", + MAME_DIR .. "src/devices/imagedev/magtape.cpp", + MAME_DIR .. "src/devices/imagedev/magtape.h", + MAME_DIR .. "src/devices/imagedev/memcard.cpp", + MAME_DIR .. "src/devices/imagedev/memcard.h", MAME_DIR .. "src/devices/imagedev/mfmhd.cpp", MAME_DIR .. "src/devices/imagedev/mfmhd.h", MAME_DIR .. "src/devices/imagedev/microdrv.cpp", @@ -57,6 +63,8 @@ files { MAME_DIR .. "src/devices/imagedev/midiin.h", MAME_DIR .. "src/devices/imagedev/midiout.cpp", MAME_DIR .. "src/devices/imagedev/midiout.h", + MAME_DIR .. "src/devices/imagedev/papertape.cpp", + MAME_DIR .. "src/devices/imagedev/papertape.h", MAME_DIR .. "src/devices/imagedev/picture.cpp", MAME_DIR .. "src/devices/imagedev/picture.h", MAME_DIR .. "src/devices/imagedev/printer.cpp", diff --git a/src/devices/bus/a7800/a78_slot.cpp b/src/devices/bus/a7800/a78_slot.cpp index 65473693f62..14127b69759 100644 --- a/src/devices/bus/a7800/a78_slot.cpp +++ b/src/devices/bus/a7800/a78_slot.cpp @@ -113,7 +113,7 @@ void device_a78_cart_interface::nvram_alloc(uint32_t size) //------------------------------------------------- a78_cart_slot_device::a78_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A78_CART_SLOT, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_cartrom_image_interface(mconfig, *this) , device_slot_interface(mconfig, *this) , m_cart(nullptr) , m_type(0) diff --git a/src/devices/bus/a7800/a78_slot.h b/src/devices/bus/a7800/a78_slot.h index 9cd5971f6f6..97eec9c2f3c 100644 --- a/src/devices/bus/a7800/a78_slot.h +++ b/src/devices/bus/a7800/a78_slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -85,7 +85,7 @@ protected: // ======================> a78_cart_slot_device class a78_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_slot_interface { public: @@ -106,11 +106,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "a7800_cart"; } virtual const char *file_extensions() const noexcept override { return "a78"; } @@ -136,9 +131,6 @@ private: // device-level overrides virtual void device_start() override; - // device_image_interface implementation - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - device_a78_cart_interface* m_cart; int m_type; diff --git a/src/devices/bus/a800/a800_slot.cpp b/src/devices/bus/a800/a800_slot.cpp index 4ae54a22663..1e9013bb602 100644 --- a/src/devices/bus/a800/a800_slot.cpp +++ b/src/devices/bus/a800/a800_slot.cpp @@ -104,7 +104,7 @@ void device_a800_cart_interface::nvram_alloc(uint32_t size) //------------------------------------------------- a800_cart_slot_device::a800_cart_slot_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), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_cart(nullptr), m_type(0) { diff --git a/src/devices/bus/a800/a800_slot.h b/src/devices/bus/a800/a800_slot.h index 0951c4a2c3d..4a59d20ebad 100644 --- a/src/devices/bus/a800/a800_slot.h +++ b/src/devices/bus/a800/a800_slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -86,7 +86,7 @@ protected: // ======================> a800_cart_slot_device class a800_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -107,11 +107,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "a8bit_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,rom,car"; } @@ -135,9 +130,6 @@ 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 rom_software_list_loader::instance(); } - private: device_a800_cart_interface* m_cart; int m_type; diff --git a/src/devices/bus/adam/exp.cpp b/src/devices/bus/adam/exp.cpp index 59c677144f3..5a2098b2cfe 100644 --- a/src/devices/bus/adam/exp.cpp +++ b/src/devices/bus/adam/exp.cpp @@ -54,7 +54,7 @@ device_adam_expansion_slot_card_interface::device_adam_expansion_slot_card_inter adam_expansion_slot_device::adam_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ADAM_EXPANSION_SLOT, tag, owner, clock), device_single_card_slot_interface(mconfig, *this), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), m_write_irq(*this), m_card(nullptr) { } diff --git a/src/devices/bus/adam/exp.h b/src/devices/bus/adam/exp.h index d9e993c3a1f..01d73774bdb 100644 --- a/src/devices/bus/adam/exp.h +++ b/src/devices/bus/adam/exp.h @@ -11,7 +11,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" //************************************************************************** @@ -24,7 +24,7 @@ class device_adam_expansion_slot_card_interface; class adam_expansion_slot_device : public device_t, public device_single_card_slot_interface, - public device_image_interface + public device_cartrom_image_interface { public: // construction/destruction @@ -55,14 +55,7 @@ protected: // image-level overrides virtual image_init_result call_load() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - - 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 true; } virtual const char *image_interface() const noexcept override { return "adam_rom"; } virtual const char *file_extensions() const noexcept override { return "bin,rom"; } diff --git a/src/devices/bus/apf/slot.cpp b/src/devices/bus/apf/slot.cpp index 31cd2abf2d4..32efe21adf3 100644 --- a/src/devices/bus/apf/slot.cpp +++ b/src/devices/bus/apf/slot.cpp @@ -73,7 +73,7 @@ void device_apf_cart_interface::ram_alloc(uint32_t size) //------------------------------------------------- apf_cart_slot_device::apf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APF_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_type(APF_STD), m_cart(nullptr) diff --git a/src/devices/bus/apf/slot.h b/src/devices/bus/apf/slot.h index 9ce2b84aec0..b85715ae0e1 100644 --- a/src/devices/bus/apf/slot.h +++ b/src/devices/bus/apf/slot.h @@ -3,7 +3,7 @@ #ifndef MAME_BUS_APF_SLOT_H #define MAME_BUS_APF_SLOT_H -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** TYPE DEFINITIONS @@ -54,7 +54,7 @@ protected: // ======================> apf_cart_slot_device class apf_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -76,11 +76,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override {} - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "apfm1000_cart"; } virtual const char *file_extensions() const noexcept override { return "bin"; } @@ -102,8 +97,6 @@ protected: // device-level overrides virtual void device_start() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - int m_type; device_apf_cart_interface* m_cart; }; diff --git a/src/devices/bus/aquarius/slot.cpp b/src/devices/bus/aquarius/slot.cpp index 0c846b6f53b..ab2966afe61 100644 --- a/src/devices/bus/aquarius/slot.cpp +++ b/src/devices/bus/aquarius/slot.cpp @@ -57,7 +57,7 @@ void device_aquarius_cartridge_interface::rom_alloc(uint32_t size, const char *t aquarius_cartridge_slot_device::aquarius_cartridge_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AQUARIUS_CARTRIDGE_SLOT, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_cartrom_image_interface(mconfig, *this) , device_single_card_slot_interface(mconfig, *this) , m_cart(nullptr) , m_irq_handler(*this) diff --git a/src/devices/bus/aquarius/slot.h b/src/devices/bus/aquarius/slot.h index 3c836803ab1..f165c146708 100644 --- a/src/devices/bus/aquarius/slot.h +++ b/src/devices/bus/aquarius/slot.h @@ -11,7 +11,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" #define AQUARIUS_CART_ROM_REGION_TAG ":cart:rom" @@ -25,7 +25,7 @@ class device_aquarius_cartridge_interface; class aquarius_cartridge_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -49,11 +49,6 @@ public: // image-level overrides virtual image_init_result call_load() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "aquarius_cart"; } virtual const char *file_extensions() const noexcept override { return "rom,bin"; } @@ -76,9 +71,6 @@ 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 rom_software_list_loader::instance(); } - device_aquarius_cartridge_interface *m_cart; private: diff --git a/src/devices/bus/arcadia/slot.cpp b/src/devices/bus/arcadia/slot.cpp index 79e9d741618..7fc145ccc64 100644 --- a/src/devices/bus/arcadia/slot.cpp +++ b/src/devices/bus/arcadia/slot.cpp @@ -63,7 +63,7 @@ void device_arcadia_cart_interface::rom_alloc(uint32_t size, const char *tag) //------------------------------------------------- arcadia_cart_slot_device::arcadia_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EA2001_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_type(ARCADIA_STD), m_cart(nullptr) { diff --git a/src/devices/bus/arcadia/slot.h b/src/devices/bus/arcadia/slot.h index ae86bc13847..f0f8eefb902 100644 --- a/src/devices/bus/arcadia/slot.h +++ b/src/devices/bus/arcadia/slot.h @@ -3,7 +3,7 @@ #ifndef MAME_BUS_ARCADIA_SLOT_H #define MAME_BUS_ARCADIA_SLOT_H -#include "softlist_dev.h" +#include "imagedev/cartrom.h" #define EA2001SLOT_ROM_REGION_TAG ":cart:rom" @@ -45,7 +45,7 @@ protected: // ======================> arcadia_cart_slot_device class arcadia_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -66,11 +66,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override {} - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual bool is_reset_on_load() const noexcept override { return true; } virtual const char *image_interface() const noexcept override { return "arcadia_cart"; } virtual const char *file_extensions() const noexcept override { return "bin"; } @@ -88,9 +83,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; device_arcadia_cart_interface* m_cart; }; diff --git a/src/devices/bus/astrocde/slot.cpp b/src/devices/bus/astrocde/slot.cpp index b629c57322d..6fcc2015160 100644 --- a/src/devices/bus/astrocde/slot.cpp +++ b/src/devices/bus/astrocde/slot.cpp @@ -63,7 +63,7 @@ void device_astrocade_cart_interface::rom_alloc(uint32_t size, const char *tag) //------------------------------------------------- astrocade_cart_slot_device::astrocade_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ASTROCADE_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_type(ASTROCADE_STD), m_cart(nullptr) { diff --git a/src/devices/bus/astrocde/slot.h b/src/devices/bus/astrocde/slot.h index d16f37e0fb1..a366b9dc518 100644 --- a/src/devices/bus/astrocde/slot.h +++ b/src/devices/bus/astrocde/slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -51,7 +51,7 @@ protected: // ======================> astrocade_cart_slot_device class astrocade_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -71,13 +71,7 @@ public: // image-level overrides virtual image_init_result call_load() override; virtual void call_unload() override {} - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "astrocde_cart"; } virtual const char *file_extensions() const noexcept override { return "bin"; } diff --git a/src/devices/bus/bbc/rom/slot.cpp b/src/devices/bus/bbc/rom/slot.cpp index 65acb920bca..4c19a767dfe 100644 --- a/src/devices/bus/bbc/rom/slot.cpp +++ b/src/devices/bus/bbc/rom/slot.cpp @@ -84,7 +84,7 @@ void device_bbc_rom_interface::nvram_alloc(uint32_t size) //------------------------------------------------- bbc_romslot_device::bbc_romslot_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) + , device_rom_image_interface(mconfig, *this) , device_single_card_slot_interface(mconfig, *this) , m_cart(nullptr) { diff --git a/src/devices/bus/bbc/rom/slot.h b/src/devices/bus/bbc/rom/slot.h index 4b43024d555..f1049030f38 100644 --- a/src/devices/bus/bbc/rom/slot.h +++ b/src/devices/bus/bbc/rom/slot.h @@ -11,7 +11,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" #define BBC_ROM_REGION_TAG ":cart:rom" @@ -25,7 +25,7 @@ class device_bbc_rom_interface; class bbc_romslot_device : public device_t, - public device_image_interface, + public device_rom_image_interface, public device_single_card_slot_interface { public: @@ -33,11 +33,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_ROM; } - 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 "bbc_rom"; } virtual const char *file_extensions() const noexcept override { return "rom,bin"; } @@ -60,9 +55,6 @@ protected: // construction/destruction bbc_romslot_device(const machine_config &mconfig, device_type type, char const *tag, device_t *owner, uint32_t clock); - // device_image_interface implementation - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - // device-level overrides virtual void device_start() override; diff --git a/src/devices/bus/c64/exp.cpp b/src/devices/bus/c64/exp.cpp index cf20f18fe45..07ecb8db9b4 100644 --- a/src/devices/bus/c64/exp.cpp +++ b/src/devices/bus/c64/exp.cpp @@ -59,7 +59,7 @@ device_c64_expansion_card_interface::~device_c64_expansion_card_interface() c64_expansion_slot_device::c64_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_EXPANSION_SLOT, tag, owner, clock), device_single_card_slot_interface(mconfig, *this), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), m_read_dma_cd(*this), m_write_dma_cd(*this), m_write_irq(*this), diff --git a/src/devices/bus/c64/exp.h b/src/devices/bus/c64/exp.h index 391827b271f..640d429d419 100644 --- a/src/devices/bus/c64/exp.h +++ b/src/devices/bus/c64/exp.h @@ -36,7 +36,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" #include "formats/cbm_crt.h" @@ -51,7 +51,7 @@ class device_c64_expansion_card_interface; class c64_expansion_slot_device : public device_t, public device_single_card_slot_interface, - public device_image_interface + public device_cartrom_image_interface { public: // construction/destruction @@ -101,14 +101,7 @@ protected: // image-level overrides virtual image_init_result call_load() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - - 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 true; } virtual const char *image_interface() const noexcept override { return "c64_cart,vic10_cart"; } virtual const char *file_extensions() const noexcept override { return "80,a0,e0,crt"; } diff --git a/src/devices/bus/cbm2/exp.cpp b/src/devices/bus/cbm2/exp.cpp index cc0f3516bc5..c43e540e181 100644 --- a/src/devices/bus/cbm2/exp.cpp +++ b/src/devices/bus/cbm2/exp.cpp @@ -63,7 +63,7 @@ device_cbm2_expansion_card_interface::~device_cbm2_expansion_card_interface() cbm2_expansion_slot_device::cbm2_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CBM2_EXPANSION_SLOT, tag, owner, clock), device_single_card_slot_interface(mconfig, *this), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), m_card(nullptr) { } diff --git a/src/devices/bus/cbm2/exp.h b/src/devices/bus/cbm2/exp.h index b9f967137ca..0cc76756215 100644 --- a/src/devices/bus/cbm2/exp.h +++ b/src/devices/bus/cbm2/exp.h @@ -29,7 +29,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" @@ -43,7 +43,7 @@ class device_cbm2_expansion_card_interface; class cbm2_expansion_slot_device : public device_t, public device_single_card_slot_interface, - public device_image_interface + public device_cartrom_image_interface { public: // construction/destruction @@ -71,14 +71,7 @@ protected: // image-level overrides virtual image_init_result call_load() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - - 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 true; } virtual const char *image_interface() const noexcept override { return "cbm2_cart"; } virtual const char *file_extensions() const noexcept override { return "20,40,60"; } diff --git a/src/devices/bus/chanf/slot.cpp b/src/devices/bus/chanf/slot.cpp index 3a4a9008c95..9a49d62ca82 100644 --- a/src/devices/bus/chanf/slot.cpp +++ b/src/devices/bus/chanf/slot.cpp @@ -73,7 +73,7 @@ void device_channelf_cart_interface::ram_alloc(uint32_t size) //------------------------------------------------- channelf_cart_slot_device::channelf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CHANF_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_type(CF_CHESS), m_cart(nullptr) { diff --git a/src/devices/bus/chanf/slot.h b/src/devices/bus/chanf/slot.h index 09f58f03800..eaf8a787857 100644 --- a/src/devices/bus/chanf/slot.h +++ b/src/devices/bus/chanf/slot.h @@ -3,7 +3,7 @@ #ifndef MAME_BUS_CHANF_SLOT_H #define MAME_BUS_CHANF_SLOT_H -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -59,7 +59,7 @@ protected: // ======================> channelf_cart_slot_device class channelf_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -81,11 +81,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override { } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "channelf_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,chf"; } @@ -107,9 +102,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; device_channelf_cart_interface* m_cart; }; diff --git a/src/devices/bus/coco/cococart.cpp b/src/devices/bus/coco/cococart.cpp index 60e6f5c840a..fb3937f6a16 100644 --- a/src/devices/bus/coco/cococart.cpp +++ b/src/devices/bus/coco/cococart.cpp @@ -133,7 +133,7 @@ ALLOW_SAVE_TYPE(cococart_slot_device::line_value); cococart_slot_device::cococart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, COCOCART_SLOT, tag, owner, clock), device_single_card_slot_interface(mconfig, *this), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), m_cart_callback(*this), m_nmi_callback(*this), m_halt_callback(*this), m_cart(nullptr) diff --git a/src/devices/bus/coco/cococart.h b/src/devices/bus/coco/cococart.h index 26c17a93e36..e2b8529ab00 100644 --- a/src/devices/bus/coco/cococart.h +++ b/src/devices/bus/coco/cococart.h @@ -13,7 +13,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -31,7 +31,7 @@ class device_cococart_interface; class cococart_slot_device final : public device_t, public device_single_card_slot_interface, - public device_image_interface + public device_cartrom_image_interface { public: // output lines on the CoCo cartridge slot @@ -73,14 +73,7 @@ public: // image-level overrides virtual image_init_result call_load() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - - 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 true; } virtual const char *image_interface() const noexcept override { return "coco_cart"; } virtual const char *file_extensions() const noexcept override { return "ccc,rom"; } diff --git a/src/devices/bus/coleco/cartridge/exp.cpp b/src/devices/bus/coleco/cartridge/exp.cpp index cb12720f8dc..6a73d73efb6 100644 --- a/src/devices/bus/coleco/cartridge/exp.cpp +++ b/src/devices/bus/coleco/cartridge/exp.cpp @@ -56,7 +56,7 @@ void device_colecovision_cartridge_interface::rom_alloc(size_t size) colecovision_cartridge_slot_device::colecovision_cartridge_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COLECOVISION_CARTRIDGE_SLOT, tag, owner, clock), device_single_card_slot_interface(mconfig, *this), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), m_card(nullptr) { } diff --git a/src/devices/bus/coleco/cartridge/exp.h b/src/devices/bus/coleco/cartridge/exp.h index d603787c3a5..5e7eaa252d2 100644 --- a/src/devices/bus/coleco/cartridge/exp.h +++ b/src/devices/bus/coleco/cartridge/exp.h @@ -30,7 +30,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" //************************************************************************** @@ -49,7 +49,7 @@ class device_colecovision_cartridge_interface; class colecovision_cartridge_slot_device : public device_t, public device_single_card_slot_interface, - public device_image_interface + public device_cartrom_image_interface { public: // construction/destruction @@ -73,14 +73,7 @@ protected: // image-level overrides virtual image_init_result call_load() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - - 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 true; } virtual const char *image_interface() const noexcept override { return "coleco_cart"; } virtual const char *file_extensions() const noexcept override { return "rom,col,bin"; } diff --git a/src/devices/bus/cpc/cpc_rom.cpp b/src/devices/bus/cpc/cpc_rom.cpp index ff60f024f39..014d4600858 100644 --- a/src/devices/bus/cpc/cpc_rom.cpp +++ b/src/devices/bus/cpc/cpc_rom.cpp @@ -76,7 +76,7 @@ DEFINE_DEVICE_TYPE(CPC_ROMSLOT, cpc_rom_image_device, "cpc_rom_image", "CPC ROM cpc_rom_image_device::cpc_rom_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_ROMSLOT, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_rom_image_interface(mconfig, *this) , m_base(nullptr) { } diff --git a/src/devices/bus/cpc/cpc_rom.h b/src/devices/bus/cpc/cpc_rom.h index 5f36de39fcf..a9932dd57a8 100644 --- a/src/devices/bus/cpc/cpc_rom.h +++ b/src/devices/bus/cpc/cpc_rom.h @@ -12,12 +12,13 @@ #pragma once #include "cpcexp.h" +#include "imagedev/cartrom.h" /*** ROM image device ***/ // ======================> cpc_rom_image_device -class cpc_rom_image_device : public device_t, public device_image_interface +class cpc_rom_image_device : public device_t, public device_rom_image_interface { public: // construction/destruction @@ -28,12 +29,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_ROM; } - - 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 true; } virtual const char *image_interface() const noexcept override { return "cpc_rom"; } virtual const char *file_extensions() const noexcept override { return "rom,bin"; } diff --git a/src/devices/bus/crvision/slot.cpp b/src/devices/bus/crvision/slot.cpp index 1c86b7ed332..e0776bec33b 100644 --- a/src/devices/bus/crvision/slot.cpp +++ b/src/devices/bus/crvision/slot.cpp @@ -63,7 +63,7 @@ void device_crvision_cart_interface::rom_alloc(uint32_t size, const char *tag) //------------------------------------------------- crvision_cart_slot_device::crvision_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CRVISION_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_type(CRV_4K), m_cart(nullptr) { diff --git a/src/devices/bus/crvision/slot.h b/src/devices/bus/crvision/slot.h index 9ea0c72b5c5..ec0a626f994 100644 --- a/src/devices/bus/crvision/slot.h +++ b/src/devices/bus/crvision/slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -55,7 +55,7 @@ protected: // ======================> crvision_cart_slot_device class crvision_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -76,11 +76,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override { } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "crvision_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,rom"; } @@ -98,9 +93,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; device_crvision_cart_interface* m_cart; }; diff --git a/src/devices/bus/ekara/slot.cpp b/src/devices/bus/ekara/slot.cpp index 459e14317b6..198d6c35519 100644 --- a/src/devices/bus/ekara/slot.cpp +++ b/src/devices/bus/ekara/slot.cpp @@ -56,7 +56,7 @@ void device_ekara_cart_interface::rom_alloc(uint32_t size, const char *tag) //------------------------------------------------- ekara_cart_slot_device::ekara_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EKARA_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_type(EKARA_PLAIN), m_cart(nullptr) diff --git a/src/devices/bus/ekara/slot.h b/src/devices/bus/ekara/slot.h index 895b2b51e41..6efbd5962e7 100644 --- a/src/devices/bus/ekara/slot.h +++ b/src/devices/bus/ekara/slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** TYPE DEFINITIONS @@ -61,7 +61,7 @@ protected: // ======================> ekara_cart_slot_device class ekara_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -84,11 +84,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override {} - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "ekara_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,u1"; } @@ -122,9 +117,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; device_ekara_cart_interface* m_cart; }; diff --git a/src/devices/bus/electron/cart/slot.cpp b/src/devices/bus/electron/cart/slot.cpp index 342cd3ae4f8..046fee21e2c 100644 --- a/src/devices/bus/electron/cart/slot.cpp +++ b/src/devices/bus/electron/cart/slot.cpp @@ -91,7 +91,7 @@ void device_electron_cart_interface::nvram_alloc(uint32_t size) //------------------------------------------------- electron_cartslot_device::electron_cartslot_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), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_cart(nullptr), m_irq_handler(*this), diff --git a/src/devices/bus/electron/cart/slot.h b/src/devices/bus/electron/cart/slot.h index d74b32c0734..b71da09d5ae 100644 --- a/src/devices/bus/electron/cart/slot.h +++ b/src/devices/bus/electron/cart/slot.h @@ -96,7 +96,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" //************************************************************************** @@ -115,7 +115,7 @@ class device_electron_cart_interface; class electron_cartslot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -140,11 +140,7 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "electron_cart"; } virtual const char *file_extensions() const noexcept override { return "rom,bin"; } @@ -167,9 +163,6 @@ 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 rom_software_list_loader::instance(); } - device_electron_cart_interface *m_cart; private: diff --git a/src/devices/bus/gamate/slot.cpp b/src/devices/bus/gamate/slot.cpp index 869abf24f98..cf75898e768 100644 --- a/src/devices/bus/gamate/slot.cpp +++ b/src/devices/bus/gamate/slot.cpp @@ -56,7 +56,7 @@ void device_gamate_cart_interface::rom_alloc(uint32_t size, const char *tag) //------------------------------------------------- gamate_cart_slot_device::gamate_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GAMATE_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_type(GAMATE_PLAIN), m_cart(nullptr) diff --git a/src/devices/bus/gamate/slot.h b/src/devices/bus/gamate/slot.h index 81b8b09c109..333fd404e4a 100644 --- a/src/devices/bus/gamate/slot.h +++ b/src/devices/bus/gamate/slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** TYPE DEFINITIONS @@ -46,7 +46,7 @@ protected: // ======================> gamate_cart_slot_device class gamate_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -68,11 +68,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override { } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "gamate_cart"; } virtual const char *file_extensions() const noexcept override { return "bin"; } @@ -91,9 +86,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; device_gamate_cart_interface* m_cart; }; diff --git a/src/devices/bus/gameboy/gb_slot.cpp b/src/devices/bus/gameboy/gb_slot.cpp index 0da541e9f5a..3bf19202635 100644 --- a/src/devices/bus/gameboy/gb_slot.cpp +++ b/src/devices/bus/gameboy/gb_slot.cpp @@ -138,7 +138,7 @@ void device_gb_cart_interface::ram_map_setup(uint8_t banks) //------------------------------------------------- gb_cart_slot_device_base::gb_cart_slot_device_base(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), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_type(GB_MBC_UNKNOWN), m_cart(nullptr) diff --git a/src/devices/bus/gameboy/gb_slot.h b/src/devices/bus/gameboy/gb_slot.h index a9d2b2aeb13..04432ba90a3 100644 --- a/src/devices/bus/gameboy/gb_slot.h +++ b/src/devices/bus/gameboy/gb_slot.h @@ -3,7 +3,7 @@ #ifndef MAME_BUS_GAMEBOY_GB_SLOT_H #define MAME_BUS_GAMEBOY_GB_SLOT_H -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -108,7 +108,7 @@ protected: // ======================> gb_cart_slot_device_base class gb_cart_slot_device_base : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -119,11 +119,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "gameboy_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,gb,gbc"; } @@ -153,9 +148,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; device_gb_cart_interface* m_cart; }; diff --git a/src/devices/bus/gba/gba_slot.cpp b/src/devices/bus/gba/gba_slot.cpp index f3a85302767..d4630c9c325 100644 --- a/src/devices/bus/gba/gba_slot.cpp +++ b/src/devices/bus/gba/gba_slot.cpp @@ -534,7 +534,7 @@ void device_gba_cart_interface::nvram_alloc(uint32_t size) //------------------------------------------------- gba_cart_slot_device::gba_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GBA_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), m_type(GBA_STD), m_cart(nullptr) diff --git a/src/devices/bus/gba/gba_slot.h b/src/devices/bus/gba/gba_slot.h index 32e935af71c..70fad8e4581 100644 --- a/src/devices/bus/gba/gba_slot.h +++ b/src/devices/bus/gba/gba_slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -79,7 +79,7 @@ protected: // ======================> gba_cart_slot_device class gba_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_slot_interface { public: @@ -101,11 +101,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "gba_cart"; } virtual const char *file_extensions() const noexcept override { return "gba,bin"; } @@ -133,9 +128,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; device_gba_cart_interface* m_cart; }; diff --git a/src/devices/bus/generic/slot.cpp b/src/devices/bus/generic/slot.cpp index 532e3aad7b6..73a47bfd0e0 100644 --- a/src/devices/bus/generic/slot.cpp +++ b/src/devices/bus/generic/slot.cpp @@ -121,12 +121,11 @@ void device_generic_cart_interface::ram_alloc(u32 size) generic_slot_device::generic_slot_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock) : device_t(mconfig, type, tag, owner, clock), - device_image_interface(mconfig, *this), + device_rom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_interface(nullptr), m_default_card("rom"), m_extensions("bin"), - m_must_be_loaded(false), m_width(GENERIC_ROM8_WIDTH), m_endianness(ENDIANNESS_LITTLE), m_cart(nullptr), diff --git a/src/devices/bus/generic/slot.h b/src/devices/bus/generic/slot.h index ee96382f435..da1e7e21988 100644 --- a/src/devices/bus/generic/slot.h +++ b/src/devices/bus/generic/slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" #include @@ -102,7 +102,7 @@ enum class generic_slot_device : public device_t, - public device_image_interface, + public device_rom_image_interface, public device_single_card_slot_interface { public: @@ -114,18 +114,12 @@ public: void set_interface(char const *interface) { m_interface = interface; } void set_default_card(char const *def) { m_default_card = def; } void set_extensions(char const *exts) { m_extensions = exts; } - void set_must_be_loaded(bool mandatory) { m_must_be_loaded = mandatory; } // default false void set_width(int width) { m_width = width; } void set_endian(endianness_t end) { m_endianness = end; } // device_image_interface implementation virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 m_must_be_loaded; } virtual bool is_reset_on_load() const noexcept override { return true; } virtual char const *image_interface() const noexcept override { return m_interface; } virtual char const *file_extensions() const noexcept override { return m_extensions; } @@ -175,13 +169,9 @@ protected: // device-level overrides virtual void device_start() override ATTR_COLD; - // device_image_interface implementation - virtual software_list_loader const &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - char const *m_interface; char const *m_default_card; char const *m_extensions; - bool m_must_be_loaded; int m_width; endianness_t m_endianness; device_generic_cart_interface *m_cart; @@ -205,7 +195,8 @@ public: generic_socket_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0); - virtual iodevice_t image_type() const noexcept override { return IO_ROM; } + virtual const char *image_type_name() const noexcept override { return "romimage"; } + virtual const char *image_brief_type_name() const noexcept override { return "rom"; } }; class generic_cartslot_device : public generic_slot_device @@ -224,7 +215,8 @@ public: generic_cartslot_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0); - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } + virtual const char *image_type_name() const noexcept override { return "cartridge"; } + virtual const char *image_brief_type_name() const noexcept override { return "cart"; } }; diff --git a/src/devices/bus/ieee488/grid2102.h b/src/devices/bus/ieee488/grid2102.h index 4bf4403ddc8..b41dc8b4b0c 100644 --- a/src/devices/bus/ieee488/grid2102.h +++ b/src/devices/bus/ieee488/grid2102.h @@ -46,14 +46,13 @@ protected: virtual void ieee488_ren(int state) override; // image-level overrides - 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 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 "img"; } + virtual const char *image_type_name() const noexcept override { return "floppydisk"; } + virtual const char *image_brief_type_name() const noexcept override { return "flop"; } void accept_transfer(); void update_ndac(int atn); @@ -101,7 +100,8 @@ public: grid2101_hdd_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_HARDDISK; } + virtual const char *image_type_name() const noexcept override { return "harddisk"; } + virtual const char *image_brief_type_name() const noexcept override { return "hard"; } private: static uint8_t identify_response[]; diff --git a/src/devices/bus/intellec4/insdatastor.cpp b/src/devices/bus/intellec4/insdatastor.cpp index b52c3815857..81bbf713db7 100644 --- a/src/devices/bus/intellec4/insdatastor.cpp +++ b/src/devices/bus/intellec4/insdatastor.cpp @@ -171,15 +171,13 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_ROM; } 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 char const *file_extensions() const noexcept override { return "rom,bin"; } - virtual char const *custom_instance_name() const noexcept override { return "promimage"; } - virtual char const *custom_brief_instance_name() const noexcept override { return "prom"; } + virtual char const *image_type_name() const noexcept override { return "promimage"; } + virtual char const *image_brief_type_name() const noexcept override { return "prom"; } protected: virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/bus/intellec4/prommemory.cpp b/src/devices/bus/intellec4/prommemory.cpp index 74b75ec79a8..7af8a5757f2 100644 --- a/src/devices/bus/intellec4/prommemory.cpp +++ b/src/devices/bus/intellec4/prommemory.cpp @@ -100,15 +100,13 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_ROM; } 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 char const *file_extensions() const noexcept override { return "rom,bin"; } - virtual char const *custom_instance_name() const noexcept override { return "promimage"; } - virtual char const *custom_brief_instance_name() const noexcept override { return "prom"; } + virtual char const *image_type_name() const noexcept override { return "promimage"; } + virtual char const *image_brief_type_name() const noexcept override { return "prom"; } protected: virtual void device_start() override; diff --git a/src/devices/bus/intellec4/tapereader.cpp b/src/devices/bus/intellec4/tapereader.cpp index 2dda4eaf561..1606c4e3e21 100644 --- a/src/devices/bus/intellec4/tapereader.cpp +++ b/src/devices/bus/intellec4/tapereader.cpp @@ -16,13 +16,14 @@ interface and paper tape reader as a single device. #include "emu.h" #include "tapereader.h" +#include "imagedev/papertape.h" + namespace { class imm4_90_device - : public device_t + : public paper_tape_reader_device , public bus::intellec4::device_univ_card_interface - , public device_image_interface { public: imm4_90_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); @@ -30,13 +31,7 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_PUNCHTAPE; } - 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 char const *file_extensions() const noexcept override { return "bnpf,hex,lst,txt"; } + virtual char const *file_extensions() const noexcept override { return "bnpf,hex,lst,txt"; } protected: virtual void device_start() override; @@ -59,9 +54,8 @@ private: imm4_90_device::imm4_90_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) - : device_t(mconfig, INTELLEC4_TAPE_READER, tag, owner, clock) + : paper_tape_reader_device(mconfig, INTELLEC4_TAPE_READER, tag, owner, clock) , bus::intellec4::device_univ_card_interface(mconfig, *this) - , device_image_interface(mconfig, *this) , m_step_timer(nullptr) , m_data(0xffU) , m_ready(false) diff --git a/src/devices/bus/intv/slot.cpp b/src/devices/bus/intv/slot.cpp index 727b5af2b5c..f956f01c0fe 100644 --- a/src/devices/bus/intv/slot.cpp +++ b/src/devices/bus/intv/slot.cpp @@ -146,7 +146,7 @@ void device_intv_cart_interface::ram_alloc(uint32_t size) //------------------------------------------------- intv_cart_slot_device::intv_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, INTV_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_type(INTV_STD), m_cart(nullptr) diff --git a/src/devices/bus/intv/slot.h b/src/devices/bus/intv/slot.h index 517ce062952..185f15128c9 100644 --- a/src/devices/bus/intv/slot.h +++ b/src/devices/bus/intv/slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -93,7 +93,7 @@ protected: // ======================> intv_cart_slot_device class intv_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -115,11 +115,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override {} - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "intv_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,int,rom,itv"; } @@ -172,9 +167,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; device_intv_cart_interface* m_cart; }; diff --git a/src/devices/bus/iq151/iq151.cpp b/src/devices/bus/iq151/iq151.cpp index cd57efa1c77..d4ad9a8a865 100644 --- a/src/devices/bus/iq151/iq151.cpp +++ b/src/devices/bus/iq151/iq151.cpp @@ -56,7 +56,7 @@ device_iq151cart_interface::~device_iq151cart_interface() iq151cart_slot_device::iq151cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IQ151CART_SLOT, tag, owner, clock) , device_single_card_slot_interface(mconfig, *this) - , device_image_interface(mconfig, *this) + , device_cartrom_image_interface(mconfig, *this) , m_out_irq0_cb(*this) , m_out_irq1_cb(*this) , m_out_irq2_cb(*this) diff --git a/src/devices/bus/iq151/iq151.h b/src/devices/bus/iq151/iq151.h index 6e1ecdef546..ff3992c7585 100644 --- a/src/devices/bus/iq151/iq151.h +++ b/src/devices/bus/iq151/iq151.h @@ -47,7 +47,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" #include "screen.h" /*************************************************************************** @@ -83,7 +83,7 @@ protected: class iq151cart_slot_device : public device_t, public device_single_card_slot_interface, - public device_image_interface + public device_cartrom_image_interface { public: // construction/destruction @@ -111,11 +111,6 @@ public: // image-level overrides virtual image_init_result call_load() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "iq151_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,rom"; } @@ -134,9 +129,6 @@ 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 rom_software_list_loader::instance(); } - devcb_write_line m_out_irq0_cb; devcb_write_line m_out_irq1_cb; devcb_write_line m_out_irq2_cb; diff --git a/src/devices/bus/isa/omti8621.cpp b/src/devices/bus/isa/omti8621.cpp index f61ab0e905f..bf3d2233bd2 100644 --- a/src/devices/bus/isa/omti8621.cpp +++ b/src/devices/bus/isa/omti8621.cpp @@ -15,6 +15,7 @@ #include "emu.h" #include "omti8621.h" #include "image.h" +#include "imagedev/harddriv.h" #include "formats/pc_dsk.h" #include "formats/naslite_dsk.h" #include "formats/apollo_dsk.h" @@ -47,25 +48,17 @@ static int verbose = VERBOSE; // forward declaration of image class DECLARE_DEVICE_TYPE(OMTI_DISK, omti_disk_image_device) -class omti_disk_image_device : public device_t, - public device_image_interface +class omti_disk_image_device : public harddisk_image_base_device { public: // construction/destruction omti_disk_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_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 true; } - 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 true; } virtual const char *file_extensions() const noexcept override { return "awd"; } - virtual const char *custom_instance_name() const noexcept override { return "winchester"; } - virtual const char *custom_brief_instance_name() const noexcept override { return "disk"; } + virtual const char *image_type_name() const noexcept override { return "winchester"; } + virtual const char *image_brief_type_name() const noexcept override { return "disk"; } virtual image_init_result call_create(int format_type, util::option_resolution *format_options) override; @@ -1383,8 +1376,7 @@ uint8_t omti8621_device::fd_disk_chg_r() DEFINE_DEVICE_TYPE(OMTI_DISK, omti_disk_image_device, "omti_disk_image", "OMTI 8621 ESDI disk") omti_disk_image_device::omti_disk_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, OMTI_DISK, tag, owner, clock) - , device_image_interface(mconfig, *this) + : harddisk_image_base_device(mconfig, OMTI_DISK, tag, owner, clock) , m_type(0), m_cylinders(0), m_heads(0), m_sectors(0), m_sectorbytes(0), m_sector_count(0), m_image(nullptr) { } diff --git a/src/devices/bus/isa/sc499.cpp b/src/devices/bus/isa/sc499.cpp index bc942ede9e8..96a2914325e 100644 --- a/src/devices/bus/isa/sc499.cpp +++ b/src/devices/bus/isa/sc499.cpp @@ -1285,8 +1285,7 @@ void sc499_device::block_set_filemark() DEFINE_DEVICE_TYPE(SC499_CTAPE, sc499_ctape_image_device, "sc499_ctape", "SC-499 Cartridge Tape") sc499_ctape_image_device::sc499_ctape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, SC499_CTAPE, tag, owner, clock) - , device_image_interface(mconfig, *this) + : microtape_image_device(mconfig, SC499_CTAPE, tag, owner, clock) { } diff --git a/src/devices/bus/isa/sc499.h b/src/devices/bus/isa/sc499.h index e62035ccb3a..4cc0cbf7bf9 100644 --- a/src/devices/bus/isa/sc499.h +++ b/src/devices/bus/isa/sc499.h @@ -14,7 +14,7 @@ #pragma once #include "bus/isa/isa.h" -#include "softlist_dev.h" +#include "imagedev/magtape.h" //************************************************************************** @@ -23,7 +23,7 @@ // ======================> sc499_ctape_image_device -class sc499_ctape_image_device : public device_t, public device_image_interface +class sc499_ctape_image_device : public microtape_image_device { public: // construction/destruction @@ -32,18 +32,12 @@ 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_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; } virtual bool support_command_line_image_creation() const noexcept override { return true; } virtual const char *image_interface() const noexcept override { return "sc499_cass"; } virtual const char *file_extensions() const noexcept override { return "act,ct"; } - virtual const char *custom_instance_name() const noexcept override { return "ctape"; } - virtual const char *custom_brief_instance_name() const noexcept override { return "ct"; } + virtual const char *image_type_name() const noexcept override { return "ctape"; } + virtual const char *image_brief_type_name() const noexcept override { return "ct"; } uint8_t *read_block(int block_num); void write_block(int block_num, uint8_t *ptr); @@ -53,9 +47,6 @@ 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(); } - std::vector m_ctape_data; }; diff --git a/src/devices/bus/jakks_gamekey/slot.cpp b/src/devices/bus/jakks_gamekey/slot.cpp index f680211859a..ab4908ea3be 100644 --- a/src/devices/bus/jakks_gamekey/slot.cpp +++ b/src/devices/bus/jakks_gamekey/slot.cpp @@ -56,7 +56,7 @@ void device_jakks_gamekey_interface::rom_alloc(uint32_t size, const char *tag) //------------------------------------------------- jakks_gamekey_slot_device::jakks_gamekey_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, JAKKS_GAMEKEY_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_type(JAKKS_GAMEKEY_PLAIN), m_cart(nullptr) diff --git a/src/devices/bus/jakks_gamekey/slot.h b/src/devices/bus/jakks_gamekey/slot.h index 426d55bb67d..0f02ca86e43 100644 --- a/src/devices/bus/jakks_gamekey/slot.h +++ b/src/devices/bus/jakks_gamekey/slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** TYPE DEFINITIONS @@ -49,7 +49,7 @@ protected: // ======================> jakks_gamekey_slot_device class jakks_gamekey_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -72,11 +72,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override { } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "jakks_gamekey"; } virtual const char *file_extensions() const noexcept override { return "bin,u1"; } @@ -100,9 +95,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; device_jakks_gamekey_interface* m_cart; }; diff --git a/src/devices/bus/kc/kc.cpp b/src/devices/bus/kc/kc.cpp index 39262d0fc76..5e2b67cdab3 100644 --- a/src/devices/bus/kc/kc.cpp +++ b/src/devices/bus/kc/kc.cpp @@ -300,7 +300,7 @@ WRITE_LINE_MEMBER( kcexp_slot_device::meo_w ) //------------------------------------------------- kccart_slot_device::kccart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : kcexp_slot_device(mconfig, KCCART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this) + device_cartrom_image_interface(mconfig, *this) { } diff --git a/src/devices/bus/kc/kc.h b/src/devices/bus/kc/kc.h index 9c510fe62cd..fdb9cd467ce 100644 --- a/src/devices/bus/kc/kc.h +++ b/src/devices/bus/kc/kc.h @@ -13,7 +13,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** TYPE DEFINITIONS @@ -94,7 +94,7 @@ protected: // ======================> kccart_slot_device -class kccart_slot_device : public kcexp_slot_device, public device_image_interface +class kccart_slot_device : public kcexp_slot_device, public device_cartrom_image_interface { public: // construction/destruction @@ -113,21 +113,12 @@ public: // image-level overrides virtual image_init_result call_load() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "kc_cart"; } virtual const char *file_extensions() const noexcept override { return "bin"; } // slot interface overrides virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override; - -protected: - // device_image_interface implementation - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } }; // device type definition diff --git a/src/devices/bus/m5/slot.cpp b/src/devices/bus/m5/slot.cpp index a75599bb807..8dba25c70a5 100644 --- a/src/devices/bus/m5/slot.cpp +++ b/src/devices/bus/m5/slot.cpp @@ -73,7 +73,7 @@ void device_m5_cart_interface::ram_alloc(uint32_t size) //------------------------------------------------- m5_cart_slot_device::m5_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, M5_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_type(M5_STD), m_cart(nullptr) diff --git a/src/devices/bus/m5/slot.h b/src/devices/bus/m5/slot.h index e1c79bc65fc..4f0d578cf1b 100644 --- a/src/devices/bus/m5/slot.h +++ b/src/devices/bus/m5/slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -61,7 +61,7 @@ protected: // ======================> m5_cart_slot_device class m5_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -83,11 +83,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override { } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "m5_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,rom"; } @@ -108,9 +103,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; device_m5_cart_interface* m_cart; }; diff --git a/src/devices/bus/mc10/mc10_cart.cpp b/src/devices/bus/mc10/mc10_cart.cpp index 088b3ca8c81..40047de0fb2 100644 --- a/src/devices/bus/mc10/mc10_cart.cpp +++ b/src/devices/bus/mc10/mc10_cart.cpp @@ -58,7 +58,7 @@ DEFINE_DEVICE_TYPE(MC10CART_SLOT, mc10cart_slot_device, "mc10cart_slot", "MC-10 mc10cart_slot_device::mc10cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, MC10CART_SLOT, tag, owner, clock), device_single_card_slot_interface(mconfig, *this), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), m_nmi_callback(*this), m_cart(nullptr), m_memspace(*this, finder_base::DUMMY_TAG, -1) diff --git a/src/devices/bus/mc10/mc10_cart.h b/src/devices/bus/mc10/mc10_cart.h index eba93284325..428316527e2 100644 --- a/src/devices/bus/mc10/mc10_cart.h +++ b/src/devices/bus/mc10/mc10_cart.h @@ -13,7 +13,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** TYPE DEFINITIONS @@ -25,7 +25,7 @@ class device_mc10cart_interface; class mc10cart_slot_device final : public device_t, public device_single_card_slot_interface, - public device_image_interface + public device_cartrom_image_interface { public: @@ -54,14 +54,7 @@ public: // image-level overrides virtual image_init_result call_load() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - - 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 true; } virtual const char *image_interface() const noexcept override { return "mc10_cart"; } virtual const char *file_extensions() const noexcept override { return "mcc,rom"; } diff --git a/src/devices/bus/megadrive/md_slot.cpp b/src/devices/bus/megadrive/md_slot.cpp index 47069101a44..769bdbdc173 100644 --- a/src/devices/bus/megadrive/md_slot.cpp +++ b/src/devices/bus/megadrive/md_slot.cpp @@ -161,10 +161,9 @@ uint32_t device_md_cart_interface::get_padded_size(uint32_t size) //------------------------------------------------- base_md_cart_slot_device::base_md_cart_slot_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), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), - m_type(SEGA_STD), m_cart(nullptr), - m_must_be_loaded(1) + m_type(SEGA_STD), m_cart(nullptr) { } diff --git a/src/devices/bus/megadrive/md_slot.h b/src/devices/bus/megadrive/md_slot.h index 78504c0e3f4..4ffb7407eee 100644 --- a/src/devices/bus/megadrive/md_slot.h +++ b/src/devices/bus/megadrive/md_slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** TYPE DEFINITIONS @@ -149,7 +149,7 @@ protected: // ======================> base_md_cart_slot_device class base_md_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -160,11 +160,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 m_must_be_loaded; } virtual bool is_reset_on_load() const noexcept override { return true; } // slot interface overrides @@ -178,7 +173,6 @@ public: void setup_custom_mappers(); void setup_nvram(); - void set_must_be_loaded(bool _must_be_loaded) { m_must_be_loaded = _must_be_loaded; } void file_logging(uint8_t *ROM, uint32_t rom_len, uint32_t nvram_len); void save_nvram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram(); } @@ -199,17 +193,12 @@ public: int m_type; device_md_cart_interface* m_cart; - bool m_must_be_loaded; protected: base_md_cart_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; - - // device_image_interface implementation - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - }; // ======================> md_cart_slot_device diff --git a/src/devices/bus/msx_slot/cartridge.cpp b/src/devices/bus/msx_slot/cartridge.cpp index de998d6d2c8..667bbaf3cc7 100644 --- a/src/devices/bus/msx_slot/cartridge.cpp +++ b/src/devices/bus/msx_slot/cartridge.cpp @@ -41,7 +41,7 @@ msx_slot_cartridge_device::msx_slot_cartridge_device(const machine_config &mconf msx_slot_cartridge_device::msx_slot_cartridge_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) + , device_cartrom_image_interface(mconfig, *this) , device_slot_interface(mconfig, *this) , msx_internal_slot_interface(mconfig, *this) , m_irq_handler(*this) diff --git a/src/devices/bus/msx_slot/cartridge.h b/src/devices/bus/msx_slot/cartridge.h index 36d0282f7b7..68d827edc93 100644 --- a/src/devices/bus/msx_slot/cartridge.h +++ b/src/devices/bus/msx_slot/cartridge.h @@ -7,7 +7,7 @@ #include "slot.h" #include "bus/msx_cart/cartridge.h" -#include "softlist_dev.h" +#include "imagedev/cartrom.h" DECLARE_DEVICE_TYPE(MSX_SLOT_CARTRIDGE, msx_slot_cartridge_device) @@ -15,7 +15,7 @@ DECLARE_DEVICE_TYPE(MSX_SLOT_YAMAHA_EXPANSION, msx_slot_yamaha_expansion_device) class msx_slot_cartridge_device : public device_t - , public device_image_interface + , public device_cartrom_image_interface , public device_slot_interface , public msx_internal_slot_interface { @@ -29,16 +29,9 @@ 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_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "msx_cart"; } virtual const char *file_extensions() const noexcept override { return "mx1,bin,rom"; } - virtual const char *custom_instance_name() const noexcept override { return "cartridge"; } - virtual const char *custom_brief_instance_name() const noexcept override { return "cart"; } // slot interface overrides virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override; @@ -56,9 +49,6 @@ protected: virtual void device_resolve_objects() override; virtual void device_start() override; - // device_image_interface implementation - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - devcb_write_line m_irq_handler; msx_cart_interface *m_cartridge; @@ -73,8 +63,8 @@ public: msx_slot_yamaha_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const char *image_interface() const noexcept override { return "msx_yamaha_60pin"; } - virtual const char *custom_instance_name() const noexcept override { return "cartridge60pin"; } - virtual const char *custom_brief_instance_name() const noexcept override { return "cart60p"; } + virtual const char *image_type_name() const noexcept override { return "cartridge60pin"; } + virtual const char *image_brief_type_name() const noexcept override { return "cart60p"; } protected: virtual void device_start() override; diff --git a/src/devices/bus/neogeo/slot.cpp b/src/devices/bus/neogeo/slot.cpp index 9f41293803f..f5cd7bf80b8 100644 --- a/src/devices/bus/neogeo/slot.cpp +++ b/src/devices/bus/neogeo/slot.cpp @@ -99,7 +99,7 @@ void device_neogeo_cart_interface::optimize_sprites(uint8_t* region_sprites, uin //------------------------------------------------- neogeo_cart_slot_device::neogeo_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock) : device_t(mconfig, NEOGEO_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_cart(nullptr) { diff --git a/src/devices/bus/neogeo/slot.h b/src/devices/bus/neogeo/slot.h index f2171a45eb1..4c86456ff61 100644 --- a/src/devices/bus/neogeo/slot.h +++ b/src/devices/bus/neogeo/slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /* PCB */ @@ -186,7 +186,7 @@ protected: // ======================> neogeo_cart_slot_device class neogeo_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -207,11 +207,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "neo_cart"; } virtual const char *file_extensions() const noexcept override { return "bin"; } @@ -338,9 +333,6 @@ 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 rom_software_list_loader::instance(); } - private: int m_type; device_neogeo_cart_interface* m_cart; diff --git a/src/devices/bus/nes/aladdin.cpp b/src/devices/bus/nes/aladdin.cpp index 325fd7bf87d..c3b4430fe12 100644 --- a/src/devices/bus/nes/aladdin.cpp +++ b/src/devices/bus/nes/aladdin.cpp @@ -68,7 +68,7 @@ DEFINE_DEVICE_TYPE(NES_ALADDIN_SLOT, nes_aladdin_slot_device, "nes_ade_slot", "N nes_aladdin_slot_device::nes_aladdin_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_ALADDIN_SLOT, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_cartrom_image_interface(mconfig, *this) , device_single_card_slot_interface(mconfig, *this) , m_cart(nullptr) { diff --git a/src/devices/bus/nes/aladdin.h b/src/devices/bus/nes/aladdin.h index 102abe68172..170649fdd30 100644 --- a/src/devices/bus/nes/aladdin.h +++ b/src/devices/bus/nes/aladdin.h @@ -6,7 +6,7 @@ #pragma once #include "nxrom.h" -#include "softlist_dev.h" +#include "imagedev/cartrom.h" //---------------------------------- @@ -44,7 +44,7 @@ protected: class nes_aladdin_device; class nes_aladdin_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { friend class nes_aladdin_device; @@ -66,11 +66,6 @@ public: // image-level overrides virtual image_init_result call_load() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "ade_cart"; } virtual const char *file_extensions() const noexcept override { return "nes,bin"; } @@ -85,9 +80,6 @@ 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 rom_software_list_loader::instance(); } - aladdin_cart_interface* m_cart; }; diff --git a/src/devices/bus/nes/datach.cpp b/src/devices/bus/nes/datach.cpp index c767830bd5a..a7e769f570f 100644 --- a/src/devices/bus/nes/datach.cpp +++ b/src/devices/bus/nes/datach.cpp @@ -68,7 +68,7 @@ DEFINE_DEVICE_TYPE(NES_DATACH_SLOT, nes_datach_slot_device, "nes_datach_slot", " nes_datach_slot_device::nes_datach_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_DATACH_SLOT, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_cartrom_image_interface(mconfig, *this) , device_single_card_slot_interface(mconfig, *this) , m_cart(nullptr) { diff --git a/src/devices/bus/nes/datach.h b/src/devices/bus/nes/datach.h index df12bbe5a86..9c34ada2163 100644 --- a/src/devices/bus/nes/datach.h +++ b/src/devices/bus/nes/datach.h @@ -6,7 +6,7 @@ #pragma once #include "bandai.h" -#include "softlist_dev.h" +#include "imagedev/cartrom.h" #include "machine/i2cmem.h" #include "machine/bcreader.h" @@ -46,7 +46,7 @@ protected: class nes_datach_device; class nes_datach_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { friend class nes_datach_device; @@ -67,11 +67,6 @@ public: // image-level overrides virtual image_init_result call_load() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "datach_cart"; } virtual const char *file_extensions() const noexcept override { return "nes,bin"; } @@ -86,9 +81,6 @@ 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 rom_software_list_loader::instance(); } - datach_cart_interface* m_cart; }; diff --git a/src/devices/bus/nes/karastudio.cpp b/src/devices/bus/nes/karastudio.cpp index 158af1ed2df..0ef56aa697a 100644 --- a/src/devices/bus/nes/karastudio.cpp +++ b/src/devices/bus/nes/karastudio.cpp @@ -72,7 +72,7 @@ DEFINE_DEVICE_TYPE(NES_KSEXPANSION_SLOT, nes_kstudio_slot_device, "nes_ks_slot", nes_kstudio_slot_device::nes_kstudio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_KSEXPANSION_SLOT, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_cartrom_image_interface(mconfig, *this) , device_single_card_slot_interface(mconfig, *this) , m_cart(nullptr) { diff --git a/src/devices/bus/nes/karastudio.h b/src/devices/bus/nes/karastudio.h index ced1ed31a21..95ea9b14881 100644 --- a/src/devices/bus/nes/karastudio.h +++ b/src/devices/bus/nes/karastudio.h @@ -6,7 +6,7 @@ #pragma once #include "nxrom.h" -#include "softlist_dev.h" +#include "imagedev/cartrom.h" //----------------------------------------- @@ -43,7 +43,7 @@ protected: class nes_karaokestudio_device; class nes_kstudio_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { friend class nes_karaokestudio_device; @@ -65,11 +65,6 @@ public: // image-level overrides virtual image_init_result call_load() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "ks_cart"; } virtual const char *file_extensions() const noexcept override { return "bin"; } @@ -84,9 +79,6 @@ 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 rom_software_list_loader::instance(); } - kstudio_cart_interface* m_cart; }; diff --git a/src/devices/bus/nes/nes_slot.cpp b/src/devices/bus/nes/nes_slot.cpp index fac3c7c1758..0f1dbb3aa50 100644 --- a/src/devices/bus/nes/nes_slot.cpp +++ b/src/devices/bus/nes/nes_slot.cpp @@ -760,12 +760,11 @@ void device_nes_cart_interface::nes_banks_restore() //------------------------------------------------- nes_cart_slot_device::nes_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_CART_SLOT, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_cartrom_image_interface(mconfig, *this) , device_single_card_slot_interface(mconfig, *this) , m_crc_hack(0) , m_cart(nullptr) , m_pcb_id(NO_BOARD) - , m_must_be_loaded(1) { } diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index 33f258f83cb..e28cea866b1 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -383,7 +383,7 @@ public: // ======================> nes_cart_slot_device class nes_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -404,11 +404,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 m_must_be_loaded; } virtual bool is_reset_on_load() const noexcept override { return true; } virtual const char *image_interface() const noexcept override { return "nes_cart"; } virtual const char *file_extensions() const noexcept override { return "nes,unf,unif"; } @@ -440,20 +435,14 @@ public: int get_crc_hack() { return m_crc_hack; } - void set_must_be_loaded(bool _must_be_loaded) { m_must_be_loaded = _must_be_loaded; } - //private: device_nes_cart_interface* m_cart; int m_pcb_id; - bool m_must_be_loaded; 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 rom_software_list_loader::instance(); } - const char * get_default_card_ines(get_default_card_software_hook &hook, const uint8_t *ROM, uint32_t len) const; static const char * get_default_card_unif(const uint8_t *ROM, uint32_t len); static const char * nes_get_slot(int pcb_id); diff --git a/src/devices/bus/nes/sunsoft_dcs.cpp b/src/devices/bus/nes/sunsoft_dcs.cpp index 04dc3219716..564c115c84a 100644 --- a/src/devices/bus/nes/sunsoft_dcs.cpp +++ b/src/devices/bus/nes/sunsoft_dcs.cpp @@ -52,7 +52,7 @@ DEFINE_DEVICE_TYPE(NES_NTB_SLOT, nes_ntb_slot_device, "nes_ntb_slot", "NES NTB C nes_ntb_slot_device::nes_ntb_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_NTB_SLOT, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_cartrom_image_interface(mconfig, *this) , device_single_card_slot_interface(mconfig, *this) , m_cart(nullptr) { diff --git a/src/devices/bus/nes/sunsoft_dcs.h b/src/devices/bus/nes/sunsoft_dcs.h index 87ca0bae5bd..491bc5d95ab 100644 --- a/src/devices/bus/nes/sunsoft_dcs.h +++ b/src/devices/bus/nes/sunsoft_dcs.h @@ -6,7 +6,7 @@ #pragma once #include "sunsoft.h" -#include "softlist_dev.h" +#include "imagedev/cartrom.h" //----------------------------------------------- @@ -40,7 +40,7 @@ protected: class nes_sunsoft_dcs_device; class nes_ntb_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { friend class nes_sunsoft_dcs_device; @@ -62,11 +62,6 @@ public: // image-level overrides virtual image_init_result call_load() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "ntb_cart"; } virtual const char *file_extensions() const noexcept override { return "bin"; } @@ -80,9 +75,6 @@ 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 rom_software_list_loader::instance(); } - ntb_cart_interface* m_cart; }; diff --git a/src/devices/bus/nubus/nubus_image.cpp b/src/devices/bus/nubus/nubus_image.cpp index bcf072338a6..ee7bacc4064 100644 --- a/src/devices/bus/nubus/nubus_image.cpp +++ b/src/devices/bus/nubus/nubus_image.cpp @@ -41,16 +41,13 @@ public: messimg_disk_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_QUICKLOAD; } - 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 *file_extensions() const noexcept override { return "img"; } - virtual const char *custom_instance_name() const noexcept override { return "disk"; } - virtual const char *custom_brief_instance_name() const noexcept override { return "disk"; } + virtual const char *image_type_name() const noexcept override { return "disk"; } + virtual const char *image_brief_type_name() const noexcept override { return "disk"; } virtual image_init_result call_load() override; virtual void call_unload() override; diff --git a/src/devices/bus/odyssey2/slot.cpp b/src/devices/bus/odyssey2/slot.cpp index 2abeb58737a..1e85ca3d4fa 100644 --- a/src/devices/bus/odyssey2/slot.cpp +++ b/src/devices/bus/odyssey2/slot.cpp @@ -52,7 +52,7 @@ device_o2_cart_interface::~device_o2_cart_interface() o2_cart_slot_device::o2_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, O2_CART_SLOT, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_cartrom_image_interface(mconfig, *this) , device_single_card_slot_interface(mconfig, *this) , m_type(O2_STD) , m_cart(nullptr) diff --git a/src/devices/bus/odyssey2/slot.h b/src/devices/bus/odyssey2/slot.h index db187b10bc0..09fcd34891e 100644 --- a/src/devices/bus/odyssey2/slot.h +++ b/src/devices/bus/odyssey2/slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /* @@ -94,7 +94,7 @@ protected: // ======================> o2_cart_slot_device class o2_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -116,11 +116,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override { } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual bool is_reset_on_load() const noexcept override { return true; } virtual const char *image_interface() const noexcept override { return "odyssey_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,rom"; } @@ -148,9 +143,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; device_o2_cart_interface* m_cart; int m_b; diff --git a/src/devices/bus/pce/pce_slot.cpp b/src/devices/bus/pce/pce_slot.cpp index 8f52410a1a3..5e30efbe283 100644 --- a/src/devices/bus/pce/pce_slot.cpp +++ b/src/devices/bus/pce/pce_slot.cpp @@ -136,7 +136,7 @@ void device_pce_cart_interface::rom_map_setup(uint32_t size) //------------------------------------------------- pce_cart_slot_device::pce_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCE_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_interface("pce_cart"), m_type(PCE_STD), m_cart(nullptr) diff --git a/src/devices/bus/pce/pce_slot.h b/src/devices/bus/pce/pce_slot.h index 79934087a0e..473c389aa61 100644 --- a/src/devices/bus/pce/pce_slot.h +++ b/src/devices/bus/pce/pce_slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -61,7 +61,7 @@ protected: // ======================> pce_cart_slot_device class pce_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -84,11 +84,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual bool is_reset_on_load() 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 "pce,bin"; } @@ -109,9 +104,6 @@ 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 rom_software_list_loader::instance(); } - const char *m_interface; int m_type; device_pce_cart_interface *m_cart; diff --git a/src/devices/bus/plus4/exp.cpp b/src/devices/bus/plus4/exp.cpp index 487de7ea3c2..1086683c02a 100644 --- a/src/devices/bus/plus4/exp.cpp +++ b/src/devices/bus/plus4/exp.cpp @@ -67,7 +67,7 @@ device_plus4_expansion_card_interface::~device_plus4_expansion_card_interface() plus4_expansion_slot_device::plus4_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PLUS4_EXPANSION_SLOT, tag, owner, clock), device_single_card_slot_interface(mconfig, *this), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), m_write_irq(*this), m_read_dma_cd(*this), m_write_dma_cd(*this), diff --git a/src/devices/bus/plus4/exp.h b/src/devices/bus/plus4/exp.h index 785207dd4f1..bac19750c2d 100644 --- a/src/devices/bus/plus4/exp.h +++ b/src/devices/bus/plus4/exp.h @@ -39,7 +39,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" //************************************************************************** @@ -52,7 +52,7 @@ class device_plus4_expansion_card_interface; class plus4_expansion_slot_device : public device_t, public device_single_card_slot_interface, - public device_image_interface + public device_cartrom_image_interface { public: // construction/destruction @@ -89,14 +89,7 @@ protected: // image-level overrides virtual image_init_result call_load() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - - 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 true; } virtual const char *image_interface() const noexcept override { return "plus4_cart"; } virtual const char *file_extensions() const noexcept override { return "rom,bin"; } diff --git a/src/devices/bus/pofo/ccm.cpp b/src/devices/bus/pofo/ccm.cpp index 1ab5c3054b8..d491af7266f 100644 --- a/src/devices/bus/pofo/ccm.cpp +++ b/src/devices/bus/pofo/ccm.cpp @@ -9,6 +9,8 @@ #include "emu.h" #include "ccm.h" +#include "softlist_dev.h" + //************************************************************************** @@ -46,7 +48,7 @@ device_portfolio_memory_card_slot_interface::device_portfolio_memory_card_slot_i portfolio_memory_card_slot_device::portfolio_memory_card_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PORTFOLIO_MEMORY_CARD_SLOT, tag, owner, clock), device_single_card_slot_interface(mconfig, *this), - device_image_interface(mconfig, *this), + device_memcard_image_interface(mconfig, *this), m_card(nullptr) { } @@ -80,6 +82,16 @@ image_init_result portfolio_memory_card_slot_device::call_load() } +//------------------------------------------------- +// get_software_list_loader - +//------------------------------------------------- + +const software_list_loader &portfolio_memory_card_slot_device::get_software_list_loader() const +{ + return rom_software_list_loader::instance(); +} + + //------------------------------------------------- // get_default_card_software - //------------------------------------------------- diff --git a/src/devices/bus/pofo/ccm.h b/src/devices/bus/pofo/ccm.h index 7dc0698453f..53e3c7a65ea 100644 --- a/src/devices/bus/pofo/ccm.h +++ b/src/devices/bus/pofo/ccm.h @@ -48,7 +48,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/memcard.h" @@ -92,7 +92,7 @@ protected: class portfolio_memory_card_slot_device : public device_t, public device_single_card_slot_interface, - public device_image_interface + public device_memcard_image_interface { public: // construction/destruction @@ -120,14 +120,8 @@ protected: // image-level overrides virtual image_init_result call_load() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } + virtual const software_list_loader &get_software_list_loader() const override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - - 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 true; } virtual const char *image_interface() const noexcept override { return "pofo_card"; } virtual const char *file_extensions() const noexcept override { return "rom,bin"; } diff --git a/src/devices/bus/psx/memcard.cpp b/src/devices/bus/psx/memcard.cpp index a2826083b48..ea282337746 100644 --- a/src/devices/bus/psx/memcard.cpp +++ b/src/devices/bus/psx/memcard.cpp @@ -43,7 +43,7 @@ enum transfer_states psxcard_device::psxcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PSXCARD, tag, owner, clock), - device_image_interface(mconfig, *this), + device_memcard_image_interface(mconfig, *this), pkt_ptr(0), pkt_sz(0), cmd(0), diff --git a/src/devices/bus/psx/memcard.h b/src/devices/bus/psx/memcard.h index 05bba518d60..8a4b461cd6b 100644 --- a/src/devices/bus/psx/memcard.h +++ b/src/devices/bus/psx/memcard.h @@ -5,22 +5,18 @@ #pragma once +#include "imagedev/memcard.h" + class psx_controller_port_device; class psxcard_device : public device_t, - public device_image_interface + public device_memcard_image_interface { public: psxcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual iodevice_t image_type() const noexcept override { return IO_MEMCARD; } - - 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 "mc"; } diff --git a/src/devices/bus/qbus/pc11.cpp b/src/devices/bus/qbus/pc11.cpp index 984c8f14e4e..a5538162b9a 100644 --- a/src/devices/bus/qbus/pc11.cpp +++ b/src/devices/bus/qbus/pc11.cpp @@ -4,6 +4,8 @@ DEC PC11 paper tape reader and punch controller (punch not implemented) + FIXME: PC11 is a Unibus device with no direct Q-bus counterpart + ***************************************************************************/ #include "emu.h" @@ -53,8 +55,7 @@ const char* pc11_regnames[] = { //------------------------------------------------- pc11_device::pc11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, DEC_PC11, tag, owner, clock) - , device_image_interface(mconfig, *this) + : paper_tape_reader_device(mconfig, DEC_PC11, tag, owner, clock) , device_qbus_card_interface(mconfig, *this) , m_rxvec(070) , m_txvec(074) diff --git a/src/devices/bus/qbus/pc11.h b/src/devices/bus/qbus/pc11.h index 163e661c9c9..46dc60c0b7e 100644 --- a/src/devices/bus/qbus/pc11.h +++ b/src/devices/bus/qbus/pc11.h @@ -13,8 +13,8 @@ #include "qbus.h" +#include "imagedev/papertape.h" #include "machine/pdp11.h" -#include "softlist_dev.h" #define PTRCSR_IMP (CSR_ERR + CSR_BUSY + CSR_DONE + CSR_IE) @@ -29,8 +29,7 @@ // ======================> pc11_device -class pc11_device : public device_t, - public device_image_interface, +class pc11_device : public paper_tape_reader_device, public device_qbus_card_interface { public: @@ -38,19 +37,11 @@ public: pc11_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_PUNCHTAPE; } - - 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 "pdp11_ptap"; } virtual const char *file_extensions() const noexcept override { return "bin,bim,lda"; } virtual image_init_result call_load() override; virtual void call_unload() override; - virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } uint16_t read(offs_t offset); void write(offs_t offset, uint16_t data); diff --git a/src/devices/bus/ql/rom.cpp b/src/devices/bus/ql/rom.cpp index f6b54fdc907..a3186b9a5b8 100644 --- a/src/devices/bus/ql/rom.cpp +++ b/src/devices/bus/ql/rom.cpp @@ -62,7 +62,8 @@ void device_ql_rom_cartridge_card_interface::interface_post_start() ql_rom_cartridge_slot_device::ql_rom_cartridge_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, QL_ROM_CARTRIDGE_SLOT, tag, owner, clock), device_single_card_slot_interface(mconfig, *this), - device_image_interface(mconfig, *this), m_card(nullptr) + device_cartrom_image_interface(mconfig, *this), + m_card(nullptr) { } diff --git a/src/devices/bus/ql/rom.h b/src/devices/bus/ql/rom.h index bfd06793d8c..690b3c231bc 100644 --- a/src/devices/bus/ql/rom.h +++ b/src/devices/bus/ql/rom.h @@ -30,7 +30,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" //************************************************************************** @@ -70,7 +70,7 @@ protected: class ql_rom_cartridge_slot_device : public device_t, public device_single_card_slot_interface, - public device_image_interface + public device_cartrom_image_interface { public: // construction/destruction @@ -97,14 +97,7 @@ protected: // image-level overrides virtual image_init_result call_load() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - - 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 true; } virtual const char *image_interface() const noexcept override { return "ql_cart"; } virtual const char *file_extensions() const noexcept override { return "rom,bin"; } diff --git a/src/devices/bus/saturn/sat_slot.cpp b/src/devices/bus/saturn/sat_slot.cpp index 955e3478f3e..068e34a3f93 100644 --- a/src/devices/bus/saturn/sat_slot.cpp +++ b/src/devices/bus/saturn/sat_slot.cpp @@ -104,7 +104,7 @@ void device_sat_cart_interface::dram1_alloc(uint32_t size) //------------------------------------------------- sat_cart_slot_device::sat_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SATURN_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_cart(nullptr) { diff --git a/src/devices/bus/saturn/sat_slot.h b/src/devices/bus/saturn/sat_slot.h index 9193cc2aa20..e4370e4c592 100644 --- a/src/devices/bus/saturn/sat_slot.h +++ b/src/devices/bus/saturn/sat_slot.h @@ -3,7 +3,7 @@ #ifndef MAME_BUS_SATURN_SAT_SLOT_H #define MAME_BUS_SATURN_SAT_SLOT_H -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -62,7 +62,7 @@ protected: // ======================> sat_cart_slot_device class sat_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -83,11 +83,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "sat_cart"; } virtual const char *file_extensions() const noexcept override { return "bin"; } @@ -110,9 +105,6 @@ 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 rom_software_list_loader::instance(); } - private: device_sat_cart_interface* m_cart; }; diff --git a/src/devices/bus/scv/slot.cpp b/src/devices/bus/scv/slot.cpp index 0d63399faea..448131cbd17 100644 --- a/src/devices/bus/scv/slot.cpp +++ b/src/devices/bus/scv/slot.cpp @@ -73,7 +73,7 @@ void device_scv_cart_interface::ram_alloc(uint32_t size) //------------------------------------------------- scv_cart_slot_device::scv_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SCV_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_type(SCV_8K), m_cart(nullptr) { diff --git a/src/devices/bus/scv/slot.h b/src/devices/bus/scv/slot.h index 2d962f6fc30..8d818221be2 100644 --- a/src/devices/bus/scv/slot.h +++ b/src/devices/bus/scv/slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -61,7 +61,7 @@ protected: // ======================> scv_cart_slot_device class scv_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -83,11 +83,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override { } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "scv_cart"; } virtual const char *file_extensions() const noexcept override { return "bin"; } @@ -109,9 +104,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; device_scv_cart_interface* m_cart; }; diff --git a/src/devices/bus/sdk85/memexp.cpp b/src/devices/bus/sdk85/memexp.cpp index ba7f402ca68..a5a752c4339 100644 --- a/src/devices/bus/sdk85/memexp.cpp +++ b/src/devices/bus/sdk85/memexp.cpp @@ -16,7 +16,7 @@ DEFINE_DEVICE_TYPE(SDK85_ROMEXP, sdk85_romexp_device, "sdk85_romexp", "SDK-85 ex sdk85_romexp_device::sdk85_romexp_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, SDK85_ROMEXP, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_rom_image_interface(mconfig, *this) , device_single_card_slot_interface(mconfig, *this) , m_dev(nullptr) { diff --git a/src/devices/bus/sdk85/memexp.h b/src/devices/bus/sdk85/memexp.h index 3023ea584bf..fbd005c48c2 100644 --- a/src/devices/bus/sdk85/memexp.h +++ b/src/devices/bus/sdk85/memexp.h @@ -6,7 +6,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" // ======================> device_sdk85_romexp_card_interface @@ -28,7 +28,7 @@ protected: // ======================> sdk85_romexp_device class sdk85_romexp_device : public device_t, - public device_image_interface, + public device_rom_image_interface, public device_single_card_slot_interface { public: @@ -59,17 +59,10 @@ protected: virtual image_init_result call_load() override; virtual void call_unload() override { } - virtual iodevice_t image_type() const noexcept override { return IO_ROM; } - 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 true; } virtual const char *image_interface() const noexcept override { return "sdk85_rom"; } virtual const char *file_extensions() const noexcept override { return "bin"; } - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - // slot interface overrides virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override; diff --git a/src/devices/bus/sega8/sega8_slot.cpp b/src/devices/bus/sega8/sega8_slot.cpp index e6d6f17a5f4..14f100e5abb 100644 --- a/src/devices/bus/sega8/sega8_slot.cpp +++ b/src/devices/bus/sega8/sega8_slot.cpp @@ -118,7 +118,7 @@ void device_sega8_cart_interface::ram_alloc(uint32_t size) sega8_cart_slot_device::sega8_cart_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, bool is_card) : device_t(mconfig, type, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_cartrom_image_interface(mconfig, *this) , device_single_card_slot_interface(mconfig, *this) , m_type(SEGA8_BASE_ROM) , m_is_card(is_card) diff --git a/src/devices/bus/sega8/sega8_slot.h b/src/devices/bus/sega8/sega8_slot.h index 05502dad7d8..9118309ce33 100644 --- a/src/devices/bus/sega8/sega8_slot.h +++ b/src/devices/bus/sega8/sega8_slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -107,7 +107,7 @@ protected: // ======================> sega8_cart_slot_device class sega8_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -118,15 +118,8 @@ public: // image-level overrides virtual image_init_result call_load() override; virtual void call_unload() override; - virtual const char *custom_instance_name() const noexcept override { return "cartridge"; } - virtual const char *custom_brief_instance_name() const noexcept override { return "cart"; } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } - virtual bool must_be_loaded() const noexcept override { return false; } virtual const char *image_interface() const noexcept override { return "sms_cart"; } virtual const char *file_extensions() const noexcept override { return "bin"; } @@ -161,9 +154,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; bool const m_is_card; device_sega8_cart_interface* m_cart; @@ -177,8 +167,8 @@ public: // construction/destruction sega8_card_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual const char *custom_instance_name() const noexcept override { return "card"; } - virtual const char *custom_brief_instance_name() const noexcept override { return "card"; } + virtual const char *image_type_name() const noexcept override { return "card"; } + virtual const char *image_brief_type_name() const noexcept override { return "card"; } protected: // construction/destruction @@ -201,7 +191,6 @@ public: set_fixed(false); } sg1000_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual bool must_be_loaded() const noexcept override { return true; } virtual const char *image_interface() const noexcept override { return "sg1000_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,sg"; } }; @@ -222,7 +211,6 @@ public: set_fixed(false); } omv_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual bool must_be_loaded() const noexcept override { return false; } virtual const char *image_interface() const noexcept override { return "sg1000_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,sg"; } }; @@ -243,7 +231,6 @@ public: set_fixed(false); } sc3000_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual bool must_be_loaded() const noexcept override { return true; } virtual const char *image_interface() const noexcept override { return "sg1000_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,sg,sc"; } }; @@ -264,7 +251,6 @@ public: set_fixed(false); } sg1000mk3_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual bool must_be_loaded() const noexcept override { return false; } virtual const char *image_interface() const noexcept override { return "sms_cart,sg1000_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,sms,sg"; } }; @@ -285,7 +271,6 @@ public: set_fixed(false); } sms_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual bool must_be_loaded() const noexcept override { return false; } virtual const char *image_interface() const noexcept override { return "sms_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,sms"; } }; @@ -306,7 +291,6 @@ public: set_fixed(false); } gamegear_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual bool must_be_loaded() const noexcept override { return true; } virtual const char *image_interface() const noexcept override { return "gamegear_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,gg"; } }; @@ -328,7 +312,6 @@ public: set_fixed(false); } sms_card_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual bool must_be_loaded() const noexcept override { return false; } virtual const char *image_interface() const noexcept override { return "sms_card"; } virtual const char *file_extensions() const noexcept override { return "bin"; } }; diff --git a/src/devices/bus/snes/snes_slot.cpp b/src/devices/bus/snes/snes_slot.cpp index 9cb4a0a0f81..8d5cf767b6f 100644 --- a/src/devices/bus/snes/snes_slot.cpp +++ b/src/devices/bus/snes/snes_slot.cpp @@ -221,7 +221,7 @@ offs_t device_sns_cart_interface::address_r() //------------------------------------------------- base_sns_cart_slot_device::base_sns_cart_slot_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), + device_cartrom_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), m_addon(ADDON_NONE), m_type(SNES_MODE20), diff --git a/src/devices/bus/snes/snes_slot.h b/src/devices/bus/snes/snes_slot.h index e4be59b6fc1..cb90c41d64f 100644 --- a/src/devices/bus/snes/snes_slot.h +++ b/src/devices/bus/snes/snes_slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -164,7 +164,7 @@ protected: // ======================> base_sns_cart_slot_device class base_sns_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_slot_interface { public: @@ -181,11 +181,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual bool is_reset_on_load() const noexcept override { return true; } // slot interface overrides @@ -244,9 +239,6 @@ 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 rom_software_list_loader::instance(); } - private: devcb_write_line m_irq_callback; devcb_read8 m_open_bus_callback; @@ -292,7 +284,6 @@ public: sns_sufami_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const char *image_interface() const noexcept override { return "st_cart"; } virtual const char *file_extensions() const noexcept override { return "st"; } - virtual bool must_be_loaded() const noexcept override { return false; } }; // ======================> sns_sufami_cart_slot_device @@ -313,7 +304,6 @@ public: sns_bsx_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const char *image_interface() const noexcept override { return "bspack"; } virtual const char *file_extensions() const noexcept override { return "bs"; } - virtual bool must_be_loaded() const noexcept override { return false; } }; diff --git a/src/devices/bus/ti99/gromport/cartridges.cpp b/src/devices/bus/ti99/gromport/cartridges.cpp index bc9c539fc9a..a6c80531f19 100644 --- a/src/devices/bus/ti99/gromport/cartridges.cpp +++ b/src/devices/bus/ti99/gromport/cartridges.cpp @@ -92,7 +92,7 @@ static const pcb_type sw_pcbdefs[] = ti99_cartridge_device::ti99_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TI99_CART, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), m_pcbtype(0), m_slot(0), m_pcb(nullptr), diff --git a/src/devices/bus/ti99/gromport/cartridges.h b/src/devices/bus/ti99/gromport/cartridges.h index ccf8773c79b..be4a8840d84 100644 --- a/src/devices/bus/ti99/gromport/cartridges.h +++ b/src/devices/bus/ti99/gromport/cartridges.h @@ -10,11 +10,11 @@ #include "gromport.h" +#include "imagedev/cartrom.h" #include "machine/tmc0430.h" #include "formats/rpk.h" #include "emuopts.h" -#include "softlist_dev.h" #include "utilfwd.h" @@ -23,7 +23,7 @@ namespace bus::ti99::gromport { class ti99_cartridge_pcb; -class ti99_cartridge_device : public device_t, public device_image_interface +class ti99_cartridge_device : public device_t, public device_cartrom_image_interface { public: ti99_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); @@ -53,16 +53,10 @@ protected: // Image handling: implementation of methods which are abstract in the parent image_init_result call_load() override; void call_unload() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } void prepare_cartridge(); // device_image_interface - iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - bool is_readable() const noexcept override { return true; } - bool is_writeable() const noexcept override { return false; } - bool is_creatable() const noexcept override { return false; } - bool must_be_loaded() const noexcept override { return false; } bool is_reset_on_load() const noexcept override { return false; } const char *image_interface() const noexcept override { return "ti99_cart"; } const char *file_extensions() const noexcept override { return "rpk"; } diff --git a/src/devices/bus/ti99/peb/ti_rs232.h b/src/devices/bus/ti99/peb/ti_rs232.h index 6716722dc9f..91f7572754d 100644 --- a/src/devices/bus/ti99/peb/ti_rs232.h +++ b/src/devices/bus/ti99/peb/ti_rs232.h @@ -133,12 +133,13 @@ class ti_rs232_attached_device : public device_t, public device_image_interface public: ti_rs232_attached_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - iodevice_t image_type() const noexcept override { return IO_SERIAL; } bool is_readable() const noexcept override { return true; } bool is_writeable() const noexcept override { return true; } bool is_creatable() const noexcept override { return true; } - bool must_be_loaded() const noexcept override { return false; } bool is_reset_on_load() const noexcept override { return false; } + bool support_command_line_image_creation() const noexcept override { return true; } + const char *image_type_name() const noexcept override { return "serial"; } + const char *image_brief_type_name() const noexcept override { return "serl"; } const char *image_interface() const noexcept override { return ""; } const char *file_extensions() const noexcept override { return ""; } void connect(tms9902_device *dev) { m_uart = dev; } @@ -161,12 +162,13 @@ class ti_pio_attached_device : public device_t, public device_image_interface public: ti_pio_attached_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - iodevice_t image_type() const noexcept override { return IO_PARALLEL; } bool is_readable() const noexcept override { return true; } bool is_writeable() const noexcept override { return true; } bool is_creatable() const noexcept override { return true; } - bool must_be_loaded() const noexcept override { return false; } bool is_reset_on_load() const noexcept override { return false; } + bool support_command_line_image_creation() const noexcept override { return true; } + const char *image_type_name() const noexcept override { return "parallel"; } + const char *image_brief_type_name() const noexcept override { return "parl"; } const char *image_interface() const noexcept override { return ""; } const char *file_extensions() const noexcept override { return ""; } diff --git a/src/devices/bus/ti99x/990_tap.cpp b/src/devices/bus/ti99x/990_tap.cpp index 917c736fe11..dff4f68a7a0 100644 --- a/src/devices/bus/ti99x/990_tap.cpp +++ b/src/devices/bus/ti99x/990_tap.cpp @@ -33,6 +33,8 @@ #include "emu.h" #include "990_tap.h" +#include "imagedev/magtape.h" + enum { w0_offline = 0x8000, @@ -887,21 +889,13 @@ 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; } virtual const char *file_extensions() const noexcept override { return "tap"; } virtual image_init_result call_load() override; @@ -918,7 +912,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) { } diff --git a/src/devices/bus/vboy/slot.cpp b/src/devices/bus/vboy/slot.cpp index b80480fe953..abbbd527941 100644 --- a/src/devices/bus/vboy/slot.cpp +++ b/src/devices/bus/vboy/slot.cpp @@ -33,7 +33,7 @@ DEFINE_DEVICE_TYPE(VBOY_CART_SLOT, vboy_cart_slot_device, "vboy_cart_slot", "Nin vboy_cart_slot_device::vboy_cart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : device_t(mconfig, VBOY_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_intcro(*this), m_exp_space(*this, finder_base::DUMMY_TAG, -1, 32), diff --git a/src/devices/bus/vboy/slot.h b/src/devices/bus/vboy/slot.h index b804a8624d8..650c3380636 100644 --- a/src/devices/bus/vboy/slot.h +++ b/src/devices/bus/vboy/slot.h @@ -62,7 +62,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" //************************************************************************** @@ -79,7 +79,7 @@ class device_vboy_cart_interface; class vboy_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -103,11 +103,6 @@ public: // device_image_interface implementation virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual bool is_reset_on_load() const noexcept override { return true; } virtual char const *image_interface() const noexcept override { return "vboy_cart"; } virtual char const *file_extensions() const noexcept override { return "vb,bin"; } @@ -121,9 +116,6 @@ protected: virtual void device_resolve_objects() override ATTR_COLD; virtual void device_start() override ATTR_COLD; - // device_image_interface implementation - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - private: devcb_write_line m_intcro; optional_address_space m_exp_space; diff --git a/src/devices/bus/vc4000/slot.cpp b/src/devices/bus/vc4000/slot.cpp index 94de9446dc2..ce8acfcbf43 100644 --- a/src/devices/bus/vc4000/slot.cpp +++ b/src/devices/bus/vc4000/slot.cpp @@ -84,7 +84,7 @@ vc4000_cart_slot_device::vc4000_cart_slot_device( device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_cartrom_image_interface(mconfig, *this) , device_single_card_slot_interface(mconfig, *this) , m_type(VC4000_STD) , m_cart(nullptr) diff --git a/src/devices/bus/vc4000/slot.h b/src/devices/bus/vc4000/slot.h index 7d9df824d4e..39de8414d0b 100644 --- a/src/devices/bus/vc4000/slot.h +++ b/src/devices/bus/vc4000/slot.h @@ -3,7 +3,7 @@ #ifndef MAME_BUS_VC4000_SLOT_H #define MAME_BUS_VC4000_SLOT_H -#include "softlist_dev.h" +#include "imagedev/cartrom.h" #define VC4000SLOT_ROM_REGION_TAG ":cart:rom" @@ -54,7 +54,7 @@ protected: // ======================> vc4000_cart_slot_device class vc4000_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -75,11 +75,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override { } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "vc4000_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,rom"; } @@ -108,9 +103,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; device_vc4000_cart_interface *m_cart; }; diff --git a/src/devices/bus/vcs/vcs_slot.cpp b/src/devices/bus/vcs/vcs_slot.cpp index 3d0fe0e4fb9..7be008584c5 100644 --- a/src/devices/bus/vcs/vcs_slot.cpp +++ b/src/devices/bus/vcs/vcs_slot.cpp @@ -78,7 +78,7 @@ void device_vcs_cart_interface::ram_alloc(uint32_t size) //------------------------------------------------- vcs_cart_slot_device::vcs_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VCS_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_cart(nullptr), m_type(0) { diff --git a/src/devices/bus/vcs/vcs_slot.h b/src/devices/bus/vcs/vcs_slot.h index 8766ae31f33..673db585543 100644 --- a/src/devices/bus/vcs/vcs_slot.h +++ b/src/devices/bus/vcs/vcs_slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -84,7 +84,7 @@ protected: // ======================> vcs_cart_slot_device class vcs_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -105,11 +105,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual bool is_reset_on_load() const noexcept override { return true; } virtual const char *image_interface() const noexcept override { return "a2600_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,a26"; } @@ -130,9 +125,6 @@ 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 rom_software_list_loader::instance(); } - private: device_vcs_cart_interface* m_cart; int m_type; diff --git a/src/devices/bus/vectrex/slot.cpp b/src/devices/bus/vectrex/slot.cpp index ffb7f515379..71b9be61a83 100644 --- a/src/devices/bus/vectrex/slot.cpp +++ b/src/devices/bus/vectrex/slot.cpp @@ -63,7 +63,7 @@ void device_vectrex_cart_interface::rom_alloc(uint32_t size, const char *tag) //------------------------------------------------- vectrex_cart_slot_device::vectrex_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VECTREX_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_type(VECTREX_STD), m_vec3d(VEC3D_NONE), diff --git a/src/devices/bus/vectrex/slot.h b/src/devices/bus/vectrex/slot.h index 38819b2bb8e..d010bae8e62 100644 --- a/src/devices/bus/vectrex/slot.h +++ b/src/devices/bus/vectrex/slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -59,7 +59,7 @@ protected: // ======================> vectrex_cart_slot_device class vectrex_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -71,11 +71,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override { } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "vectrex_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,gam,vec"; } @@ -95,9 +90,6 @@ 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 rom_software_list_loader::instance(); } - int m_type, m_vec3d; device_vectrex_cart_interface* m_cart; }; diff --git a/src/devices/bus/vic10/exp.cpp b/src/devices/bus/vic10/exp.cpp index 48f42ad73c1..c09651066ba 100644 --- a/src/devices/bus/vic10/exp.cpp +++ b/src/devices/bus/vic10/exp.cpp @@ -56,7 +56,7 @@ device_vic10_expansion_card_interface::~device_vic10_expansion_card_interface() vic10_expansion_slot_device::vic10_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC10_EXPANSION_SLOT, tag, owner, clock), device_single_card_slot_interface(mconfig, *this), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), m_write_irq(*this), m_write_res(*this), m_write_cnt(*this), diff --git a/src/devices/bus/vic10/exp.h b/src/devices/bus/vic10/exp.h index c2b1f52ec70..36098dfc2cf 100644 --- a/src/devices/bus/vic10/exp.h +++ b/src/devices/bus/vic10/exp.h @@ -36,7 +36,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" #include "formats/cbm_crt.h" @@ -50,7 +50,7 @@ class device_vic10_expansion_card_interface; class vic10_expansion_slot_device : public device_t, public device_single_card_slot_interface, - public device_image_interface + public device_cartrom_image_interface { public: // construction/destruction @@ -88,14 +88,7 @@ protected: // image-level overrides virtual image_init_result call_load() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - - 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 true; } virtual bool is_reset_on_load() const noexcept override { return true; } virtual const char *image_interface() const noexcept override { return "vic10_cart"; } virtual const char *file_extensions() const noexcept override { return "80,e0"; } diff --git a/src/devices/bus/vic20/exp.cpp b/src/devices/bus/vic20/exp.cpp index c7f0120b25f..0746b3092da 100644 --- a/src/devices/bus/vic20/exp.cpp +++ b/src/devices/bus/vic20/exp.cpp @@ -55,7 +55,7 @@ device_vic20_expansion_card_interface::~device_vic20_expansion_card_interface() vic20_expansion_slot_device::vic20_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC20_EXPANSION_SLOT, tag, owner, clock), device_single_card_slot_interface(mconfig, *this), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), m_write_irq(*this), m_write_nmi(*this), m_write_res(*this), diff --git a/src/devices/bus/vic20/exp.h b/src/devices/bus/vic20/exp.h index dab459cf7bf..a9bfc781638 100644 --- a/src/devices/bus/vic20/exp.h +++ b/src/devices/bus/vic20/exp.h @@ -36,7 +36,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" //************************************************************************** @@ -49,7 +49,7 @@ class device_vic20_expansion_card_interface; class vic20_expansion_slot_device : public device_t, public device_single_card_slot_interface, - public device_image_interface + public device_cartrom_image_interface { public: // construction/destruction @@ -86,14 +86,7 @@ protected: // image-level overrides virtual image_init_result call_load() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - - 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 true; } virtual const char *image_interface() const noexcept override { return "vic1001_cart"; } virtual const char *file_extensions() const noexcept override { return "20,40,60,70,a0,b0,crt"; } diff --git a/src/devices/bus/vidbrain/exp.cpp b/src/devices/bus/vidbrain/exp.cpp index 9923ab76fbd..42cd7ebe9ba 100644 --- a/src/devices/bus/vidbrain/exp.cpp +++ b/src/devices/bus/vidbrain/exp.cpp @@ -82,7 +82,7 @@ uint8_t* device_videobrain_expansion_card_interface::videobrain_ram_pointer(runn videobrain_expansion_slot_device::videobrain_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIDEOBRAIN_EXPANSION_SLOT, tag, owner, clock), device_single_card_slot_interface(mconfig, *this), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), m_write_extres(*this), m_cart(nullptr) { } diff --git a/src/devices/bus/vidbrain/exp.h b/src/devices/bus/vidbrain/exp.h index 4850de91f9e..a72cc410adc 100644 --- a/src/devices/bus/vidbrain/exp.h +++ b/src/devices/bus/vidbrain/exp.h @@ -39,7 +39,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" //************************************************************************** @@ -84,7 +84,7 @@ protected: class videobrain_expansion_slot_device : public device_t, public device_single_card_slot_interface, - public device_image_interface + public device_cartrom_image_interface { public: // construction/destruction @@ -121,14 +121,7 @@ protected: // image-level overrides virtual image_init_result call_load() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - - 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 true; } virtual const char *image_interface() const noexcept override { return "vidbrain_cart"; } virtual const char *file_extensions() const noexcept override { return "bin"; } diff --git a/src/devices/bus/vsmile/vsmile_slot.cpp b/src/devices/bus/vsmile/vsmile_slot.cpp index 9c2906826c9..f7a44c3014a 100644 --- a/src/devices/bus/vsmile/vsmile_slot.cpp +++ b/src/devices/bus/vsmile/vsmile_slot.cpp @@ -74,7 +74,7 @@ void device_vsmile_cart_interface::nvram_alloc(uint32_t size) //------------------------------------------------- vsmile_cart_slot_device::vsmile_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VSMILE_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_type(VSMILE_STD), m_cart(nullptr) diff --git a/src/devices/bus/vsmile/vsmile_slot.h b/src/devices/bus/vsmile/vsmile_slot.h index a17163ad105..910e352db21 100644 --- a/src/devices/bus/vsmile/vsmile_slot.h +++ b/src/devices/bus/vsmile/vsmile_slot.h @@ -5,7 +5,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -64,7 +64,7 @@ protected: // ======================> vsmile_cart_slot_device class vsmile_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -85,11 +85,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual const char *image_interface() const noexcept override { return "vsmile_cart"; } virtual const char *file_extensions() const noexcept override { return "u1,u3,bin"; } @@ -117,9 +112,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; device_vsmile_cart_interface* m_cart; }; diff --git a/src/devices/bus/wswan/slot.cpp b/src/devices/bus/wswan/slot.cpp index 3e11eb00908..6062540b4cf 100644 --- a/src/devices/bus/wswan/slot.cpp +++ b/src/devices/bus/wswan/slot.cpp @@ -78,7 +78,7 @@ void device_ws_cart_interface::nvram_alloc(u32 size) //------------------------------------------------- ws_cart_slot_device::ws_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, WS_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface(mconfig, *this), m_type(WS_STD), m_cart(nullptr) diff --git a/src/devices/bus/wswan/slot.h b/src/devices/bus/wswan/slot.h index 21abdb7fc13..8a743a2ac07 100644 --- a/src/devices/bus/wswan/slot.h +++ b/src/devices/bus/wswan/slot.h @@ -66,7 +66,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -128,7 +128,7 @@ protected: // ======================> ws_cart_slot_device class ws_cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -149,11 +149,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 true; } virtual bool is_reset_on_load() const noexcept override { return true; } virtual const char *image_interface() const noexcept override { return "wswan_cart"; } virtual const char *file_extensions() const noexcept override { return "ws,wsc,bin"; } @@ -180,9 +175,6 @@ 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 rom_software_list_loader::instance(); } - int m_type; device_ws_cart_interface* m_cart; }; diff --git a/src/devices/bus/z88/z88.cpp b/src/devices/bus/z88/z88.cpp index 024c960a9b7..6030ac2d1bc 100644 --- a/src/devices/bus/z88/z88.cpp +++ b/src/devices/bus/z88/z88.cpp @@ -57,7 +57,7 @@ device_z88cart_interface::~device_z88cart_interface() //------------------------------------------------- z88cart_slot_device::z88cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z88CART_SLOT, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_cartrom_image_interface(mconfig, *this) , device_single_card_slot_interface(mconfig, *this) , m_out_flp_cb(*this) , m_cart(nullptr) diff --git a/src/devices/bus/z88/z88.h b/src/devices/bus/z88/z88.h index 15207ff66df..93d516cc071 100644 --- a/src/devices/bus/z88/z88.h +++ b/src/devices/bus/z88/z88.h @@ -56,7 +56,7 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** @@ -85,7 +85,7 @@ protected: // ======================> z88cart_slot_device class z88cart_slot_device : public device_t, - public device_image_interface, + public device_cartrom_image_interface, public device_single_card_slot_interface { public: @@ -107,11 +107,6 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 "z88_cart"; } virtual const char *file_extensions() const noexcept override { return "epr,bin"; } @@ -129,9 +124,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 rom_software_list_loader::instance(); } - private: static constexpr device_timer_id TIMER_FLP_CLEAR = 0; 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 @@ -38,6 +38,16 @@ static char const *const hd_option_spec = // device type definition 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(); } }; diff --git a/src/devices/machine/ds6417.cpp b/src/devices/machine/ds6417.cpp index ef359d9ffd1..51ae6e7a201 100644 --- a/src/devices/machine/ds6417.cpp +++ b/src/devices/machine/ds6417.cpp @@ -10,7 +10,7 @@ DEFINE_DEVICE_TYPE(DS6417, ds6417_device, "ds6417", "Dallas DS6417 CyberCard") ds6417_device::ds6417_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DS6417, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_memcard_image_interface(mconfig, *this) { } diff --git a/src/devices/machine/ds6417.h b/src/devices/machine/ds6417.h index d2bae0d2e77..94d5e109426 100644 --- a/src/devices/machine/ds6417.h +++ b/src/devices/machine/ds6417.h @@ -6,20 +6,18 @@ #ifndef MAME_MACHINE_DS6417_H_ #define MAME_MACHINE_DS6417_H_ +#pragma once + +#include "imagedev/memcard.h" + class ds6417_device : public device_t, - public device_image_interface + public device_memcard_image_interface { public: // construction/destruction ds6417_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual iodevice_t image_type() const noexcept override { return IO_MEMCARD; } - - 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 "bin"; } diff --git a/src/devices/machine/hp_dc100_tape.cpp b/src/devices/machine/hp_dc100_tape.cpp index 23cf9e4bead..8c72745d4b5 100644 --- a/src/devices/machine/hp_dc100_tape.cpp +++ b/src/devices/machine/hp_dc100_tape.cpp @@ -78,8 +78,7 @@ constexpr double MOTION_MARGIN = 1e-5; // Margin to ensure motion events have p constexpr hti_format_t::tape_pos_t TAPE_INIT_POS = 80 * hti_format_t::ONE_INCH_POS; // Initial tape position: 80" from beginning (just past the punched part) hp_dc100_tape_device::hp_dc100_tape_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig , HP_DC100_TAPE , tag , owner , clock) - , device_image_interface(mconfig , *this) + : microtape_image_device(mconfig , HP_DC100_TAPE , tag , owner , clock) , m_cart_out_handler(*this) , m_hole_handler(*this) , m_tacho_tick_handler(*this) diff --git a/src/devices/machine/hp_dc100_tape.h b/src/devices/machine/hp_dc100_tape.h index 2d3a2ea0617..6b52b3c7274 100644 --- a/src/devices/machine/hp_dc100_tape.h +++ b/src/devices/machine/hp_dc100_tape.h @@ -13,10 +13,11 @@ #pragma once +#include "imagedev/magtape.h" + #include "formats/hti_tape.h" -class hp_dc100_tape_device : public device_t, - public device_image_interface +class hp_dc100_tape_device : public microtape_image_device { public: // Construction @@ -27,12 +28,6 @@ public: virtual image_init_result call_create(int format_type, util::option_resolution *format_options) override; virtual void call_unload() override; virtual std::string call_display() 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 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; // **** Units **** diff --git a/src/devices/machine/i7220.h b/src/devices/machine/i7220.h index a65eecbf119..631f03cd01e 100644 --- a/src/devices/machine/i7220.h +++ b/src/devices/machine/i7220.h @@ -52,14 +52,13 @@ public: // image-level overrides virtual image_init_result call_load() override; - virtual iodevice_t image_type() const noexcept override { return IO_MEMCARD; } - 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 true; } virtual bool is_reset_on_load() const noexcept override { return false; } virtual const char *file_extensions() const noexcept override { return "bubble"; } + virtual const char *image_type_name() const noexcept override { return "bubble"; } + virtual const char *image_brief_type_name() const noexcept override { return "mbm"; } uint8_t read(offs_t offset); void write(offs_t offset, uint8_t data); diff --git a/src/devices/machine/smartmed.cpp b/src/devices/machine/smartmed.cpp index 1e7dc925ce0..1c54d36d174 100644 --- a/src/devices/machine/smartmed.cpp +++ b/src/devices/machine/smartmed.cpp @@ -21,6 +21,8 @@ #include "emu.h" #include "smartmed.h" +#include "softlist_dev.h" + namespace { @@ -777,6 +779,11 @@ DEFINE_DEVICE_TYPE(SMARTMEDIA, smartmedia_image_device, "smartmedia", "SmartMedi smartmedia_image_device::smartmedia_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nand_device(mconfig, SMARTMEDIA, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_memcard_image_interface(mconfig, *this) { } + +const software_list_loader &smartmedia_image_device::get_software_list_loader() const +{ + return image_software_list_loader::instance(); +} diff --git a/src/devices/machine/smartmed.h b/src/devices/machine/smartmed.h index 3c9eeeca54e..77c7d53b209 100644 --- a/src/devices/machine/smartmed.h +++ b/src/devices/machine/smartmed.h @@ -10,7 +10,7 @@ #pragma once #include "formats/imageutl.h" -#include "softlist_dev.h" +#include "imagedev/memcard.h" //#define SMARTMEDIA_IMAGE_SAVE @@ -195,19 +195,14 @@ protected: -class smartmedia_image_device : public nand_device, public device_image_interface +class smartmedia_image_device : public nand_device, public device_memcard_image_interface { public: // construction/destruction smartmedia_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_MEMCARD; } - - 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 "sm_memc"; } virtual const char *file_extensions() const noexcept override { return "smc"; } @@ -216,7 +211,7 @@ public: virtual void call_unload() override; protected: - 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; image_init_result smartmedia_format_1(); image_init_result smartmedia_format_2(); diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp index 031ed46eb30..81bd272ef6a 100644 --- a/src/emu/diimage.cpp +++ b/src/emu/diimage.cpp @@ -27,35 +27,6 @@ #include -//************************************************************************** -// DEVICE CONFIG IMAGE INTERFACE -//************************************************************************** -const image_device_type_info device_image_interface::m_device_info_array[] = - { - { IO_UNKNOWN, "unknown", "unkn" }, /* 0 */ - { IO_CARTSLOT, "cartridge", "cart" }, /* 1 */ - { IO_FLOPPY, "floppydisk", "flop" }, /* 2 */ - { IO_HARDDISK, "harddisk", "hard" }, /* 3 */ - { IO_CYLINDER, "cylinder", "cyln" }, /* 4 */ - { IO_CASSETTE, "cassette", "cass" }, /* 5 */ - { IO_PUNCHCARD, "punchcard", "pcrd" }, /* 6 */ - { IO_PUNCHTAPE, "punchtape", "ptap" }, /* 7 */ - { IO_PRINTER, "printout", "prin" }, /* 8 */ - { IO_SERIAL, "serial", "serl" }, /* 9 */ - { IO_PARALLEL, "parallel", "parl" }, /* 10 */ - { IO_SNAPSHOT, "snapshot", "dump" }, /* 11 */ - { IO_QUICKLOAD, "quickload", "quik" }, /* 12 */ - { IO_MEMCARD, "memcard", "memc" }, /* 13 */ - { IO_CDROM, "cdrom", "cdrm" }, /* 14 */ - { IO_MAGTAPE, "magtape", "magt" }, /* 15 */ - { IO_ROM, "romimage", "rom" }, /* 16 */ - { IO_MIDIIN, "midiin", "min" }, /* 17 */ - { IO_MIDIOUT, "midiout", "mout" }, /* 18 */ - { IO_PICTURE, "picture", "pic" }, /* 19 */ - { IO_VIDEO, "vidfile", "vid" } /* 20 */ - }; - - //************************************************************************** // IMAGE DEVICE FORMAT //************************************************************************** @@ -103,6 +74,7 @@ device_image_interface::device_image_interface(const machine_config &mconfig, de , m_create_format(0) , m_create_args(nullptr) , m_user_loadable(true) + , m_must_be_loaded(false) , m_is_loading(false) , m_is_reset_and_loading(false) { @@ -131,56 +103,6 @@ void device_image_interface::interface_config_complete() } -//------------------------------------------------- -// find_device_type - search through list of -// device types to extract data -//------------------------------------------------- - -const image_device_type_info *device_image_interface::find_device_type(iodevice_t type) -{ - for (const image_device_type_info &info : m_device_info_array) - { - if (info.m_type == type) - return &info; - } - return nullptr; -} - -//------------------------------------------------- -// device_typename - retrieves device type name -//------------------------------------------------- - -const char *device_image_interface::device_typename(iodevice_t type) -{ - const image_device_type_info *info = find_device_type(type); - return (info != nullptr) ? info->m_name : "unknown"; -} - -//------------------------------------------------- -// device_brieftypename - retrieves device -// brief type name -//------------------------------------------------- - -const char *device_image_interface::device_brieftypename(iodevice_t type) -{ - const image_device_type_info *info = find_device_type(type); - return (info != nullptr) ? info->m_shortname : "unk"; -} - -//------------------------------------------------- -// device_typeid - retrieves device type id -//------------------------------------------------- - -iodevice_t device_image_interface::device_typeid(const char *name) -{ - for (const image_device_type_info &info : m_device_info_array) - { - if (!core_stricmp(name, info.m_name) || !core_stricmp(name, info.m_shortname)) - return info.m_type; - } - return (iodevice_t)-1; -} - //------------------------------------------------- // set_image_filename - specifies the filename of // an image @@ -231,10 +153,10 @@ bool device_image_interface::is_filetype(std::string_view candidate_filetype) co // image creation by name //------------------------------------------------- -const image_device_format *device_image_interface::device_get_named_creatable_format(const std::string &format_name) noexcept +const image_device_format *device_image_interface::device_get_named_creatable_format(std::string_view format_name) const noexcept { - for (auto &format : m_formatlist) - if (format->name() == format_name) + for (const auto &format : m_formatlist) + if (std::string_view(format->name()) == format_name) return format.get(); return nullptr; } @@ -266,11 +188,10 @@ void device_image_interface::add_format(std::string &&name, std::string &&descri ****************************************************************************/ //------------------------------------------------- -// image_clear_error - clear out any specified -// error +// clear_error - clear out any specified error //------------------------------------------------- -void device_image_interface::clear_error() +void device_image_interface::clear_error() noexcept { m_err.clear(); m_err_message.clear(); @@ -370,7 +291,7 @@ const software_info *device_image_interface::software_entry() const noexcept // get_software_region //------------------------------------------------- -u8 *device_image_interface::get_software_region(const char *tag) +u8 *device_image_interface::get_software_region(std::string_view tag) { if (!loaded_through_softlist()) return nullptr; @@ -385,7 +306,7 @@ u8 *device_image_interface::get_software_region(const char *tag) // image_get_software_region_length //------------------------------------------------- -u32 device_image_interface::get_software_region_length(const char *tag) +u32 device_image_interface::get_software_region_length(std::string_view tag) { std::string full_tag = util::string_format("%s:%s", device().tag(), tag); memory_region *region = device().machine().root_device().memregion(full_tag); @@ -397,7 +318,7 @@ u32 device_image_interface::get_software_region_length(const char *tag) // image_get_feature //------------------------------------------------- -const char *device_image_interface::get_feature(const char *feature_name) const +const char *device_image_interface::get_feature(std::string_view feature_name) const { return !m_software_part_ptr ? nullptr : m_software_part_ptr->feature(feature_name); } @@ -407,7 +328,7 @@ const char *device_image_interface::get_feature(const char *feature_name) const // load_software_region - //------------------------------------------------- -bool device_image_interface::load_software_region(const char *tag, std::unique_ptr &ptr) +bool device_image_interface::load_software_region(std::string_view tag, std::unique_ptr &ptr) { size_t size = get_software_region_length(tag); @@ -477,7 +398,7 @@ bool device_image_interface::image_checkhash() { // do not cause a linear read of 600 megs please // TODO: use SHA1 in the CHD header as the hash - if (image_type() == IO_CDROM) + if (image_is_chd_type()) return true; // Skip calculating the hash when we have an image mounted through a software list @@ -514,33 +435,6 @@ u32 device_image_interface::crc() } -//------------------------------------------------- -// support_command_line_image_creation - do we -// want to support image creation from the front -// end command line? -//------------------------------------------------- - -bool device_image_interface::support_command_line_image_creation() const noexcept -{ - bool result; - switch (image_type()) - { - case IO_PRINTER: - case IO_SERIAL: - case IO_PARALLEL: - // going by the assumption that these device image types should support this - // behavior; ideally we'd get rid of IO_* and just push this to the specific - // devices - result = true; - break; - default: - result = false; - break; - } - return result; -} - - // **************************************************************************** // Battery functions // @@ -619,34 +513,6 @@ void device_image_interface::battery_save(const void *buffer, int length) } -//------------------------------------------------- -// uses_file_extension - update configuration -// based on completed device setup -//------------------------------------------------- - -bool device_image_interface::uses_file_extension(const char *file_extension) const -{ - bool result = false; - - if (file_extension[0] == '.') - file_extension++; - - /* find the extensions */ - std::string extensions(file_extensions()); - char *ext = strtok((char*)extensions.c_str(),","); - while (ext != nullptr) - { - if (!core_stricmp(ext, file_extension)) - { - result = true; - break; - } - ext = strtok (nullptr, ","); - } - return result; -} - - // *************************************************************************** // IMAGE LOADING // *************************************************************************** @@ -1137,12 +1003,10 @@ const util::option_guide &device_image_interface::create_option_guide() const void device_image_interface::update_names() { - const char *inst_name = custom_instance_name(); - const char *brief_name = custom_brief_instance_name(); - if (inst_name == nullptr) - inst_name = device_typename(image_type()); - if (brief_name == nullptr) - brief_name = device_brieftypename(image_type()); + const char *inst_name = image_type_name(); + const char *brief_name = image_brief_type_name(); + assert(inst_name != nullptr); + assert(brief_name != nullptr); // count instances of the general image type, or device type if custom int count = 0; @@ -1151,19 +1015,21 @@ void device_image_interface::update_names() { if (this == &image) index = count; - const char *other_name = image.custom_instance_name(); - if (!other_name) - other_name = device_typename(image.image_type()); + const char *other_name = image.image_type_name(); + const char *other_brief_name = image.image_brief_type_name(); + assert(other_name != nullptr); + assert(other_brief_name != nullptr); - if (other_name == inst_name || !strcmp(other_name, inst_name)) + if (other_name == inst_name || !strcmp(other_name, inst_name) || + other_brief_name == brief_name || !strcmp(other_brief_name, brief_name)) count++; } - m_canonical_instance_name = string_format("%s%d", inst_name, index + 1); + m_canonical_instance_name = util::string_format("%s%d", inst_name, index + 1); if (count > 1) { m_instance_name = m_canonical_instance_name; - m_brief_instance_name = string_format("%s%d", brief_name, index + 1); + m_brief_instance_name = util::string_format("%s%d", brief_name, index + 1); } else { diff --git a/src/emu/diimage.h b/src/emu/diimage.h index 67d20c43402..4d97e4cd717 100644 --- a/src/emu/diimage.h +++ b/src/emu/diimage.h @@ -29,33 +29,6 @@ // TYPE DEFINITIONS //************************************************************************** -enum iodevice_t -{ - /* List of all supported devices. Refer to the device by these names only */ - IO_UNKNOWN, - IO_CARTSLOT, /* 1 - Cartridge Port, as found on most console and on some computers */ - IO_FLOPPY, /* 2 - Floppy Disk unit */ - IO_HARDDISK, /* 3 - Hard Disk unit */ - IO_CYLINDER, /* 4 - Magnetically-Coated Cylinder */ - IO_CASSETTE, /* 5 - Cassette Recorder (common on early home computers) */ - IO_PUNCHCARD, /* 6 - Card Puncher/Reader */ - IO_PUNCHTAPE, /* 7 - Tape Puncher/Reader (reels instead of punchcards) */ - IO_PRINTER, /* 8 - Printer device */ - IO_SERIAL, /* 9 - Generic Serial Port */ - IO_PARALLEL, /* 10 - Generic Parallel Port */ - IO_SNAPSHOT, /* 11 - Complete 'snapshot' of the state of the computer */ - IO_QUICKLOAD, /* 12 - Allow to load program/data into memory, without matching any actual device */ - IO_MEMCARD, /* 13 - Memory card */ - IO_CDROM, /* 14 - optical CD-ROM disc */ - IO_MAGTAPE, /* 15 - Magnetic tape */ - IO_ROM, /* 16 - Individual ROM image - the Amstrad CPC has a few applications that were sold on 16kB ROMs */ - IO_MIDIIN, /* 17 - MIDI In port */ - IO_MIDIOUT, /* 18 - MIDI Out port */ - IO_PICTURE, /* 19 - A single-frame image */ - IO_VIDEO, /* 20 - A video file */ - IO_COUNT /* 21 - Total Number of IO_devices for searching */ -}; - enum class image_error : int { INTERNAL = 1, @@ -69,13 +42,6 @@ const std::error_category &image_category() noexcept; inline std::error_condition make_error_condition(image_error e) noexcept { return std::error_condition(int(e), image_category()); } namespace std { template <> struct is_error_condition_enum : public std::true_type { }; } -struct image_device_type_info -{ - iodevice_t m_type; - const char *m_name; - const char *m_shortname; -}; - class image_device_format { public: @@ -124,31 +90,26 @@ public: device_image_interface(const machine_config &mconfig, device_t &device); virtual ~device_image_interface(); - static const char *device_typename(iodevice_t type); - static const char *device_brieftypename(iodevice_t type); - static iodevice_t device_typeid(const char *name); - virtual image_init_result call_load() { return image_init_result::PASS; } virtual image_init_result call_create(int format_type, util::option_resolution *format_options) { return image_init_result::PASS; } virtual void call_unload() { } virtual std::string call_display() { return std::string(); } virtual u32 unhashed_header_length() const noexcept { return 0; } virtual bool core_opens_image_file() const noexcept { return true; } - virtual iodevice_t image_type() const noexcept = 0; + virtual bool image_is_chd_type() const noexcept { return false; } virtual bool is_readable() const noexcept = 0; virtual bool is_writeable() const noexcept = 0; virtual bool is_creatable() const noexcept = 0; - virtual bool must_be_loaded() const noexcept = 0; virtual bool is_reset_on_load() const noexcept = 0; - virtual bool support_command_line_image_creation() const noexcept; + virtual bool support_command_line_image_creation() const noexcept { return false; } virtual const char *image_interface() const noexcept { return nullptr; } virtual const char *file_extensions() const noexcept = 0; virtual const util::option_guide &create_option_guide() const; - virtual const char *custom_instance_name() const noexcept { return nullptr; } - virtual const char *custom_brief_instance_name() const noexcept { return nullptr; } + virtual const char *image_type_name() const noexcept = 0; + virtual const char *image_brief_type_name() const noexcept = 0; const image_device_format *device_get_indexed_creatable_format(int index) const noexcept { return (index < m_formatlist.size()) ? m_formatlist.at(index).get() : nullptr; } - const image_device_format *device_get_named_creatable_format(const std::string &format_name) noexcept; + const image_device_format *device_get_named_creatable_format(std::string_view format_name) const noexcept; const util::option_guide &device_get_creation_option_guide() const { return create_option_guide(); } std::string_view error(); @@ -243,10 +204,10 @@ public: const std::string &working_directory() const { return m_working_directory; } // access to software list properties and ROM data areas - u8 *get_software_region(const char *tag); - u32 get_software_region_length(const char *tag); - const char *get_feature(const char *feature_name) const; - bool load_software_region(const char *tag, std::unique_ptr &ptr); + u8 *get_software_region(std::string_view tag); + u32 get_software_region_length(std::string_view tag); + const char *get_feature(std::string_view feature_name) const; + bool load_software_region(std::string_view tag, std::unique_ptr &ptr); u32 crc(); util::hash_collection& hash() { return m_hash; } @@ -256,12 +217,9 @@ public: void battery_load(void *buffer, int length, const void *def_buffer); void battery_save(const void *buffer, int length); - const char *image_type_name() const { return device_typename(image_type()); } - const std::string &instance_name() const { return m_instance_name; } const std::string &brief_instance_name() const { return m_brief_instance_name; } const std::string &canonical_instance_name() const { return m_canonical_instance_name; } - bool uses_file_extension(const char *file_extension) const; const formatlist_type &formatlist() const { return m_formatlist; } // loads an image file @@ -277,9 +235,11 @@ public: bool load_software(software_list_device &swlist, std::string_view swname, const rom_entry *entry); std::error_condition reopen_for_write(std::string_view path); - void set_user_loadable(bool user_loadable) { m_user_loadable = user_loadable; } + void set_user_loadable(bool user_loadable) noexcept { m_user_loadable = user_loadable; } + void set_must_be_loaded(bool must_be_loaded) noexcept { m_must_be_loaded = must_be_loaded; } bool user_loadable() const noexcept { return m_user_loadable; } + bool must_be_loaded() const noexcept { return m_must_be_loaded; } bool is_reset_and_loading() const noexcept { return m_is_reset_and_loading; } const std::string &full_software_name() const noexcept { return m_full_software_name; } @@ -297,7 +257,7 @@ protected: void set_image_filename(std::string_view filename); - void clear_error(); + void clear_error() noexcept; void check_for_file() const { if (!m_file) throw emu_fatalerror("%s(%s): Illegal operation on unmounted image", device().shortname(), device().tag()); } @@ -311,12 +271,6 @@ protected: void add_format(std::unique_ptr &&format); void add_format(std::string &&name, std::string &&description, std::string &&extensions, std::string &&optspec); - // derived class overrides - - // configuration - static const image_device_type_info *find_device_type(iodevice_t type); - static const image_device_type_info m_device_info_array[]; - // error related info std::error_condition m_err; std::string m_err_message; @@ -370,6 +324,8 @@ private: // we want to disable command line cart loading... bool m_user_loadable; + bool m_must_be_loaded; + bool m_is_loading; bool m_is_reset_and_loading; diff --git a/src/mame/drivers/a2600.cpp b/src/mame/drivers/a2600.cpp index 8548f26d927..da7a43517b0 100644 --- a/src/mame/drivers/a2600.cpp +++ b/src/mame/drivers/a2600.cpp @@ -592,7 +592,7 @@ static void a2600_cart(device_slot_interface &device) void a2600_state::a2600_cartslot(machine_config &config) { - VCS_CART_SLOT(config, "cartslot", a2600_cart, nullptr); + VCS_CART_SLOT(config, "cartslot", a2600_cart, nullptr).set_must_be_loaded(true); /* software lists */ SOFTWARE_LIST(config, "cart_list").set_original("a2600"); diff --git a/src/mame/drivers/arcadia.cpp b/src/mame/drivers/arcadia.cpp index 780bc8d71b5..7710621eacc 100644 --- a/src/mame/drivers/arcadia.cpp +++ b/src/mame/drivers/arcadia.cpp @@ -490,7 +490,7 @@ void arcadia_state::arcadia(machine_config &config) ARCADIA_SOUND(config, m_custom).add_route(ALL_OUTPUTS, "mono", 1.00); /* cartridge */ - EA2001_CART_SLOT(config, "cartslot", arcadia_cart, nullptr); + EA2001_CART_SLOT(config, "cartslot", arcadia_cart, nullptr).set_must_be_loaded(true); /* Software lists */ SOFTWARE_LIST(config, "cart_list").set_original("arcadia"); diff --git a/src/mame/drivers/gridcomp.cpp b/src/mame/drivers/gridcomp.cpp index e09cfc3f85d..c21df36d8cb 100644 --- a/src/mame/drivers/gridcomp.cpp +++ b/src/mame/drivers/gridcomp.cpp @@ -375,6 +375,7 @@ void gridcomp_state::grid1101(machine_config &config) i7220_device &i7220(I7220(config, "i7220", XTAL(4'000'000))); i7220.set_data_size(3); // 3 1-Mbit MBM's + i7220.set_must_be_loaded(true); i7220.irq_callback().set(I80130_TAG, FUNC(i80130_device::ir1_w)); i7220.drq_callback().set(I80130_TAG, FUNC(i80130_device::ir1_w)); diff --git a/src/mame/drivers/megadriv.cpp b/src/mame/drivers/megadriv.cpp index fe81ca42560..c5e7dd0aee3 100644 --- a/src/mame/drivers/megadriv.cpp +++ b/src/mame/drivers/megadriv.cpp @@ -406,7 +406,7 @@ void md_cons_slot_state::ms_megadriv(machine_config &config) subdevice("megadriv")->screen_vblank().set(FUNC(md_cons_state::screen_vblank_console)); - MD_CART_SLOT(config, m_cart, md_cart, nullptr); + MD_CART_SLOT(config, m_cart, md_cart, nullptr).set_must_be_loaded(true); SOFTWARE_LIST(config, "cart_list").set_original("megadriv"); } @@ -416,7 +416,7 @@ void md_cons_slot_state::ms_megadpal(machine_config &config) subdevice("megadriv")->screen_vblank().set(FUNC(md_cons_state::screen_vblank_console)); - MD_CART_SLOT(config, m_cart, md_cart, nullptr); + MD_CART_SLOT(config, m_cart, md_cart, nullptr).set_must_be_loaded(true); SOFTWARE_LIST(config, "cart_list").set_original("megadriv"); } @@ -426,7 +426,7 @@ void md_cons_slot_state::ms_megadriv2(machine_config &config) subdevice("megadriv")->screen_vblank().set(FUNC(md_cons_state::screen_vblank_console)); - MD_CART_SLOT(config, m_cart, md_cart, nullptr); + MD_CART_SLOT(config, m_cart, md_cart, nullptr).set_must_be_loaded(true); SOFTWARE_LIST(config, "cart_list").set_original("megadriv"); } @@ -443,7 +443,7 @@ void md_cons_state::dcat16_megadriv(machine_config &config) subdevice("megadriv")->screen_vblank().set(FUNC(md_cons_state::screen_vblank_console)); // has SD card slot instead? -// MD_CART_SLOT(config, m_cart, md_cart, nullptr); +// MD_CART_SLOT(config, m_cart, md_cart, nullptr).set_must_be_loaded(true); // SOFTWARE_LIST(config, "cart_list").set_original("megadriv"); } diff --git a/src/mame/drivers/nes.cpp b/src/mame/drivers/nes.cpp index 4719ea16d38..7bfbcf065dc 100644 --- a/src/mame/drivers/nes.cpp +++ b/src/mame/drivers/nes.cpp @@ -80,7 +80,7 @@ void nes_state::nes(machine_config &config) m_ctrl1->set_screen_tag(m_screen); m_ctrl2->set_screen_tag(m_screen); - NES_CART_SLOT(config, m_cartslot, NTSC_APU_CLOCK, nes_cart, nullptr); + NES_CART_SLOT(config, m_cartslot, NTSC_APU_CLOCK, nes_cart, nullptr).set_must_be_loaded(true); SOFTWARE_LIST(config, "cart_list").set_original("nes"); SOFTWARE_LIST(config, "ade_list").set_original("nes_ade"); // Camerica/Codemasters Aladdin Deck Enhancer mini-carts SOFTWARE_LIST(config, "ntb_list").set_original("nes_ntbrom"); // Sunsoft Nantettate! Baseball mini-carts diff --git a/src/mame/drivers/odyssey2.cpp b/src/mame/drivers/odyssey2.cpp index 1e5a4a0d90b..61da9c63f7b 100644 --- a/src/mame/drivers/odyssey2.cpp +++ b/src/mame/drivers/odyssey2.cpp @@ -778,7 +778,7 @@ void odyssey2_state::odyssey2(machine_config &config) SPEAKER(config, "mono").front_center(); /* cartridge */ - O2_CART_SLOT(config, m_cart, o2_cart, nullptr); + O2_CART_SLOT(config, m_cart, o2_cart, nullptr).set_must_be_loaded(true); SOFTWARE_LIST(config, "cart_list").set_original("videopac").set_filter("O2"); } @@ -851,7 +851,7 @@ void vpp_state::g7400(machine_config &config) SPEAKER(config, "mono").front_center(); /* cartridge */ - O2_CART_SLOT(config, m_cart, o2_cart, nullptr); + O2_CART_SLOT(config, m_cart, o2_cart, nullptr).set_must_be_loaded(true); SOFTWARE_LIST(config, "cart_list").set_original("videopac").set_filter("VPP"); } diff --git a/src/mame/drivers/pce.cpp b/src/mame/drivers/pce.cpp index 15bfe8a26ae..1923b74578f 100644 --- a/src/mame/drivers/pce.cpp +++ b/src/mame/drivers/pce.cpp @@ -185,7 +185,7 @@ void pce_state::pce_common(machine_config &config) void pce_state::pce(machine_config &config) { pce_common(config); - PCE_CART_SLOT(config, m_cartslot, pce_cart, nullptr, "pce_cart"); + PCE_CART_SLOT(config, m_cartslot, pce_cart, nullptr, "pce_cart").set_must_be_loaded(true); SOFTWARE_LIST(config, "cart_list").set_original("pce"); // bundled pad (in white PC engine) has not support autofire @@ -195,7 +195,7 @@ void pce_state::pce(machine_config &config) void pce_state::tg16(machine_config &config) { pce_common(config); - PCE_CART_SLOT(config, m_cartslot, pce_cart, nullptr, "tg16_cart"); + PCE_CART_SLOT(config, m_cartslot, pce_cart, nullptr, "tg16_cart").set_must_be_loaded(true); SOFTWARE_LIST(config, "cart_list").set_original("tg16"); // turbo pad bundled @@ -256,7 +256,7 @@ void pce_state::sgx(machine_config &config) // turbo pad bundled PCE_CONTROL_PORT(config, m_port_ctrl, pce_control_port_devices, "joypad2_turbo"); - PCE_CART_SLOT(config, m_cartslot, pce_cart, nullptr, "pce_cart"); + PCE_CART_SLOT(config, m_cartslot, pce_cart, nullptr, "pce_cart").set_must_be_loaded(true); SOFTWARE_LIST(config, "cart_list").set_original("sgx"); SOFTWARE_LIST(config, "pce_list").set_compatible("pce"); diff --git a/src/mame/drivers/pdp1.cpp b/src/mame/drivers/pdp1.cpp index 68896be32d7..176611ee3a8 100644 --- a/src/mame/drivers/pdp1.cpp +++ b/src/mame/drivers/pdp1.cpp @@ -611,8 +611,7 @@ void pdp1_state::machine_start() DEFINE_DEVICE_TYPE(PDP1_READTAPE, pdp1_readtape_image_device, "pdp1_readtape_image", "PDP-1 Tape Reader") pdp1_readtape_image_device::pdp1_readtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, PDP1_READTAPE, tag, owner, clock) - , device_image_interface(mconfig, *this) + : paper_tape_reader_device(mconfig, PDP1_READTAPE, tag, owner, clock) , m_maincpu(*this, "^maincpu") , m_st_ptr(*this) , m_timer(nullptr) @@ -635,8 +634,7 @@ void pdp1_readtape_image_device::device_start() DEFINE_DEVICE_TYPE(PDP1_PUNCHTAPE, pdp1_punchtape_image_device, "pdp1_punchtape_image_device", "PDP-1 Tape Puncher") pdp1_punchtape_image_device::pdp1_punchtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, PDP1_PUNCHTAPE, tag, owner, clock) - , device_image_interface(mconfig, *this) + : paper_tape_punch_device(mconfig, PDP1_PUNCHTAPE, tag, owner, clock) , m_maincpu(*this, "^maincpu") , m_st_ptp(*this) , m_timer(nullptr) diff --git a/src/mame/drivers/psion.cpp b/src/mame/drivers/psion.cpp index 047c8b13424..4caa9c949b0 100644 --- a/src/mame/drivers/psion.cpp +++ b/src/mame/drivers/psion.cpp @@ -24,7 +24,7 @@ #include "includes/psion.h" #include "screen.h" -#include "softlist.h" +#include "softlist_dev.h" #include "speaker.h" diff --git a/src/mame/drivers/segapico.cpp b/src/mame/drivers/segapico.cpp index 6cde8b1b306..a6efcfdb7d4 100644 --- a/src/mame/drivers/segapico.cpp +++ b/src/mame/drivers/segapico.cpp @@ -405,7 +405,7 @@ void pico_state::pico(machine_config &config) MCFG_MACHINE_START_OVERRIDE( pico_state, pico ) - PICO_CART_SLOT(config, m_picocart, pico_cart, nullptr); + PICO_CART_SLOT(config, m_picocart, pico_cart, nullptr).set_must_be_loaded(true); SOFTWARE_LIST(config, "cart_list").set_original("pico"); SEGA_315_5641_PCM(config, m_sega_315_5641_pcm, upd7759_device::STANDARD_CLOCK*2); @@ -425,7 +425,7 @@ void pico_state::picopal(machine_config &config) MCFG_MACHINE_START_OVERRIDE( pico_state, pico ) - PICO_CART_SLOT(config, m_picocart, pico_cart, nullptr); + PICO_CART_SLOT(config, m_picocart, pico_cart, nullptr).set_must_be_loaded(true); SOFTWARE_LIST(config, "cart_list").set_original("pico"); SEGA_315_5641_PCM(config, m_sega_315_5641_pcm, upd7759_device::STANDARD_CLOCK*2); @@ -623,7 +623,7 @@ void copera_state::copera(machine_config &config) MCFG_MACHINE_START_OVERRIDE( copera_state, copera ) - COPERA_CART_SLOT(config, m_picocart, copera_cart, nullptr); + COPERA_CART_SLOT(config, m_picocart, copera_cart, nullptr).set_must_be_loaded(true); SOFTWARE_LIST(config, "cart_list").set_original("copera"); SEGA_315_5641_PCM(config, m_sega_315_5641_pcm, upd7759_device::STANDARD_CLOCK); diff --git a/src/mame/drivers/sg1000.cpp b/src/mame/drivers/sg1000.cpp index bd084c9b5f4..70493244682 100644 --- a/src/mame/drivers/sg1000.cpp +++ b/src/mame/drivers/sg1000.cpp @@ -548,7 +548,7 @@ void sg1000_state::sg1000(machine_config &config) SG1000_EXPANSION_SLOT(config, m_sgexpslot, sg1000_expansion_devices, nullptr, false); /* cartridge */ - SG1000_CART_SLOT(config, CARTSLOT_TAG, sg1000_cart, nullptr); + SG1000_CART_SLOT(config, CARTSLOT_TAG, sg1000_cart, nullptr).set_must_be_loaded(true); /* software lists */ SOFTWARE_LIST(config, "cart_list").set_original("sg1000"); @@ -568,8 +568,7 @@ void sg1000_state::omv(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &sg1000_state::omv_map); m_maincpu->set_addrmap(AS_IO, &sg1000_state::omv_io_map); - config.device_remove(CARTSLOT_TAG); - OMV_CART_SLOT(config, CARTSLOT_TAG, sg1000_cart, nullptr); + OMV_CART_SLOT(config.replace(), CARTSLOT_TAG, sg1000_cart, nullptr); m_ram->set_default_size("2K"); } @@ -601,7 +600,7 @@ void sc3000_state::sc3000(machine_config &config) SG1000_EXPANSION_SLOT(config, m_sgexpslot, sg1000_expansion_devices, "sk1100", true); /* cartridge */ - SC3000_CART_SLOT(config, CARTSLOT_TAG, sg1000_cart, nullptr); + SC3000_CART_SLOT(config, CARTSLOT_TAG, sg1000_cart, nullptr).set_must_be_loaded(true); /* software lists */ SOFTWARE_LIST(config, "cart_list").set_original("sg1000"); diff --git a/src/mame/drivers/sms.cpp b/src/mame/drivers/sms.cpp index 38e36b43183..28f85f5c694 100644 --- a/src/mame/drivers/sms.cpp +++ b/src/mame/drivers/sms.cpp @@ -973,7 +973,7 @@ void gamegear_state::gamegear(machine_config &config) m_vdp->add_route(1, "rspeaker", 1.00); /* cartridge */ - GAMEGEAR_CART_SLOT(config, "slot", gg_cart, nullptr); + GAMEGEAR_CART_SLOT(config, "slot", gg_cart, nullptr).set_must_be_loaded(true); SOFTWARE_LIST(config, "cart_list").set_original("gamegear"); diff --git a/src/mame/drivers/snes.cpp b/src/mame/drivers/snes.cpp index 0e1c9ada78e..5f27f3feaac 100644 --- a/src/mame/drivers/snes.cpp +++ b/src/mame/drivers/snes.cpp @@ -1371,6 +1371,7 @@ void snes_console_state::snes(machine_config &config) m_s_dsp->add_route(1, "rspeaker", 1.00); SNS_CART_SLOT(config, m_cartslot, MCLK_NTSC, snes_cart, nullptr); + m_cartslot->set_must_be_loaded(true); m_cartslot->irq_callback().set(m_scpu_irq, FUNC(input_merger_device::in_w<1>)); // FIXME: conflict with video interrupt, it should be ORed m_cartslot->open_bus_callback().set(FUNC(snes_console_state::snes_open_bus_r)); m_cartslot->set_scanlines(SNES_VTOTAL_NTSC); diff --git a/src/mame/drivers/tm990189.cpp b/src/mame/drivers/tm990189.cpp index 8778c8584d0..5b7d7f59c12 100644 --- a/src/mame/drivers/tm990189.cpp +++ b/src/mame/drivers/tm990189.cpp @@ -481,14 +481,14 @@ public: tm990_189_rs232_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_SERIAL; } - 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 bool support_command_line_image_creation() const noexcept override { return true; } virtual const char *file_extensions() const noexcept override { return ""; } + virtual const char *image_type_name() const noexcept override { return "serial"; } + virtual const char *image_brief_type_name() const noexcept override { return "serl"; } virtual image_init_result call_load() override; virtual void call_unload() override; diff --git a/src/mame/drivers/tx0.cpp b/src/mame/drivers/tx0.cpp index 85465f0d2a9..654e1d69c62 100644 --- a/src/mame/drivers/tx0.cpp +++ b/src/mame/drivers/tx0.cpp @@ -9,6 +9,9 @@ #include "emu.h" #include "includes/tx0.h" +#include "imagedev/magtape.h" +#include "imagedev/papertape.h" + #include "video/crt.h" #include "screen.h" #include "softlist_dev.h" @@ -358,27 +361,18 @@ void tx0_state::machine_start() perforated tape handling */ -class tx0_readtape_image_device : public device_t, - public device_image_interface +class tx0_readtape_image_device : public paper_tape_reader_device { public: // construction/destruction tx0_readtape_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_PUNCHTAPE; } - - 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 "tap,rim"; } virtual image_init_result call_load() override; virtual void call_unload() override; virtual const char *image_interface() const noexcept override { return "tx0_ptp"; } - virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } protected: // device-level overrides @@ -391,28 +385,18 @@ private: DEFINE_DEVICE_TYPE(TX0_READTAPE, tx0_readtape_image_device, "tx0_readtape_image", "TX0 Tape Reader") tx0_readtape_image_device::tx0_readtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, TX0_READTAPE, tag, owner, clock) - , device_image_interface(mconfig, *this) + : paper_tape_reader_device(mconfig, TX0_READTAPE, tag, owner, clock) , m_tx0(*this, DEVICE_SELF_OWNER) { } -class tx0_punchtape_image_device : public device_t, - public device_image_interface +class tx0_punchtape_image_device : public paper_tape_punch_device { public: // construction/destruction tx0_punchtape_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_PUNCHTAPE; } - virtual bool support_command_line_image_creation() const noexcept override { return true; } - - 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 "tap,rim"; } virtual image_init_result call_load() override; @@ -430,8 +414,7 @@ private: DEFINE_DEVICE_TYPE(TX0_PUNCHTAPE, tx0_punchtape_image_device, "tx0_punchtape_image", "TX0 Tape Puncher") tx0_punchtape_image_device::tx0_punchtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, TX0_PUNCHTAPE, tag, owner, clock) - , device_image_interface(mconfig, *this) + : paper_tape_punch_device(mconfig, TX0_PUNCHTAPE, tag, owner, clock) , m_tx0(*this, DEVICE_SELF_OWNER) { } @@ -445,14 +428,14 @@ public: tx0_printer_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_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 bool support_command_line_image_creation() const noexcept override { return true; } virtual const char *file_extensions() const noexcept override { return "typ"; } + virtual const char *image_type_name() const noexcept override { return "printout"; } + virtual const char *image_brief_type_name() const noexcept override { return "prin"; } virtual image_init_result call_load() override; virtual void call_unload() override; @@ -474,21 +457,13 @@ tx0_printer_image_device::tx0_printer_image_device(const machine_config &mconfig { } -class tx0_magtape_image_device : public device_t, - public device_image_interface +class tx0_magtape_image_device : public magtape_image_device { public: // construction/destruction tx0_magtape_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; } virtual const char *file_extensions() const noexcept override { return "tap"; } virtual image_init_result call_load() override; @@ -505,8 +480,7 @@ private: DEFINE_DEVICE_TYPE(TX0_MAGTAPE, tx0_magtape_image_device, "tx0_magtape_image", "TX0 Magnetic Tape") tx0_magtape_image_device::tx0_magtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, TX0_MAGTAPE, tag, owner, clock) - , device_image_interface(mconfig, *this) + : magtape_image_device(mconfig, TX0_MAGTAPE, tag, owner, clock) , m_tx0(*this, DEVICE_SELF_OWNER) { } diff --git a/src/mame/drivers/vboy.cpp b/src/mame/drivers/vboy.cpp index 584f25245ce..5ea9744e27b 100644 --- a/src/mame/drivers/vboy.cpp +++ b/src/mame/drivers/vboy.cpp @@ -1269,6 +1269,7 @@ void vboy_state::vboy(machine_config &config) /* cartridge */ VBOY_CART_SLOT(config, m_cart, vboy_carts, nullptr); + m_cart->set_must_be_loaded(true); m_cart->intcro().set_inputline(m_maincpu, 2); m_cart->set_exp(m_maincpu, AS_PROGRAM, 0x0400'0000); m_cart->set_chip(m_maincpu, AS_PROGRAM, 0x0600'0000); diff --git a/src/mame/drivers/vic10.cpp b/src/mame/drivers/vic10.cpp index 9fcd2ab324f..6681bc70a6d 100644 --- a/src/mame/drivers/vic10.cpp +++ b/src/mame/drivers/vic10.cpp @@ -687,6 +687,7 @@ void vic10_state::vic10(machine_config &config) VCS_CONTROL_PORT(config, m_joy2, vcs_control_port_devices, "joy"); VIC10_EXPANSION_SLOT(config, m_exp, XTAL(8'000'000)/8, vic10_expansion_cards, nullptr); + m_exp->set_must_be_loaded(true); m_exp->irq_callback().set("mainirq", FUNC(input_merger_device::in_w<2>)); m_exp->res_callback().set(FUNC(vic10_state::exp_reset_w)); m_exp->cnt_callback().set(m_cia, FUNC(mos6526_device::cnt_w)); diff --git a/src/mame/drivers/wswan.cpp b/src/mame/drivers/wswan.cpp index ad1eb484937..00036fe890a 100644 --- a/src/mame/drivers/wswan.cpp +++ b/src/mame/drivers/wswan.cpp @@ -320,6 +320,8 @@ void wscolor_state::wscolor(machine_config &config) config.device_remove("wsc_list"); SOFTWARE_LIST(config.replace(), "cart_list").set_original("wscolor"); SOFTWARE_LIST(config, "ws_list").set_compatible("wswan"); + + m_cart->set_must_be_loaded(true); } diff --git a/src/mame/includes/apollo.h b/src/mame/includes/apollo.h index 47f9548b31f..15c0bb33c56 100644 --- a/src/mame/includes/apollo.h +++ b/src/mame/includes/apollo.h @@ -378,12 +378,9 @@ public: virtual ~apollo_ni(); // image-level overrides - virtual iodevice_t image_type() const noexcept override { return IO_ROM; } - 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 bool support_command_line_image_creation() const noexcept override { return true; } virtual const char *file_extensions() const noexcept override { return "ani,bin"; } @@ -391,8 +388,8 @@ public: virtual image_init_result call_load() override; virtual image_init_result call_create(int format_type, util::option_resolution *format_options) override; virtual void call_unload() override; - virtual const char *custom_instance_name() const noexcept override { return "node_id"; } - virtual const char *custom_brief_instance_name() const noexcept override { return "ni"; } + virtual const char *image_type_name() const noexcept override { return "node_id"; } + virtual const char *image_brief_type_name() const noexcept override { return "ni"; } void write(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t read(offs_t offset, uint16_t mem_mask = ~0); diff --git a/src/mame/includes/pdp1.h b/src/mame/includes/pdp1.h index 20c0d09365e..a68e9885943 100644 --- a/src/mame/includes/pdp1.h +++ b/src/mame/includes/pdp1.h @@ -10,9 +10,9 @@ #define MAME_INCLUDES_PDP1_H #include "cpu/pdp1/pdp1.h" +#include "imagedev/papertape.h" #include "video/crt.h" #include "emupal.h" -#include "softlist_dev.h" /* defines for each bit and mask in input port "CSW" */ enum @@ -172,8 +172,7 @@ enum class pdp1_state; // tape reader device -class pdp1_readtape_image_device : public device_t, - public device_image_interface +class pdp1_readtape_image_device : public paper_tape_reader_device { public: // construction/destruction @@ -192,18 +191,10 @@ protected: virtual void device_start() override; // image-level overrides - virtual iodevice_t image_type() const noexcept override { return IO_PUNCHTAPE; } - - 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 "tap,rim"; } virtual image_init_result call_load() override; virtual void call_unload() override; - virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } public: TIMER_CALLBACK_MEMBER(reader_callback); @@ -229,8 +220,7 @@ public: // tape puncher device -class pdp1_punchtape_image_device : public device_t, - public device_image_interface +class pdp1_punchtape_image_device : public paper_tape_punch_device { public: // construction/destruction @@ -247,12 +237,9 @@ protected: virtual void device_start() override; // image-level overrides - virtual iodevice_t image_type() const noexcept override { return IO_PUNCHTAPE; } - 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 "tap,rim"; } @@ -293,14 +280,14 @@ protected: virtual void device_start() override; // image-level overrides - 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 bool support_command_line_image_creation() const noexcept override { return true; } virtual const char *file_extensions() const noexcept override { return "typ"; } + virtual const char *image_type_name() const noexcept override { return "printout"; } + virtual const char *image_brief_type_name() const noexcept override { return "prin"; } virtual image_init_result call_load() override; virtual void call_unload() override; @@ -350,14 +337,14 @@ protected: virtual void device_start() override; // image-level overrides - virtual iodevice_t image_type() const noexcept override { return IO_CYLINDER; } - 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 "drm"; } + virtual const char *image_type_name() const noexcept override { return "cylinder"; } + virtual const char *image_brief_type_name() const noexcept override { return "cyln"; } + virtual image_init_result call_load() override; virtual void call_unload() override; diff --git a/src/mame/machine/apexc.cpp b/src/mame/machine/apexc.cpp index f002b2ff7f1..9f6fff31fb9 100644 --- a/src/mame/machine/apexc.cpp +++ b/src/mame/machine/apexc.cpp @@ -66,8 +66,7 @@ void apexc_cylinder_image_device::call_unload() apexc_tape_puncher_image_device::apexc_tape_puncher_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, APEXC_TAPE_PUNCHER, tag, owner, clock) - , device_image_interface(mconfig, *this) + : paper_tape_punch_device(mconfig, APEXC_TAPE_PUNCHER, tag, owner, clock) { } @@ -85,8 +84,7 @@ void apexc_tape_puncher_image_device::write(uint8_t data) } apexc_tape_reader_image_device::apexc_tape_reader_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, APEXC_TAPE_READER, tag, owner, clock) - , device_image_interface(mconfig, *this) + : paper_tape_reader_device(mconfig, APEXC_TAPE_READER, tag, owner, clock) { } diff --git a/src/mame/machine/apexc.h b/src/mame/machine/apexc.h index 9b11f185a7c..4c009d857fd 100644 --- a/src/mame/machine/apexc.h +++ b/src/mame/machine/apexc.h @@ -12,6 +12,8 @@ #define MAME_MACHINE_APEXC #pragma once + +#include "imagedev/papertape.h" #include "softlist_dev.h" @@ -33,14 +35,13 @@ public: apexc_cylinder_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); // image-level overrides - virtual iodevice_t image_type() const noexcept override { return IO_CYLINDER; } - 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 true; } virtual const char *file_extensions() const noexcept override { return "apc"; } + virtual const char *image_type_name() const noexcept override { return "cylinder"; } + virtual const char *image_brief_type_name() const noexcept override { return "cyln"; } virtual image_init_result call_load() override; virtual void call_unload() override; @@ -98,20 +99,13 @@ private: 11111 Letters */ -class apexc_tape_puncher_image_device : public device_t, public device_image_interface +class apexc_tape_puncher_image_device : public paper_tape_punch_device { public: // construction/destruction apexc_tape_puncher_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); // image-level overrides - virtual iodevice_t image_type() const noexcept override { return IO_PUNCHTAPE; } - - 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 "tap"; } void write(uint8_t data); @@ -120,7 +114,7 @@ private: virtual void device_start() override { } }; -class apexc_tape_reader_image_device : public device_t, public device_image_interface +class apexc_tape_reader_image_device : public paper_tape_reader_device { public: // construction/destruction @@ -132,13 +126,6 @@ public: apexc_tape_reader_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_PUNCHTAPE; } - - 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 "tap"; } uint8_t read(); diff --git a/src/mame/machine/coco_vhd.h b/src/mame/machine/coco_vhd.h index e523be69c20..78c7ca20b56 100644 --- a/src/mame/machine/coco_vhd.h +++ b/src/mame/machine/coco_vhd.h @@ -36,14 +36,13 @@ public: // image-level overrides virtual image_init_result call_load() 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 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 "vhd"; } + virtual const char *image_type_name() const noexcept override { return "harddisk"; } + virtual const char *image_brief_type_name() const noexcept override { return "hard"; } // specific implementation uint8_t read(offs_t offset); diff --git a/src/mame/machine/fmt_icmem.cpp b/src/mame/machine/fmt_icmem.cpp index fc005570b9f..b38c3057eb7 100644 --- a/src/mame/machine/fmt_icmem.cpp +++ b/src/mame/machine/fmt_icmem.cpp @@ -22,7 +22,7 @@ DEFINE_DEVICE_TYPE(FMT_ICMEM, fmt_icmem_device, "fmt_icmem", "FM Towns IC Memory fmt_icmem_device::fmt_icmem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, FMT_ICMEM, tag, owner, clock), - device_image_interface(mconfig, *this), + device_memcard_image_interface(mconfig, *this), m_writeprotect(*this,"icmem"), m_change(false), m_attr_select(false), diff --git a/src/mame/machine/fmt_icmem.h b/src/mame/machine/fmt_icmem.h index 50e9abc8ed6..9f45ebcfe18 100644 --- a/src/mame/machine/fmt_icmem.h +++ b/src/mame/machine/fmt_icmem.h @@ -13,23 +13,19 @@ #pragma once +#include "imagedev/memcard.h" + /*************************************************************************** FUNCTION PROTOTYPES ***************************************************************************/ -class fmt_icmem_device : public device_t, public device_image_interface +class fmt_icmem_device : public device_t, public device_memcard_image_interface { public: // construction/destruction fmt_icmem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual iodevice_t image_type() const noexcept override { return IO_MEMCARD; } - - 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 "icm"; } diff --git a/src/mame/machine/hp48_port.h b/src/mame/machine/hp48_port.h index 887c702910a..4d2fcc4ba2a 100644 --- a/src/mame/machine/hp48_port.h +++ b/src/mame/machine/hp48_port.h @@ -35,16 +35,13 @@ public: } // image-level overrides - virtual iodevice_t image_type() const noexcept override { return IO_MEMCARD; } - 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 "crd"; } - virtual const char *custom_instance_name() const noexcept override { return "port"; } - virtual const char *custom_brief_instance_name() const noexcept override { return "p"; } + virtual const char *image_type_name() const noexcept override { return "port"; } + virtual const char *image_brief_type_name() const noexcept override { return "p"; } virtual image_init_result call_load() override; virtual void call_unload() override; diff --git a/src/mame/machine/hp80_optrom.cpp b/src/mame/machine/hp80_optrom.cpp index b8389dcf858..0dc0cec1022 100644 --- a/src/mame/machine/hp80_optrom.cpp +++ b/src/mame/machine/hp80_optrom.cpp @@ -23,7 +23,7 @@ DEFINE_DEVICE_TYPE(HP80_OPTROM, hp80_optrom_device, "hp80_optrom", "HP80 optiona // +------------------+ hp80_optrom_device::hp80_optrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HP80_OPTROM, tag, owner, clock), - device_image_interface(mconfig, *this), + device_rom_image_interface(mconfig, *this), m_select_code(0) { } diff --git a/src/mame/machine/hp80_optrom.h b/src/mame/machine/hp80_optrom.h index 7ab35cd7967..2f4f6cd7250 100644 --- a/src/mame/machine/hp80_optrom.h +++ b/src/mame/machine/hp80_optrom.h @@ -13,13 +13,13 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" // Size of optional ROMs (8k) static constexpr offs_t HP80_OPTROM_SIZE = 0x2000; class hp80_optrom_device : public device_t, - public device_image_interface + public device_rom_image_interface { public: // construction/destruction @@ -40,13 +40,7 @@ protected: // image-level overrides virtual image_init_result call_load() override; virtual void call_unload() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_ROM; } - 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 true; } virtual const char *image_interface() const noexcept override { return "hp80_rom"; } virtual const char *file_extensions() const noexcept override { return "bin"; } diff --git a/src/mame/machine/hp9825_optrom.cpp b/src/mame/machine/hp9825_optrom.cpp index b49ed6f4846..1466bf25b83 100644 --- a/src/mame/machine/hp9825_optrom.cpp +++ b/src/mame/machine/hp9825_optrom.cpp @@ -46,7 +46,7 @@ hp9825_optrom_device::hp9825_optrom_device(machine_config const &mconfig, char c hp9825_optrom_device::hp9825_optrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HP9825_OPTROM, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_rom_image_interface(mconfig, *this) , m_rom_limit(0xffffU) , m_loaded_regions(0) , m_space_r(nullptr) diff --git a/src/mame/machine/hp9825_optrom.h b/src/mame/machine/hp9825_optrom.h index d83cd9563a8..494f2ffda20 100644 --- a/src/mame/machine/hp9825_optrom.h +++ b/src/mame/machine/hp9825_optrom.h @@ -13,10 +13,10 @@ #pragma once #include "machine/bankdev.h" -#include "softlist_dev.h" +#include "imagedev/cartrom.h" class hp9825_optrom_device : public device_t, - public device_image_interface + public device_rom_image_interface { public: // construction/destruction @@ -36,13 +36,7 @@ protected: // image-level overrides virtual image_init_result call_load() override; virtual void call_unload() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_ROM; } - 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 true; } virtual const char *image_interface() const noexcept override { return "hp9825_rom"; } virtual const char *file_extensions() const noexcept override { return "bin"; } diff --git a/src/mame/machine/hp9845_optrom.cpp b/src/mame/machine/hp9845_optrom.cpp index 7f01abee7c7..c33b8b8ab16 100644 --- a/src/mame/machine/hp9845_optrom.cpp +++ b/src/mame/machine/hp9845_optrom.cpp @@ -20,7 +20,7 @@ DEFINE_DEVICE_TYPE(HP9845_OPTROM, hp9845_optrom_device, "hp9845_optrom", "HP9845 // +--------------------+ hp9845_optrom_device::hp9845_optrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HP9845_OPTROM, tag, owner, clock), - device_image_interface(mconfig, *this), + device_rom_image_interface(mconfig, *this), m_base_addr(0), m_end_addr(0) { diff --git a/src/mame/machine/hp9845_optrom.h b/src/mame/machine/hp9845_optrom.h index 0345474c94d..0f972da3427 100644 --- a/src/mame/machine/hp9845_optrom.h +++ b/src/mame/machine/hp9845_optrom.h @@ -13,10 +13,10 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" class hp9845_optrom_device : public device_t, - public device_image_interface + public device_rom_image_interface { public: // construction/destruction @@ -30,13 +30,7 @@ protected: // image-level overrides virtual image_init_result call_load() override; virtual void call_unload() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_ROM; } - 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 true; } virtual const char *image_interface() const noexcept override { return "hp9845b_rom"; } virtual const char *file_extensions() const noexcept override { return "bin"; } diff --git a/src/mame/machine/hp_ipc_optrom.cpp b/src/mame/machine/hp_ipc_optrom.cpp index 75b66ec7a67..045b420b6ef 100644 --- a/src/mame/machine/hp_ipc_optrom.cpp +++ b/src/mame/machine/hp_ipc_optrom.cpp @@ -23,7 +23,7 @@ DEFINE_DEVICE_TYPE(HP_IPC_OPTROM, hp_ipc_optrom_device, "hp_ipc_optrom", "HP IPC // +--------------------+ hp_ipc_optrom_device::hp_ipc_optrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HP_IPC_OPTROM, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_rom_image_interface(mconfig, *this) , m_base(0) { } diff --git a/src/mame/machine/hp_ipc_optrom.h b/src/mame/machine/hp_ipc_optrom.h index 93872a0a5b8..bf7d62e6920 100644 --- a/src/mame/machine/hp_ipc_optrom.h +++ b/src/mame/machine/hp_ipc_optrom.h @@ -13,10 +13,10 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" class hp_ipc_optrom_device : public device_t, - public device_image_interface + public device_rom_image_interface { public: // construction/destruction @@ -37,13 +37,7 @@ protected: // image-level overrides virtual image_init_result call_load() override; virtual void call_unload() override; - virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - virtual iodevice_t image_type() const noexcept override { return IO_ROM; } - 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 true; } virtual const char *image_interface() const noexcept override { return "hp_ipc_rom"; } virtual const char *file_extensions() const noexcept override { return "bin"; } diff --git a/src/mame/machine/hyperscan_card.cpp b/src/mame/machine/hyperscan_card.cpp index 2e1f87f2a38..ad9642fec3a 100644 --- a/src/mame/machine/hyperscan_card.cpp +++ b/src/mame/machine/hyperscan_card.cpp @@ -9,6 +9,8 @@ #include "emu.h" #include "hyperscan_card.h" +#include "softlist_dev.h" + //#define LOG_OUTPUT_FUNC printf //#define VERBOSE 1 #include "logmacro.h" @@ -19,10 +21,15 @@ DEFINE_DEVICE_TYPE(HYPERSCAN_CARD, hyperscan_card_device, "hyperscan_card", "Hyp hyperscan_card_device::hyperscan_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HYPERSCAN_CARD, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_memcard_image_interface(mconfig, *this) { } +const software_list_loader &hyperscan_card_device::get_software_list_loader() const +{ + return image_software_list_loader::instance(); +} + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/machine/hyperscan_card.h b/src/mame/machine/hyperscan_card.h index c1d2cff450e..5a48483149a 100644 --- a/src/mame/machine/hyperscan_card.h +++ b/src/mame/machine/hyperscan_card.h @@ -7,10 +7,10 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/memcard.h" class hyperscan_card_device : public device_t, - public device_image_interface + public device_memcard_image_interface { public: hyperscan_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); @@ -25,17 +25,13 @@ protected: // 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_MEMCARD; } - 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 "hyperscan_card"; } virtual const char *file_extensions() const noexcept override { return "bin"; } // 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; private: uint16_t calc_crc(std::vector const &data); diff --git a/src/mame/machine/imm6_76.h b/src/mame/machine/imm6_76.h index e004f3b234a..cef6df9ba81 100644 --- a/src/mame/machine/imm6_76.h +++ b/src/mame/machine/imm6_76.h @@ -157,16 +157,14 @@ public: virtual void call_unload() override; // device_image_interface static info - virtual iodevice_t image_type() const noexcept override { return IO_ROM; } 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 bool support_command_line_image_creation() const noexcept override { return true; } virtual char const *file_extensions() const noexcept override { return "rom,bin"; } - virtual char const *custom_instance_name() const noexcept override { return "promimage"; } - virtual char const *custom_brief_instance_name() const noexcept override { return "prom"; } + virtual char const *image_type_name() const noexcept override { return "promimage"; } + virtual char const *image_brief_type_name() const noexcept override { return "prom"; } void di_w(u8 data); void a_w(u8 data); diff --git a/src/mame/machine/ng_memcard.cpp b/src/mame/machine/ng_memcard.cpp index e97cb1f771b..c82549cba7c 100644 --- a/src/mame/machine/ng_memcard.cpp +++ b/src/mame/machine/ng_memcard.cpp @@ -23,7 +23,7 @@ DEFINE_DEVICE_TYPE(NG_MEMCARD, ng_memcard_device, "ng_memcard", "NeoGeo Memory C ng_memcard_device::ng_memcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NG_MEMCARD, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_memcard_image_interface(mconfig, *this) { } diff --git a/src/mame/machine/ng_memcard.h b/src/mame/machine/ng_memcard.h index 19870d4d166..186a998cc17 100644 --- a/src/mame/machine/ng_memcard.h +++ b/src/mame/machine/ng_memcard.h @@ -12,21 +12,18 @@ #pragma once +#include "imagedev/memcard.h" + // ======================> ng_memcard_device -class ng_memcard_device : public device_t, public device_image_interface +class ng_memcard_device : public device_t, public device_memcard_image_interface { public: // construction/destruction ng_memcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device_image_interface implementation - virtual iodevice_t image_type() const noexcept override { return IO_MEMCARD; } - 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 "neo"; } diff --git a/src/mame/machine/pce220_ser.h b/src/mame/machine/pce220_ser.h index c9249bf5853..c3d7e5af21e 100644 --- a/src/mame/machine/pce220_ser.h +++ b/src/mame/machine/pce220_ser.h @@ -33,14 +33,14 @@ public: virtual void call_unload() override; virtual image_init_result call_create(int format_type, util::option_resolution *format_options) override; - 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 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 bool support_command_line_image_creation() const noexcept override { return true; } virtual const char *file_extensions() const noexcept override { return "txt,ihx"; } + virtual const char *image_type_name() const noexcept override { return "serial"; } + virtual const char *image_brief_type_name() const noexcept override { return "serl"; } // specific implementation uint8_t in_xin(void) { return m_xin & 0x01; } diff --git a/src/mame/machine/pgm2_memcard.cpp b/src/mame/machine/pgm2_memcard.cpp index 3e52d7a4eb7..f50c8b9e07b 100644 --- a/src/mame/machine/pgm2_memcard.cpp +++ b/src/mame/machine/pgm2_memcard.cpp @@ -24,7 +24,7 @@ DEFINE_DEVICE_TYPE(PGM2_MEMCARD, pgm2_memcard_device, "pgm2_memcard", "PGM2 Memo pgm2_memcard_device::pgm2_memcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PGM2_MEMCARD, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_memcard_image_interface(mconfig, *this) { } diff --git a/src/mame/machine/pgm2_memcard.h b/src/mame/machine/pgm2_memcard.h index 41ec6ea2a59..b2239a1b8c6 100644 --- a/src/mame/machine/pgm2_memcard.h +++ b/src/mame/machine/pgm2_memcard.h @@ -13,6 +13,8 @@ #pragma once +#include "imagedev/memcard.h" + /*************************************************************************** FUNCTION PROTOTYPES @@ -21,18 +23,12 @@ // ======================> pgm2_memcard_device class pgm2_memcard_device : public device_t, - public device_image_interface + public device_memcard_image_interface { public: // construction/destruction pgm2_memcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual iodevice_t image_type() const noexcept override { return IO_MEMCARD; } - - 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 "pg2,bin,mem"; } diff --git a/src/mame/machine/psion_pack.cpp b/src/mame/machine/psion_pack.cpp index 09c523e09e5..104da5ceae9 100644 --- a/src/mame/machine/psion_pack.cpp +++ b/src/mame/machine/psion_pack.cpp @@ -23,6 +23,8 @@ #include "emu.h" #include "psion_pack.h" +#include "softlist_dev.h" + #include "opresolv.h" // Datapack control lines @@ -64,7 +66,7 @@ DEFINE_DEVICE_TYPE(PSION_DATAPACK, datapack_device, "datapack", "Psion Datapack" datapack_device::datapack_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PSION_DATAPACK, tag, owner, clock) - , device_image_interface(mconfig, *this) + , device_memcard_image_interface(mconfig, *this) { } @@ -100,6 +102,16 @@ void datapack_device::device_config_complete() } +//------------------------------------------------- +// get_software_list_loader - +//------------------------------------------------- + +const software_list_loader &datapack_device::get_software_list_loader() const +{ + return image_software_list_loader::instance(); +} + + //------------------------------------------------- // option_guide for create new image //------------------------------------------------- diff --git a/src/mame/machine/psion_pack.h b/src/mame/machine/psion_pack.h index 35e69338d38..41b256f6df3 100644 --- a/src/mame/machine/psion_pack.h +++ b/src/mame/machine/psion_pack.h @@ -9,7 +9,7 @@ #ifndef MAME_MACHINE_PSION_PACK_H #define MAME_MACHINE_PSION_PACK_H -#include "softlist_dev.h" +#include "imagedev/memcard.h" /*************************************************************************** @@ -19,7 +19,7 @@ // ======================> datapack_device class datapack_device : public device_t, - public device_image_interface + public device_memcard_image_interface { public: // construction/destruction @@ -31,14 +31,11 @@ public: virtual void call_unload() override; virtual image_init_result call_create(int format_type, util::option_resolution *create_args) override; - virtual iodevice_t image_type() const noexcept override { return IO_CARTSLOT; } - 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 "psion_pack"; } virtual const char *file_extensions() const noexcept override { return "opk"; } + virtual const char *image_type_name() const noexcept override { return "datapack"; } + virtual const char *image_brief_type_name() const noexcept override { return "dpak"; } virtual const util::option_guide &create_option_guide() const override; // specific implementation @@ -56,7 +53,7 @@ protected: virtual void device_config_complete() 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; private: // internal device state diff --git a/src/mame/machine/x68k_hdc.cpp b/src/mame/machine/x68k_hdc.cpp index d3051b8bcb9..d3f108cb40b 100644 --- a/src/mame/machine/x68k_hdc.cpp +++ b/src/mame/machine/x68k_hdc.cpp @@ -27,8 +27,7 @@ ALLOW_SAVE_TYPE(x68k_hdc_image_device::sasi_phase); DEFINE_DEVICE_TYPE(X68KHDC, x68k_hdc_image_device, "x68k_hdc_image", "SASI Hard Disk") x68k_hdc_image_device::x68k_hdc_image_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : device_t(mconfig, X68KHDC, tag, owner, clock) - , device_image_interface(mconfig, *this) + : harddisk_image_base_device(mconfig, X68KHDC, tag, owner, clock) { } diff --git a/src/mame/machine/x68k_hdc.h b/src/mame/machine/x68k_hdc.h index 05d2f86af5c..0927f29401d 100644 --- a/src/mame/machine/x68k_hdc.h +++ b/src/mame/machine/x68k_hdc.h @@ -10,9 +10,10 @@ #pragma once +#include "imagedev/harddriv.h" -class x68k_hdc_image_device : public device_t, - public device_image_interface + +class x68k_hdc_image_device : public harddisk_image_base_device { enum class sasi_phase : u8 { @@ -97,16 +98,9 @@ public: x68k_hdc_image_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); // image-level overrides - 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 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 "hdf"; } - virtual const char *custom_instance_name() const noexcept override { return "sasihd"; } - virtual const char *custom_brief_instance_name() const noexcept override { return "sasi"; } + virtual const char *image_type_name() const noexcept override { return "sasihd"; } + virtual const char *image_brief_type_name() const noexcept override { return "sasi"; } virtual image_init_result call_create(int format_type, util::option_resolution *format_options) override; void hdc_w(offs_t offset, u16 data); diff --git a/src/osd/modules/debugger/debugimgui.cpp b/src/osd/modules/debugger/debugimgui.cpp index 6271adf97a5..ebaa320ea3a 100644 --- a/src/osd/modules/debugger/debugimgui.cpp +++ b/src/osd/modules/debugger/debugimgui.cpp @@ -987,9 +987,9 @@ void debug_imgui::create_image() { image_init_result res; - if(m_dialog_image->image_type() == IO_FLOPPY) + auto *fd = dynamic_cast(m_dialog_image); + if(fd != nullptr) { - auto *fd = static_cast(m_dialog_image); res = fd->create(m_path,nullptr,nullptr); if(res == image_init_result::PASS) fd->setup_write(m_typelist.at(m_format_sel).format); @@ -1199,7 +1199,8 @@ void debug_imgui::draw_create_dialog(const char* label) } // format combo box for floppy devices - if(m_dialog_image->image_type() == IO_FLOPPY) + auto *fd = dynamic_cast(m_dialog_image); + if(fd != nullptr) { std::string combo_str; combo_str.clear();