summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/emu/imagedev/harddriv.c24
-rw-r--r--src/emu/imagedev/harddriv.h5
2 files changed, 20 insertions, 9 deletions
diff --git a/src/emu/imagedev/harddriv.c b/src/emu/imagedev/harddriv.c
index 6f3c6c7b0a8..fbf23de2ea5 100644
--- a/src/emu/imagedev/harddriv.c
+++ b/src/emu/imagedev/harddriv.c
@@ -206,20 +206,26 @@ int harddisk_image_device::internal_load_hd(const char *metadata)
{
chd_error err = (chd_error)0;
int is_writeable;
+ astring tempstring;
/* open the CHD file */
- do
+ if (software_entry() != NULL)
{
- is_writeable = !is_readonly();
- m_chd = NULL;
- err = chd_open_file(image_core_file(), is_writeable ? CHD_OPEN_READWRITE : CHD_OPEN_READ, NULL, &m_chd);
+ m_chd = get_disk_handle(device().machine(), device().subtag(tempstring,"harddriv"));
+ } else {
+ do
+ {
+ is_writeable = !is_readonly();
+ m_chd = NULL;
+ err = chd_open_file(image_core_file(), is_writeable ? CHD_OPEN_READWRITE : CHD_OPEN_READ, NULL, &m_chd);
- /* special case; if we get CHDERR_FILE_NOT_WRITEABLE, make the
- * image read only and repeat */
- if (err == CHDERR_FILE_NOT_WRITEABLE)
- make_readonly();
+ /* special case; if we get CHDERR_FILE_NOT_WRITEABLE, make the
+ * image read only and repeat */
+ if (err == CHDERR_FILE_NOT_WRITEABLE)
+ make_readonly();
+ }
+ while(!m_chd && is_writeable && (err == CHDERR_FILE_NOT_WRITEABLE));
}
- while(!m_chd && is_writeable && (err == CHDERR_FILE_NOT_WRITEABLE));
if (!m_chd)
goto done;
diff --git a/src/emu/imagedev/harddriv.h b/src/emu/imagedev/harddriv.h
index 10420c23bdf..d5ff35f6f98 100644
--- a/src/emu/imagedev/harddriv.h
+++ b/src/emu/imagedev/harddriv.h
@@ -22,6 +22,8 @@ struct harddisk_interface
{
device_image_load_func m_device_image_load;
device_image_unload_func m_device_image_unload;
+ const char * m_interface;
+ device_image_display_info_func m_device_displayinfo;
};
// ======================> harddisk_image_device
@@ -39,6 +41,8 @@ public:
virtual bool call_load();
virtual bool call_create(int create_format, option_resolution *create_args);
virtual void call_unload();
+ virtual void call_display_info() { if (m_device_displayinfo) m_device_displayinfo(*this); }
+ virtual bool call_softlist_load(char *swlist, char *swname, rom_entry *start_entry) { load_software_part_region(this, swlist, swname, start_entry ); return TRUE; }
virtual iodevice_t image_type() const { return IO_HARDDISK; }
@@ -47,6 +51,7 @@ public:
virtual bool is_creatable() const { return 0; }
virtual bool must_be_loaded() const { return 0; }
virtual bool is_reset_on_load() const { return 0; }
+ virtual const char *image_interface() const { return m_interface; }
virtual const char *file_extensions() const { return "chd,hd"; }
virtual const option_guide *create_option_guide() const;