diff options
Diffstat (limited to 'src/emu/imagedev/harddriv.c')
-rw-r--r-- | src/emu/imagedev/harddriv.c | 24 |
1 files changed, 15 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; |