diff options
author | 2011-11-21 14:44:32 +0000 | |
---|---|---|
committer | 2011-11-21 14:44:32 +0000 | |
commit | f2464acbf97c6776fe26adbeb251ce36ca7ce8f2 (patch) | |
tree | b08729b566aa75f2d19d7913dbff1149a620efd1 /src/emu/imagedev/harddriv.c | |
parent | 43245e3777319a3f2a1b9dd069ad96d6995a364f (diff) |
Added support for hard disk softlists [Miodrag Milanovic]
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; |