From 4e9582a5b4bf052202948b53b030c200a3434d0c Mon Sep 17 00:00:00 2001 From: Dirk Hoffmann Date: Sun, 1 Sep 2024 16:05:17 +0200 Subject: [PATCH] Renamed ERROR_XXX to VAERROR_XXX (to avoid the generic name 'ERROR') --- Emulator/Base/CoreComponent.cpp | 4 +- Emulator/Base/Defaults.cpp | 14 +- Emulator/Base/Error.cpp | 178 +++--- Emulator/Base/ErrorTypes.h | 568 +++++++++--------- Emulator/Base/GuardList.cpp | 18 +- Emulator/Base/Host.cpp | 4 +- Emulator/Components/Agnus/Agnus.cpp | 6 +- Emulator/Components/Agnus/Blitter/Blitter.cpp | 4 +- .../Agnus/DmaDebugger/DmaDebugger.cpp | 4 +- Emulator/Components/Amiga.cpp | 22 +- Emulator/Components/CIA/CIA.cpp | 4 +- Emulator/Components/CPU/CPU.cpp | 8 +- Emulator/Components/Denise/Denise.cpp | 4 +- Emulator/Components/Denise/PixelEngine.cpp | 10 +- Emulator/Components/Emulator.cpp | 10 +- Emulator/Components/Memory/Memory.cpp | 56 +- Emulator/Components/Memory/MemoryDebugger.cpp | 18 +- .../Components/Paula/Audio/AudioFilter.cpp | 4 +- .../Paula/DiskController/DiskController.cpp | 4 +- Emulator/Components/Ports/AudioPort.cpp | 4 +- Emulator/Components/Ports/SerialPort.cpp | 6 +- Emulator/Components/Ports/VideoPort.cpp | 2 +- Emulator/Components/RTC/RTC.cpp | 6 +- Emulator/Components/Zorro/DiagBoard.cpp | 6 +- Emulator/Components/Zorro/HdController.cpp | 16 +- Emulator/FileSystems/FSBlock.cpp | 24 +- Emulator/FileSystems/FSBlock.h | 36 +- Emulator/FileSystems/FSDescriptors.cpp | 6 +- Emulator/FileSystems/FileSystem.cpp | 30 +- Emulator/FileSystems/MutableFileSystem.cpp | 24 +- Emulator/Media/AmigaFile.cpp | 14 +- Emulator/Media/DiskFiles/ADFFile.cpp | 28 +- Emulator/Media/DiskFiles/DMSFile.cpp | 2 +- Emulator/Media/DiskFiles/EADFFile.cpp | 16 +- Emulator/Media/DiskFiles/EXEFile.cpp | 4 +- Emulator/Media/DiskFiles/FloppyFile.cpp | 4 +- Emulator/Media/DiskFiles/Folder.cpp | 2 +- Emulator/Media/DiskFiles/HDFFile.cpp | 8 +- Emulator/Media/DiskFiles/IMGFile.cpp | 16 +- Emulator/Media/DiskFiles/STFile.cpp | 14 +- Emulator/Media/MediaFile.cpp | 6 +- Emulator/Media/RomFiles/RomFile.cpp | 4 +- Emulator/Media/Snapshot.cpp | 12 +- Emulator/Misc/OSDebugger/OSDebugger.cpp | 18 +- Emulator/Misc/OSDebugger/OSDescriptors.cpp | 16 +- Emulator/Misc/Recorder/Recorder.cpp | 14 +- .../RegressionTester/RegressionTester.cpp | 4 +- Emulator/Misc/RemoteServers/GdbServerCmds.cpp | 36 +- Emulator/Misc/RemoteServers/RemoteServer.cpp | 2 +- Emulator/Misc/RemoteServers/Socket.cpp | 20 +- Emulator/Misc/RetroShell/CommandConsole.cpp | 4 +- Emulator/Misc/RetroShell/Console.cpp | 2 +- Emulator/Misc/RetroShell/DebugConsole.cpp | 14 +- Emulator/Misc/RetroShell/RetroShell.cpp | 2 +- .../Peripherals/Drive/DriveDescriptors.cpp | 18 +- Emulator/Peripherals/Drive/FloppyDisk.cpp | 2 +- Emulator/Peripherals/Drive/FloppyDrive.cpp | 20 +- Emulator/Peripherals/Drive/HardDrive.cpp | 18 +- Emulator/Peripherals/Joystick/Joystick.cpp | 2 +- Emulator/Peripherals/Keyboard/Keyboard.cpp | 2 +- Emulator/Peripherals/Mouse/Mouse.cpp | 4 +- Emulator/VAmiga.h | 30 +- Proxy/EmulatorProxy.mm | 2 +- 63 files changed, 730 insertions(+), 730 deletions(-) diff --git a/Emulator/Base/CoreComponent.cpp b/Emulator/Base/CoreComponent.cpp index 64abaa4ca..749d789c3 100644 --- a/Emulator/Base/CoreComponent.cpp +++ b/Emulator/Base/CoreComponent.cpp @@ -274,7 +274,7 @@ CoreComponent::load(const u8 *buffer) // Check integrity if (hash != c->checksum(false) || FORCE_SNAP_CORRUPTED) { - if (SNP_DEBUG) { fatalError; } else { throw Error(ERROR_SNAP_CORRUPTED); } + if (SNP_DEBUG) { fatalError; } else { throw Error(VAERROR_SNAP_CORRUPTED); } } debug(SNP_DEBUG, "Loaded %ld bytes (expected %ld)\n", count, c->size(false)); @@ -306,7 +306,7 @@ CoreComponent::save(u8 *buffer) // Check integrity if (count != c->size(false) || FORCE_SNAP_CORRUPTED) { - if (SNP_DEBUG) { fatalError; } else { throw Error(ERROR_SNAP_CORRUPTED); } + if (SNP_DEBUG) { fatalError; } else { throw Error(VAERROR_SNAP_CORRUPTED); } } debug(SNP_DEBUG, "Saved %ld bytes (expected %ld)\n", count, c->size(false)); diff --git a/Emulator/Base/Defaults.cpp b/Emulator/Base/Defaults.cpp index 2786ff0e4..8098e642c 100644 --- a/Emulator/Base/Defaults.cpp +++ b/Emulator/Base/Defaults.cpp @@ -198,7 +198,7 @@ Defaults::load(const fs::path &path) auto fs = std::ifstream(path, std::ifstream::binary); if (!fs.is_open()) { - throw Error(ERROR_FILE_NOT_FOUND); + throw Error(VAERROR_FILE_NOT_FOUND); } debug(DEF_DEBUG, "Loading user defaults from %s...\n", path.string().c_str()); @@ -276,7 +276,7 @@ Defaults::load(std::stringstream &stream) continue; } - throw Error(ERROR_SYNTAX, line); + throw Error(VAERROR_SYNTAX, line); } if (accepted || skipped) { @@ -291,7 +291,7 @@ Defaults::save(const fs::path &path) auto fs = std::ofstream(path, std::ofstream::binary); if (!fs.is_open()) { - throw Error(ERROR_FILE_CANT_WRITE); + throw Error(VAERROR_FILE_CANT_WRITE); } save(fs); @@ -360,7 +360,7 @@ Defaults::getRaw(const string &key) const if (values.contains(key)) return values.at(key); if (fallbacks.contains(key)) return fallbacks.at(key); - throw Error(ERROR_INVALID_KEY, key); + throw Error(VAERROR_INVALID_KEY, key); } i64 @@ -397,7 +397,7 @@ Defaults::getFallbackRaw(const string &key) const { if (fallbacks.contains(key)) return fallbacks.at(key); - throw Error(ERROR_INVALID_KEY, key); + throw Error(VAERROR_INVALID_KEY, key); } i64 @@ -440,7 +440,7 @@ Defaults::set(const string &key, const string &value) warn("Invalid key: %s\n", key.c_str()); assert(false); - throw Error(ERROR_INVALID_KEY, key); + throw Error(VAERROR_INVALID_KEY, key); } values[key] = value; @@ -528,7 +528,7 @@ Defaults::remove(const string &key) warn("Invalid key: %s\n", key.c_str()); assert(false); - throw Error(ERROR_INVALID_KEY, key); + throw Error(VAERROR_INVALID_KEY, key); } if (values.contains(key)) { values.erase(key); diff --git a/Emulator/Base/Error.cpp b/Emulator/Base/Error.cpp index 527ad8385..2c78d9522 100644 --- a/Emulator/Base/Error.cpp +++ b/Emulator/Base/Error.cpp @@ -20,109 +20,109 @@ Error::Error(ErrorCode code, const string &s) switch (code) { - case ERROR_OK: + case VAERROR_OK: fatalError; break; - case ERROR_POWERED_OFF: + case VAERROR_POWERED_OFF: description = "The emulator is powered off."; break; - case ERROR_POWERED_ON: + case VAERROR_POWERED_ON: description = "The emulator is powered on."; break; - case ERROR_DEBUG_OFF: + case VAERROR_DEBUG_OFF: description = "Debug mode is switched off."; break; - case ERROR_RUNNING: + case VAERROR_RUNNING: description = "The emulator is running."; break; - case ERROR_OPT_UNSUPPORTED: + case VAERROR_OPT_UNSUPPORTED: description = s == "" ? "This option is not supported yet." : s; break; - case ERROR_OPT_INV_ARG: + case VAERROR_OPT_INV_ARG: description = "Invalid argument. Expected: " + s; break; - case ERROR_OPT_INV_ID: + case VAERROR_OPT_INV_ID: description = "Invalid component ID. Expected: " + s; break; - case ERROR_OPT_LOCKED: + case VAERROR_OPT_LOCKED: description = "This option is locked because the Amiga is powered on."; break; - case ERROR_INVALID_KEY: + case VAERROR_INVALID_KEY: description = "Invalid key: " + s + "."; break; - case ERROR_SYNTAX: + case VAERROR_SYNTAX: description = "Syntax error in line " + s + "."; break; - case ERROR_CPU_UNSUPPORTED: + case VAERROR_CPU_UNSUPPORTED: description = "CPU revision is not supported yet."; break; - case ERROR_GUARD_NOT_FOUND: + case VAERROR_GUARD_NOT_FOUND: description = "Entry " + s + " not found."; break; - case ERROR_GUARD_ALREADY_SET: + case VAERROR_GUARD_ALREADY_SET: description = "Target " + s + " is already observed."; break; - case ERROR_BP_NOT_FOUND: + case VAERROR_BP_NOT_FOUND: description = "Breakpoint " + s + " not found."; break; - case ERROR_BP_ALREADY_SET: + case VAERROR_BP_ALREADY_SET: description = "A breakpoint at " + s + " is already set."; break; - case ERROR_WP_NOT_FOUND: + case VAERROR_WP_NOT_FOUND: description = "Watchpoint " + s + " not found."; break; - case ERROR_WP_ALREADY_SET: + case VAERROR_WP_ALREADY_SET: description = "A watchpoint at " + s + " is already set."; break; - case ERROR_CP_NOT_FOUND: + case VAERROR_CP_NOT_FOUND: description = "Catchpoint " + s + " not found."; break; - case ERROR_CP_ALREADY_SET: + case VAERROR_CP_ALREADY_SET: description = "This catchpoint is already set."; break; /* - case ERROR_CP_CANT_CATCH: + case VAERROR_CP_CANT_CATCH: description = "Exception vector " + s + " cannot be catched."; break; */ - case ERROR_DIR_NOT_FOUND: + case VAERROR_DIR_NOT_FOUND: description = "Folder \"" + s + "\" not found."; break; - case ERROR_DIR_ACCESS_DENIED: + case VAERROR_DIR_ACCESS_DENIED: description = "Unable to access folder \"" + s + "\". Permission denied."; break; - case ERROR_FILE_NOT_FOUND: + case VAERROR_FILE_NOT_FOUND: description = "File \"" + s + "\" not found."; break; - case ERROR_FILE_EXISTS: + case VAERROR_FILE_EXISTS: description = "File \"" + s + "\" already exists."; break; - case ERROR_FILE_IS_DIRECTORY: + case VAERROR_FILE_IS_DIRECTORY: if (s.empty()) { description = "The selected file is a directory."; } else { @@ -130,95 +130,95 @@ Error::Error(ErrorCode code, const string &s) } break; - case ERROR_FILE_ACCESS_DENIED: + case VAERROR_FILE_ACCESS_DENIED: description = "Unable to access file \"" + s + "\". Permission denied."; break; - case ERROR_FILE_TYPE_MISMATCH: + case VAERROR_FILE_TYPE_MISMATCH: description = "The file content and the file type do not match."; break; - case ERROR_FILE_CANT_READ: + case VAERROR_FILE_CANT_READ: description = "Failed to read from file \"" + s + "\"."; break; - case ERROR_FILE_CANT_WRITE: + case VAERROR_FILE_CANT_WRITE: description = "Failed to write to file \"" + s + "\"."; break; - case ERROR_FILE_CANT_CREATE: + case VAERROR_FILE_CANT_CREATE: description = "Failed to create file \"" + s + "\"."; break; - case ERROR_OUT_OF_MEMORY: + case VAERROR_OUT_OF_MEMORY: description = "Out of memory."; break; - case ERROR_CHIP_RAM_MISSING: + case VAERROR_CHIP_RAM_MISSING: description = "No Chip RAM installed."; break; - case ERROR_CHIP_RAM_LIMIT: + case VAERROR_CHIP_RAM_LIMIT: description = "The selected Agnus revision is not able to address"; description += " the selected amount of Chip RAM."; break; - case ERROR_AROS_RAM_LIMIT: + case VAERROR_AROS_RAM_LIMIT: description = "The Aros Kickstart requires at least 1 MB of memory."; break; - case ERROR_ROM_MISSING: + case VAERROR_ROM_MISSING: description = "No Rom installed."; break; - case ERROR_AROS_NO_EXTROM: + case VAERROR_AROS_NO_EXTROM: description = "No Extension Rom installed."; break; - case ERROR_WT_BLOCKED: + case VAERROR_WT_BLOCKED: description = "The storage file for the selected hard drive is"; description += " being used by another emulator instance. It cannot "; description += " be shared among multiple emulator instances."; break; - case ERROR_WT: + case VAERROR_WT: description = "Write through: " + s; break; - case ERROR_DISK_MISSING: + case VAERROR_DISK_MISSING: description = "No disk in drive."; break; - case ERROR_DISK_INCOMPATIBLE: + case VAERROR_DISK_INCOMPATIBLE: description = "This disk is not compatible with the selected drive."; break; - case ERROR_DISK_INVALID_DIAMETER: + case VAERROR_DISK_INVALID_DIAMETER: description = "Invalid disk diameter."; break; - case ERROR_DISK_INVALID_DENSITY: + case VAERROR_DISK_INVALID_DENSITY: description = "Invalid disk density."; break; - case ERROR_DISK_INVALID_LAYOUT: + case VAERROR_DISK_INVALID_LAYOUT: description = "The disk density and disk diameter do not match."; break; - case ERROR_DISK_WRONG_SECTOR_COUNT: + case VAERROR_DISK_WRONG_SECTOR_COUNT: description = "Unable to decode the MFM bit stream (wrong sector count)."; break; - case ERROR_DISK_INVALID_SECTOR_NUMBER: + case VAERROR_DISK_INVALID_SECTOR_NUMBER: description = "Unable to decode the MFM bit stream (invalid sector number)."; break; - case ERROR_HDR_TOO_LARGE: + case VAERROR_HDR_TOO_LARGE: description = "vAmiga supports hard drives with a maximum capacity of "; description += "504 MB."; break; - case ERROR_HDR_UNSUPPORTED_CYL_COUNT: + case VAERROR_HDR_UNSUPPORTED_CYL_COUNT: description = "The geometry of this drive is not supported. "; description += "vAmiga supports hard drives with "; description += "at least " + std::to_string(HDR_C_MIN) + " and "; @@ -226,7 +226,7 @@ Error::Error(ErrorCode code, const string &s) description += "This drive has " + s + " cylinders."; break; - case ERROR_HDR_UNSUPPORTED_HEAD_COUNT: + case VAERROR_HDR_UNSUPPORTED_HEAD_COUNT: description = "The geometry of this drive is not supported. "; description += "vAmiga supports hard drives with "; description += "at least " + std::to_string(HDR_H_MIN) + " and "; @@ -234,7 +234,7 @@ Error::Error(ErrorCode code, const string &s) description += "The drive has " + s + " heads."; break; - case ERROR_HDR_UNSUPPORTED_SEC_COUNT: + case VAERROR_HDR_UNSUPPORTED_SEC_COUNT: description = "The geometry of this drive is not supported. "; description += "vAmiga only supports hard drives with "; description += "at least " + std::to_string(HDR_S_MIN) + " and "; @@ -242,171 +242,171 @@ Error::Error(ErrorCode code, const string &s) description += "The drive stores " + s + " sectors per track."; break; - case ERROR_HDR_UNSUPPORTED_BSIZE: + case VAERROR_HDR_UNSUPPORTED_BSIZE: description = "The geometry of this drive is not supported. "; description += "vAmiga only supports hard drives with a "; description += "block size of 512 bytes. "; description += "The drive stores " + s + " bytes per block."; break; - case ERROR_HDR_UNKNOWN_GEOMETRY: + case VAERROR_HDR_UNKNOWN_GEOMETRY: description = "vAmiga failed to derive to geometry of this drive."; break; - case ERROR_HDR_UNMATCHED_GEOMETRY: + case VAERROR_HDR_UNMATCHED_GEOMETRY: description = "The drive geometry doesn't match the hard drive capacity."; break; - case ERROR_HDR_UNPARTITIONED: + case VAERROR_HDR_UNPARTITIONED: description = "The hard drive has no partitions."; break; - case ERROR_HDR_CORRUPTED_PTABLE: + case VAERROR_HDR_CORRUPTED_PTABLE: description = "Invalid partition table."; break; - case ERROR_HDR_CORRUPTED_FSH: + case VAERROR_HDR_CORRUPTED_FSH: description = "Invalid file system header block."; break; - case ERROR_HDR_UNSUPPORTED: + case VAERROR_HDR_UNSUPPORTED: description = "The hard drive is encoded in an unknown or unsupported format."; break; - case ERROR_HDC_INIT: + case VAERROR_HDC_INIT: description = "Failed to initialize hard drive: " + s; break; - case ERROR_SNAP_TOO_OLD: + case VAERROR_SNAP_TOO_OLD: description = "The snapshot was created with an older version of vAmiga"; description += " and is incompatible with this release."; break; - case ERROR_SNAP_TOO_NEW: + case VAERROR_SNAP_TOO_NEW: description = "The snapshot was created with a newer version of vAmiga"; description += " and is incompatible with this release."; break; - case ERROR_SNAP_IS_BETA: + case VAERROR_SNAP_IS_BETA: description = "The snapshot was created with a beta version of vAmiga"; description += " and is incompatible with this release."; break; - case ERROR_SNAP_CORRUPTED: + case VAERROR_SNAP_CORRUPTED: description = "The snapshot data is corrupted and has put the"; description += " emulator into an inconsistent state."; break; - case ERROR_DMS_CANT_CREATE: + case VAERROR_DMS_CANT_CREATE: description = "Failed to extract the DMS archive."; break; - case ERROR_EXT_FACTOR5: + case VAERROR_EXT_FACTOR5: description = "The file is encoded in an outdated format that was"; description += " introduced by Factor 5 to distribute Turrican images."; description += " The format has no relevance today and is not supported"; description += " by the emulator."; break; - case ERROR_EXT_INCOMPATIBLE: + case VAERROR_EXT_INCOMPATIBLE: description = "This file utilizes encoding features of the extended "; description += " ADF format that are not supported by the emulator yet."; break; - case ERROR_EXT_CORRUPTED: + case VAERROR_EXT_CORRUPTED: description = "The disk encoder failed to extract the disk due to "; description += " corrupted or inconsistend file data."; break; - case ERROR_MISSING_ROM_KEY: + case VAERROR_MISSING_ROM_KEY: description = "No \"rom.key\" file found."; break; - case ERROR_INVALID_ROM_KEY: + case VAERROR_INVALID_ROM_KEY: description = "Invalid Rom key."; break; - case ERROR_REC_LAUNCH: + case VAERROR_REC_LAUNCH: description = s; break; - case ERROR_REG_READ_ONLY: + case VAERROR_REG_READ_ONLY: description = s + " is a read-only register"; break; - case ERROR_REG_WRITE_ONLY: + case VAERROR_REG_WRITE_ONLY: description = s + " is a write-only register"; break; - case ERROR_REG_UNUSED: + case VAERROR_REG_UNUSED: description = "Register " + s + " is unused"; break; - case ERROR_ADDR_UNALIGNED: + case VAERROR_ADDR_UNALIGNED: description = "Address not aligned"; break; - case ERROR_OSDB: + case VAERROR_OSDB: description = "OS Debugger: " + s; break; - case ERROR_HUNK_BAD_COOKIE: + case VAERROR_HUNK_BAD_COOKIE: description = "Invalid magic cookie."; break; - case ERROR_HUNK_BAD_HEADER: + case VAERROR_HUNK_BAD_HEADER: description = "Bad header."; break; - case ERROR_HUNK_NO_SECTIONS: + case VAERROR_HUNK_NO_SECTIONS: description = "No hunks found."; break; - case ERROR_HUNK_UNSUPPORTED: + case VAERROR_HUNK_UNSUPPORTED: description = "Unsupported hunk: " + s; break; - case ERROR_HUNK_CORRUPTED: + case VAERROR_HUNK_CORRUPTED: description = "Corrupted hunk structure."; break; - case ERROR_FS_UNSUPPORTED: + case VAERROR_FS_UNSUPPORTED: description = "Unsupported file system."; break; - case ERROR_FS_UNFORMATTED: + case VAERROR_FS_UNFORMATTED: description = "Unformatted device."; break; - case ERROR_FS_WRONG_BSIZE: + case VAERROR_FS_WRONG_BSIZE: description = "Invalid block size."; break; - case ERROR_FS_WRONG_DOS_TYPE: + case VAERROR_FS_WRONG_DOS_TYPE: description = "Wrong DOS type."; break; - case ERROR_FS_WRONG_CAPACITY: + case VAERROR_FS_WRONG_CAPACITY: description = "Wrong file system capacity."; break; - case ERROR_FS_HAS_CYCLES: + case VAERROR_FS_HAS_CYCLES: description = "Cyclic reference chain detected."; break; - case ERROR_FS_CORRUPTED: + case VAERROR_FS_CORRUPTED: description = "Corrupted file system."; break; - case ERROR_FS_DIR_NOT_EMPTY: + case VAERROR_FS_DIR_NOT_EMPTY: description = "Directory is not empty."; break; - case ERROR_FS_CANNOT_CREATE_DIR: + case VAERROR_FS_CANNOT_CREATE_DIR: description = "Unable to create directory."; break; - case ERROR_FS_CANNOT_CREATE_FILE: + case VAERROR_FS_CANNOT_CREATE_FILE: description = "Unable to create file."; break; diff --git a/Emulator/Base/ErrorTypes.h b/Emulator/Base/ErrorTypes.h index 4fc36d36e..4e751119f 100644 --- a/Emulator/Base/ErrorTypes.h +++ b/Emulator/Base/ErrorTypes.h @@ -12,363 +12,363 @@ #include "Types.h" #include "Reflection.h" -enum_long(ERROR_CODE) +enum_long(VAERROR_CODE) { - ERROR_OK, ///< No error - ERROR_UNKNOWN, ///< Unclassified error condition + VAERROR_OK, ///< No error + VAERROR_UNKNOWN, ///< Unclassified error condition // Emulator state - ERROR_LAUNCH, ///< Launch error - ERROR_POWERED_OFF, ///< The emulator is powered off - ERROR_POWERED_ON, ///< The emulator is powered on - ERROR_DEBUG_OFF, - ERROR_RUNNING, ///< The emulator is running + VAERROR_LAUNCH, ///< Launch error + VAERROR_POWERED_OFF, ///< The emulator is powered off + VAERROR_POWERED_ON, ///< The emulator is powered on + VAERROR_DEBUG_OFF, + VAERROR_RUNNING, ///< The emulator is running // Configuration - ERROR_OPT_UNSUPPORTED, ///< Unsupported configuration option - ERROR_OPT_INV_ARG, ///< Invalid argument - ERROR_OPT_INV_ID, ///< Invalid component id - ERROR_OPT_LOCKED, ///< The option is temporarily locked + VAERROR_OPT_UNSUPPORTED, ///< Unsupported configuration option + VAERROR_OPT_INV_ARG, ///< Invalid argument + VAERROR_OPT_INV_ID, ///< Invalid component id + VAERROR_OPT_LOCKED, ///< The option is temporarily locked // Property storage - ERROR_INVALID_KEY, ///< Invalid property key - ERROR_SYNTAX, ///< Syntax error + VAERROR_INVALID_KEY, ///< Invalid property key + VAERROR_SYNTAX, ///< Syntax error // CPU - ERROR_CPU_UNSUPPORTED, ///< Unsupported CPU model - ERROR_GUARD_NOT_FOUND, ///< Guard is not set - ERROR_GUARD_ALREADY_SET, ///< Guard is already set - ERROR_BP_NOT_FOUND, ///< Breakpoint is not set (DEPRECATED) - ERROR_BP_ALREADY_SET, ///< Breakpoint is already set (DEPRECATED) - ERROR_WP_NOT_FOUND, ///< Watchpoint is not set (DEPRECATED) - ERROR_WP_ALREADY_SET, ///< Watchpoint is already set (DEPRECATED) - ERROR_CP_NOT_FOUND, ///< Catchpoint is not set (DEPRECATED) - ERROR_CP_ALREADY_SET, ///< Catchpoint is already set (DEPRECATED) - // ERROR_CP_CANT_CATCH, + VAERROR_CPU_UNSUPPORTED, ///< Unsupported CPU model + VAERROR_GUARD_NOT_FOUND, ///< Guard is not set + VAERROR_GUARD_ALREADY_SET, ///< Guard is already set + VAERROR_BP_NOT_FOUND, ///< Breakpoint is not set (DEPRECATED) + VAERROR_BP_ALREADY_SET, ///< Breakpoint is already set (DEPRECATED) + VAERROR_WP_NOT_FOUND, ///< Watchpoint is not set (DEPRECATED) + VAERROR_WP_ALREADY_SET, ///< Watchpoint is already set (DEPRECATED) + VAERROR_CP_NOT_FOUND, ///< Catchpoint is not set (DEPRECATED) + VAERROR_CP_ALREADY_SET, ///< Catchpoint is already set (DEPRECATED) + // VAERROR_CP_CANT_CATCH, // Memory - ERROR_OUT_OF_MEMORY, ///< Out of memory + VAERROR_OUT_OF_MEMORY, ///< Out of memory // General - ERROR_DIR_NOT_FOUND, ///< Directory does not exist - ERROR_DIR_ACCESS_DENIED, ///< File access denied - ERROR_DIR_CANT_CREATE, ///< Unable to create a directory - ERROR_DIR_NOT_EMPTY, ///< Directory is not empty - ERROR_FILE_NOT_FOUND, ///< File not found error - ERROR_FILE_EXISTS, ///< File already exists - ERROR_FILE_IS_DIRECTORY, ///< The file is a directory - ERROR_FILE_ACCESS_DENIED, ///< File access denied - ERROR_FILE_TYPE_MISMATCH, ///< File type mismatch - ERROR_FILE_TYPE_UNSUPPORTED,///< Unsupported file type - ERROR_FILE_CANT_READ, ///< Can't read from file - ERROR_FILE_CANT_WRITE, ///< Can't write to file - ERROR_FILE_CANT_CREATE, ///< Can't create file + VAERROR_DIR_NOT_FOUND, ///< Directory does not exist + VAERROR_DIR_ACCESS_DENIED, ///< File access denied + VAERROR_DIR_CANT_CREATE, ///< Unable to create a directory + VAERROR_DIR_NOT_EMPTY, ///< Directory is not empty + VAERROR_FILE_NOT_FOUND, ///< File not found error + VAERROR_FILE_EXISTS, ///< File already exists + VAERROR_FILE_IS_DIRECTORY, ///< The file is a directory + VAERROR_FILE_ACCESS_DENIED, ///< File access denied + VAERROR_FILE_TYPE_MISMATCH, ///< File type mismatch + VAERROR_FILE_TYPE_UNSUPPORTED,///< Unsupported file type + VAERROR_FILE_CANT_READ, ///< Can't read from file + VAERROR_FILE_CANT_WRITE, ///< Can't write to file + VAERROR_FILE_CANT_CREATE, ///< Can't create file // Ram - ERROR_CHIP_RAM_MISSING, - ERROR_CHIP_RAM_LIMIT, - ERROR_AROS_RAM_LIMIT, + VAERROR_CHIP_RAM_MISSING, + VAERROR_CHIP_RAM_LIMIT, + VAERROR_AROS_RAM_LIMIT, // Rom - ERROR_ROM_MISSING, - ERROR_AROS_NO_EXTROM, + VAERROR_ROM_MISSING, + VAERROR_AROS_NO_EXTROM, // Drives - ERROR_WT_BLOCKED, - ERROR_WT, + VAERROR_WT_BLOCKED, + VAERROR_WT, // Floppy disks - ERROR_DISK_MISSING, - ERROR_DISK_INCOMPATIBLE, - ERROR_DISK_INVALID_DIAMETER, - ERROR_DISK_INVALID_DENSITY, - ERROR_DISK_INVALID_LAYOUT, - ERROR_DISK_WRONG_SECTOR_COUNT, - ERROR_DISK_INVALID_SECTOR_NUMBER, + VAERROR_DISK_MISSING, + VAERROR_DISK_INCOMPATIBLE, + VAERROR_DISK_INVALID_DIAMETER, + VAERROR_DISK_INVALID_DENSITY, + VAERROR_DISK_INVALID_LAYOUT, + VAERROR_DISK_WRONG_SECTOR_COUNT, + VAERROR_DISK_INVALID_SECTOR_NUMBER, // Hard disks - ERROR_HDR_TOO_LARGE, - ERROR_HDR_UNSUPPORTED_CYL_COUNT, - ERROR_HDR_UNSUPPORTED_HEAD_COUNT, - ERROR_HDR_UNSUPPORTED_SEC_COUNT, - ERROR_HDR_UNSUPPORTED_BSIZE, - ERROR_HDR_UNKNOWN_GEOMETRY, - ERROR_HDR_UNMATCHED_GEOMETRY, - ERROR_HDR_UNPARTITIONED, - ERROR_HDR_CORRUPTED_PTABLE, - ERROR_HDR_CORRUPTED_FSH, - ERROR_HDR_CORRUPTED_LSEG, - ERROR_HDR_UNSUPPORTED, + VAERROR_HDR_TOO_LARGE, + VAERROR_HDR_UNSUPPORTED_CYL_COUNT, + VAERROR_HDR_UNSUPPORTED_HEAD_COUNT, + VAERROR_HDR_UNSUPPORTED_SEC_COUNT, + VAERROR_HDR_UNSUPPORTED_BSIZE, + VAERROR_HDR_UNKNOWN_GEOMETRY, + VAERROR_HDR_UNMATCHED_GEOMETRY, + VAERROR_HDR_UNPARTITIONED, + VAERROR_HDR_CORRUPTED_PTABLE, + VAERROR_HDR_CORRUPTED_FSH, + VAERROR_HDR_CORRUPTED_LSEG, + VAERROR_HDR_UNSUPPORTED, // Hard drive controller - ERROR_HDC_INIT, + VAERROR_HDC_INIT, // Snapshots - ERROR_SNAP_TOO_OLD, ///< Snapshot was created with an older version - ERROR_SNAP_TOO_NEW, ///< Snapshot was created with a later version - ERROR_SNAP_IS_BETA, ///< Snapshot was created with a beta release - ERROR_SNAP_CORRUPTED, ///< Snapshot data is corrupted + VAERROR_SNAP_TOO_OLD, ///< Snapshot was created with an older version + VAERROR_SNAP_TOO_NEW, ///< Snapshot was created with a later version + VAERROR_SNAP_IS_BETA, ///< Snapshot was created with a beta release + VAERROR_SNAP_CORRUPTED, ///< Snapshot data is corrupted // Media files - ERROR_DMS_CANT_CREATE, - ERROR_EXT_FACTOR5, - ERROR_EXT_INCOMPATIBLE, - ERROR_EXT_CORRUPTED, + VAERROR_DMS_CANT_CREATE, + VAERROR_EXT_FACTOR5, + VAERROR_EXT_INCOMPATIBLE, + VAERROR_EXT_CORRUPTED, // Encrypted Roms - ERROR_MISSING_ROM_KEY, - ERROR_INVALID_ROM_KEY, + VAERROR_MISSING_ROM_KEY, + VAERROR_INVALID_ROM_KEY, // Recorder - ERROR_REC_LAUNCH, + VAERROR_REC_LAUNCH, // Debugger - ERROR_REG_READ_ONLY, - ERROR_REG_WRITE_ONLY, - ERROR_REG_UNUSED, - ERROR_ADDR_UNALIGNED, + VAERROR_REG_READ_ONLY, + VAERROR_REG_WRITE_ONLY, + VAERROR_REG_UNUSED, + VAERROR_ADDR_UNALIGNED, // OS Debugger - ERROR_OSDB, - ERROR_HUNK_BAD_COOKIE, - ERROR_HUNK_BAD_HEADER, - ERROR_HUNK_NO_SECTIONS, - ERROR_HUNK_UNSUPPORTED, - ERROR_HUNK_CORRUPTED, + VAERROR_OSDB, + VAERROR_HUNK_BAD_COOKIE, + VAERROR_HUNK_BAD_HEADER, + VAERROR_HUNK_NO_SECTIONS, + VAERROR_HUNK_UNSUPPORTED, + VAERROR_HUNK_CORRUPTED, // Remote servers - ERROR_SOCK_CANT_CREATE, - ERROR_SOCK_CANT_CONNECT, - ERROR_SOCK_CANT_BIND, - ERROR_SOCK_CANT_LISTEN, - ERROR_SOCK_CANT_ACCEPT, - ERROR_SOCK_CANT_RECEIVE, - ERROR_SOCK_CANT_SEND, - ERROR_SOCK_DISCONNECTED, - ERROR_SERVER_PORT_IN_USE, - ERROR_SERVER_ON, - ERROR_SERVER_OFF, - ERROR_SERVER_RUNNING, - ERROR_SERVER_NOT_RUNNING, - ERROR_SERVER_NO_CLIENT, + VAERROR_SOCK_CANT_CREATE, + VAERROR_SOCK_CANT_CONNECT, + VAERROR_SOCK_CANT_BIND, + VAERROR_SOCK_CANT_LISTEN, + VAERROR_SOCK_CANT_ACCEPT, + VAERROR_SOCK_CANT_RECEIVE, + VAERROR_SOCK_CANT_SEND, + VAERROR_SOCK_DISCONNECTED, + VAERROR_SERVER_PORT_IN_USE, + VAERROR_SERVER_ON, + VAERROR_SERVER_OFF, + VAERROR_SERVER_RUNNING, + VAERROR_SERVER_NOT_RUNNING, + VAERROR_SERVER_NO_CLIENT, // GDB server - ERROR_GDB_NO_ACK, - ERROR_GDB_INVALID_FORMAT, - ERROR_GDB_INVALID_CHECKSUM, - ERROR_GDB_UNRECOGNIZED_CMD, - ERROR_GDB_UNSUPPORTED_CMD, + VAERROR_GDB_NO_ACK, + VAERROR_GDB_INVALID_FORMAT, + VAERROR_GDB_INVALID_CHECKSUM, + VAERROR_GDB_UNRECOGNIZED_CMD, + VAERROR_GDB_UNSUPPORTED_CMD, // File system - ERROR_FS_UNKNOWN, - ERROR_FS_UNSUPPORTED, - ERROR_FS_UNFORMATTED, - ERROR_FS_WRONG_BSIZE, - ERROR_FS_WRONG_CAPACITY, - ERROR_FS_WRONG_DOS_TYPE, - ERROR_FS_HAS_CYCLES, - ERROR_FS_CORRUPTED, + VAERROR_FS_UNKNOWN, + VAERROR_FS_UNSUPPORTED, + VAERROR_FS_UNFORMATTED, + VAERROR_FS_WRONG_BSIZE, + VAERROR_FS_WRONG_CAPACITY, + VAERROR_FS_WRONG_DOS_TYPE, + VAERROR_FS_HAS_CYCLES, + VAERROR_FS_CORRUPTED, // File system (import errors) - ERROR_FS_OUT_OF_SPACE, + VAERROR_FS_OUT_OF_SPACE, // File system (export errors) - ERROR_FS_DIR_NOT_EMPTY, - ERROR_FS_CANNOT_CREATE_DIR, - ERROR_FS_CANNOT_CREATE_FILE, + VAERROR_FS_DIR_NOT_EMPTY, + VAERROR_FS_CANNOT_CREATE_DIR, + VAERROR_FS_CANNOT_CREATE_FILE, // File system (block errors) - ERROR_FS_INVALID_BLOCK_TYPE, - ERROR_FS_EXPECTED_VALUE, - ERROR_FS_EXPECTED_SMALLER_VALUE, - ERROR_FS_EXPECTED_DOS_REVISION, - ERROR_FS_EXPECTED_NO_REF, - ERROR_FS_EXPECTED_REF, - ERROR_FS_EXPECTED_SELFREF, - ERROR_FS_PTR_TO_UNKNOWN_BLOCK, - ERROR_FS_PTR_TO_EMPTY_BLOCK, - ERROR_FS_PTR_TO_BOOT_BLOCK, - ERROR_FS_PTR_TO_ROOT_BLOCK, - ERROR_FS_PTR_TO_BITMAP_BLOCK, - ERROR_FS_PTR_TO_BITMAP_EXT_BLOCK, - ERROR_FS_PTR_TO_USERDIR_BLOCK, - ERROR_FS_PTR_TO_FILEHEADER_BLOCK, - ERROR_FS_PTR_TO_FILELIST_BLOCK, - ERROR_FS_PTR_TO_DATA_BLOCK, - ERROR_FS_EXPECTED_DATABLOCK_NR, - ERROR_FS_INVALID_HASHTABLE_SIZE + VAERROR_FS_INVALID_BLOCK_TYPE, + VAERROR_FS_EXPECTED_VALUE, + VAERROR_FS_EXPECTED_SMALLER_VALUE, + VAERROR_FS_EXPECTED_DOS_REVISION, + VAERROR_FS_EXPECTED_NO_REF, + VAERROR_FS_EXPECTED_REF, + VAERROR_FS_EXPECTED_SELFREF, + VAERROR_FS_PTR_TO_UNKNOWN_BLOCK, + VAERROR_FS_PTR_TO_EMPTY_BLOCK, + VAERROR_FS_PTR_TO_BOOT_BLOCK, + VAERROR_FS_PTR_TO_ROOT_BLOCK, + VAERROR_FS_PTR_TO_BITMAP_BLOCK, + VAERROR_FS_PTR_TO_BITMAP_EXT_BLOCK, + VAERROR_FS_PTR_TO_USERDIR_BLOCK, + VAERROR_FS_PTR_TO_FILEHEADER_BLOCK, + VAERROR_FS_PTR_TO_FILELIST_BLOCK, + VAERROR_FS_PTR_TO_DATA_BLOCK, + VAERROR_FS_EXPECTED_DATABLOCK_NR, + VAERROR_FS_INVALID_HASHTABLE_SIZE }; -typedef ERROR_CODE ErrorCode; +typedef VAERROR_CODE ErrorCode; #ifdef __cplusplus struct ErrorCodeEnum : vamiga::util::Reflection { static constexpr long minVal = 0; - static constexpr long maxVal = ERROR_FS_INVALID_HASHTABLE_SIZE; + static constexpr long maxVal = VAERROR_FS_INVALID_HASHTABLE_SIZE; static const char *prefix() { return "ERROR"; } static const char *_key(long value) { switch (value) { - case ERROR_OK: return "OK"; - case ERROR_UNKNOWN: return "UNKNOWN"; + case VAERROR_OK: return "OK"; + case VAERROR_UNKNOWN: return "UNKNOWN"; - case ERROR_LAUNCH: return "LAUNCH"; - case ERROR_POWERED_OFF: return "POWERED_OFF"; - case ERROR_POWERED_ON: return "POWERED_ON"; - case ERROR_DEBUG_OFF: return "DEBUG_OFF"; - case ERROR_RUNNING: return "RUNNING"; - - case ERROR_OPT_UNSUPPORTED: return "OPT_UNSUPPORTED"; - case ERROR_OPT_INV_ARG: return "OPT_INV_ARG"; - case ERROR_OPT_INV_ID: return "OPT_INV_ID"; - case ERROR_OPT_LOCKED: return "OPT_LOCKED"; + case VAERROR_LAUNCH: return "LAUNCH"; + case VAERROR_POWERED_OFF: return "POWERED_OFF"; + case VAERROR_POWERED_ON: return "POWERED_ON"; + case VAERROR_DEBUG_OFF: return "DEBUG_OFF"; + case VAERROR_RUNNING: return "RUNNING"; + + case VAERROR_OPT_UNSUPPORTED: return "OPT_UNSUPPORTED"; + case VAERROR_OPT_INV_ARG: return "OPT_INV_ARG"; + case VAERROR_OPT_INV_ID: return "OPT_INV_ID"; + case VAERROR_OPT_LOCKED: return "OPT_LOCKED"; - case ERROR_INVALID_KEY: return "INVALID_KEY"; - case ERROR_SYNTAX: return "SYNTAX"; + case VAERROR_INVALID_KEY: return "INVALID_KEY"; + case VAERROR_SYNTAX: return "SYNTAX"; - case ERROR_CPU_UNSUPPORTED: return "CPU_UNSUPPORTED"; - case ERROR_GUARD_NOT_FOUND: return "GUARD_NOT_FOUND"; - case ERROR_GUARD_ALREADY_SET: return "GUARD_ALREADY_SET"; - case ERROR_BP_NOT_FOUND: return "BP_NOT_FOUND"; - case ERROR_BP_ALREADY_SET: return "BP_ALREADY_SET"; - case ERROR_WP_NOT_FOUND: return "WP_NOT_FOUND"; - case ERROR_WP_ALREADY_SET: return "WP_ALREADY_SET"; - case ERROR_CP_NOT_FOUND: return "CP_NOT_FOUND"; - case ERROR_CP_ALREADY_SET: return "CP_ALREADY_SET"; - // case ERROR_CP_CANT_CATCH: return "CP_CANT_CATCH"; - - case ERROR_OUT_OF_MEMORY: return "OUT_OF_MEMORY"; - - case ERROR_DIR_NOT_FOUND: return "DIR_NOT_FOUND"; - case ERROR_DIR_ACCESS_DENIED: return "DIR_ACCESS_DENIED"; - case ERROR_DIR_CANT_CREATE: return "DIR_CANT_CREATE"; - case ERROR_DIR_NOT_EMPTY: return "DIR_NOT_EMPTY"; - case ERROR_FILE_NOT_FOUND: return "FILE_NOT_FOUND"; - case ERROR_FILE_EXISTS: return "FILE_EXISTS"; - case ERROR_FILE_IS_DIRECTORY: return "FILE_IS_DIRECtORY"; - case ERROR_FILE_ACCESS_DENIED: return "FILE_ACCESS_DENIED"; - case ERROR_FILE_TYPE_MISMATCH: return "FILE_TYPE_MISMATCH"; - case ERROR_FILE_TYPE_UNSUPPORTED: return "FILE_TYPE_UNSUPPORTED"; - case ERROR_FILE_CANT_READ: return "FILE_CANT_READ"; - case ERROR_FILE_CANT_WRITE: return "FILE_CANT_WRITE"; - case ERROR_FILE_CANT_CREATE: return "FILE_CANT_CREATE"; + case VAERROR_CPU_UNSUPPORTED: return "CPU_UNSUPPORTED"; + case VAERROR_GUARD_NOT_FOUND: return "GUARD_NOT_FOUND"; + case VAERROR_GUARD_ALREADY_SET: return "GUARD_ALREADY_SET"; + case VAERROR_BP_NOT_FOUND: return "BP_NOT_FOUND"; + case VAERROR_BP_ALREADY_SET: return "BP_ALREADY_SET"; + case VAERROR_WP_NOT_FOUND: return "WP_NOT_FOUND"; + case VAERROR_WP_ALREADY_SET: return "WP_ALREADY_SET"; + case VAERROR_CP_NOT_FOUND: return "CP_NOT_FOUND"; + case VAERROR_CP_ALREADY_SET: return "CP_ALREADY_SET"; + // case VAERROR_CP_CANT_CATCH: return "CP_CANT_CATCH"; + + case VAERROR_OUT_OF_MEMORY: return "OUT_OF_MEMORY"; + + case VAERROR_DIR_NOT_FOUND: return "DIR_NOT_FOUND"; + case VAERROR_DIR_ACCESS_DENIED: return "DIR_ACCESS_DENIED"; + case VAERROR_DIR_CANT_CREATE: return "DIR_CANT_CREATE"; + case VAERROR_DIR_NOT_EMPTY: return "DIR_NOT_EMPTY"; + case VAERROR_FILE_NOT_FOUND: return "FILE_NOT_FOUND"; + case VAERROR_FILE_EXISTS: return "FILE_EXISTS"; + case VAERROR_FILE_IS_DIRECTORY: return "FILE_IS_DIRECtORY"; + case VAERROR_FILE_ACCESS_DENIED: return "FILE_ACCESS_DENIED"; + case VAERROR_FILE_TYPE_MISMATCH: return "FILE_TYPE_MISMATCH"; + case VAERROR_FILE_TYPE_UNSUPPORTED: return "FILE_TYPE_UNSUPPORTED"; + case VAERROR_FILE_CANT_READ: return "FILE_CANT_READ"; + case VAERROR_FILE_CANT_WRITE: return "FILE_CANT_WRITE"; + case VAERROR_FILE_CANT_CREATE: return "FILE_CANT_CREATE"; - case ERROR_CHIP_RAM_MISSING: return "CHIP_RAM_MISSING"; - case ERROR_CHIP_RAM_LIMIT: return "CHIP_RAM_LIMIT"; - case ERROR_AROS_RAM_LIMIT: return "AROS_RAM_LIMIT"; - - case ERROR_ROM_MISSING: return "ROM_MISSING"; - case ERROR_AROS_NO_EXTROM: return "AROS_NO_EXTROM"; - - case ERROR_WT_BLOCKED: return "WT_BLOCKED"; - case ERROR_WT: return "WT"; - - case ERROR_DISK_MISSING: return "DISK_MISSING"; - case ERROR_DISK_INCOMPATIBLE: return "DISK_INCOMPATIBLE"; - case ERROR_DISK_INVALID_DIAMETER: return "DISK_INVALID_DIAMETER"; - case ERROR_DISK_INVALID_DENSITY: return "DISK_INVALID_DENSITY"; - case ERROR_DISK_INVALID_LAYOUT: return "DISK_INVALID_LAYOUT"; - case ERROR_DISK_WRONG_SECTOR_COUNT: return "DISK_WRONG_SECTOR_COUNT"; - case ERROR_DISK_INVALID_SECTOR_NUMBER: return "DISK_INVALID_SECTOR_NUMBER"; + case VAERROR_CHIP_RAM_MISSING: return "CHIP_RAM_MISSING"; + case VAERROR_CHIP_RAM_LIMIT: return "CHIP_RAM_LIMIT"; + case VAERROR_AROS_RAM_LIMIT: return "AROS_RAM_LIMIT"; + + case VAERROR_ROM_MISSING: return "ROM_MISSING"; + case VAERROR_AROS_NO_EXTROM: return "AROS_NO_EXTROM"; + + case VAERROR_WT_BLOCKED: return "WT_BLOCKED"; + case VAERROR_WT: return "WT"; + + case VAERROR_DISK_MISSING: return "DISK_MISSING"; + case VAERROR_DISK_INCOMPATIBLE: return "DISK_INCOMPATIBLE"; + case VAERROR_DISK_INVALID_DIAMETER: return "DISK_INVALID_DIAMETER"; + case VAERROR_DISK_INVALID_DENSITY: return "DISK_INVALID_DENSITY"; + case VAERROR_DISK_INVALID_LAYOUT: return "DISK_INVALID_LAYOUT"; + case VAERROR_DISK_WRONG_SECTOR_COUNT: return "DISK_WRONG_SECTOR_COUNT"; + case VAERROR_DISK_INVALID_SECTOR_NUMBER: return "DISK_INVALID_SECTOR_NUMBER"; - case ERROR_HDR_TOO_LARGE: return "HDR_TOO_LARGE"; - case ERROR_HDR_UNSUPPORTED_CYL_COUNT: return "HDR_UNSUPPORTED_CYL_COUNT"; - case ERROR_HDR_UNSUPPORTED_HEAD_COUNT: return "HDR_UNSUPPORTED_HEAD_COUNT"; - case ERROR_HDR_UNSUPPORTED_SEC_COUNT: return "HDR_UNSUPPORTED_SEC_COUNT"; - case ERROR_HDR_UNSUPPORTED_BSIZE: return "HDR_UNSUPPORTED_BSIZE"; - case ERROR_HDR_UNKNOWN_GEOMETRY: return "HDR_UNKNOWN_GEOMETRY"; - case ERROR_HDR_UNMATCHED_GEOMETRY: return "HDR_UNMATCHED_GEOMETRY"; - case ERROR_HDR_UNPARTITIONED: return "HDR_UNPARTITIONED"; - case ERROR_HDR_CORRUPTED_PTABLE: return "HDR_CORRUPTED_PTABLE"; - case ERROR_HDR_CORRUPTED_FSH: return "HDR_CORRUPTED_FSH"; - case ERROR_HDR_CORRUPTED_LSEG: return "HDR_CORRUPTED_LSEG"; - case ERROR_HDR_UNSUPPORTED: return "HDR_UNSUPPORTED"; + case VAERROR_HDR_TOO_LARGE: return "HDR_TOO_LARGE"; + case VAERROR_HDR_UNSUPPORTED_CYL_COUNT: return "HDR_UNSUPPORTED_CYL_COUNT"; + case VAERROR_HDR_UNSUPPORTED_HEAD_COUNT: return "HDR_UNSUPPORTED_HEAD_COUNT"; + case VAERROR_HDR_UNSUPPORTED_SEC_COUNT: return "HDR_UNSUPPORTED_SEC_COUNT"; + case VAERROR_HDR_UNSUPPORTED_BSIZE: return "HDR_UNSUPPORTED_BSIZE"; + case VAERROR_HDR_UNKNOWN_GEOMETRY: return "HDR_UNKNOWN_GEOMETRY"; + case VAERROR_HDR_UNMATCHED_GEOMETRY: return "HDR_UNMATCHED_GEOMETRY"; + case VAERROR_HDR_UNPARTITIONED: return "HDR_UNPARTITIONED"; + case VAERROR_HDR_CORRUPTED_PTABLE: return "HDR_CORRUPTED_PTABLE"; + case VAERROR_HDR_CORRUPTED_FSH: return "HDR_CORRUPTED_FSH"; + case VAERROR_HDR_CORRUPTED_LSEG: return "HDR_CORRUPTED_LSEG"; + case VAERROR_HDR_UNSUPPORTED: return "HDR_UNSUPPORTED"; - case ERROR_HDC_INIT: return "HDC_INIT"; + case VAERROR_HDC_INIT: return "HDC_INIT"; - case ERROR_SNAP_TOO_OLD: return "SNAP_TOO_OLD"; - case ERROR_SNAP_TOO_NEW: return "SNAP_TOO_NEW"; - case ERROR_SNAP_IS_BETA: return "SNAP_IS_BETA"; + case VAERROR_SNAP_TOO_OLD: return "SNAP_TOO_OLD"; + case VAERROR_SNAP_TOO_NEW: return "SNAP_TOO_NEW"; + case VAERROR_SNAP_IS_BETA: return "SNAP_IS_BETA"; - case ERROR_DMS_CANT_CREATE: return "DMS_CANT_CREATE"; - case ERROR_EXT_FACTOR5: return "EXT_UNSUPPORTED"; - case ERROR_EXT_INCOMPATIBLE: return "EXT_INCOMPATIBLE"; - case ERROR_EXT_CORRUPTED: return "EXT_CORRUPTED"; + case VAERROR_DMS_CANT_CREATE: return "DMS_CANT_CREATE"; + case VAERROR_EXT_FACTOR5: return "EXT_UNSUPPORTED"; + case VAERROR_EXT_INCOMPATIBLE: return "EXT_INCOMPATIBLE"; + case VAERROR_EXT_CORRUPTED: return "EXT_CORRUPTED"; - case ERROR_MISSING_ROM_KEY: return "MISSING_ROM_KEY"; - case ERROR_INVALID_ROM_KEY: return "INVALID_ROM_KEY"; + case VAERROR_MISSING_ROM_KEY: return "MISSING_ROM_KEY"; + case VAERROR_INVALID_ROM_KEY: return "INVALID_ROM_KEY"; - case ERROR_REC_LAUNCH: return "REC_LAUNCH"; - - case ERROR_REG_READ_ONLY: return "REG_READ_ONLY"; - case ERROR_REG_WRITE_ONLY: return "REG_WRITE_ONLY"; - case ERROR_REG_UNUSED: return "REG_UNUSED"; - case ERROR_ADDR_UNALIGNED: return "ADDR_UNALIGNED"; - - case ERROR_OSDB: return "OSDB"; - case ERROR_HUNK_BAD_COOKIE: return "HUNK_BAD_COOKIE"; - case ERROR_HUNK_BAD_HEADER: return "HUNK_BAD_HEADER"; - case ERROR_HUNK_NO_SECTIONS: return "HUNK_NO_SECTIONS"; - case ERROR_HUNK_UNSUPPORTED: return "HUNK_UNSUPPORTED"; - case ERROR_HUNK_CORRUPTED: return "HUNK_CORRUPTED"; - - case ERROR_SOCK_CANT_CREATE: return "SOCK_CANT_CREATE"; - case ERROR_SOCK_CANT_CONNECT: return "SOCK_CANT_CONNECT"; - case ERROR_SOCK_CANT_BIND: return "SOCK_CANT_BIND"; - case ERROR_SOCK_CANT_LISTEN: return "SOCK_CANT_LISTEN"; - case ERROR_SOCK_CANT_ACCEPT: return "SOCK_CANT_ACCEPT"; - case ERROR_SOCK_CANT_RECEIVE: return "SOCK_CANT_RECEIVE"; - case ERROR_SOCK_CANT_SEND: return "SOCK_CANT_SEND"; - case ERROR_SOCK_DISCONNECTED: return "SOCK_DISCONNECTED"; - case ERROR_SERVER_PORT_IN_USE: return "SERVER_PORT_IN_USE"; - case ERROR_SERVER_ON: return "SERVER_ON"; - case ERROR_SERVER_OFF: return "SERVER_OFF"; - case ERROR_SERVER_RUNNING: return "SERVER_RUNNING"; - case ERROR_SERVER_NOT_RUNNING: return "SERVER_NOT_RUNNING"; - case ERROR_SERVER_NO_CLIENT: return "SERVER_NO_CLIENT"; + case VAERROR_REC_LAUNCH: return "REC_LAUNCH"; + + case VAERROR_REG_READ_ONLY: return "REG_READ_ONLY"; + case VAERROR_REG_WRITE_ONLY: return "REG_WRITE_ONLY"; + case VAERROR_REG_UNUSED: return "REG_UNUSED"; + case VAERROR_ADDR_UNALIGNED: return "ADDR_UNALIGNED"; + + case VAERROR_OSDB: return "OSDB"; + case VAERROR_HUNK_BAD_COOKIE: return "HUNK_BAD_COOKIE"; + case VAERROR_HUNK_BAD_HEADER: return "HUNK_BAD_HEADER"; + case VAERROR_HUNK_NO_SECTIONS: return "HUNK_NO_SECTIONS"; + case VAERROR_HUNK_UNSUPPORTED: return "HUNK_UNSUPPORTED"; + case VAERROR_HUNK_CORRUPTED: return "HUNK_CORRUPTED"; + + case VAERROR_SOCK_CANT_CREATE: return "SOCK_CANT_CREATE"; + case VAERROR_SOCK_CANT_CONNECT: return "SOCK_CANT_CONNECT"; + case VAERROR_SOCK_CANT_BIND: return "SOCK_CANT_BIND"; + case VAERROR_SOCK_CANT_LISTEN: return "SOCK_CANT_LISTEN"; + case VAERROR_SOCK_CANT_ACCEPT: return "SOCK_CANT_ACCEPT"; + case VAERROR_SOCK_CANT_RECEIVE: return "SOCK_CANT_RECEIVE"; + case VAERROR_SOCK_CANT_SEND: return "SOCK_CANT_SEND"; + case VAERROR_SOCK_DISCONNECTED: return "SOCK_DISCONNECTED"; + case VAERROR_SERVER_PORT_IN_USE: return "SERVER_PORT_IN_USE"; + case VAERROR_SERVER_ON: return "SERVER_ON"; + case VAERROR_SERVER_OFF: return "SERVER_OFF"; + case VAERROR_SERVER_RUNNING: return "SERVER_RUNNING"; + case VAERROR_SERVER_NOT_RUNNING: return "SERVER_NOT_RUNNING"; + case VAERROR_SERVER_NO_CLIENT: return "SERVER_NO_CLIENT"; - case ERROR_GDB_NO_ACK: return "GDB_NO_ACK"; - case ERROR_GDB_INVALID_FORMAT: return "GDB_INVALID_FORMAT"; - case ERROR_GDB_INVALID_CHECKSUM: return "GDB_INVALID_CHECKSUM"; - case ERROR_GDB_UNRECOGNIZED_CMD: return "GDB_UNRECOGNIZED_CMD"; - case ERROR_GDB_UNSUPPORTED_CMD: return "GDB_UNSUPPORTED_CMD"; - - case ERROR_FS_UNKNOWN: return "FS_UNKNOWN"; - case ERROR_FS_UNSUPPORTED: return "FS_UNSUPPORTED"; - case ERROR_FS_UNFORMATTED: return "FS_UNFORMATTED"; - case ERROR_FS_WRONG_BSIZE: return "FS_WRONG_BSIZE"; - case ERROR_FS_WRONG_CAPACITY: return "FS_WRONG_CAPACITY"; - case ERROR_FS_WRONG_DOS_TYPE: return "FS_WRONG_DOS_TYPE"; - case ERROR_FS_HAS_CYCLES: return "FS_HAS_CYCLES"; - case ERROR_FS_CORRUPTED: return "FS_CORRUPTED"; - - case ERROR_FS_OUT_OF_SPACE: return "FS_OUT_OF_SPACE"; + case VAERROR_GDB_NO_ACK: return "GDB_NO_ACK"; + case VAERROR_GDB_INVALID_FORMAT: return "GDB_INVALID_FORMAT"; + case VAERROR_GDB_INVALID_CHECKSUM: return "GDB_INVALID_CHECKSUM"; + case VAERROR_GDB_UNRECOGNIZED_CMD: return "GDB_UNRECOGNIZED_CMD"; + case VAERROR_GDB_UNSUPPORTED_CMD: return "GDB_UNSUPPORTED_CMD"; + + case VAERROR_FS_UNKNOWN: return "FS_UNKNOWN"; + case VAERROR_FS_UNSUPPORTED: return "FS_UNSUPPORTED"; + case VAERROR_FS_UNFORMATTED: return "FS_UNFORMATTED"; + case VAERROR_FS_WRONG_BSIZE: return "FS_WRONG_BSIZE"; + case VAERROR_FS_WRONG_CAPACITY: return "FS_WRONG_CAPACITY"; + case VAERROR_FS_WRONG_DOS_TYPE: return "FS_WRONG_DOS_TYPE"; + case VAERROR_FS_HAS_CYCLES: return "FS_HAS_CYCLES"; + case VAERROR_FS_CORRUPTED: return "FS_CORRUPTED"; + + case VAERROR_FS_OUT_OF_SPACE: return "FS_OUT_OF_SPACE"; - case ERROR_FS_DIR_NOT_EMPTY: return "FS_DIR_NOT_EMPTY"; - case ERROR_FS_CANNOT_CREATE_DIR: return "FS_CANNOT_CREATE_DIR"; - case ERROR_FS_CANNOT_CREATE_FILE: return "FS_CANNOT_CREATE_FILE"; - - case ERROR_FS_INVALID_BLOCK_TYPE: return "FS_INVALID_BLOCK_TYPE"; - case ERROR_FS_EXPECTED_VALUE: return "FS_EXPECTED_VALUE"; - case ERROR_FS_EXPECTED_SMALLER_VALUE: return "FS_EXPECTED_SMALLER_VALUE"; - case ERROR_FS_EXPECTED_DOS_REVISION: return "FS_EXPECTED_DOS_REVISION"; - case ERROR_FS_EXPECTED_NO_REF: return "FS_EXPECTED_NO_REF"; - case ERROR_FS_EXPECTED_REF: return "FS_EXPECTED_REF"; - case ERROR_FS_EXPECTED_SELFREF: return "FS_EXPECTED_SELFREF"; - case ERROR_FS_PTR_TO_UNKNOWN_BLOCK: return "FS_PTR_TO_UNKNOWN_BLOCK"; - case ERROR_FS_PTR_TO_EMPTY_BLOCK: return "FS_PTR_TO_EMPTY_BLOCK"; - case ERROR_FS_PTR_TO_BOOT_BLOCK: return "FS_PTR_TO_BOOT_BLOCK"; - case ERROR_FS_PTR_TO_ROOT_BLOCK: return "FS_PTR_TO_ROOT_BLOCK"; - case ERROR_FS_PTR_TO_BITMAP_BLOCK: return "FS_PTR_TO_BITMAP_BLOCK"; - case ERROR_FS_PTR_TO_BITMAP_EXT_BLOCK: return "FS_PTR_TO_BITMAP_EXT_BLOCK"; - case ERROR_FS_PTR_TO_USERDIR_BLOCK: return "FS_PTR_TO_USERDIR_BLOCK"; - case ERROR_FS_PTR_TO_FILEHEADER_BLOCK: return "FS_PTR_TO_FILEHEADER_BLOCK"; - case ERROR_FS_PTR_TO_FILELIST_BLOCK: return "FS_PTR_TO_FILELIST_BLOCK"; - case ERROR_FS_PTR_TO_DATA_BLOCK: return "FS_PTR_TO_DATA_BLOCK"; - case ERROR_FS_EXPECTED_DATABLOCK_NR: return "FS_EXPECTED_DATABLOCK_NR"; - case ERROR_FS_INVALID_HASHTABLE_SIZE: return "FS_INVALID_HASHTABLE_SIZE"; + case VAERROR_FS_DIR_NOT_EMPTY: return "FS_DIR_NOT_EMPTY"; + case VAERROR_FS_CANNOT_CREATE_DIR: return "FS_CANNOT_CREATE_DIR"; + case VAERROR_FS_CANNOT_CREATE_FILE: return "FS_CANNOT_CREATE_FILE"; + + case VAERROR_FS_INVALID_BLOCK_TYPE: return "FS_INVALID_BLOCK_TYPE"; + case VAERROR_FS_EXPECTED_VALUE: return "FS_EXPECTED_VALUE"; + case VAERROR_FS_EXPECTED_SMALLER_VALUE: return "FS_EXPECTED_SMALLER_VALUE"; + case VAERROR_FS_EXPECTED_DOS_REVISION: return "FS_EXPECTED_DOS_REVISION"; + case VAERROR_FS_EXPECTED_NO_REF: return "FS_EXPECTED_NO_REF"; + case VAERROR_FS_EXPECTED_REF: return "FS_EXPECTED_REF"; + case VAERROR_FS_EXPECTED_SELFREF: return "FS_EXPECTED_SELFREF"; + case VAERROR_FS_PTR_TO_UNKNOWN_BLOCK: return "FS_PTR_TO_UNKNOWN_BLOCK"; + case VAERROR_FS_PTR_TO_EMPTY_BLOCK: return "FS_PTR_TO_EMPTY_BLOCK"; + case VAERROR_FS_PTR_TO_BOOT_BLOCK: return "FS_PTR_TO_BOOT_BLOCK"; + case VAERROR_FS_PTR_TO_ROOT_BLOCK: return "FS_PTR_TO_ROOT_BLOCK"; + case VAERROR_FS_PTR_TO_BITMAP_BLOCK: return "FS_PTR_TO_BITMAP_BLOCK"; + case VAERROR_FS_PTR_TO_BITMAP_EXT_BLOCK: return "FS_PTR_TO_BITMAP_EXT_BLOCK"; + case VAERROR_FS_PTR_TO_USERDIR_BLOCK: return "FS_PTR_TO_USERDIR_BLOCK"; + case VAERROR_FS_PTR_TO_FILEHEADER_BLOCK: return "FS_PTR_TO_FILEHEADER_BLOCK"; + case VAERROR_FS_PTR_TO_FILELIST_BLOCK: return "FS_PTR_TO_FILELIST_BLOCK"; + case VAERROR_FS_PTR_TO_DATA_BLOCK: return "FS_PTR_TO_DATA_BLOCK"; + case VAERROR_FS_EXPECTED_DATABLOCK_NR: return "FS_EXPECTED_DATABLOCK_NR"; + case VAERROR_FS_INVALID_HASHTABLE_SIZE: return "FS_INVALID_HASHTABLE_SIZE"; } return "???"; } diff --git a/Emulator/Base/GuardList.cpp b/Emulator/Base/GuardList.cpp index c1dca0452..6cb0aae06 100644 --- a/Emulator/Base/GuardList.cpp +++ b/Emulator/Base/GuardList.cpp @@ -46,7 +46,7 @@ GuardList::hit() const void GuardList::setAt(u32 target, isize ignores) { - if (guards.isSetAt(target)) throw Error(ERROR_GUARD_ALREADY_SET, target); + if (guards.isSetAt(target)) throw Error(VAERROR_GUARD_ALREADY_SET, target); guards.setAt(target, ignores); update(); emu.main.msgQueue.put(MSG_GUARD_UPDATED); @@ -55,7 +55,7 @@ GuardList::setAt(u32 target, isize ignores) void GuardList::moveTo(isize nr, u32 newTarget) { - if (!guards.guardNr(nr)) throw Error(ERROR_GUARD_NOT_FOUND, nr); + if (!guards.guardNr(nr)) throw Error(VAERROR_GUARD_NOT_FOUND, nr); guards.replace(nr, newTarget); update(); emu.main.msgQueue.put(MSG_GUARD_UPDATED); @@ -64,7 +64,7 @@ GuardList::moveTo(isize nr, u32 newTarget) void GuardList::ignore(long nr, long count) { - if (!guards.guardNr(nr)) throw Error(ERROR_GUARD_NOT_FOUND, nr); + if (!guards.guardNr(nr)) throw Error(VAERROR_GUARD_NOT_FOUND, nr); guards.ignore(nr, count); update(); emu.main.msgQueue.put(MSG_GUARD_UPDATED); @@ -73,7 +73,7 @@ GuardList::ignore(long nr, long count) void GuardList::remove(isize nr) { - if (!guards.isSet(nr)) throw Error(ERROR_GUARD_NOT_FOUND, nr); + if (!guards.isSet(nr)) throw Error(VAERROR_GUARD_NOT_FOUND, nr); guards.remove(nr); update(); emu.main.msgQueue.put(MSG_GUARD_UPDATED); @@ -82,7 +82,7 @@ GuardList::remove(isize nr) void GuardList::removeAt(u32 target) { - if (!guards.isSetAt(target)) throw Error(ERROR_GUARD_NOT_FOUND, target); + if (!guards.isSetAt(target)) throw Error(VAERROR_GUARD_NOT_FOUND, target); guards.removeAt(target); update(); emu.main.msgQueue.put(MSG_GUARD_UPDATED); @@ -99,7 +99,7 @@ GuardList::removeAll() void GuardList::enable(isize nr) { - if (!guards.isSet(nr)) throw Error(ERROR_GUARD_NOT_FOUND, nr); + if (!guards.isSet(nr)) throw Error(VAERROR_GUARD_NOT_FOUND, nr); guards.enable(nr); update(); emu.main.msgQueue.put(MSG_GUARD_UPDATED); @@ -108,7 +108,7 @@ GuardList::enable(isize nr) void GuardList::enableAt(u32 target) { - if (!guards.isSetAt(target)) throw Error(ERROR_GUARD_NOT_FOUND, target); + if (!guards.isSetAt(target)) throw Error(VAERROR_GUARD_NOT_FOUND, target); guards.enableAt(target); update(); emu.main.msgQueue.put(MSG_GUARD_UPDATED); @@ -125,7 +125,7 @@ GuardList::enableAll() void GuardList::disable(isize nr) { - if (!guards.isSet(nr)) throw Error(ERROR_GUARD_NOT_FOUND, nr); + if (!guards.isSet(nr)) throw Error(VAERROR_GUARD_NOT_FOUND, nr); guards.disable(nr); update(); emu.main.msgQueue.put(MSG_GUARD_UPDATED); @@ -134,7 +134,7 @@ GuardList::disable(isize nr) void GuardList::disableAt(u32 target) { - if (!guards.isSetAt(target)) throw Error(ERROR_GUARD_NOT_FOUND, target); + if (!guards.isSetAt(target)) throw Error(VAERROR_GUARD_NOT_FOUND, target); guards.disableAt(target); update(); emu.main.msgQueue.put(MSG_GUARD_UPDATED); diff --git a/Emulator/Base/Host.cpp b/Emulator/Base/Host.cpp index c7592a711..3f4e87caa 100644 --- a/Emulator/Base/Host.cpp +++ b/Emulator/Base/Host.cpp @@ -42,7 +42,7 @@ Host::checkOption(Option opt, i64 value) return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } @@ -111,7 +111,7 @@ Host::tmp() const if (!logfile.is_open()) { - throw Error(ERROR_DIR_NOT_FOUND); + throw Error(VAERROR_DIR_NOT_FOUND); } } diff --git a/Emulator/Components/Agnus/Agnus.cpp b/Emulator/Components/Agnus/Agnus.cpp index f81964d35..cd94fba09 100644 --- a/Emulator/Components/Agnus/Agnus.cpp +++ b/Emulator/Components/Agnus/Agnus.cpp @@ -84,10 +84,10 @@ Agnus::checkOption(Option opt, i64 value) case OPT_AGNUS_REVISION: if (!isPoweredOff()) { - throw Error(ERROR_OPT_LOCKED); + throw Error(VAERROR_OPT_LOCKED); } if (!AgnusRevisionEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, AgnusRevisionEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, AgnusRevisionEnum::keyList()); } return; @@ -96,7 +96,7 @@ Agnus::checkOption(Option opt, i64 value) return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/Components/Agnus/Blitter/Blitter.cpp b/Emulator/Components/Agnus/Blitter/Blitter.cpp index 55f21e61a..017d35aba 100644 --- a/Emulator/Components/Agnus/Blitter/Blitter.cpp +++ b/Emulator/Components/Agnus/Blitter/Blitter.cpp @@ -91,12 +91,12 @@ Blitter::checkOption(Option opt, i64 value) case OPT_BLITTER_ACCURACY: if (value < 0 || value > 2) { - throw Error(ERROR_OPT_INV_ARG, "0, 1, 2"); + throw Error(VAERROR_OPT_INV_ARG, "0, 1, 2"); } return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/Components/Agnus/DmaDebugger/DmaDebugger.cpp b/Emulator/Components/Agnus/DmaDebugger/DmaDebugger.cpp index 97062f6c7..de03e3ce4 100644 --- a/Emulator/Components/Agnus/DmaDebugger/DmaDebugger.cpp +++ b/Emulator/Components/Agnus/DmaDebugger/DmaDebugger.cpp @@ -93,7 +93,7 @@ DmaDebugger::checkOption(Option opt, i64 value) case OPT_DMA_DEBUG_MODE: if (!DmaDisplayModeEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, DmaDisplayModeEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, DmaDisplayModeEnum::keyList()); } return; @@ -118,7 +118,7 @@ DmaDebugger::checkOption(Option opt, i64 value) return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/Components/Amiga.cpp b/Emulator/Components/Amiga.cpp index dcb284924..ab5c14c73 100644 --- a/Emulator/Components/Amiga.cpp +++ b/Emulator/Components/Amiga.cpp @@ -189,7 +189,7 @@ Amiga::checkOption(Option opt, i64 value) case OPT_AMIGA_VIDEO_FORMAT: if (!VideoFormatEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, VideoFormatEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, VideoFormatEnum::keyList()); } return; @@ -200,7 +200,7 @@ Amiga::checkOption(Option opt, i64 value) case OPT_AMIGA_WARP_MODE: if (!WarpModeEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, WarpModeEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, WarpModeEnum::keyList()); } return; @@ -211,7 +211,7 @@ Amiga::checkOption(Option opt, i64 value) case OPT_AMIGA_SPEED_BOOST: if (value < 50 || value > 200) { - throw Error(ERROR_OPT_INV_ARG, "50...200"); + throw Error(VAERROR_OPT_INV_ARG, "50...200"); } return; @@ -222,19 +222,19 @@ Amiga::checkOption(Option opt, i64 value) case OPT_AMIGA_SNAPSHOT_DELAY: if (value < 10 || value > 3600) { - throw Error(ERROR_OPT_INV_ARG, "10...3600"); + throw Error(VAERROR_OPT_INV_ARG, "10...3600"); } return; case OPT_AMIGA_RUN_AHEAD: if (value < 0 || value > 12) { - throw Error(ERROR_OPT_INV_ARG, "0...12"); + throw Error(VAERROR_OPT_INV_ARG, "0...12"); } return; default: - throw Error(ERROR_OPT_UNSUPPORTED); + throw Error(VAERROR_OPT_UNSUPPORTED); } } @@ -300,7 +300,7 @@ Amiga::exportConfig(const fs::path &path, bool diff) const auto fs = std::ofstream(path, std::ofstream::binary); if (!fs.is_open()) { - throw Error(ERROR_FILE_CANT_WRITE); + throw Error(VAERROR_FILE_CANT_WRITE); } exportConfig(fs, diff); @@ -347,7 +347,7 @@ Amiga::get(Option opt, isize objid) const debug(CNF_DEBUG, "get(%s, %ld)\n", OptionEnum::key(opt), objid); auto target = routeOption(opt, objid); - if (target == nullptr) throw Error(ERROR_OPT_INV_ID); + if (target == nullptr) throw Error(VAERROR_OPT_INV_ID); return target->getOption(opt); } @@ -372,7 +372,7 @@ Amiga::check(Option opt, i64 value, const std::vector objids) debug(CNF_DEBUG, "check(%s, %lld, %ld)\n", OptionEnum::key(opt), value, objid); auto target = routeOption(opt, objid); - if (target == nullptr) throw Error(ERROR_OPT_INV_ID); + if (target == nullptr) throw Error(VAERROR_OPT_INV_ID); target->checkOption(opt, value); } @@ -399,7 +399,7 @@ Amiga::set(Option opt, i64 value, const std::vector objids) debug(CNF_DEBUG, "set(%s, %lld, %ld)\n", OptionEnum::key(opt), value, objid); auto target = routeOption(opt, objid); - if (target == nullptr) throw Error(ERROR_OPT_INV_ID); + if (target == nullptr) throw Error(VAERROR_OPT_INV_ID); target->setOption(opt, value); } @@ -1093,7 +1093,7 @@ Amiga::loadSnapshot(const MediaFile &file) } catch (...) { - throw Error(ERROR_FILE_TYPE_MISMATCH); + throw Error(VAERROR_FILE_TYPE_MISMATCH); } } diff --git a/Emulator/Components/CIA/CIA.cpp b/Emulator/Components/CIA/CIA.cpp index 493df68be..404e2b1ce 100755 --- a/Emulator/Components/CIA/CIA.cpp +++ b/Emulator/Components/CIA/CIA.cpp @@ -93,7 +93,7 @@ CIA::checkOption(Option opt, i64 value) case OPT_CIA_REVISION: if (!CIARevisionEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, CIARevisionEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, CIARevisionEnum::keyList()); } return; @@ -104,7 +104,7 @@ CIA::checkOption(Option opt, i64 value) return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/Components/CPU/CPU.cpp b/Emulator/Components/CPU/CPU.cpp index 3a4f055ab..889e1b21c 100644 --- a/Emulator/Components/CPU/CPU.cpp +++ b/Emulator/Components/CPU/CPU.cpp @@ -307,21 +307,21 @@ CPU::checkOption(Option opt, i64 value) case OPT_CPU_REVISION: if (!CPURevisionEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, CPURevisionEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, CPURevisionEnum::keyList()); } return; case OPT_CPU_DASM_REVISION: if (!DasmRevisionEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, DasmRevisionEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, DasmRevisionEnum::keyList()); } return; case OPT_CPU_DASM_SYNTAX: if (!DasmSyntaxEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, DasmSyntaxEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, DasmSyntaxEnum::keyList()); } return; @@ -331,7 +331,7 @@ CPU::checkOption(Option opt, i64 value) return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/Components/Denise/Denise.cpp b/Emulator/Components/Denise/Denise.cpp index 6a73000c0..af86e056f 100644 --- a/Emulator/Components/Denise/Denise.cpp +++ b/Emulator/Components/Denise/Denise.cpp @@ -64,7 +64,7 @@ Denise::checkOption(Option opt, i64 value) case OPT_DENISE_REVISION: if (!DeniseRevisionEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, DeniseRevisionEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, DeniseRevisionEnum::keyList()); } return; @@ -81,7 +81,7 @@ Denise::checkOption(Option opt, i64 value) return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/Components/Denise/PixelEngine.cpp b/Emulator/Components/Denise/PixelEngine.cpp index 433c7daa7..3aa716bbb 100644 --- a/Emulator/Components/Denise/PixelEngine.cpp +++ b/Emulator/Components/Denise/PixelEngine.cpp @@ -98,33 +98,33 @@ PixelEngine::checkOption(Option opt, i64 value) case OPT_MON_PALETTE: if (!PaletteEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, PaletteEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, PaletteEnum::keyList()); } return; case OPT_MON_BRIGHTNESS: if (value < 0 || value > 100) { - throw Error(ERROR_OPT_INV_ARG, "0...100"); + throw Error(VAERROR_OPT_INV_ARG, "0...100"); } return; case OPT_MON_CONTRAST: if (value < 0 || value > 100) { - throw Error(ERROR_OPT_INV_ARG, "0...100"); + throw Error(VAERROR_OPT_INV_ARG, "0...100"); } return; case OPT_MON_SATURATION: if (value < 0 || value > 100) { - throw Error(ERROR_OPT_INV_ARG, "0...100"); + throw Error(VAERROR_OPT_INV_ARG, "0...100"); } return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/Components/Emulator.cpp b/Emulator/Components/Emulator.cpp index 24e70fb5f..6e67de751 100644 --- a/Emulator/Components/Emulator.cpp +++ b/Emulator/Components/Emulator.cpp @@ -60,7 +60,7 @@ void Emulator::initialize() { // Make sure this function is only called once - if (isInitialized()) throw Error(ERROR_LAUNCH, "The emulator is already initialized."); + if (isInitialized()) throw Error(VAERROR_LAUNCH, "The emulator is already initialized."); // Initialize all components main.initialize(); @@ -423,7 +423,7 @@ Emulator::getDebugVariable(DebugFlag flag) { #ifdef RELEASEBUILD - throw Error(ERROR_OPT_UNSUPPORTED, "Debug variables are only accessible in debug builds."); + throw Error(VAERROR_OPT_UNSUPPORTED, "Debug variables are only accessible in debug builds."); #else @@ -542,7 +542,7 @@ Emulator::getDebugVariable(DebugFlag flag) case FLAG_GDB_DEBUG: return GDB_DEBUG; default: - throw Error(ERROR_OPT_UNSUPPORTED, + throw Error(VAERROR_OPT_UNSUPPORTED, "Unhandled debug variable: " + string(DebugFlagEnum::key(flag))); } @@ -554,7 +554,7 @@ Emulator::setDebugVariable(DebugFlag flag, bool val) { #ifdef RELEASEBUILD - throw Error(ERROR_OPT_UNSUPPORTED, "Debug variables are only accessible in debug builds."); + throw Error(VAERROR_OPT_UNSUPPORTED, "Debug variables are only accessible in debug builds."); #else @@ -692,7 +692,7 @@ Emulator::setDebugVariable(DebugFlag flag, bool val) case FLAG_GDB_DEBUG: GDB_DEBUG = val; break; default: - throw Error(ERROR_OPT_UNSUPPORTED, + throw Error(VAERROR_OPT_UNSUPPORTED, "Unhandled debug variable: " + string(DebugFlagEnum::key(flag))); } #endif diff --git a/Emulator/Components/Memory/Memory.cpp b/Emulator/Components/Memory/Memory.cpp index f00524fad..64bc704e8 100644 --- a/Emulator/Components/Memory/Memory.cpp +++ b/Emulator/Components/Memory/Memory.cpp @@ -145,40 +145,40 @@ Memory::checkOption(Option opt, i64 value) case OPT_MEM_CHIP_RAM: if (!isPoweredOff()) { - throw Error(ERROR_OPT_LOCKED); + throw Error(VAERROR_OPT_LOCKED); } if (value != 256 && value != 512 && value != 1024 && value != 2048) { - throw Error(ERROR_OPT_INV_ARG, "256, 512, 1024, 2048"); + throw Error(VAERROR_OPT_INV_ARG, "256, 512, 1024, 2048"); } return; case OPT_MEM_SLOW_RAM: if (!isPoweredOff()) { - throw Error(ERROR_OPT_LOCKED); + throw Error(VAERROR_OPT_LOCKED); } if ((value % 256) != 0 || value > 1536) { - throw Error(ERROR_OPT_INV_ARG, "0, 256, 512, ..., 1536"); + throw Error(VAERROR_OPT_INV_ARG, "0, 256, 512, ..., 1536"); } return; case OPT_MEM_FAST_RAM: if (!isPoweredOff()) { - throw Error(ERROR_OPT_LOCKED); + throw Error(VAERROR_OPT_LOCKED); } if ((value % 64) != 0 || value > 8192) { - throw Error(ERROR_OPT_INV_ARG, "0, 64, 128, ..., 8192"); + throw Error(VAERROR_OPT_INV_ARG, "0, 64, 128, ..., 8192"); } return; case OPT_MEM_EXT_START: if (!isPoweredOff()) { - throw Error(ERROR_OPT_LOCKED); + throw Error(VAERROR_OPT_LOCKED); } if (value != 0xE0 && value != 0xF0) { - throw Error(ERROR_OPT_INV_ARG, "E0, F0"); + throw Error(VAERROR_OPT_INV_ARG, "E0, F0"); } return; @@ -191,26 +191,26 @@ Memory::checkOption(Option opt, i64 value) case OPT_MEM_BANKMAP: if (!BankMapEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, BankMapEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, BankMapEnum::keyList()); } return; case OPT_MEM_UNMAPPING_TYPE: if (!UnmappedMemoryEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, UnmappedMemoryEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, UnmappedMemoryEnum::keyList()); } return; case OPT_MEM_RAM_INIT_PATTERN: if (!RamInitPatternEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, RamInitPatternEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, RamInitPatternEnum::keyList()); } return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } @@ -375,12 +375,12 @@ Memory::operator << (SerReader &worker) << fastSize; // Check the integrity of the new values before allocating memory - if (romSize > KB(512)) throw Error(ERROR_SNAP_CORRUPTED); - if (womSize > KB(256)) throw Error(ERROR_SNAP_CORRUPTED); - if (extSize > KB(512)) throw Error(ERROR_SNAP_CORRUPTED); - if (chipSize > MB(2)) throw Error(ERROR_SNAP_CORRUPTED); - if (slowSize > KB(1792)) throw Error(ERROR_SNAP_CORRUPTED); - if (fastSize > MB(8)) throw Error(ERROR_SNAP_CORRUPTED); + if (romSize > KB(512)) throw Error(VAERROR_SNAP_CORRUPTED); + if (womSize > KB(256)) throw Error(VAERROR_SNAP_CORRUPTED); + if (extSize > KB(512)) throw Error(VAERROR_SNAP_CORRUPTED); + if (chipSize > MB(2)) throw Error(VAERROR_SNAP_CORRUPTED); + if (slowSize > KB(1792)) throw Error(VAERROR_SNAP_CORRUPTED); + if (fastSize > MB(8)) throw Error(VAERROR_SNAP_CORRUPTED); // Allocate ROM space (only if Roms are included in the snapshot) if (romSize) allocRom(romSize, false); @@ -460,16 +460,16 @@ Memory::_isReady() const bool hasAros = traits.vendor == ROM_VENDOR_AROS; if (!hasRom || FORCE_ROM_MISSING) { - throw Error(ERROR_ROM_MISSING); + throw Error(VAERROR_ROM_MISSING); } if (!chip || FORCE_CHIP_RAM_MISSING) { - throw Error(ERROR_CHIP_RAM_MISSING); + throw Error(VAERROR_CHIP_RAM_MISSING); } if ((hasAros && !ext) || FORCE_AROS_NO_EXTROM) { - throw Error(ERROR_AROS_NO_EXTROM); + throw Error(VAERROR_AROS_NO_EXTROM); } if ((hasAros && ramSize() < MB(1)) || FORCE_AROS_RAM_LIMIT) { - throw Error(ERROR_AROS_RAM_LIMIT); + throw Error(VAERROR_AROS_RAM_LIMIT); } } @@ -658,7 +658,7 @@ Memory::extFingerprint() const void Memory::loadRom(MediaFile &file) { - // if (amiga.isPoweredOn()) throw Error(ERROR_POWERED_ON); + // if (amiga.isPoweredOn()) throw Error(VAERROR_POWERED_ON); try { @@ -692,7 +692,7 @@ Memory::loadRom(MediaFile &file) } catch (...) { - throw Error(ERROR_FILE_TYPE_MISMATCH); + throw Error(VAERROR_FILE_TYPE_MISMATCH); }} } @@ -725,7 +725,7 @@ Memory::loadExt(MediaFile &file) } catch (...) { - throw Error(ERROR_FILE_TYPE_MISMATCH); + throw Error(VAERROR_FILE_TYPE_MISMATCH); } } @@ -746,7 +746,7 @@ Memory::loadExt(const u8 *buf, isize len) void Memory::saveRom(const std::filesystem::path &path) { - if (rom == nullptr) throw Error(ERROR_ROM_MISSING); + if (rom == nullptr) throw Error(VAERROR_ROM_MISSING); RomFile file(rom, config.romSize); file.writeToFile(path); @@ -755,7 +755,7 @@ Memory::saveRom(const std::filesystem::path &path) void Memory::saveWom(const std::filesystem::path &path) { - if (wom == nullptr) throw Error(ERROR_ROM_MISSING); + if (wom == nullptr) throw Error(VAERROR_ROM_MISSING); RomFile file(wom, config.womSize); file.writeToFile(path); @@ -764,7 +764,7 @@ Memory::saveWom(const std::filesystem::path &path) void Memory::saveExt(const std::filesystem::path &path) { - if (ext == nullptr) throw Error(ERROR_ROM_MISSING); + if (ext == nullptr) throw Error(VAERROR_ROM_MISSING); RomFile file(ext, config.extSize); file.writeToFile(path); diff --git a/Emulator/Components/Memory/MemoryDebugger.cpp b/Emulator/Components/Memory/MemoryDebugger.cpp index d0d508fbb..1e9c3d94b 100644 --- a/Emulator/Components/Memory/MemoryDebugger.cpp +++ b/Emulator/Components/Memory/MemoryDebugger.cpp @@ -127,7 +127,7 @@ i64 MemoryDebugger::memSearch(const string &pattern, u32 addr, isize align) { // Check alignment - if (align != 1 && IS_ODD(addr)) throw Error(ERROR_ADDR_UNALIGNED); + if (align != 1 && IS_ODD(addr)) throw Error(VAERROR_ADDR_UNALIGNED); if (isize length = isize(pattern.length()); length > 0) { @@ -161,7 +161,7 @@ MemoryDebugger::read(u32 addr, isize sz) printf("sz = %ld addr = %d\n", sz, addr); // Check alignment - if (sz != 1 && IS_ODD(addr)) throw Error(ERROR_ADDR_UNALIGNED); + if (sz != 1 && IS_ODD(addr)) throw Error(VAERROR_ADDR_UNALIGNED); { SUSPENDED @@ -186,7 +186,7 @@ void MemoryDebugger::write(u32 addr, u32 val, isize sz, isize repeats) { // Check alignment - if (sz != 1 && IS_ODD(addr)) throw Error(ERROR_ADDR_UNALIGNED); + if (sz != 1 && IS_ODD(addr)) throw Error(VAERROR_ADDR_UNALIGNED); { SUSPENDED @@ -232,7 +232,7 @@ void MemoryDebugger::load(fs::path& path, u32 addr) { std::ifstream stream(path, std::ifstream::binary); - if (!stream.is_open()) throw Error(ERROR_FILE_NOT_FOUND, path); + if (!stream.is_open()) throw Error(VAERROR_FILE_NOT_FOUND, path); load(stream, addr); } @@ -251,7 +251,7 @@ void MemoryDebugger::save(fs::path& path, u32 addr, isize count) { std::ofstream stream(path, std::ifstream::binary); - if (!stream.is_open()) throw Error(ERROR_FILE_CANT_CREATE, path); + if (!stream.is_open()) throw Error(VAERROR_FILE_CANT_CREATE, path); save(stream, addr, count); } @@ -369,16 +369,16 @@ MemoryDebugger::isUnused(ChipsetReg reg) const u16 MemoryDebugger::readCs(ChipsetReg reg) const { - if (isUnused(reg)) throw Error(ERROR_REG_UNUSED, ChipsetRegEnum::key(reg)); - if (isWritable(reg)) throw Error(ERROR_REG_WRITE_ONLY, ChipsetRegEnum::key(reg)); + if (isUnused(reg)) throw Error(VAERROR_REG_UNUSED, ChipsetRegEnum::key(reg)); + if (isWritable(reg)) throw Error(VAERROR_REG_WRITE_ONLY, ChipsetRegEnum::key(reg)); return mem.peekCustom16(u32(reg << 1)); } void MemoryDebugger::writeCs(ChipsetReg reg, u16 value) { - if (isUnused(reg)) throw Error(ERROR_REG_UNUSED, ChipsetRegEnum::key(reg)); - if (isReadable(reg)) throw Error(ERROR_REG_READ_ONLY, ChipsetRegEnum::key(reg)); + if (isUnused(reg)) throw Error(VAERROR_REG_UNUSED, ChipsetRegEnum::key(reg)); + if (isReadable(reg)) throw Error(VAERROR_REG_READ_ONLY, ChipsetRegEnum::key(reg)); return mem.pokeCustom16(u32(reg << 1), value); } diff --git a/Emulator/Components/Paula/Audio/AudioFilter.cpp b/Emulator/Components/Paula/Audio/AudioFilter.cpp index 23f1cd1b5..c5e121b2c 100644 --- a/Emulator/Components/Paula/Audio/AudioFilter.cpp +++ b/Emulator/Components/Paula/Audio/AudioFilter.cpp @@ -205,12 +205,12 @@ AudioFilter::checkOption(Option opt, i64 value) case OPT_AUD_FILTER_TYPE: if (!FilterTypeEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, FilterTypeEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, FilterTypeEnum::keyList()); } return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/Components/Paula/DiskController/DiskController.cpp b/Emulator/Components/Paula/DiskController/DiskController.cpp index c19d40ea7..fb86be1f7 100644 --- a/Emulator/Components/Paula/DiskController/DiskController.cpp +++ b/Emulator/Components/Paula/DiskController/DiskController.cpp @@ -53,7 +53,7 @@ DiskController::checkOption(Option opt, i64 value) case OPT_DC_SPEED: if (!isValidDriveSpeed((isize)value)) { - throw Error(ERROR_OPT_INV_ARG, "-1, 1, 2, 4, 8"); + throw Error(VAERROR_OPT_INV_ARG, "-1, 1, 2, 4, 8"); } return; @@ -63,7 +63,7 @@ DiskController::checkOption(Option opt, i64 value) return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/Components/Ports/AudioPort.cpp b/Emulator/Components/Ports/AudioPort.cpp index 15d61d8a8..a8d75ea26 100644 --- a/Emulator/Components/Ports/AudioPort.cpp +++ b/Emulator/Components/Ports/AudioPort.cpp @@ -176,7 +176,7 @@ AudioPort::checkOption(Option opt, i64 value) case OPT_AUD_SAMPLING_METHOD: if (!SamplingMethodEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, SamplingMethodEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, SamplingMethodEnum::keyList()); } return; @@ -195,7 +195,7 @@ AudioPort::checkOption(Option opt, i64 value) return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/Components/Ports/SerialPort.cpp b/Emulator/Components/Ports/SerialPort.cpp index 08c11fb14..d09292b60 100644 --- a/Emulator/Components/Ports/SerialPort.cpp +++ b/Emulator/Components/Ports/SerialPort.cpp @@ -35,7 +35,7 @@ SerialPort::checkOption(Option opt, i64 value) case OPT_SER_DEVICE: if (!SerialPortDeviceEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, SerialPortDeviceEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, SerialPortDeviceEnum::keyList()); } return; @@ -44,7 +44,7 @@ SerialPort::checkOption(Option opt, i64 value) return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } @@ -56,7 +56,7 @@ SerialPort::setOption(Option option, i64 value) case OPT_SER_DEVICE: if (!SerialPortDeviceEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, SerialPortDeviceEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, SerialPortDeviceEnum::keyList()); } config.device = (SerialPortDevice)value; diff --git a/Emulator/Components/Ports/VideoPort.cpp b/Emulator/Components/Ports/VideoPort.cpp index 13ca1a0dd..daa6ce341 100644 --- a/Emulator/Components/Ports/VideoPort.cpp +++ b/Emulator/Components/Ports/VideoPort.cpp @@ -76,7 +76,7 @@ VideoPort::checkOption(Option opt, i64 value) return; default: - throw Error(ERROR_OPT_UNSUPPORTED); + throw Error(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/Components/RTC/RTC.cpp b/Emulator/Components/RTC/RTC.cpp index 8dda2e3fd..d58e5a723 100644 --- a/Emulator/Components/RTC/RTC.cpp +++ b/Emulator/Components/RTC/RTC.cpp @@ -35,15 +35,15 @@ RTC::checkOption(Option opt, i64 value) case OPT_RTC_MODEL: if (!isPoweredOff()) { - throw Error(ERROR_OPT_LOCKED); + throw Error(VAERROR_OPT_LOCKED); } if (!RTCRevisionEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, RTCRevisionEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, RTCRevisionEnum::keyList()); } return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/Components/Zorro/DiagBoard.cpp b/Emulator/Components/Zorro/DiagBoard.cpp index 1b90c89e9..bf54a0164 100644 --- a/Emulator/Components/Zorro/DiagBoard.cpp +++ b/Emulator/Components/Zorro/DiagBoard.cpp @@ -60,12 +60,12 @@ DiagBoard::checkOption(Option opt, i64 value) case OPT_DIAG_BOARD: if (!isPoweredOff()) { - throw Error(ERROR_OPT_LOCKED); + throw Error(VAERROR_OPT_LOCKED); } return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } @@ -321,7 +321,7 @@ DiagBoard::catchTask(const string &name) { SUSPENDED if (!diagBoard.pluggedIn()) { - throw Error(ERROR_OSDB, "Diagnose board is not plugged in."); + throw Error(VAERROR_OSDB, "Diagnose board is not plugged in."); } if (std::find(targets.begin(), targets.end(), name) == targets.end()) { targets.push_back(name); diff --git a/Emulator/Components/Zorro/HdController.cpp b/Emulator/Components/Zorro/HdController.cpp index 9d000e62b..a17f4cb54 100644 --- a/Emulator/Components/Zorro/HdController.cpp +++ b/Emulator/Components/Zorro/HdController.cpp @@ -103,12 +103,12 @@ HdController::checkOption(Option opt, i64 value) case OPT_HDC_CONNECT: if (!isPoweredOff()) { - throw Error(ERROR_OPT_LOCKED); + throw Error(VAERROR_OPT_LOCKED); } return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } @@ -572,7 +572,7 @@ HdController::processInfoReq(u32 ptr) debug(HDR_DEBUG, "Requested info for driver %d\n", num); if (num >= drive.drivers.size()) { - throw Error(ERROR_HDC_INIT, "Invalid driver number: " + std::to_string(num)); + throw Error(VAERROR_HDC_INIT, "Invalid driver number: " + std::to_string(num)); } auto &driver = drive.drivers[num]; @@ -585,7 +585,7 @@ HdController::processInfoReq(u32 ptr) // We accept up to three hunks auto numHunks = descr.numHunks(); if (numHunks == 0 || numHunks > 3) { - throw Error(ERROR_HUNK_CORRUPTED); + throw Error(VAERROR_HUNK_CORRUPTED); } // Pass the hunk information back to the driver @@ -617,7 +617,7 @@ HdController::processInitSeg(u32 ptr) debug(HDR_DEBUG, "Processing driver %d\n", num); if (num >= drive.drivers.size()) { - throw Error(ERROR_HDC_INIT, "Invalid driver number: " + std::to_string(num)); + throw Error(VAERROR_HDC_INIT, "Invalid driver number: " + std::to_string(num)); } // Read driver @@ -628,7 +628,7 @@ HdController::processInitSeg(u32 ptr) // We accept up to three hunks auto numHunks = descr.numHunks(); if (numHunks == 0 || numHunks > 3) { - throw Error(ERROR_HUNK_CORRUPTED); + throw Error(VAERROR_HUNK_CORRUPTED); } // Extract pointers to the allocated memory @@ -639,7 +639,7 @@ HdController::processInitSeg(u32 ptr) auto segPtr = mem.spypeek32 (segPtrAddr); if (segPtr == 0) { - throw Error(ERROR_HDC_INIT, "Memory allocation failed inside AmigaOS"); + throw Error(VAERROR_HDC_INIT, "Memory allocation failed inside AmigaOS"); } debug(HDR_DEBUG, "Allocated memory at %x\n", segPtr); segPtrs.push_back(segPtr); @@ -672,7 +672,7 @@ HdController::processInitSeg(u32 ptr) if (s.type == HUNK_RELOC32) { if (s.target >= numHunks) { - throw Error(ERROR_HDC_INIT, "Invalid relocation target"); + throw Error(VAERROR_HDC_INIT, "Invalid relocation target"); } debug(HDR_DEBUG, "Relocation target: %ld\n", s.target); diff --git a/Emulator/FileSystems/FSBlock.cpp b/Emulator/FileSystems/FSBlock.cpp index 4b26f9b35..e62e4b15b 100644 --- a/Emulator/FileSystems/FSBlock.cpp +++ b/Emulator/FileSystems/FSBlock.cpp @@ -100,7 +100,7 @@ FSBlock::make(FileSystem &ref, Block nr, FSBlockType type) return new FSBlock(ref, nr, type); default: - throw Error(ERROR_FS_INVALID_BLOCK_TYPE); + throw Error(VAERROR_FS_INVALID_BLOCK_TYPE); } } @@ -338,7 +338,7 @@ FSBlock::check(bool strict) const for (isize i = 0; i < bsize(); i++) { - if ((error = check(i, &expected, strict)) != ERROR_OK) { + if ((error = check(i, &expected, strict)) != VAERROR_OK) { count++; debug(FS_DEBUG, "Block %d [%ld.%ld]: %s\n", nr, i / 4, i % 4, ErrorCodeEnum::key(error)); @@ -463,10 +463,10 @@ FSBlock::check(isize byte, u8 *expected, bool strict) const if (word <= -51 && value) EXPECT_DATABLOCK_REF; if (word == -51) { if (value == 0 && getNumDataBlockRefs() > 0) { - return ERROR_FS_EXPECTED_REF; + return VAERROR_FS_EXPECTED_REF; } if (value != 0 && getNumDataBlockRefs() == 0) { - return ERROR_FS_EXPECTED_NO_REF; + return VAERROR_FS_EXPECTED_NO_REF; } } break; @@ -500,10 +500,10 @@ FSBlock::check(isize byte, u8 *expected, bool strict) const if (word <= -51 && value) EXPECT_DATABLOCK_REF; if (word == -51) { if (value == 0 && getNumDataBlockRefs() > 0) { - return ERROR_FS_EXPECTED_REF; + return VAERROR_FS_EXPECTED_REF; } if (value != 0 && getNumDataBlockRefs() == 0) { - return ERROR_FS_EXPECTED_NO_REF; + return VAERROR_FS_EXPECTED_NO_REF; } } break; @@ -538,7 +538,7 @@ FSBlock::check(isize byte, u8 *expected, bool strict) const break; } - return ERROR_OK; + return VAERROR_OK; } u8 * @@ -793,7 +793,7 @@ FSBlock::exportBlock(const fs::path &path) case FS_FILEHEADER_BLOCK: return exportFileHeaderBlock(path); default: - return ERROR_OK; + return VAERROR_OK; } } @@ -803,10 +803,10 @@ FSBlock::exportUserDirBlock(const fs::path &path) auto name = path / device.getPath(this); if (!util::createDirectory(name.string())) { - return ERROR_FS_CANNOT_CREATE_DIR; + return VAERROR_FS_CANNOT_CREATE_DIR; } - return ERROR_OK; + return VAERROR_OK; } ErrorCode @@ -815,10 +815,10 @@ FSBlock::exportFileHeaderBlock(const fs::path &path) auto filename = path / device.getPath(this); std::ofstream file(filename.string(), std::ofstream::binary); - if (!file.is_open()) return ERROR_FS_CANNOT_CREATE_FILE; + if (!file.is_open()) return VAERROR_FS_CANNOT_CREATE_FILE; writeData(file); - return ERROR_OK; + return VAERROR_OK; } FSName diff --git a/Emulator/FileSystems/FSBlock.h b/Emulator/FileSystems/FSBlock.h index cc02b4d27..30bf90203 100644 --- a/Emulator/FileSystems/FSBlock.h +++ b/Emulator/FileSystems/FSBlock.h @@ -324,73 +324,73 @@ typedef FSBlock* BlockPtr; // #define EXPECT_BYTE(exp) { \ -if (value != (exp)) { *expected = (exp); return ERROR_FS_EXPECTED_VALUE; } } +if (value != (exp)) { *expected = (exp); return VAERROR_FS_EXPECTED_VALUE; } } #define EXPECT_LONGWORD(exp) { \ if ((byte % 4) == 0 && BYTE3(value) != BYTE3((u32)exp)) \ -{ *expected = (BYTE3((u32)exp)); return ERROR_FS_EXPECTED_VALUE; } \ +{ *expected = (BYTE3((u32)exp)); return VAERROR_FS_EXPECTED_VALUE; } \ if ((byte % 4) == 1 && BYTE2(value) != BYTE2((u32)exp)) \ -{ *expected = (BYTE2((u32)exp)); return ERROR_FS_EXPECTED_VALUE; } \ +{ *expected = (BYTE2((u32)exp)); return VAERROR_FS_EXPECTED_VALUE; } \ if ((byte % 4) == 2 && BYTE1(value) != BYTE1((u32)exp)) \ -{ *expected = (BYTE1((u32)exp)); return ERROR_FS_EXPECTED_VALUE; } \ +{ *expected = (BYTE1((u32)exp)); return VAERROR_FS_EXPECTED_VALUE; } \ if ((byte % 4) == 3 && BYTE0(value) != BYTE0((u32)exp)) \ -{ *expected = (BYTE0((u32)exp)); return ERROR_FS_EXPECTED_VALUE; } } +{ *expected = (BYTE0((u32)exp)); return VAERROR_FS_EXPECTED_VALUE; } } #define EXPECT_CHECKSUM EXPECT_LONGWORD(checksum()) #define EXPECT_LESS_OR_EQUAL(exp) { \ if (value > (u32)exp) \ -{ *expected = (u8)(exp); return ERROR_FS_EXPECTED_SMALLER_VALUE; } } +{ *expected = (u8)(exp); return VAERROR_FS_EXPECTED_SMALLER_VALUE; } } #define EXPECT_DOS_REVISION { \ -if (!FSVolumeTypeEnum::isValid((isize)value)) return ERROR_FS_EXPECTED_DOS_REVISION; } +if (!FSVolumeTypeEnum::isValid((isize)value)) return VAERROR_FS_EXPECTED_DOS_REVISION; } #define EXPECT_REF { \ -if (!device.block(value)) return ERROR_FS_EXPECTED_REF; } +if (!device.block(value)) return VAERROR_FS_EXPECTED_REF; } #define EXPECT_SELFREF { \ -if (value != nr) return ERROR_FS_EXPECTED_SELFREF; } +if (value != nr) return VAERROR_FS_EXPECTED_SELFREF; } #define EXPECT_FILEHEADER_REF { \ -if (ErrorCode e = device.checkBlockType(value, FS_FILEHEADER_BLOCK); e != ERROR_OK) return e; } +if (ErrorCode e = device.checkBlockType(value, FS_FILEHEADER_BLOCK); e != VAERROR_OK) return e; } #define EXPECT_HASH_REF { \ -if (ErrorCode e = device.checkBlockType(value, FS_FILEHEADER_BLOCK, FS_USERDIR_BLOCK); e != ERROR_OK) return e; } +if (ErrorCode e = device.checkBlockType(value, FS_FILEHEADER_BLOCK, FS_USERDIR_BLOCK); e != VAERROR_OK) return e; } #define EXPECT_OPTIONAL_HASH_REF { \ if (value) { EXPECT_HASH_REF } } #define EXPECT_PARENT_DIR_REF { \ -if (ErrorCode e = device.checkBlockType(value, FS_ROOT_BLOCK, FS_USERDIR_BLOCK); e != ERROR_OK) return e; } +if (ErrorCode e = device.checkBlockType(value, FS_ROOT_BLOCK, FS_USERDIR_BLOCK); e != VAERROR_OK) return e; } #define EXPECT_FILELIST_REF { \ -if (ErrorCode e = device.checkBlockType(value, FS_FILELIST_BLOCK); e != ERROR_OK) return e; } +if (ErrorCode e = device.checkBlockType(value, FS_FILELIST_BLOCK); e != VAERROR_OK) return e; } #define EXPECT_OPTIONAL_FILELIST_REF { \ if (value) { EXPECT_FILELIST_REF } } #define EXPECT_BITMAP_REF { \ -if (ErrorCode e = device.checkBlockType(value, FS_BITMAP_BLOCK); e != ERROR_OK) return e; } +if (ErrorCode e = device.checkBlockType(value, FS_BITMAP_BLOCK); e != VAERROR_OK) return e; } #define EXPECT_OPTIONAL_BITMAP_REF { \ if (value) { EXPECT_BITMAP_REF } } #define EXPECT_BITMAP_EXT_REF { \ -if (ErrorCode e = device.checkBlockType(value, FS_BITMAP_EXT_BLOCK); e != ERROR_OK) return e; } +if (ErrorCode e = device.checkBlockType(value, FS_BITMAP_EXT_BLOCK); e != VAERROR_OK) return e; } #define EXPECT_OPTIONAL_BITMAP_EXT_REF { \ if (value) { EXPECT_BITMAP_EXT_REF } } #define EXPECT_DATABLOCK_REF { \ -if (ErrorCode e = device.checkBlockType(value, FS_DATA_BLOCK_OFS, FS_DATA_BLOCK_FFS); e != ERROR_OK) return e; } +if (ErrorCode e = device.checkBlockType(value, FS_DATA_BLOCK_OFS, FS_DATA_BLOCK_FFS); e != VAERROR_OK) return e; } #define EXPECT_OPTIONAL_DATABLOCK_REF { \ if (value) { EXPECT_DATABLOCK_REF } } #define EXPECT_DATABLOCK_NUMBER { \ -if (value == 0) return ERROR_FS_EXPECTED_DATABLOCK_NR; } +if (value == 0) return VAERROR_FS_EXPECTED_DATABLOCK_NR; } #define EXPECT_HASHTABLE_SIZE { \ -if (value != 72) return ERROR_FS_INVALID_HASHTABLE_SIZE; } +if (value != 72) return VAERROR_FS_INVALID_HASHTABLE_SIZE; } } diff --git a/Emulator/FileSystems/FSDescriptors.cpp b/Emulator/FileSystems/FSDescriptors.cpp index ba1475831..43dec2086 100644 --- a/Emulator/FileSystems/FSDescriptors.cpp +++ b/Emulator/FileSystems/FSDescriptors.cpp @@ -100,13 +100,13 @@ void FileSystemDescriptor::checkCompatibility() const { if (numBytes() > MB(504) || FORCE_FS_WRONG_CAPACITY) { - throw Error(ERROR_FS_WRONG_CAPACITY); + throw Error(VAERROR_FS_WRONG_CAPACITY); } if (bsize != 512 || FORCE_FS_WRONG_BSIZE) { - throw Error(ERROR_FS_WRONG_BSIZE); + throw Error(VAERROR_FS_WRONG_BSIZE); } if (!FSVolumeTypeEnum::isValid(dos) || FORCE_FS_WRONG_DOS_TYPE) { - throw Error(ERROR_FS_WRONG_DOS_TYPE); + throw Error(VAERROR_FS_WRONG_DOS_TYPE); } } diff --git a/Emulator/FileSystems/FileSystem.cpp b/Emulator/FileSystems/FileSystem.cpp index 9cc6e59db..cddba75b7 100644 --- a/Emulator/FileSystems/FileSystem.cpp +++ b/Emulator/FileSystems/FileSystem.cpp @@ -33,7 +33,7 @@ FileSystem::init(const MediaFile &file, isize part) throws case FILETYPE_HDF: init(dynamic_cast(file), part); break; default: - throw Error(ERROR_FILE_TYPE_UNSUPPORTED); + throw Error(VAERROR_FILE_TYPE_UNSUPPORTED); } } @@ -89,7 +89,7 @@ FileSystem::init(FileSystemDescriptor layout, u8 *buf, isize len) layout.checkCompatibility(); // Only proceed if the volume is formatted - if (layout.dos == FS_NODOS) throw Error(ERROR_FS_UNFORMATTED); + if (layout.dos == FS_NODOS) throw Error(VAERROR_FS_UNFORMATTED); // Copy layout parameters dos = layout.dos; @@ -605,7 +605,7 @@ FileSystem::collectRefsWithSameHashValue(Block nr, for (FSBlock *b = hashableBlockPtr(nr); b; b = b->getNextHashBlock()) { // Only proceed if we haven't seen this block yet - if (visited.find(b->nr) != visited.end()) throw Error(ERROR_FS_HAS_CYCLES); + if (visited.find(b->nr) != visited.end()) throw Error(VAERROR_FS_HAS_CYCLES); visited.insert(b->nr); refs.push(b->nr); @@ -729,21 +729,21 @@ FileSystem::checkBlockType(Block nr, FSBlockType type, FSBlockType altType) cons switch (t) { - case FS_EMPTY_BLOCK: return ERROR_FS_PTR_TO_EMPTY_BLOCK; - case FS_BOOT_BLOCK: return ERROR_FS_PTR_TO_BOOT_BLOCK; - case FS_ROOT_BLOCK: return ERROR_FS_PTR_TO_ROOT_BLOCK; - case FS_BITMAP_BLOCK: return ERROR_FS_PTR_TO_BITMAP_BLOCK; - case FS_BITMAP_EXT_BLOCK: return ERROR_FS_PTR_TO_BITMAP_EXT_BLOCK; - case FS_USERDIR_BLOCK: return ERROR_FS_PTR_TO_USERDIR_BLOCK; - case FS_FILEHEADER_BLOCK: return ERROR_FS_PTR_TO_FILEHEADER_BLOCK; - case FS_FILELIST_BLOCK: return ERROR_FS_PTR_TO_FILELIST_BLOCK; - case FS_DATA_BLOCK_OFS: return ERROR_FS_PTR_TO_DATA_BLOCK; - case FS_DATA_BLOCK_FFS: return ERROR_FS_PTR_TO_DATA_BLOCK; - default: return ERROR_FS_PTR_TO_UNKNOWN_BLOCK; + case FS_EMPTY_BLOCK: return VAERROR_FS_PTR_TO_EMPTY_BLOCK; + case FS_BOOT_BLOCK: return VAERROR_FS_PTR_TO_BOOT_BLOCK; + case FS_ROOT_BLOCK: return VAERROR_FS_PTR_TO_ROOT_BLOCK; + case FS_BITMAP_BLOCK: return VAERROR_FS_PTR_TO_BITMAP_BLOCK; + case FS_BITMAP_EXT_BLOCK: return VAERROR_FS_PTR_TO_BITMAP_EXT_BLOCK; + case FS_USERDIR_BLOCK: return VAERROR_FS_PTR_TO_USERDIR_BLOCK; + case FS_FILEHEADER_BLOCK: return VAERROR_FS_PTR_TO_FILEHEADER_BLOCK; + case FS_FILELIST_BLOCK: return VAERROR_FS_PTR_TO_FILELIST_BLOCK; + case FS_DATA_BLOCK_OFS: return VAERROR_FS_PTR_TO_DATA_BLOCK; + case FS_DATA_BLOCK_FFS: return VAERROR_FS_PTR_TO_DATA_BLOCK; + default: return VAERROR_FS_PTR_TO_UNKNOWN_BLOCK; } } - return ERROR_OK; + return VAERROR_OK; } isize diff --git a/Emulator/FileSystems/MutableFileSystem.cpp b/Emulator/FileSystems/MutableFileSystem.cpp index da46571ad..d0cf5d207 100644 --- a/Emulator/FileSystems/MutableFileSystem.cpp +++ b/Emulator/FileSystems/MutableFileSystem.cpp @@ -525,13 +525,13 @@ MutableFileSystem::importVolume(const u8 *src, isize size) debug(FS_DEBUG, "Importing file system...\n"); // Only proceed if the (predicted) block size matches - if (size % bsize != 0) throw Error(ERROR_FS_WRONG_BSIZE); + if (size % bsize != 0) throw Error(VAERROR_FS_WRONG_BSIZE); // Only proceed if the source buffer contains the right amount of data - if (numBytes() != size) throw Error(ERROR_FS_WRONG_CAPACITY); + if (numBytes() != size) throw Error(VAERROR_FS_WRONG_CAPACITY); // Only proceed if all partitions contain a valid file system - if (dos == FS_NODOS) throw Error(ERROR_FS_UNSUPPORTED); + if (dos == FS_NODOS) throw Error(VAERROR_FS_UNSUPPORTED); // Import all blocks for (isize i = 0; i < numBlocks(); i++) { @@ -567,7 +567,7 @@ MutableFileSystem::importDirectory(const std::filesystem::path &path, bool recur fs::directory_entry dir; try { dir = fs::directory_entry(path); } - catch (...) { throw Error(ERROR_FILE_CANT_READ); } + catch (...) { throw Error(VAERROR_FILE_CANT_READ); } importDirectory(dir, recursive); } @@ -634,7 +634,7 @@ MutableFileSystem::exportBlocks(Block first, Block last, u8 *dst, isize size) co ErrorCode error; bool result = exportBlocks(first, last, dst, size, &error); - assert(result == (error == ERROR_OK)); + assert(result == (error == VAERROR_OK)); return result; } @@ -651,13 +651,13 @@ MutableFileSystem::exportBlocks(Block first, Block last, u8 *dst, isize size, Er // Only proceed if the (predicted) block size matches if (size % bsize != 0) { - if (err) *err = ERROR_FS_WRONG_BSIZE; + if (err) *err = VAERROR_FS_WRONG_BSIZE; return false; } // Only proceed if the source buffer contains the right amount of data if (count * bsize != size) { - if (err) *err = ERROR_FS_WRONG_CAPACITY; + if (err) *err = VAERROR_FS_WRONG_CAPACITY; return false; } @@ -672,7 +672,7 @@ MutableFileSystem::exportBlocks(Block first, Block last, u8 *dst, isize size, Er debug(FS_DEBUG, "Success\n"); - if (err) *err = ERROR_OK; + if (err) *err = VAERROR_OK; return true; } @@ -681,17 +681,17 @@ MutableFileSystem::exportDirectory(const std::filesystem::path &path, bool creat { // Try to create the directory if it doesn't exist if (!util::isDirectory(path) && createDir && !util::createDirectory(path)) { - throw Error(ERROR_FS_CANNOT_CREATE_DIR); + throw Error(VAERROR_FS_CANNOT_CREATE_DIR); } // Only proceed if the directory exists if (!util::isDirectory(path)) { - throw Error(ERROR_DIR_NOT_FOUND); + throw Error(VAERROR_DIR_NOT_FOUND); } // Only proceed if path points to an empty directory if (util::numDirectoryItems(path) != 0) { - throw Error(ERROR_FS_DIR_NOT_EMPTY); + throw Error(VAERROR_FS_DIR_NOT_EMPTY); } // Collect all files and directories @@ -701,7 +701,7 @@ MutableFileSystem::exportDirectory(const std::filesystem::path &path, bool creat // Export all items for (auto const& i : items) { - if (ErrorCode error = blockPtr(i)->exportBlock(path.c_str()); error != ERROR_OK) { + if (ErrorCode error = blockPtr(i)->exportBlock(path.c_str()); error != VAERROR_OK) { throw Error(error); } } diff --git a/Emulator/Media/AmigaFile.cpp b/Emulator/Media/AmigaFile.cpp index b83ef28b6..72392bda8 100644 --- a/Emulator/Media/AmigaFile.cpp +++ b/Emulator/Media/AmigaFile.cpp @@ -40,14 +40,14 @@ void AmigaFile::init(const std::filesystem::path &path) { std::ifstream stream(path, std::ifstream::binary); - if (!stream.is_open()) throw Error(ERROR_FILE_NOT_FOUND, path); + if (!stream.is_open()) throw Error(VAERROR_FILE_NOT_FOUND, path); init(path, stream); } void AmigaFile::init(const std::filesystem::path &path, std::istream &stream) { - if (!isCompatiblePath(path)) throw Error(ERROR_FILE_TYPE_MISMATCH); + if (!isCompatiblePath(path)) throw Error(VAERROR_FILE_TYPE_MISMATCH); init(stream); this->path = path; } @@ -55,7 +55,7 @@ AmigaFile::init(const std::filesystem::path &path, std::istream &stream) void AmigaFile::init(std::istream &stream) { - if (!isCompatibleStream(stream)) throw Error(ERROR_FILE_TYPE_MISMATCH); + if (!isCompatibleStream(stream)) throw Error(VAERROR_FILE_TYPE_MISMATCH); readFromStream(stream); } @@ -120,7 +120,7 @@ AmigaFile::readFromFile(const std::filesystem::path &path) std::ifstream stream(path, std::ifstream::binary); if (!stream.is_open()) { - throw Error(ERROR_FILE_CANT_READ, path); + throw Error(VAERROR_FILE_CANT_READ, path); } this->path = path; @@ -168,13 +168,13 @@ isize AmigaFile::writeToFile(const std::filesystem::path &path, isize offset, isize len) { if (util::isDirectory(path)) { - throw Error(ERROR_FILE_IS_DIRECTORY); + throw Error(VAERROR_FILE_IS_DIRECTORY); } std::ofstream stream(path, std::ofstream::binary); if (!stream.is_open()) { - throw Error(ERROR_FILE_CANT_WRITE, path); + throw Error(VAERROR_FILE_CANT_WRITE, path); } isize result = writeToStream(stream, offset, len); @@ -218,7 +218,7 @@ AmigaFile::writeToFile(const std::filesystem::path &path) isize AmigaFile::writePartitionToFile(const std::filesystem::path &path, isize partition) { - throw Error(ERROR_FILE_TYPE_UNSUPPORTED); + throw Error(VAERROR_FILE_TYPE_UNSUPPORTED); } isize diff --git a/Emulator/Media/DiskFiles/ADFFile.cpp b/Emulator/Media/DiskFiles/ADFFile.cpp index 4a7a4403f..4bcf8004b 100644 --- a/Emulator/Media/DiskFiles/ADFFile.cpp +++ b/Emulator/Media/DiskFiles/ADFFile.cpp @@ -48,12 +48,12 @@ ADFFile::fileSize(Diameter diameter, Density density) assert_enum(Diameter, diameter); assert_enum(Density, density); - if (diameter != INCH_35) throw Error(ERROR_DISK_INVALID_DIAMETER); + if (diameter != INCH_35) throw Error(VAERROR_DISK_INVALID_DIAMETER); if (density == DENSITY_DD) return ADFSIZE_35_DD; if (density == DENSITY_HD) return ADFSIZE_35_HD; - throw Error(ERROR_DISK_INVALID_DENSITY); + throw Error(VAERROR_DISK_INVALID_DENSITY); } void @@ -68,7 +68,7 @@ ADFFile::init(Diameter diameter, Density density) void ADFFile::init(const FloppyDiskDescriptor &descr) { - if (descr.diameter != INCH_35) throw Error(ERROR_DISK_INVALID_DIAMETER); + if (descr.diameter != INCH_35) throw Error(VAERROR_DISK_INVALID_DIAMETER); switch (descr.density) { @@ -83,7 +83,7 @@ ADFFile::init(const FloppyDiskDescriptor &descr) case 84: init(ADFSIZE_35_DD_84); break; default: - throw Error(ERROR_DISK_INVALID_LAYOUT); + throw Error(VAERROR_DISK_INVALID_LAYOUT); } break; @@ -93,7 +93,7 @@ ADFFile::init(const FloppyDiskDescriptor &descr) break; default: - throw Error(ERROR_DISK_INVALID_DENSITY); + throw Error(VAERROR_DISK_INVALID_DENSITY); } } @@ -111,7 +111,7 @@ ADFFile::init(FloppyDisk &disk) void ADFFile::init(FloppyDrive &drive) { - if (drive.disk == nullptr) throw Error(ERROR_DISK_MISSING); + if (drive.disk == nullptr) throw Error(VAERROR_DISK_MISSING); init(*drive.disk); } @@ -129,7 +129,7 @@ ADFFile::init(MutableFileSystem &volume) break; default: - throw Error(ERROR_FS_WRONG_CAPACITY); + throw Error(VAERROR_FS_WRONG_CAPACITY); } volume.exportVolume(data.ptr, data.size); @@ -296,17 +296,17 @@ ADFFile::formatDisk(FSVolumeType fs, BootBlockId id, string name) volume.makeBootable(id); // Export the file system to the ADF - if (!volume.exportVolume(data.ptr, data.size)) throw Error(ERROR_FS_UNKNOWN); + if (!volume.exportVolume(data.ptr, data.size)) throw Error(VAERROR_FS_UNKNOWN); } void ADFFile::encodeDisk(FloppyDisk &disk) const { if (disk.getDiameter() != getDiameter()) { - throw Error(ERROR_DISK_INVALID_DIAMETER); + throw Error(VAERROR_DISK_INVALID_DIAMETER); } if (disk.getDensity() != getDensity()) { - throw Error(ERROR_DISK_INVALID_DENSITY); + throw Error(VAERROR_DISK_INVALID_DENSITY); } isize tracks = numTracks(); @@ -445,10 +445,10 @@ ADFFile::decodeDisk(FloppyDisk &disk) debug(ADF_DEBUG, "Decoding Amiga disk with %ld tracks\n", tracks); if (disk.getDiameter() != getDiameter()) { - throw Error(ERROR_DISK_INVALID_DIAMETER); + throw Error(VAERROR_DISK_INVALID_DIAMETER); } if (disk.getDensity() != getDensity()) { - throw Error(ERROR_DISK_INVALID_DENSITY); + throw Error(VAERROR_DISK_INVALID_DENSITY); } // Make the MFM stream scannable beyond the track end @@ -491,7 +491,7 @@ ADFFile::decodeTrack(FloppyDisk &disk, Track t) if (nr != sectors) { warn("Found %ld sectors, expected %ld. Aborting.\n", nr, sectors); - throw Error(ERROR_DISK_WRONG_SECTOR_COUNT); + throw Error(VAERROR_DISK_WRONG_SECTOR_COUNT); } // Decode all sectors @@ -514,7 +514,7 @@ ADFFile::decodeSector(u8 *dst, u8 *src) u8 sector = info[2]; if (sector >= numSectors()) { warn("Invalid sector number %d. Aborting.\n", sector); - throw Error(ERROR_DISK_INVALID_SECTOR_NUMBER); + throw Error(VAERROR_DISK_INVALID_SECTOR_NUMBER); } // Skip sector header diff --git a/Emulator/Media/DiskFiles/DMSFile.cpp b/Emulator/Media/DiskFiles/DMSFile.cpp index 66768a928..d47f8c6a7 100644 --- a/Emulator/Media/DiskFiles/DMSFile.cpp +++ b/Emulator/Media/DiskFiles/DMSFile.cpp @@ -45,7 +45,7 @@ DMSFile::finalizeRead() } if (adfData) free(adfData); - if (!adf) throw Error(ERROR_DMS_CANT_CREATE); + if (!adf) throw Error(VAERROR_DMS_CANT_CREATE); } } diff --git a/Emulator/Media/DiskFiles/EADFFile.cpp b/Emulator/Media/DiskFiles/EADFFile.cpp index c63f04a1d..8ade41297 100644 --- a/Emulator/Media/DiskFiles/EADFFile.cpp +++ b/Emulator/Media/DiskFiles/EADFFile.cpp @@ -59,7 +59,7 @@ EADFFile::init(FloppyDisk &disk) void EADFFile::init(FloppyDrive &drive) { - if (drive.disk == nullptr) throw Error(ERROR_DISK_MISSING); + if (drive.disk == nullptr) throw Error(VAERROR_DISK_MISSING); init(*drive.disk); } @@ -89,19 +89,19 @@ EADFFile::finalizeRead() if (std::strcmp((char *)data.ptr, "UAE-1ADF") != 0) { warn("Only UAE-1ADF files are supported\n"); - throw Error(ERROR_EXT_FACTOR5); + throw Error(VAERROR_EXT_FACTOR5); } if (numTracks < 160 || numTracks > 168) { warn("Invalid number of tracks\n"); - throw Error(ERROR_EXT_CORRUPTED); + throw Error(VAERROR_EXT_CORRUPTED); } if (data.size < proposedHeaderSize() || data.size != proposedFileSize()) { warn("File size mismatch\n"); - throw Error(ERROR_EXT_CORRUPTED); + throw Error(VAERROR_EXT_CORRUPTED); } for (isize i = 0; i < numTracks; i++) { @@ -109,7 +109,7 @@ EADFFile::finalizeRead() if (typeOfTrack(i) != 0 && typeOfTrack(i) != 1) { warn("Unsupported track format\n"); - throw Error(ERROR_EXT_INCOMPATIBLE); + throw Error(VAERROR_EXT_INCOMPATIBLE); } if (typeOfTrack(i) == 0) { @@ -117,20 +117,20 @@ EADFFile::finalizeRead() if (usedBitsForTrack(i) != 11 * 512 * 8) { warn("Unsupported standard track size\n"); - throw Error(ERROR_EXT_CORRUPTED); + throw Error(VAERROR_EXT_CORRUPTED); } } if (usedBitsForTrack(i) > availableBytesForTrack(i) * 8) { warn("Corrupted length information\n"); - throw Error(ERROR_EXT_CORRUPTED); + throw Error(VAERROR_EXT_CORRUPTED); } if (usedBitsForTrack(i) % 8) { warn("Track length is not a multiple of 8\n"); - throw Error(ERROR_EXT_INCOMPATIBLE); + throw Error(VAERROR_EXT_INCOMPATIBLE); } } diff --git a/Emulator/Media/DiskFiles/EXEFile.cpp b/Emulator/Media/DiskFiles/EXEFile.cpp index ca9ea59d4..e72fa6f8f 100644 --- a/Emulator/Media/DiskFiles/EXEFile.cpp +++ b/Emulator/Media/DiskFiles/EXEFile.cpp @@ -49,7 +49,7 @@ EXEFile::finalizeRead() // Add the executable FSBlock *file = volume.createFile("file", data.ptr, data.size); - if (!file) throw Error(ERROR_FS_OUT_OF_SPACE); + if (!file) throw Error(VAERROR_FS_OUT_OF_SPACE); // Add a script directory volume.createDir("s"); @@ -57,7 +57,7 @@ EXEFile::finalizeRead() // Add a startup sequence file = volume.createFile("startup-sequence", "file"); - if (!file) throw Error(ERROR_FS_OUT_OF_SPACE); + if (!file) throw Error(VAERROR_FS_OUT_OF_SPACE); // Finalize volume.updateChecksums(); diff --git a/Emulator/Media/DiskFiles/FloppyFile.cpp b/Emulator/Media/DiskFiles/FloppyFile.cpp index 8a26e8a8a..b9761f36c 100644 --- a/Emulator/Media/DiskFiles/FloppyFile.cpp +++ b/Emulator/Media/DiskFiles/FloppyFile.cpp @@ -22,7 +22,7 @@ FloppyFile * FloppyFile::make(const std::filesystem::path &path) { std::ifstream stream(path, std::ifstream::binary); - if (!stream.is_open()) throw Error(ERROR_FILE_NOT_FOUND, path); + if (!stream.is_open()) throw Error(VAERROR_FILE_NOT_FOUND, path); switch (type(path)) { @@ -35,7 +35,7 @@ FloppyFile::make(const std::filesystem::path &path) default: break; } - throw Error(ERROR_FILE_TYPE_MISMATCH); + throw Error(VAERROR_FILE_TYPE_MISMATCH); } FloppyDiskDescriptor diff --git a/Emulator/Media/DiskFiles/Folder.cpp b/Emulator/Media/DiskFiles/Folder.cpp index fa7cdeab4..94b378474 100644 --- a/Emulator/Media/DiskFiles/Folder.cpp +++ b/Emulator/Media/DiskFiles/Folder.cpp @@ -26,7 +26,7 @@ Folder::init(const std::filesystem::path &path) debug(FS_DEBUG, "make(%s)\n", path.string().c_str()); // Only proceed if the provided filename points to a directory - if (!isCompatiblePath(path)) throw Error(ERROR_FILE_TYPE_MISMATCH); + if (!isCompatiblePath(path)) throw Error(VAERROR_FILE_TYPE_MISMATCH); // Create a file system and import the directory MutableFileSystem volume(FS_OFS, path.c_str()); diff --git a/Emulator/Media/DiskFiles/HDFFile.cpp b/Emulator/Media/DiskFiles/HDFFile.cpp index 8e4120b52..306579015 100644 --- a/Emulator/Media/DiskFiles/HDFFile.cpp +++ b/Emulator/Media/DiskFiles/HDFFile.cpp @@ -53,7 +53,7 @@ void HDFFile::init(const std::filesystem::path &path) { // Check size - if (isOversized(util::getSizeOfFile(path))) throw Error(ERROR_HDR_TOO_LARGE); + if (isOversized(util::getSizeOfFile(path))) throw Error(VAERROR_HDR_TOO_LARGE); AmigaFile::init(path); } @@ -62,7 +62,7 @@ void HDFFile::init(const u8 *buf, isize len) { // Check size - if (isOversized(len)) throw Error(ERROR_HDR_TOO_LARGE); + if (isOversized(len)) throw Error(VAERROR_HDR_TOO_LARGE); AmigaFile::init(buf, len); } @@ -197,10 +197,10 @@ HDFFile::getDriverDescriptor(isize driver) const auto lsegBlock = seekBlock(lsegRef); if (!lsegBlock || strcmp((const char *)lsegBlock, "LSEG")) { - throw Error(ERROR_HDR_CORRUPTED_LSEG); + throw Error(VAERROR_HDR_CORRUPTED_LSEG); } if (i >= 1024) { - throw Error(ERROR_HDR_CORRUPTED_LSEG); + throw Error(VAERROR_HDR_CORRUPTED_LSEG); } result.blocks.push_back(lsegRef); diff --git a/Emulator/Media/DiskFiles/IMGFile.cpp b/Emulator/Media/DiskFiles/IMGFile.cpp index f64f18d52..de81d070c 100644 --- a/Emulator/Media/DiskFiles/IMGFile.cpp +++ b/Emulator/Media/DiskFiles/IMGFile.cpp @@ -41,7 +41,7 @@ IMGFile::init(Diameter dia, Density den) } else { - throw Error(ERROR_DISK_INVALID_LAYOUT); + throw Error(VAERROR_DISK_INVALID_LAYOUT); } } @@ -55,7 +55,7 @@ IMGFile::init(FloppyDisk &disk) void IMGFile::init(FloppyDrive &drive) { - if (drive.disk == nullptr) throw Error(ERROR_DISK_MISSING); + if (drive.disk == nullptr) throw Error(VAERROR_DISK_MISSING); init(*drive.disk); } @@ -81,10 +81,10 @@ void IMGFile::encodeDisk(FloppyDisk &disk) const { if (disk.getDiameter() != getDiameter()) { - throw Error(ERROR_DISK_INVALID_DIAMETER); + throw Error(VAERROR_DISK_INVALID_DIAMETER); } if (disk.getDensity() != getDensity()) { - throw Error(ERROR_DISK_INVALID_DENSITY); + throw Error(VAERROR_DISK_INVALID_DENSITY); } isize tracks = numTracks(); @@ -207,10 +207,10 @@ IMGFile::decodeDisk(FloppyDisk &disk) debug(IMG_DEBUG, "Decoding DOS disk (%ld tracks)\n", tracks); if (disk.getDiameter() != getDiameter()) { - throw Error(ERROR_DISK_INVALID_DIAMETER); + throw Error(VAERROR_DISK_INVALID_DIAMETER); } if (disk.getDensity() != getDensity()) { - throw Error(ERROR_DISK_INVALID_DENSITY); + throw Error(VAERROR_DISK_INVALID_DENSITY); } // Make the MFM stream scannable beyond the track end @@ -264,12 +264,12 @@ IMGFile::decodeTrack(FloppyDisk &disk, Track t) cnt++; } else { - throw Error(ERROR_DISK_INVALID_SECTOR_NUMBER); + throw Error(VAERROR_DISK_INVALID_SECTOR_NUMBER); } } if (cnt != numSectors) { - throw Error(ERROR_DISK_WRONG_SECTOR_COUNT); + throw Error(VAERROR_DISK_WRONG_SECTOR_COUNT); } // Do some consistency checking diff --git a/Emulator/Media/DiskFiles/STFile.cpp b/Emulator/Media/DiskFiles/STFile.cpp index 56fb2c6a4..351adc372 100644 --- a/Emulator/Media/DiskFiles/STFile.cpp +++ b/Emulator/Media/DiskFiles/STFile.cpp @@ -41,7 +41,7 @@ STFile::init(Diameter dia, Density den) } else { - throw Error(ERROR_DISK_INVALID_LAYOUT); + throw Error(VAERROR_DISK_INVALID_LAYOUT); } } @@ -74,10 +74,10 @@ void STFile::encodeDisk(FloppyDisk &disk) const { if (disk.getDiameter() != getDiameter()) { - throw Error(ERROR_DISK_INVALID_DIAMETER); + throw Error(VAERROR_DISK_INVALID_DIAMETER); } if (disk.getDensity() != getDensity()) { - throw Error(ERROR_DISK_INVALID_DENSITY); + throw Error(VAERROR_DISK_INVALID_DENSITY); } isize tracks = numTracks(); @@ -203,10 +203,10 @@ STFile::decodeDisk(FloppyDisk &disk) debug(IMG_DEBUG, "Decoding DOS disk (%ld tracks)\n", tracks); if (disk.getDiameter() != getDiameter()) { - throw Error(ERROR_DISK_INVALID_DIAMETER); + throw Error(VAERROR_DISK_INVALID_DIAMETER); } if (disk.getDensity() != getDensity()) { - throw Error(ERROR_DISK_INVALID_DENSITY); + throw Error(VAERROR_DISK_INVALID_DENSITY); } // Make the MFM stream scannable beyond the track end @@ -260,12 +260,12 @@ STFile::decodeTrack(FloppyDisk &disk, Track t) cnt++; } else { - throw Error(ERROR_DISK_INVALID_SECTOR_NUMBER); + throw Error(VAERROR_DISK_INVALID_SECTOR_NUMBER); } } if (cnt != numSectors) { - throw Error(ERROR_DISK_WRONG_SECTOR_COUNT); + throw Error(VAERROR_DISK_WRONG_SECTOR_COUNT); } // Do some consistency checking diff --git a/Emulator/Media/MediaFile.cpp b/Emulator/Media/MediaFile.cpp index 018b02c6e..a1ce71b59 100644 --- a/Emulator/Media/MediaFile.cpp +++ b/Emulator/Media/MediaFile.cpp @@ -184,7 +184,7 @@ MediaFile::getDiskInfo() const } catch (...) { - throw Error(ERROR_FILE_TYPE_MISMATCH); + throw Error(VAERROR_FILE_TYPE_MISMATCH); } } @@ -208,7 +208,7 @@ MediaFile::getFloppyDiskInfo() const } catch (...) { - throw Error(ERROR_FILE_TYPE_MISMATCH); + throw Error(VAERROR_FILE_TYPE_MISMATCH); } } @@ -229,7 +229,7 @@ MediaFile::getHDFInfo() const } catch (...) { - throw Error(ERROR_FILE_TYPE_MISMATCH); + throw Error(VAERROR_FILE_TYPE_MISMATCH); } } diff --git a/Emulator/Media/RomFiles/RomFile.cpp b/Emulator/Media/RomFiles/RomFile.cpp index 52386d66d..69617af48 100644 --- a/Emulator/Media/RomFiles/RomFile.cpp +++ b/Emulator/Media/RomFiles/RomFile.cpp @@ -152,7 +152,7 @@ RomFile::decrypt() // Load the rom.key file romKey.init(romKeyPath); - if (romKey.empty()) throw Error(ERROR_MISSING_ROM_KEY); + if (romKey.empty()) throw Error(VAERROR_MISSING_ROM_KEY); // Decrypt decrypted.alloc(data.size - headerSize); @@ -165,7 +165,7 @@ RomFile::decrypt() // Check if we've got a valid ROM if (!isRomBuffer(data.ptr, data.size)) { - throw Error(ERROR_INVALID_ROM_KEY); + throw Error(VAERROR_INVALID_ROM_KEY); } } diff --git a/Emulator/Media/Snapshot.cpp b/Emulator/Media/Snapshot.cpp index f86b092a3..d8d05b35f 100644 --- a/Emulator/Media/Snapshot.cpp +++ b/Emulator/Media/Snapshot.cpp @@ -80,13 +80,13 @@ Snapshot::Snapshot(Amiga &amiga) : Snapshot(amiga.size()) void Snapshot::finalizeRead() { - if (FORCE_SNAP_TOO_OLD) throw Error(ERROR_SNAP_TOO_OLD); - if (FORCE_SNAP_TOO_NEW) throw Error(ERROR_SNAP_TOO_NEW); - if (FORCE_SNAP_IS_BETA) throw Error(ERROR_SNAP_IS_BETA); + if (FORCE_SNAP_TOO_OLD) throw Error(VAERROR_SNAP_TOO_OLD); + if (FORCE_SNAP_TOO_NEW) throw Error(VAERROR_SNAP_TOO_NEW); + if (FORCE_SNAP_IS_BETA) throw Error(VAERROR_SNAP_IS_BETA); - if (isTooOld()) throw Error(ERROR_SNAP_TOO_OLD); - if (isTooNew()) throw Error(ERROR_SNAP_TOO_NEW); - if (isBeta() && !betaRelease) throw Error(ERROR_SNAP_IS_BETA); + if (isTooOld()) throw Error(VAERROR_SNAP_TOO_OLD); + if (isTooNew()) throw Error(VAERROR_SNAP_TOO_NEW); + if (isBeta() && !betaRelease) throw Error(VAERROR_SNAP_IS_BETA); } std::pair diff --git a/Emulator/Misc/OSDebugger/OSDebugger.cpp b/Emulator/Misc/OSDebugger/OSDebugger.cpp index fbca26492..4fe430c8c 100644 --- a/Emulator/Misc/OSDebugger/OSDebugger.cpp +++ b/Emulator/Misc/OSDebugger/OSDebugger.cpp @@ -432,12 +432,12 @@ OSDebugger::checkExecBase(const os::ExecBase &execBase) const { // Check if the struct resides at an even location in RAM if (!(IS_EVEN(execBase.addr) && mem.inRam(execBase.addr))) { - throw Error(ERROR_OSDB, "ExecBase: Invalid address"); + throw Error(VAERROR_OSDB, "ExecBase: Invalid address"); } // Check if ChkBase is the bitwise complement of SysBase if (!(execBase.ChkBase == ~execBase.addr)) { - throw Error(ERROR_OSDB, "ExecBase: Invalid ChkSum"); + throw Error(VAERROR_OSDB, "ExecBase: Invalid ChkSum"); } // Check if words in the range [0x22 ; 0x52] sum up to 0xFFFF @@ -446,15 +446,15 @@ OSDebugger::checkExecBase(const os::ExecBase &execBase) const checksum += mem.spypeek16 (execBase.addr + offset); } if (!(checksum == 0xFFFF)) { - throw Error(ERROR_OSDB, "ExecBase: Checksum mismatch"); + throw Error(VAERROR_OSDB, "ExecBase: Checksum mismatch"); } // Check if MaxLocMem complies to the bank map if (execBase.MaxLocMem & 0xFF000000) { - throw Error(ERROR_OSDB, "ExecBase: MaxLocMem is too large"); + throw Error(VAERROR_OSDB, "ExecBase: MaxLocMem is too large"); } if (execBase.MaxLocMem & 0x3FFFF) { - throw Error(ERROR_OSDB, "ExecBase: MaxLocMem is not aligned"); + throw Error(VAERROR_OSDB, "ExecBase: MaxLocMem is not aligned"); } if (auto bank = execBase.MaxLocMem >> 16) { @@ -462,16 +462,16 @@ OSDebugger::checkExecBase(const os::ExecBase &execBase) const auto src2 =mem.cpuMemSrc[bank]; if (!(src1 == MEM_CHIP && src2 != MEM_CHIP)) { - throw Error(ERROR_OSDB, "ExecBase: MaxLocMem doesn't match bank map"); + throw Error(VAERROR_OSDB, "ExecBase: MaxLocMem doesn't match bank map"); } } // Check if MaxExtMem complies to the bank map if (execBase.MaxExtMem & 0xFF000000) { - throw Error(ERROR_OSDB, "ExecBase: MaxExtMem is too large"); + throw Error(VAERROR_OSDB, "ExecBase: MaxExtMem is too large"); } if (execBase.MaxExtMem & 0x3FFFF) { - throw Error(ERROR_OSDB, "ExecBase: MaxExtMem is not aligned"); + throw Error(VAERROR_OSDB, "ExecBase: MaxExtMem is not aligned"); } if (auto bank = execBase.MaxExtMem >> 16) { @@ -479,7 +479,7 @@ OSDebugger::checkExecBase(const os::ExecBase &execBase) const auto src2 =mem.cpuMemSrc[bank]; if (!(src1 == MEM_SLOW && src2 != MEM_SLOW)) { - throw Error(ERROR_OSDB, "ExecBase: MaxExtMem doesn't match bank map"); + throw Error(VAERROR_OSDB, "ExecBase: MaxExtMem doesn't match bank map"); } } } diff --git a/Emulator/Misc/OSDebugger/OSDescriptors.cpp b/Emulator/Misc/OSDebugger/OSDescriptors.cpp index 0f7e62206..c053a2a93 100644 --- a/Emulator/Misc/OSDebugger/OSDescriptors.cpp +++ b/Emulator/Misc/OSDebugger/OSDescriptors.cpp @@ -118,7 +118,7 @@ ProgramUnitDescriptor::init(const u8 *buf, isize len) auto read = [&]() { - if (offset + 4 > len) throw Error(ERROR_HUNK_CORRUPTED); + if (offset + 4 > len) throw Error(VAERROR_HUNK_CORRUPTED); auto result = R32BE(buf + offset); offset += 4; return result; @@ -127,7 +127,7 @@ ProgramUnitDescriptor::init(const u8 *buf, isize len) auto cookie = read(); // Check magic cookie - if (cookie != HUNK_HEADER) throw Error(ERROR_HUNK_BAD_COOKIE); + if (cookie != HUNK_HEADER) throw Error(VAERROR_HUNK_BAD_COOKIE); // Skip strings for (auto count = read(); count != 0; count = read()) { @@ -137,11 +137,11 @@ ProgramUnitDescriptor::init(const u8 *buf, isize len) // Read block count and range auto numHunks = isize(read()); - if (numHunks == 0) throw Error(ERROR_HUNK_NO_SECTIONS); + if (numHunks == 0) throw Error(VAERROR_HUNK_NO_SECTIONS); auto first = isize(read()); - if (first != 0) throw Error(ERROR_HUNK_BAD_HEADER); + if (first != 0) throw Error(VAERROR_HUNK_BAD_HEADER); auto last = isize(read()); - if (last != numHunks - 1) throw Error(ERROR_HUNK_BAD_HEADER); + if (last != numHunks - 1) throw Error(VAERROR_HUNK_BAD_HEADER); // Read hunk sizes for (isize i = 0; i < numHunks; i++) { @@ -194,7 +194,7 @@ ProgramUnitDescriptor::init(const u8 *buf, isize len) if (count > KB(64)) { warn("Relocation section too large (%d)\n", count); - throw Error(ERROR_HUNK_CORRUPTED); + throw Error(VAERROR_HUNK_CORRUPTED); } section.size += 4 * count; @@ -231,7 +231,7 @@ ProgramUnitDescriptor::init(const u8 *buf, isize len) case HUNK_HEADER: // There cannot be a second header section - throw Error(ERROR_HUNK_CORRUPTED); + throw Error(VAERROR_HUNK_CORRUPTED); break; case HUNK_OVERLAY: @@ -248,7 +248,7 @@ ProgramUnitDescriptor::init(const u8 *buf, isize len) default: - throw Error(ERROR_HUNK_UNSUPPORTED, HunkTypeEnum::key(type)); + throw Error(VAERROR_HUNK_UNSUPPORTED, HunkTypeEnum::key(type)); } } } diff --git a/Emulator/Misc/Recorder/Recorder.cpp b/Emulator/Misc/Recorder/Recorder.cpp index 096a10b9b..92b27ed7c 100644 --- a/Emulator/Misc/Recorder/Recorder.cpp +++ b/Emulator/Misc/Recorder/Recorder.cpp @@ -86,17 +86,17 @@ Recorder::startRecording(isize x1, isize y1, isize x2, isize y2, x1, y1, x2, y2, bitRate, aspectX, aspectY); if (isRecording()) { - throw Error(ERROR_REC_LAUNCH, "Recording in progress."); + throw Error(VAERROR_REC_LAUNCH, "Recording in progress."); } // Create pipes debug(REC_DEBUG, "Creating pipes...\n"); if (!videoPipe.create(videoPipePath())) { - throw Error(ERROR_REC_LAUNCH, "Failed to create the video encoder pipe."); + throw Error(VAERROR_REC_LAUNCH, "Failed to create the video encoder pipe."); } if (!audioPipe.create(audioPipePath())) { - throw Error(ERROR_REC_LAUNCH, "Failed to create the video encoder pipe."); + throw Error(VAERROR_REC_LAUNCH, "Failed to create the video encoder pipe."); } debug(REC_DEBUG, "Pipes created\n"); @@ -203,7 +203,7 @@ Recorder::startRecording(isize x1, isize y1, isize x2, isize y2, debug(REC_DEBUG, "%s\n", cmd1.c_str()); if (!videoFFmpeg.launch(cmd1)) { - throw Error(ERROR_REC_LAUNCH, "Unable to launch the FFmpeg video encoder."); + throw Error(VAERROR_REC_LAUNCH, "Unable to launch the FFmpeg video encoder."); } // Launch the audio encoder @@ -211,21 +211,21 @@ Recorder::startRecording(isize x1, isize y1, isize x2, isize y2, debug(REC_DEBUG, "%s\n", cmd2.c_str()); if (!audioFFmpeg.launch(cmd2)) { - throw Error(ERROR_REC_LAUNCH, "Unable to launch the FFmpeg audio encoder."); + throw Error(VAERROR_REC_LAUNCH, "Unable to launch the FFmpeg audio encoder."); } // Open the video pipe debug(REC_DEBUG, "Opening video pipe\n"); if (!videoPipe.open()) { - throw Error(ERROR_REC_LAUNCH, "Unable to open the video pipe."); + throw Error(VAERROR_REC_LAUNCH, "Unable to open the video pipe."); } // Open the audio pipe debug(REC_DEBUG, "Opening audio pipe\n"); if (!audioPipe.open()) { - throw Error(ERROR_REC_LAUNCH, "Unable to launch the audio pipe."); + throw Error(VAERROR_REC_LAUNCH, "Unable to launch the audio pipe."); } debug(REC_DEBUG, "Success\n"); diff --git a/Emulator/Misc/RegressionTester/RegressionTester.cpp b/Emulator/Misc/RegressionTester/RegressionTester.cpp index 087006184..48684e50e 100644 --- a/Emulator/Misc/RegressionTester/RegressionTester.cpp +++ b/Emulator/Misc/RegressionTester/RegressionTester.cpp @@ -20,10 +20,10 @@ void RegressionTester::prepare(ConfigScheme scheme, string rom, string ext) { // Only proceed if the /tmp folder exisits - if (!util::fileExists("/tmp")) throw Error(ERROR_DIR_NOT_FOUND, "/tmp"); + if (!util::fileExists("/tmp")) throw Error(VAERROR_DIR_NOT_FOUND, "/tmp"); // Check if we've got write permissions - if (host.tmp() != "/tmp") throw Error(ERROR_DIR_ACCESS_DENIED, "/tmp"); + if (host.tmp() != "/tmp") throw Error(VAERROR_DIR_ACCESS_DENIED, "/tmp"); // Initialize the emulator according to the specified scheme emulator.powerOff(); diff --git a/Emulator/Misc/RemoteServers/GdbServerCmds.cpp b/Emulator/Misc/RemoteServers/GdbServerCmds.cpp index 4a13cdc56..4c8e0170d 100644 --- a/Emulator/Misc/RemoteServers/GdbServerCmds.cpp +++ b/Emulator/Misc/RemoteServers/GdbServerCmds.cpp @@ -131,7 +131,7 @@ GdbServer::process <'v', GdbCmd::Cont> (string arg) return; } - throw Error(ERROR_GDB_INVALID_FORMAT); + throw Error(VAERROR_GDB_INVALID_FORMAT); } template <> void @@ -161,7 +161,7 @@ GdbServer::process <'v'> (string cmd) return; } - throw Error(ERROR_GDB_UNSUPPORTED_CMD, "v"); + throw Error(VAERROR_GDB_UNSUPPORTED_CMD, "v"); } template <> void @@ -220,7 +220,7 @@ GdbServer::process <'q'> (string cmd) return; } - throw Error(ERROR_GDB_UNSUPPORTED_CMD, "q"); + throw Error(VAERROR_GDB_UNSUPPORTED_CMD, "q"); } template <> void @@ -234,7 +234,7 @@ GdbServer::process <'Q'> (string cmd) return; } - throw Error(ERROR_GDB_UNSUPPORTED_CMD, "Q"); + throw Error(VAERROR_GDB_UNSUPPORTED_CMD, "Q"); } template <> void @@ -254,7 +254,7 @@ GdbServer::process <'s'> (string cmd) template <> void GdbServer::process <'n'> (string cmd) { - throw Error(ERROR_GDB_UNSUPPORTED_CMD, "n"); + throw Error(VAERROR_GDB_UNSUPPORTED_CMD, "n"); } template <> void @@ -266,7 +266,7 @@ GdbServer::process <'H'> (string cmd) template <> void GdbServer::process <'G'> (string cmd) { - throw Error(ERROR_GDB_UNSUPPORTED_CMD, "G"); + throw Error(VAERROR_GDB_UNSUPPORTED_CMD, "G"); } template <> void @@ -291,13 +291,13 @@ GdbServer::process <'?'> (string cmd) template <> void GdbServer::process <'!'> (string cmd) { - throw Error(ERROR_GDB_UNSUPPORTED_CMD, "!"); + throw Error(VAERROR_GDB_UNSUPPORTED_CMD, "!"); } template <> void GdbServer::process <'k'> (string cmd) { - throw Error(ERROR_GDB_UNSUPPORTED_CMD, "k"); + throw Error(VAERROR_GDB_UNSUPPORTED_CMD, "k"); } template <> void @@ -322,14 +322,14 @@ GdbServer::process <'m'> (string cmd) } else { - throw Error(ERROR_GDB_UNSUPPORTED_CMD, "m"); + throw Error(VAERROR_GDB_UNSUPPORTED_CMD, "m"); } } template <> void GdbServer::process <'M'> (string cmd) { - throw Error(ERROR_GDB_UNSUPPORTED_CMD, "M"); + throw Error(VAERROR_GDB_UNSUPPORTED_CMD, "M"); } template <> void @@ -343,7 +343,7 @@ GdbServer::process <'p'> (string cmd) template <> void GdbServer::process <'P'> (string cmd) { - throw Error(ERROR_GDB_UNSUPPORTED_CMD, "P"); + throw Error(VAERROR_GDB_UNSUPPORTED_CMD, "P"); } template <> void @@ -355,7 +355,7 @@ GdbServer::process <'c'> (string cmd) template <> void GdbServer::process <'D'> (string cmd) { - throw Error(ERROR_GDB_UNSUPPORTED_CMD, "D"); + throw Error(VAERROR_GDB_UNSUPPORTED_CMD, "D"); } template <> void @@ -377,7 +377,7 @@ GdbServer::process <'Z'> (string cmd) } else { - throw Error(ERROR_GDB_INVALID_FORMAT, "Z"); + throw Error(VAERROR_GDB_INVALID_FORMAT, "Z"); } } @@ -400,7 +400,7 @@ GdbServer::process <'z'> (string cmd) } else { - throw Error(ERROR_GDB_INVALID_FORMAT, "z"); + throw Error(VAERROR_GDB_INVALID_FORMAT, "z"); } } @@ -410,7 +410,7 @@ GdbServer::process(string package) debug(SRV_DEBUG, "process(%s)\n", package.c_str()); // Check if the previous package has been rejected - if (package[0] == '-') throw Error(ERROR_GDB_NO_ACK); + if (package[0] == '-') throw Error(VAERROR_GDB_NO_ACK); // Strip off the acknowledgment symbol if present if (package[0] == '+') package.erase(0,1); @@ -440,13 +440,13 @@ GdbServer::process(string package) } else { if (ackMode) connection.send("-"); - throw Error(ERROR_GDB_INVALID_CHECKSUM); + throw Error(VAERROR_GDB_INVALID_CHECKSUM); } return; } - throw Error(ERROR_GDB_INVALID_FORMAT); + throw Error(VAERROR_GDB_INVALID_FORMAT); } } @@ -476,7 +476,7 @@ GdbServer::process(char cmd, string package) case 'z' : process <'z'> (package); break; default: - throw Error(ERROR_GDB_UNRECOGNIZED_CMD, string(1, cmd)); + throw Error(VAERROR_GDB_UNRECOGNIZED_CMD, string(1, cmd)); } } diff --git a/Emulator/Misc/RemoteServers/RemoteServer.cpp b/Emulator/Misc/RemoteServers/RemoteServer.cpp index 15e37ae1d..0e28be1f8 100644 --- a/Emulator/Misc/RemoteServers/RemoteServer.cpp +++ b/Emulator/Misc/RemoteServers/RemoteServer.cpp @@ -93,7 +93,7 @@ RemoteServer::checkOption(Option opt, i64 value) return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/Misc/RemoteServers/Socket.cpp b/Emulator/Misc/RemoteServers/Socket.cpp index dacaa3431..0ca802072 100644 --- a/Emulator/Misc/RemoteServers/Socket.cpp +++ b/Emulator/Misc/RemoteServers/Socket.cpp @@ -60,7 +60,7 @@ void Socket::create() WSADATA wsaData; if (WSAStartup(MAKEWORD(2, 2), &wsaData)) - throw Error(ERROR_SOCK_CANT_CREATE); + throw Error(VAERROR_SOCK_CANT_CREATE); } ~WSAInit() { @@ -74,7 +74,7 @@ void Socket::create() // Create a new socket socket = ::socket(AF_INET, SOCK_STREAM, 0); if (socket == INVALID_SOCKET) { - throw Error(ERROR_SOCK_CANT_CREATE); + throw Error(VAERROR_SOCK_CANT_CREATE); } // Set options @@ -85,7 +85,7 @@ void Socket::create() (const char *)&opt, sizeof(opt)); if (success < 0) { - throw Error(ERROR_SOCK_CANT_CREATE); + throw Error(VAERROR_SOCK_CANT_CREATE); } debug(SCK_DEBUG, "Created new socket %lld\n", (i64)socket); @@ -104,7 +104,7 @@ Socket::connect(u16 port) address.sin_port = util::bigEndian(port); if (::connect(socket, (struct sockaddr *)&address, sizeof(address)) < 0) { - throw Error(ERROR_SOCK_CANT_CONNECT); + throw Error(VAERROR_SOCK_CANT_CONNECT); } } @@ -120,7 +120,7 @@ Socket::bind(u16 port) address.sin_port = util::bigEndian(port); if (::bind(socket, (struct sockaddr *)&address, sizeof(address)) < 0) { - throw Error(ERROR_SOCK_CANT_BIND); + throw Error(VAERROR_SOCK_CANT_BIND); } } @@ -128,7 +128,7 @@ void Socket::listen() { if (::listen(socket, 3) < 0) { - throw Error(ERROR_SOCK_CANT_LISTEN); + throw Error(VAERROR_SOCK_CANT_LISTEN); } } @@ -140,7 +140,7 @@ Socket::accept() auto s = ::accept(socket, (struct sockaddr *)&address, &addrlen); if (s == INVALID_SOCKET) { - throw Error(ERROR_SOCK_CANT_ACCEPT); + throw Error(VAERROR_SOCK_CANT_ACCEPT); } return Socket(s); @@ -157,14 +157,14 @@ Socket::recv() return result; } - throw Error(ERROR_SOCK_CANT_RECEIVE); + throw Error(VAERROR_SOCK_CANT_RECEIVE); } void Socket::send(u8 value) { if (::send(socket, (const char *)&value, 1, 0) < 1) { - throw Error(ERROR_SOCK_CANT_SEND); + throw Error(VAERROR_SOCK_CANT_SEND); } } @@ -172,7 +172,7 @@ void Socket::send(const string &s) { if (::send(socket, s.c_str(), (int)s.length(), 0) < 0) { - throw Error(ERROR_SOCK_CANT_SEND); + throw Error(VAERROR_SOCK_CANT_SEND); } } diff --git a/Emulator/Misc/RetroShell/CommandConsole.cpp b/Emulator/Misc/RetroShell/CommandConsole.cpp index 3f718d563..4b97ab863 100644 --- a/Emulator/Misc/RetroShell/CommandConsole.cpp +++ b/Emulator/Misc/RetroShell/CommandConsole.cpp @@ -602,7 +602,7 @@ CommandConsole::initCommands(Command &root) case 3: port.joystick.trigger(PRESS_FIRE3); break; default: - throw Error(ERROR_OPT_INV_ARG, "1...3"); + throw Error(VAERROR_OPT_INV_ARG, "1...3"); } }, i); @@ -621,7 +621,7 @@ CommandConsole::initCommands(Command &root) case 3: port.joystick.trigger(RELEASE_FIRE3); break; default: - throw Error(ERROR_OPT_INV_ARG, "1...3"); + throw Error(VAERROR_OPT_INV_ARG, "1...3"); } }, i); diff --git a/Emulator/Misc/RetroShell/Console.cpp b/Emulator/Misc/RetroShell/Console.cpp index 3a79a749a..792bd6926 100644 --- a/Emulator/Misc/RetroShell/Console.cpp +++ b/Emulator/Misc/RetroShell/Console.cpp @@ -830,7 +830,7 @@ Console::initCommands(Command &root) [this](Arguments& argv, long value) { auto stream = std::ifstream(argv.front()); - if (!stream.is_open()) throw Error(ERROR_FILE_NOT_FOUND, argv.front()); + if (!stream.is_open()) throw Error(VAERROR_FILE_NOT_FOUND, argv.front()); retroShell.asyncExecScript(stream); }); diff --git a/Emulator/Misc/RetroShell/DebugConsole.cpp b/Emulator/Misc/RetroShell/DebugConsole.cpp index 506740aea..50a5c86f2 100644 --- a/Emulator/Misc/RetroShell/DebugConsole.cpp +++ b/Emulator/Misc/RetroShell/DebugConsole.cpp @@ -121,7 +121,7 @@ DebugConsole::initCommands(Command &root) [this](Arguments& argv, long value) { auto addr = parseAddr(argv[0]); - if (IS_ODD(addr)) throw Error(ERROR_ADDR_UNALIGNED); + if (IS_ODD(addr)) throw Error(VAERROR_ADDR_UNALIGNED); cpu.breakpoints.setAt(addr, parseNum(argv, 1, 0)); }); @@ -190,7 +190,7 @@ DebugConsole::initCommands(Command &root) [this](Arguments& argv, long value) { auto nr = parseNum(argv[0]); - if (nr < 0 || nr > 255) throw Error(ERROR_OPT_INV_ARG, "0...255"); + if (nr < 0 || nr > 255) throw Error(VAERROR_OPT_INV_ARG, "0...255"); cpu.catchpoints.setAt(u32(nr), parseNum(argv, 1, 0)); }); @@ -199,7 +199,7 @@ DebugConsole::initCommands(Command &root) [this](Arguments& argv, long value) { auto nr = parseNum(argv[0]); - if (nr < 1 || nr > 7) throw Error(ERROR_OPT_INV_ARG, "1...7"); + if (nr < 1 || nr > 7) throw Error(VAERROR_OPT_INV_ARG, "1...7"); cpu.catchpoints.setAt(u32(nr + 24), parseNum(argv, 1, 0)); }); @@ -208,7 +208,7 @@ DebugConsole::initCommands(Command &root) [this](Arguments& argv, long value) { auto nr = parseNum(argv[0]); - if (nr < 0 || nr > 15) throw Error(ERROR_OPT_INV_ARG, "0...15"); + if (nr < 0 || nr > 15) throw Error(VAERROR_OPT_INV_ARG, "0...15"); cpu.catchpoints.setAt(u32(nr + 32), parseNum(argv, 1, 0)); }); @@ -243,7 +243,7 @@ DebugConsole::initCommands(Command &root) [this](Arguments& argv, long value) { auto addr = parseAddr(argv[0]); - if (IS_ODD(addr)) throw Error(ERROR_ADDR_UNALIGNED); + if (IS_ODD(addr)) throw Error(VAERROR_ADDR_UNALIGNED); copper.debugger.breakpoints.setAt(addr, parseNum(argv, 1, 0)); }); @@ -278,7 +278,7 @@ DebugConsole::initCommands(Command &root) [this](Arguments& argv, long value) { auto addr = parseAddr(argv[0]); - if (IS_ODD(addr)) throw Error(ERROR_ADDR_UNALIGNED); + if (IS_ODD(addr)) throw Error(VAERROR_ADDR_UNALIGNED); copper.debugger.watchpoints.setAt(addr, parseNum(argv, 1, 0)); }); @@ -622,7 +622,7 @@ DebugConsole::initCommands(Command &root) case 2: dump(amiga.agnus.copper, Category::List2); break; default: - throw Error(ERROR_OPT_INV_ARG, "1 or 2"); + throw Error(VAERROR_OPT_INV_ARG, "1 or 2"); } }); } diff --git a/Emulator/Misc/RetroShell/RetroShell.cpp b/Emulator/Misc/RetroShell/RetroShell.cpp index 1c1bb0cd6..7cac203fd 100644 --- a/Emulator/Misc/RetroShell/RetroShell.cpp +++ b/Emulator/Misc/RetroShell/RetroShell.cpp @@ -126,7 +126,7 @@ RetroShell::asyncExecScript(const MediaFile &file) default: - throw Error(ERROR_FILE_TYPE_MISMATCH); + throw Error(VAERROR_FILE_TYPE_MISMATCH); } } diff --git a/Emulator/Peripherals/Drive/DriveDescriptors.cpp b/Emulator/Peripherals/Drive/DriveDescriptors.cpp index e60b90fa6..9b1d0f08f 100644 --- a/Emulator/Peripherals/Drive/DriveDescriptors.cpp +++ b/Emulator/Peripherals/Drive/DriveDescriptors.cpp @@ -128,22 +128,22 @@ GeometryDescriptor::checkCompatibility() const return; } if (cylinders == 0 || FORCE_HDR_UNKNOWN_GEOMETRY) { - throw Error(ERROR_HDR_UNKNOWN_GEOMETRY); + throw Error(VAERROR_HDR_UNKNOWN_GEOMETRY); } if (numBytes() > MB(504) || FORCE_HDR_TOO_LARGE) { - throw Error(ERROR_HDR_TOO_LARGE); + throw Error(VAERROR_HDR_TOO_LARGE); } if ((cylinders < cMin && heads > 1) || cylinders > cMax || FORCE_HDR_UNSUPPORTED_C) { - throw Error(ERROR_HDR_UNSUPPORTED_CYL_COUNT, cylinders); + throw Error(VAERROR_HDR_UNSUPPORTED_CYL_COUNT, cylinders); } if (heads < hMin || heads > hMax || FORCE_HDR_UNSUPPORTED_H) { - throw Error(ERROR_HDR_UNSUPPORTED_HEAD_COUNT, heads); + throw Error(VAERROR_HDR_UNSUPPORTED_HEAD_COUNT, heads); } if (sectors < sMin || sectors > sMax || FORCE_HDR_UNSUPPORTED_S) { - throw Error(ERROR_HDR_UNSUPPORTED_SEC_COUNT, sectors); + throw Error(VAERROR_HDR_UNSUPPORTED_SEC_COUNT, sectors); } if (bsize != 512 || FORCE_HDR_UNSUPPORTED_B) { - throw Error(ERROR_HDR_UNSUPPORTED_BSIZE); + throw Error(VAERROR_HDR_UNSUPPORTED_BSIZE); } } @@ -208,13 +208,13 @@ void PartitionDescriptor::checkCompatibility(const GeometryDescriptor &geo) cons auto bsize = 4 * sizeBlock; if (bsize != 512) { - throw Error(ERROR_HDR_UNSUPPORTED_BSIZE, std::to_string(bsize)); + throw Error(VAERROR_HDR_UNSUPPORTED_BSIZE, std::to_string(bsize)); } if (lowCyl > highCyl) { - throw Error(ERROR_HDR_CORRUPTED_PTABLE); + throw Error(VAERROR_HDR_CORRUPTED_PTABLE); } if (isize(highCyl) >= geo.cylinders) { - throw Error(ERROR_HDR_CORRUPTED_PTABLE); + throw Error(VAERROR_HDR_CORRUPTED_PTABLE); } } diff --git a/Emulator/Peripherals/Drive/FloppyDisk.cpp b/Emulator/Peripherals/Drive/FloppyDisk.cpp index 50630a180..7dcd2df31 100644 --- a/Emulator/Peripherals/Drive/FloppyDisk.cpp +++ b/Emulator/Peripherals/Drive/FloppyDisk.cpp @@ -26,7 +26,7 @@ FloppyDisk::init(Diameter dia, Density den, bool wp) if (dia == INCH_525 && den == DENSITY_DD) trackLength = 12668; if (trackLength == 0 || FORCE_DISK_INVALID_LAYOUT) { - throw Error(ERROR_DISK_INVALID_LAYOUT); + throw Error(VAERROR_DISK_INVALID_LAYOUT); } for (isize i = 0; i < 168; i++) length.track[i] = trackLength; diff --git a/Emulator/Peripherals/Drive/FloppyDrive.cpp b/Emulator/Peripherals/Drive/FloppyDrive.cpp index 5caa5ef6f..28d47ba79 100644 --- a/Emulator/Peripherals/Drive/FloppyDrive.cpp +++ b/Emulator/Peripherals/Drive/FloppyDrive.cpp @@ -121,17 +121,17 @@ FloppyDrive::checkOption(Option opt, i64 value) case OPT_DRIVE_TYPE: if (!FloppyDriveTypeEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, FloppyDriveTypeEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, FloppyDriveTypeEnum::keyList()); } if (value != DRIVE_DD_35 && value != DRIVE_HD_35) { - throw Error(ERROR_OPT_UNSUPPORTED); + throw Error(VAERROR_OPT_UNSUPPORTED); } return; case OPT_DRIVE_MECHANICS: if (!DriveMechanicsEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, DriveMechanicsEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, DriveMechanicsEnum::keyList()); } return; @@ -146,7 +146,7 @@ FloppyDrive::checkOption(Option opt, i64 value) return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } @@ -982,7 +982,7 @@ FloppyDrive::exportDisk(FileType type) case FILETYPE_IMG: return new IMGFile(*this); default: - throw Error(ERROR_FILE_TYPE_UNSUPPORTED); + throw Error(VAERROR_FILE_TYPE_UNSUPPORTED); } } @@ -994,7 +994,7 @@ FloppyDrive::insertDisk(std::unique_ptr disk, Cycle delay) debug(DSK_DEBUG, "insertDisk <%ld> (%lld)\n", s, delay); // Only proceed if the provided disk is compatible with this drive - if (!isInsertable(*disk)) throw Error(ERROR_DISK_INCOMPATIBLE); + if (!isInsertable(*disk)) throw Error(VAERROR_DISK_INCOMPATIBLE); { SUSPENDED @@ -1019,7 +1019,7 @@ FloppyDrive::catchFile(const std::filesystem::path &path) // Seek file auto file = fs.seekFile(path.string()); - if (file == nullptr) throw Error(ERROR_FILE_NOT_FOUND); + if (file == nullptr) throw Error(VAERROR_FILE_NOT_FOUND); // Extract file Buffer buffer; @@ -1030,7 +1030,7 @@ FloppyDrive::catchFile(const std::filesystem::path &path) // Seek the code section and read the first instruction word auto offset = descr.seek(HUNK_CODE); - if (!offset) throw Error(ERROR_HUNK_CORRUPTED); + if (!offset) throw Error(VAERROR_HUNK_CORRUPTED); u16 instr = HI_LO(buffer[*offset + 8], buffer[*offset + 9]); // Replace the first instruction word by a software trap @@ -1090,7 +1090,7 @@ FloppyDrive::swapDisk(std::unique_ptr disk) debug(DSK_DEBUG, "swapDisk()\n"); // Only proceed if the provided disk is compatible with this drive - if (!isInsertable(*disk)) throw Error(ERROR_DISK_INCOMPATIBLE); + if (!isInsertable(*disk)) throw Error(VAERROR_DISK_INCOMPATIBLE); // Determine delay (in pause mode, we insert immediately) auto delay = isRunning() ? config.diskSwapDelay : 0; @@ -1137,7 +1137,7 @@ FloppyDrive::insertMediaFile(class MediaFile &file, bool wp) } catch (...) { - throw Error(ERROR_FILE_TYPE_MISMATCH); + throw Error(VAERROR_FILE_TYPE_MISMATCH); } } diff --git a/Emulator/Peripherals/Drive/HardDrive.cpp b/Emulator/Peripherals/Drive/HardDrive.cpp index e33a6a1e2..23a75a11b 100644 --- a/Emulator/Peripherals/Drive/HardDrive.cpp +++ b/Emulator/Peripherals/Drive/HardDrive.cpp @@ -135,7 +135,7 @@ HardDrive::init(const MediaFile &file) } catch (...) { - throw Error(ERROR_FILE_TYPE_MISMATCH); + throw Error(VAERROR_FILE_TYPE_MISMATCH); } } @@ -273,7 +273,7 @@ HardDrive::checkOption(Option opt, i64 value) case OPT_HDR_TYPE: if (!HardDriveTypeEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, HardDriveTypeEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, HardDriveTypeEnum::keyList()); } return; @@ -287,7 +287,7 @@ HardDrive::checkOption(Option opt, i64 value) return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } @@ -299,7 +299,7 @@ HardDrive::setOption(Option option, i64 value) case OPT_HDR_TYPE: if (!HardDriveTypeEnum::isValid(value)) { - throw Error(ERROR_OPT_INV_ARG, HardDriveTypeEnum::keyList()); + throw Error(VAERROR_OPT_INV_ARG, HardDriveTypeEnum::keyList()); } config.type = (HardDriveType)value; return; @@ -589,12 +589,12 @@ HardDrive::saveWriteThroughImage() // Only proceed if a storage file is given if (path.empty()) { - throw Error(ERROR_WT, "No storage path specified"); + throw Error(VAERROR_WT, "No storage path specified"); } // Only proceed if no other emulator instance is using the storage file if (wtStream[objid].is_open()) { - throw Error(ERROR_WT_BLOCKED); + throw Error(VAERROR_WT_BLOCKED); } // Delete the old storage file @@ -603,13 +603,13 @@ HardDrive::saveWriteThroughImage() // Recreate the storage file with the contents of this disk writeToFile(path); if (!util::fileExists(path)) { - throw Error(ERROR_WT, "Can't create storage file"); + throw Error(VAERROR_WT, "Can't create storage file"); } // Open file wtStream[objid].open(path, std::ios::binary | std::ios::in | std::ios::out); if (!wtStream[objid].is_open()) { - throw Error(ERROR_WT, "Can't open storage file"); + throw Error(VAERROR_WT, "Can't open storage file"); } } @@ -670,7 +670,7 @@ HardDrive::changeGeometry(const GeometryDescriptor &geometry) } else { - throw Error(ERROR_HDR_UNMATCHED_GEOMETRY); + throw Error(VAERROR_HDR_UNMATCHED_GEOMETRY); } } diff --git a/Emulator/Peripherals/Joystick/Joystick.cpp b/Emulator/Peripherals/Joystick/Joystick.cpp index 884d895c3..078654d31 100644 --- a/Emulator/Peripherals/Joystick/Joystick.cpp +++ b/Emulator/Peripherals/Joystick/Joystick.cpp @@ -58,7 +58,7 @@ Joystick::checkOption(Option opt, i64 value) return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/Peripherals/Keyboard/Keyboard.cpp b/Emulator/Peripherals/Keyboard/Keyboard.cpp index 3d4ac5154..4aec57b8a 100644 --- a/Emulator/Peripherals/Keyboard/Keyboard.cpp +++ b/Emulator/Peripherals/Keyboard/Keyboard.cpp @@ -44,7 +44,7 @@ Keyboard::checkOption(Option opt, i64 value) return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/Peripherals/Mouse/Mouse.cpp b/Emulator/Peripherals/Mouse/Mouse.cpp index da124cda5..326fe6171 100644 --- a/Emulator/Peripherals/Mouse/Mouse.cpp +++ b/Emulator/Peripherals/Mouse/Mouse.cpp @@ -47,12 +47,12 @@ Mouse::checkOption(Option opt, i64 value) case OPT_MOUSE_VELOCITY: if (value < 0 || value > 255) { - throw Error(ERROR_OPT_INV_ARG, "0...255"); + throw Error(VAERROR_OPT_INV_ARG, "0...255"); } return; default: - throw(ERROR_OPT_UNSUPPORTED); + throw(VAERROR_OPT_UNSUPPORTED); } } diff --git a/Emulator/VAmiga.h b/Emulator/VAmiga.h index 1d901b24d..d86f0ebeb 100644 --- a/Emulator/VAmiga.h +++ b/Emulator/VAmiga.h @@ -1068,23 +1068,23 @@ struct DefaultsAPI : public API { /// @name Loading and saving the key-value storage /** @brief Loads a storage file from disk - * @throw VC64Error (#ERROR_FILE_NOT_FOUND) - * @throw VC64Error (#ERROR_SYNTAX) + * @throw VC64Error (#VAERROR_FILE_NOT_FOUND) + * @throw VC64Error (#VAERROR_SYNTAX) */ void load(const std::filesystem::path &path); /** @brief Loads a storage file from a stream - * @throw VC64Error (#ERROR_SYNTAX) + * @throw VC64Error (#VAERROR_SYNTAX) */ void load(std::ifstream &stream); /** @brief Loads a storage file from a string stream - * @throw VC64Error (#ERROR_SYNTAX) + * @throw VC64Error (#VAERROR_SYNTAX) */ void load(std::stringstream &stream); /** @brief Saves a storage file to disk - * @throw VC64Error (#ERROR_FILE_CANT_WRITE) + * @throw VC64Error (#VAERROR_FILE_CANT_WRITE) */ void save(const std::filesystem::path &path); @@ -1153,14 +1153,14 @@ struct DefaultsAPI : public API { /** @brief Writes a key-value pair into the user storage. * @param key The key, given as a string. * @param value The value, given as a string. - * @throw VC64Error (#ERROR_INVALID_KEY) + * @throw VC64Error (#VAERROR_INVALID_KEY) */ void set(const string &key, const string &value); /** @brief Writes a key-value pair into the user storage. * @param opt The option's name forms the prefix of the keys. * @param value The value, given as a string. - * @throw VC64Error (#ERROR_INVALID_KEY) + * @throw VC64Error (#VAERROR_INVALID_KEY) */ void set(Option opt, const string &value); @@ -1168,14 +1168,14 @@ struct DefaultsAPI : public API { * @param opt The option's name forms the prefix of the keys. * @param value The value for all pairs, given as a string. * @param objids The keys are parameterized by adding the vector values as suffixes. - * @throw VC64Error (#ERROR_INVALID_KEY) + * @throw VC64Error (#VAERROR_INVALID_KEY) */ void set(Option opt, const string &value, std::vector objids); /** @brief Writes a key-value pair into the user storage. * @param opt The option's name forms the prefix of the keys. * @param value The value, given as an integer. - * @throw VC64Error (#ERROR_INVALID_KEY) + * @throw VC64Error (#VAERROR_INVALID_KEY) */ void set(Option opt, i64 value); @@ -1183,7 +1183,7 @@ struct DefaultsAPI : public API { * @param opt The option's name forms the prefix of the keys. * @param value The value for all pairs, given as an integer. * @param objids The keys are parameterized by adding the vector values as suffixes. - * @throw VC64Error (#ERROR_INVALID_KEY) + * @throw VC64Error (#VAERROR_INVALID_KEY) */ void set(Option opt, i64 value, std::vector objids); @@ -1196,7 +1196,7 @@ struct DefaultsAPI : public API { /** @brief Writes a key-value pair into the fallback storage. * @param opt The option's name forms the prefix of the keys. * @param value The value, given as an integer. - * @throw VC64Error (#ERROR_INVALID_KEY) + * @throw VC64Error (#VAERROR_INVALID_KEY) */ void setFallback(Option opt, const string &value); @@ -1210,7 +1210,7 @@ struct DefaultsAPI : public API { /** @brief Writes a key-value pair into the fallback storage. * @param opt The option's name forms the prefix of the keys. * @param value The value, given as an integer. - * @throw VC64Error (#ERROR_INVALID_KEY) + * @throw VC64Error (#VAERROR_INVALID_KEY) */ void setFallback(Option opt, i64 value); @@ -1232,20 +1232,20 @@ struct DefaultsAPI : public API { /** @brief Deletes a key-value pair * @param key The key of the key-value pair. - * @throw VC64Error (#ERROR_INVALID_KEY) + * @throw VC64Error (#VAERROR_INVALID_KEY) */ void remove(const string &key) throws; /** @brief Deletes a key-value pair * @param option The option's name forms the key. - * @throw VC64Error (#ERROR_INVALID_KEY) + * @throw VC64Error (#VAERROR_INVALID_KEY) */ void remove(Option option) throws; /** @brief Deletes multiple key-value pairs. * @param option The option's name forms the prefix of the keys. * @param objids The keys are parameterized by adding the vector values as suffixes. - * @throw VC64Error (#ERROR_INVALID_KEY) + * @throw VC64Error (#VAERROR_INVALID_KEY) */ void remove(Option option, std::vector objids) throws; diff --git a/Proxy/EmulatorProxy.mm b/Proxy/EmulatorProxy.mm index c94ab50e1..55105a0de 100644 --- a/Proxy/EmulatorProxy.mm +++ b/Proxy/EmulatorProxy.mm @@ -26,7 +26,7 @@ - (instancetype)init { if (self = [super init]) { - errorCode = ERROR_OK; + errorCode = VAERROR_OK; what = @""; } return self;