summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/softlist_dev.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2023-03-30 20:23:35 -0400
committer AJR <ajrhacker@users.noreply.github.com>2023-03-30 20:40:34 -0400
commit6f7e4141ea14acaaf9cb973c66788fabb3457023 (patch)
treeb7d89cfdacecbe34257c15c199a85b0a806850db /src/emu/softlist_dev.cpp
parent7579c2f89dbcd509e4083bd578d2864d342caad4 (diff)
API change for device_image_interface
- Remove the seterror method for recording error messages and conditions. Condition codes have been made return values for call_load, call_create and various related callbacks. Error messages (which many devices weren't generating) are now displayed through osd_printf_error. - Eliminate the image_init_result and image_verify_result pass/fail enumeration types. Update many functions that were returning these enumerations or simply bools to return std::error_condition instead. In some cases, this type is now passed down from internal parsing/loading functions which were already returning it. In various other cases, the former default UNSPECIFIED has been used as a catchall for I/O errors; anticipated future refactorings should make these error returns more specific. - Expand the image_error categories to include INVALIDLENGTH, NOSOFTWARE and BADSOFTWARE. The first is largely self-explanatory. The second is generated by the core to indicate failure to find software items in lists. The third is provided for devices to indicate semantic errors in software list entries. - Change the return type of floppy_image_device::identify to a pair so the potential error condition can be passed along to the UI without storing it in a member variable. - Move device_image_interface::message down into snapshot_image_device and change its implementation to use string_format instead of printf. - Correct a typo in the shortname of the generic snapshot device.
Diffstat (limited to 'src/emu/softlist_dev.cpp')
-rw-r--r--src/emu/softlist_dev.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/emu/softlist_dev.cpp b/src/emu/softlist_dev.cpp
index 6db85f917cf..731b7e94db4 100644
--- a/src/emu/softlist_dev.cpp
+++ b/src/emu/softlist_dev.cpp
@@ -50,9 +50,9 @@ image_software_list_loader image_software_list_loader::s_instance;
// false_software_list_loader::load_software
//-------------------------------------------------
-bool false_software_list_loader::load_software(device_image_interface &image, software_list_device &swlist, std::string_view swname, const rom_entry *start_entry) const
+std::error_condition false_software_list_loader::load_software(device_image_interface &image, software_list_device &swlist, std::string_view swname, const rom_entry *start_entry) const
{
- return false;
+ return image_error::UNSUPPORTED;
}
@@ -60,10 +60,10 @@ bool false_software_list_loader::load_software(device_image_interface &image, so
// rom_software_list_loader::load_software
//-------------------------------------------------
-bool rom_software_list_loader::load_software(device_image_interface &image, software_list_device &swlist, std::string_view swname, const rom_entry *start_entry) const
+std::error_condition rom_software_list_loader::load_software(device_image_interface &image, software_list_device &swlist, std::string_view swname, const rom_entry *start_entry) const
{
swlist.machine().rom_load().load_software_part_region(image.device(), swlist, swname, start_entry);
- return true;
+ return std::error_condition();
}
@@ -71,7 +71,7 @@ bool rom_software_list_loader::load_software(device_image_interface &image, soft
// image_software_list_loader::load_software
//-------------------------------------------------
-bool image_software_list_loader::load_software(device_image_interface &image, software_list_device &swlist, std::string_view swname, const rom_entry *start_entry) const
+std::error_condition image_software_list_loader::load_software(device_image_interface &image, software_list_device &swlist, std::string_view swname, const rom_entry *start_entry) const
{
return image.load_software(swlist, swname, start_entry);
}