diff options
Diffstat (limited to 'src/devices/bus/a7800/a78_slot.h')
-rw-r--r-- | src/devices/bus/a7800/a78_slot.h | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/src/devices/bus/a7800/a78_slot.h b/src/devices/bus/a7800/a78_slot.h index 9cd5971f6f6..9f9b8126c82 100644 --- a/src/devices/bus/a7800/a78_slot.h +++ b/src/devices/bus/a7800/a78_slot.h @@ -5,15 +5,13 @@ #pragma once -#include "softlist_dev.h" +#include "imagedev/cartrom.h" /*************************************************************************** TYPE DEFINITIONS ***************************************************************************/ -#define A78SLOT_ROM_REGION_TAG ":cart:rom" - /* PCB */ enum { @@ -58,7 +56,7 @@ public: virtual void write_30xx(offs_t offset, uint8_t data) {} virtual void write_40xx(offs_t offset, uint8_t data) {} - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); void ram_alloc(uint32_t size); void nvram_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } @@ -85,41 +83,36 @@ 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: // construction/destruction template <typename T> - a78_cart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) - : a78_cart_slot_device(mconfig, tag, owner, (uint32_t)0) + a78_cart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock, T &&opts, char const *dflt) + : a78_cart_slot_device(mconfig, tag, owner, clock) { option_reset(); opts(*this); set_default_option(dflt); set_fixed(false); } - a78_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + a78_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~a78_cart_slot_device(); - // image-level overrides - virtual image_init_result call_load() override; + // device_image_interface implementation + virtual std::pair<std::error_condition, std::string> 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"; } virtual u32 unhashed_header_length() const noexcept override { return 128; } - // slot interface overrides + // device_slot_interface implementation virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override; - int get_cart_type() { return m_type; }; + int get_cart_type() { return m_type; } bool has_cart() { return m_cart != nullptr; } // reading and writing @@ -133,18 +126,15 @@ public: void write_40xx(offs_t offset, uint8_t data); private: - // device-level overrides + // device_t implementation 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(); } + std::pair<std::error_condition, std::string> verify_header(const uint8_t *header); + int validate_header(int head, bool log) const; + void internal_header_logging(const uint8_t *header, uint32_t len); - device_a78_cart_interface* m_cart; + device_a78_cart_interface *m_cart; int m_type; - - image_verify_result verify_header(char *header); - int validate_header(int head, bool log) const; - void internal_header_logging(uint8_t *header, uint32_t len); }; |