summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/imagedev/cdromimg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/imagedev/cdromimg.cpp')
-rw-r--r--src/devices/imagedev/cdromimg.cpp34
1 files changed, 9 insertions, 25 deletions
diff --git a/src/devices/imagedev/cdromimg.cpp b/src/devices/imagedev/cdromimg.cpp
index e5e0bc2b9e6..355314a8285 100644
--- a/src/devices/imagedev/cdromimg.cpp
+++ b/src/devices/imagedev/cdromimg.cpp
@@ -79,10 +79,9 @@ void cdrom_image_device::setup_current_preset_image()
m_dvdrom_handle.reset();
chd_file *chd = current_preset_image_chd();
-
- if (!chd->check_is_cd() || (m_gd_compat && !chd->check_is_gd()))
+ if (chd->is_cd() || (m_gd_compat && chd->is_gd()))
m_cdrom_handle = std::make_unique<cdrom_file>(chd);
- else if(m_dvd_compat && !chd->check_is_dvd())
+ else if(m_dvd_compat && chd->is_dvd())
m_dvdrom_handle = std::make_unique<dvdrom_file>(chd);
else
fatalerror("chd for region %s is not compatible with the cdrom image device\n", preset_images_list()[current_preset_image_id()]);
@@ -127,31 +126,16 @@ std::pair<std::error_condition, std::string> cdrom_image_device::call_load()
// open the CHD file
if (chd)
{
- err = chd->check_is_cd();
- if (err == chd_file::error::METADATA_NOT_FOUND && m_gd_compat)
- err = chd->check_is_gd();
- if (!err)
- {
+ if (chd->is_cd() || (m_gd_compat && chd->is_gd()))
m_cdrom_handle.reset(new cdrom_file(chd));
- return std::make_pair(std::error_condition(), std::string());
- }
- if (err != chd_file::error::METADATA_NOT_FOUND)
- goto error;
-
- if (m_dvd_compat)
+ else if(m_dvd_compat && chd->is_dvd())
+ m_dvdrom_handle.reset(new dvdrom_file(chd));
+ else
{
- err = chd->check_is_dvd();
- if (!err)
- {
- m_dvdrom_handle.reset(new dvdrom_file(chd));
- return std::make_pair(std::error_condition(), std::string());
- }
- if (err != chd_file::error::METADATA_NOT_FOUND)
- goto error;
+ err = image_error::UNSUPPORTED;
+ goto error;
}
-
- err = image_error::UNSUPPORTED;
- goto error;
+ m_cdrom_handle.reset(new cdrom_file(chd));
}
else
{