summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/imagedev/diablo.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/imagedev/diablo.h')
-rw-r--r--src/devices/imagedev/diablo.h41
1 files changed, 22 insertions, 19 deletions
diff --git a/src/devices/imagedev/diablo.h b/src/devices/imagedev/diablo.h
index c541573f5f5..76cd7a320e5 100644
--- a/src/devices/imagedev/diablo.h
+++ b/src/devices/imagedev/diablo.h
@@ -9,9 +9,16 @@
#pragma once
-#include "harddisk.h"
#include "softlist_dev.h"
+#include "harddriv.h"
+
+#include <memory>
+#include <string>
+#include <system_error>
+#include <utility>
+
+
#define DIABLO_TAG(id) "diablo"#id
/***************************************************************************
@@ -20,9 +27,12 @@
// ======================> diablo_image_device
-class diablo_image_device : public device_t, public device_image_interface
+class diablo_image_device : public harddisk_image_base_device
{
public:
+ typedef device_delegate<std::error_condition (device_image_interface &)> load_delegate;
+ typedef device_delegate<void (device_image_interface &)> unload_delegate;
+
// construction/destruction
diablo_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~diablo_image_device();
@@ -31,28 +41,21 @@ public:
template <typename Object> void set_device_unload(Object &&cb) { m_device_image_unload = std::forward<Object>(cb); }
void set_interface(const char *interface) { m_interface = interface; }
- // image-level overrides
- virtual image_init_result call_load() override;
- virtual image_init_result call_create(int create_format, util::option_resolution *create_args) override;
+ // device_image_interface implementation
+ virtual std::pair<std::error_condition, std::string> call_load() override;
+ virtual std::pair<std::error_condition, std::string> 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;
// specific implementation
- hard_disk_file *get_hard_disk_file() { return m_hard_disk_handle; }
- chd_file *get_chd_file();
+ hard_disk_file *get_hard_disk_file() { return m_hard_disk_handle.get(); }
protected:
- // device-level overrides
+ // device_t implementation
virtual void device_config_complete() override;
virtual void device_start() override;
virtual void device_stop() override;
@@ -60,12 +63,12 @@ protected:
// device_image_interface implementation
virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
- image_init_result internal_load_dsk();
+ std::error_condition internal_load_dsk();
chd_file *m_chd;
- chd_file m_origchd; /* handle to the original CHD */
- chd_file m_diffchd; /* handle to the diff CHD */
- hard_disk_file *m_hard_disk_handle;
+ chd_file m_origchd; // handle to the original CHD
+ chd_file m_diffchd; // handle to the diff CHD
+ std::unique_ptr<hard_disk_file> m_hard_disk_handle;
load_delegate m_device_image_load;
unload_delegate m_device_image_unload;