diff options
author | Vas Crabb <vas@vastheman.com> | 2016-08-01 18:46:56 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2016-08-01 18:47:22 +1000 |
commit | 15e7be7ac8e4127e9fc0f9b5c248f4a73ba85703 (patch) | |
tree | 71346f2c2d1ac08e0e9c9f4dea8f2537af380143 /src/mame/drivers/nascom1.cpp | |
parent | c4c05c9735a5b956de128d6017027658b6c61a8e (diff) |
Turn image init/validate into scoped enums to avoid accidental casts to/from integer and boolean types
The image error should also be turned into a scoped enum - the menus were assuming it was the same thing as an init result
Diffstat (limited to 'src/mame/drivers/nascom1.cpp')
-rw-r--r-- | src/mame/drivers/nascom1.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mame/drivers/nascom1.cpp b/src/mame/drivers/nascom1.cpp index ffe9b3b55e6..9633a388d76 100644 --- a/src/mame/drivers/nascom1.cpp +++ b/src/mame/drivers/nascom1.cpp @@ -116,7 +116,7 @@ public: DECLARE_DRIVER_INIT(nascom2c); UINT32 screen_update_nascom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - int load_cart(device_image_interface &image, generic_slot_device *slot, int slot_id); + image_init_result load_cart(device_image_interface &image, generic_slot_device *slot, int slot_id); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(socket1_load) { return load_cart(image, m_socket1, 1); } DECLARE_DEVICE_IMAGE_LOAD_MEMBER(socket2_load) { return load_cart(image, m_socket2, 2); } @@ -211,10 +211,10 @@ DEVICE_IMAGE_LOAD_MEMBER( nascom_state, nascom1_cassette ) m_tape_image = (UINT8*)image.ptr(); if (!m_tape_image) - return IMAGE_INIT_FAIL; + return image_init_result::FAIL; m_tape_index = 0; - return IMAGE_INIT_PASS; + return image_init_result::PASS; } DEVICE_IMAGE_UNLOAD_MEMBER( nascom_state, nascom1_cassette ) @@ -250,7 +250,7 @@ SNAPSHOT_LOAD_MEMBER( nascom_state, nascom1 ) } } - return IMAGE_INIT_PASS; + return image_init_result::PASS; } @@ -258,7 +258,7 @@ SNAPSHOT_LOAD_MEMBER( nascom_state, nascom1 ) // SOCKETS //************************************************************************** -int nascom2_state::load_cart(device_image_interface &image, generic_slot_device *slot, int slot_id) +image_init_result nascom2_state::load_cart(device_image_interface &image, generic_slot_device *slot, int slot_id) { // loading directly from file if (image.software_entry() == nullptr) @@ -266,7 +266,7 @@ int nascom2_state::load_cart(device_image_interface &image, generic_slot_device if (slot->length() > 0x1000) { image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported file size"); - return IMAGE_INIT_FAIL; + return image_init_result::FAIL; } slot->rom_alloc(slot->length(), GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); @@ -310,7 +310,7 @@ int nascom2_state::load_cart(device_image_interface &image, generic_slot_device } } - return IMAGE_INIT_PASS; + return image_init_result::PASS; } |