summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/imagedev/memcard.h
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2022-01-06 20:59:02 -0500
committer AJR <ajrhacker@users.noreply.github.com>2022-01-06 20:59:02 -0500
commit23bbd37da65e7d9783b8fa697039fa85257fa6de (patch)
tree6970df7d29d7751e560baf251af7ad173f143429 /src/devices/imagedev/memcard.h
parent20adc731c24b8be2f7b963c8ed6a41829f7f5617 (diff)
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
Diffstat (limited to 'src/devices/imagedev/memcard.h')
-rw-r--r--src/devices/imagedev/memcard.h38
1 files changed, 38 insertions, 0 deletions
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