From 84571f8fe6bde4bb8ac75f10c0f55872e2cd1636 Mon Sep 17 00:00:00 2001 From: Adrian <78108584+AdrianCassar@users.noreply.github.com> Date: Mon, 13 Feb 2023 15:16:37 +0000 Subject: [PATCH] Allow patched arrays to start with 0x --- src/xenia/app/emulator_window.cc | 5 +++-- src/xenia/base/string_util.h | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/xenia/app/emulator_window.cc b/src/xenia/app/emulator_window.cc index 2a9855e8d..3367dc228 100644 --- a/src/xenia/app/emulator_window.cc +++ b/src/xenia/app/emulator_window.cc @@ -60,7 +60,7 @@ DEFINE_bool(fullscreen, false, "Whether to launch the emulator in fullscreen.", "Display"); DEFINE_bool(controller_hotkeys, true, - "Toggle hotkeys for Xbox and PS controllers.", "General"); + "Hotkeys for Xbox and PS controllers.", "General"); DEFINE_string( postprocess_antialiasing, "", @@ -1570,7 +1570,8 @@ void EmulatorWindow::LoadRecentlyLaunchedTitles() { std::time_t last_run_time = *entry_table->get_as("last_run_time"); - if (path.empty() || !std::filesystem::exists(path)) { + std::error_code ec = {}; + if (path.empty() || !std::filesystem::exists(path, ec)) { continue; } diff --git a/src/xenia/base/string_util.h b/src/xenia/base/string_util.h index 4cbbcc6b3..1c0d8c522 100644 --- a/src/xenia/base/string_util.h +++ b/src/xenia/base/string_util.h @@ -112,7 +112,11 @@ inline size_t copy_and_swap_maybe_truncating(char16_t* dest, } inline bool hex_string_to_array(std::vector& output_array, - const std::string_view value) { + std::string_view value) { + if (value.rfind("0x", 0) == 0) { + value.remove_prefix(2); + } + output_array.reserve((value.size() + 1) / 2); size_t remaining_length = value.size();