diimage: allow image devices to skip core fopen() of the image's filename and handle themselves in call_load() [R. Belmont]

This commit is contained in:
R. Belmont 2013-01-12 04:46:30 +00:00
parent aec743cb17
commit 7cd142d28d
2 changed files with 40 additions and 36 deletions

View File

@ -936,6 +936,8 @@ bool device_image_interface::load_internal(const char *path, bool is_create, int
if (m_err)
goto done;
if (core_opens_image_file())
{
/* Check if there's a software list defined for this device and use that if we're not creating an image */
if (!filename_has_period && !just_load)
{
@ -978,6 +980,7 @@ bool device_image_interface::load_internal(const char *path, bool is_create, int
m_err = IMAGE_ERROR_FILENOTFOUND;
goto done;
}
}
/* call device load or create */
m_create_format = create_format;

View File

@ -154,6 +154,7 @@ public:
virtual void call_display() { }
virtual void call_display_info() { }
virtual device_image_partialhash_func get_partial_hash() const { return NULL; }
virtual bool core_opens_image_file() const { return TRUE; }
virtual iodevice_t image_type() const = 0;
virtual bool is_readable() const = 0;
virtual bool is_writeable() const = 0;