diff options
-rw-r--r-- | src/devices/bus/vic10/exp.cpp | 8 | ||||
-rw-r--r-- | src/devices/imagedev/cdromimg.cpp | 35 | ||||
-rw-r--r-- | src/devices/machine/ds2430a.cpp | 5 | ||||
-rw-r--r-- | src/lib/util/cdrom.h | 2 | ||||
-rw-r--r-- | src/mame/trs/trs80_quik.cpp | 32 |
5 files changed, 50 insertions, 32 deletions
diff --git a/src/devices/bus/vic10/exp.cpp b/src/devices/bus/vic10/exp.cpp index 8ad3d88d8ca..08866c7aeb9 100644 --- a/src/devices/bus/vic10/exp.cpp +++ b/src/devices/bus/vic10/exp.cpp @@ -82,6 +82,8 @@ void vic10_expansion_slot_device::device_start() std::pair<std::error_condition, std::string> vic10_expansion_slot_device::call_load() { + std::error_condition err; + if (m_card) { if (!loaded_through_softlist()) @@ -122,6 +124,10 @@ std::pair<std::error_condition, std::string> vic10_expansion_slot_device::call_l cbm_crt_read_data(image_core_file(), roml, romh); } } + else + { + err = image_error::INVALIDIMAGE; + } } else { @@ -131,7 +137,7 @@ std::pair<std::error_condition, std::string> vic10_expansion_slot_device::call_l } } - return std::make_pair(std::error_condition(), std::string()); + return std::make_pair(err, std::string()); } diff --git a/src/devices/imagedev/cdromimg.cpp b/src/devices/imagedev/cdromimg.cpp index c5e0a7fbad6..6078aa79611 100644 --- a/src/devices/imagedev/cdromimg.cpp +++ b/src/devices/imagedev/cdromimg.cpp @@ -109,8 +109,10 @@ std::pair<std::error_condition, std::string> cdrom_image_device::call_load() m_cdrom_handle.reset(); m_dvdrom_handle.reset(); - if (!loaded_through_softlist()) { - if (is_filetype("chd") && is_loaded()) { + if (!loaded_through_softlist()) + { + if (is_filetype("chd") && is_loaded()) + { util::core_file::ptr proxy; err = util::core_file::open_proxy(image_core_file(), proxy); if (!err) @@ -119,8 +121,10 @@ std::pair<std::error_condition, std::string> cdrom_image_device::call_load() goto error; chd = &m_self_chd; } - } else { - chd = device().machine().rom_load().get_disk_handle(device().subtag("cdrom").c_str()); + } + else + { + chd = device().machine().rom_load().get_disk_handle(device().subtag("cdrom")); } // open the CHD file @@ -128,25 +132,28 @@ std::pair<std::error_condition, std::string> cdrom_image_device::call_load() { if (chd->is_cd() || (m_gd_compat && chd->is_gd())) m_cdrom_handle.reset(new cdrom_file(chd)); - else if(m_dvd_compat && chd->is_dvd()) + else if (m_dvd_compat && chd->is_dvd()) m_dvdrom_handle.reset(new dvdrom_file(chd)); else { err = image_error::UNSUPPORTED; goto error; } - m_cdrom_handle.reset(new cdrom_file(chd)); } else { - try { - auto *cdrom = new cdrom_file(filename()); - m_cdrom_handle.reset(cdrom); - } catch(void *) { - try { - auto *dvdrom = new dvdrom_file(filename()); - m_dvdrom_handle.reset(dvdrom); - } catch(void *) { + try + { + m_cdrom_handle.reset(new cdrom_file(filename())); + } + catch (void *) + { + try + { + m_dvdrom_handle.reset(new dvdrom_file(filename())); + } + catch (void *) + { err = image_error::UNSUPPORTED; goto error; } diff --git a/src/devices/machine/ds2430a.cpp b/src/devices/machine/ds2430a.cpp index ba7926432e7..b788f2e061d 100644 --- a/src/devices/machine/ds2430a.cpp +++ b/src/devices/machine/ds2430a.cpp @@ -45,10 +45,11 @@ #define LOG_STATE (1U << 3) #define LOG_DATA (1U << 4) #define LOG_COMMAND (1U << 5) -#define VERBOSE (0) +#define VERBOSE (0) #include "logmacro.h" + //************************************************************************** // GLOBAL VARIABLES //************************************************************************** @@ -465,7 +466,7 @@ bool ds2430a_device::nvram_read(util::read_stream &file) if (m_rom[0] != 0x14) osd_printf_error("Incorrect ROM family code (expected 14h, found %02Xh in saved data)\n", m_rom[0]); - u8 crc = std::accumulate(std::begin(m_rom), std::end(m_rom) - 1, u8(0), &ds1wire_crc); + u8 const crc = std::accumulate(std::begin(m_rom), std::end(m_rom) - 1, u8(0), &ds1wire_crc); if (m_rom[7] != crc) osd_printf_error("Incorrect ROM CRC (expected %02Xh, found %02Xh in saved data)\n", crc, m_rom[7]); diff --git a/src/lib/util/cdrom.h b/src/lib/util/cdrom.h index c8b5d1f1f56..214a7ed39d6 100644 --- a/src/lib/util/cdrom.h +++ b/src/lib/util/cdrom.h @@ -21,7 +21,7 @@ public: // tracks are padded to a multiple of this many frames static constexpr uint32_t TRACK_PADDING = 4; - static constexpr uint32_t MAX_TRACKS = 99 + 1; + static constexpr uint32_t MAX_TRACKS = 99; /* AFAIK the theoretical limit */ static constexpr uint32_t MAX_SECTOR_DATA = 2352; static constexpr uint32_t MAX_SUBCODE_DATA = 96; diff --git a/src/mame/trs/trs80_quik.cpp b/src/mame/trs/trs80_quik.cpp index aa34138e589..dfdf6460929 100644 --- a/src/mame/trs/trs80_quik.cpp +++ b/src/mame/trs/trs80_quik.cpp @@ -11,26 +11,30 @@ #include "cpu/z80/z80.h" +#define VERBOSE 1 +#include "logmacro.h" + /*************************************************************************** PARAMETERS ***************************************************************************/ -#define VERBOSE 1 -#include "logmacro.h" +enum : uint8_t +{ + CMD_TYPE_OBJECT_CODE = 0x01, + CMD_TYPE_TRANSFER_ADDRESS = 0x02, + CMD_TYPE_END_OF_PARTITIONED_DATA_SET_MEMBER = 0x04, + CMD_TYPE_LOAD_MODULE_HEADER = 0x05, + CMD_TYPE_PARTITIONED_DATA_SET_HEADER = 0x06, + CMD_TYPE_PATCH_NAME_HEADER = 0x07, + CMD_TYPE_ISAM_DIRECTORY_ENTRY = 0x08, + CMD_TYPE_END_OF_ISAM_DIRECTORY_ENTRY = 0x0a, + CMD_TYPE_PDS_DIRECTORY_ENTRY = 0x0c, + CMD_TYPE_END_OF_PDS_DIRECTORY_ENTRY = 0x0e, + CMD_TYPE_YANKED_LOAD_BLOCK = 0x10, + CMD_TYPE_COPYRIGHT_BLOCK = 0x1f +}; -#define CMD_TYPE_OBJECT_CODE 0x01 -#define CMD_TYPE_TRANSFER_ADDRESS 0x02 -#define CMD_TYPE_END_OF_PARTITIONED_DATA_SET_MEMBER 0x04 -#define CMD_TYPE_LOAD_MODULE_HEADER 0x05 -#define CMD_TYPE_PARTITIONED_DATA_SET_HEADER 0x06 -#define CMD_TYPE_PATCH_NAME_HEADER 0x07 -#define CMD_TYPE_ISAM_DIRECTORY_ENTRY 0x08 -#define CMD_TYPE_END_OF_ISAM_DIRECTORY_ENTRY 0x0a -#define CMD_TYPE_PDS_DIRECTORY_ENTRY 0x0c -#define CMD_TYPE_END_OF_PDS_DIRECTORY_ENTRY 0x0e -#define CMD_TYPE_YANKED_LOAD_BLOCK 0x10 -#define CMD_TYPE_COPYRIGHT_BLOCK 0x1f /*************************************************************************** IMPLEMENTATION |