diff options
| -rw-r--r-- | src/common/string_util.h | 12 | ||||
| -rw-r--r-- | src/common/virtual_buffer.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 1 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/software_keyboard.cpp | 61 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/software_keyboard.h | 1 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/debug_pad.cpp | 53 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/keyboard.cpp | 17 | ||||
| -rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.h | 30 | ||||
| -rw-r--r-- | src/core/hle/service/vi/vi.cpp | 4 | ||||
| -rw-r--r-- | src/input_common/gcadapter/gc_adapter.cpp | 6 | ||||
| -rw-r--r-- | src/input_common/gcadapter/gc_poller.cpp | 6 | ||||
| -rw-r--r-- | src/input_common/udp/client.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/gpu.h | 4 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_debug.ui | 22 |
15 files changed, 113 insertions, 109 deletions
diff --git a/src/common/string_util.h b/src/common/string_util.h index 583fd05e6..023dff5dc 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h | |||
| @@ -74,16 +74,4 @@ std::string StringFromFixedZeroTerminatedBuffer(const char* buffer, std::size_t | |||
| 74 | std::u16string UTF16StringFromFixedZeroTerminatedBuffer(std::u16string_view buffer, | 74 | std::u16string UTF16StringFromFixedZeroTerminatedBuffer(std::u16string_view buffer, |
| 75 | std::size_t max_len); | 75 | std::size_t max_len); |
| 76 | 76 | ||
| 77 | /** | ||
| 78 | * Attempts to trim an arbitrary prefix from `path`, leaving only the part starting at `root`. It's | ||
| 79 | * intended to be used to strip a system-specific build directory from the `__FILE__` macro, | ||
| 80 | * leaving only the path relative to the sources root. | ||
| 81 | * | ||
| 82 | * @param path The input file path as a null-terminated string | ||
| 83 | * @param root The name of the root source directory as a null-terminated string. Path up to and | ||
| 84 | * including the last occurrence of this name will be stripped | ||
| 85 | * @return A pointer to the same string passed as `path`, but starting at the trimmed portion | ||
| 86 | */ | ||
| 87 | const char* TrimSourcePath(const char* path, const char* root = "src"); | ||
| 88 | |||
| 89 | } // namespace Common | 77 | } // namespace Common |
diff --git a/src/common/virtual_buffer.cpp b/src/common/virtual_buffer.cpp index b426f4747..be5b67752 100644 --- a/src/common/virtual_buffer.cpp +++ b/src/common/virtual_buffer.cpp | |||
| @@ -38,7 +38,7 @@ void* AllocateMemoryPages(std::size_t size) { | |||
| 38 | return base; | 38 | return base; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | void FreeMemoryPages(void* base, std::size_t size) { | 41 | void FreeMemoryPages(void* base, [[maybe_unused]] std::size_t size) { |
| 42 | if (!base) { | 42 | if (!base) { |
| 43 | return; | 43 | return; |
| 44 | } | 44 | } |
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 4e7a0bec9..ceed20609 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -1405,7 +1405,6 @@ void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) { | |||
| 1405 | // Get supported languages from NACP, if possible | 1405 | // Get supported languages from NACP, if possible |
| 1406 | // Default to 0 (all languages supported) | 1406 | // Default to 0 (all languages supported) |
| 1407 | u32 supported_languages = 0; | 1407 | u32 supported_languages = 0; |
| 1408 | FileSys::PatchManager pm{system.CurrentProcess()->GetTitleID()}; | ||
| 1409 | 1408 | ||
| 1410 | const auto res = [this] { | 1409 | const auto res = [this] { |
| 1411 | const auto title_id = system.CurrentProcess()->GetTitleID(); | 1410 | const auto title_id = system.CurrentProcess()->GetTitleID(); |
diff --git a/src/core/hle/service/am/applets/software_keyboard.cpp b/src/core/hle/service/am/applets/software_keyboard.cpp index fbe3686ae..289da2619 100644 --- a/src/core/hle/service/am/applets/software_keyboard.cpp +++ b/src/core/hle/service/am/applets/software_keyboard.cpp | |||
| @@ -13,11 +13,23 @@ | |||
| 13 | 13 | ||
| 14 | namespace Service::AM::Applets { | 14 | namespace Service::AM::Applets { |
| 15 | 15 | ||
| 16 | namespace { | ||
| 17 | enum class Request : u32 { | ||
| 18 | Finalize = 0x4, | ||
| 19 | SetUserWordInfo = 0x6, | ||
| 20 | SetCustomizeDic = 0x7, | ||
| 21 | Calc = 0xa, | ||
| 22 | SetCustomizedDictionaries = 0xb, | ||
| 23 | UnsetCustomizedDictionaries = 0xc, | ||
| 24 | UnknownD = 0xd, | ||
| 25 | UnknownE = 0xe, | ||
| 26 | }; | ||
| 27 | constexpr std::size_t SWKBD_INLINE_INIT_SIZE = 0x8; | ||
| 16 | constexpr std::size_t SWKBD_OUTPUT_BUFFER_SIZE = 0x7D8; | 28 | constexpr std::size_t SWKBD_OUTPUT_BUFFER_SIZE = 0x7D8; |
| 17 | constexpr std::size_t SWKBD_OUTPUT_INTERACTIVE_BUFFER_SIZE = 0x7D4; | 29 | constexpr std::size_t SWKBD_OUTPUT_INTERACTIVE_BUFFER_SIZE = 0x7D4; |
| 18 | constexpr std::size_t DEFAULT_MAX_LENGTH = 500; | 30 | constexpr std::size_t DEFAULT_MAX_LENGTH = 500; |
| 19 | constexpr bool INTERACTIVE_STATUS_OK = false; | 31 | constexpr bool INTERACTIVE_STATUS_OK = false; |
| 20 | 32 | } // Anonymous namespace | |
| 21 | static Core::Frontend::SoftwareKeyboardParameters ConvertToFrontendParameters( | 33 | static Core::Frontend::SoftwareKeyboardParameters ConvertToFrontendParameters( |
| 22 | KeyboardConfig config, std::u16string initial_text) { | 34 | KeyboardConfig config, std::u16string initial_text) { |
| 23 | Core::Frontend::SoftwareKeyboardParameters params{}; | 35 | Core::Frontend::SoftwareKeyboardParameters params{}; |
| @@ -47,6 +59,7 @@ SoftwareKeyboard::~SoftwareKeyboard() = default; | |||
| 47 | 59 | ||
| 48 | void SoftwareKeyboard::Initialize() { | 60 | void SoftwareKeyboard::Initialize() { |
| 49 | complete = false; | 61 | complete = false; |
| 62 | is_inline = false; | ||
| 50 | initial_text.clear(); | 63 | initial_text.clear(); |
| 51 | final_data.clear(); | 64 | final_data.clear(); |
| 52 | 65 | ||
| @@ -56,6 +69,11 @@ void SoftwareKeyboard::Initialize() { | |||
| 56 | ASSERT(keyboard_config_storage != nullptr); | 69 | ASSERT(keyboard_config_storage != nullptr); |
| 57 | const auto& keyboard_config = keyboard_config_storage->GetData(); | 70 | const auto& keyboard_config = keyboard_config_storage->GetData(); |
| 58 | 71 | ||
| 72 | if (keyboard_config.size() == SWKBD_INLINE_INIT_SIZE) { | ||
| 73 | is_inline = true; | ||
| 74 | return; | ||
| 75 | } | ||
| 76 | |||
| 59 | ASSERT(keyboard_config.size() >= sizeof(KeyboardConfig)); | 77 | ASSERT(keyboard_config.size() >= sizeof(KeyboardConfig)); |
| 60 | std::memcpy(&config, keyboard_config.data(), sizeof(KeyboardConfig)); | 78 | std::memcpy(&config, keyboard_config.data(), sizeof(KeyboardConfig)); |
| 61 | 79 | ||
| @@ -87,16 +105,32 @@ void SoftwareKeyboard::ExecuteInteractive() { | |||
| 87 | const auto storage = broker.PopInteractiveDataToApplet(); | 105 | const auto storage = broker.PopInteractiveDataToApplet(); |
| 88 | ASSERT(storage != nullptr); | 106 | ASSERT(storage != nullptr); |
| 89 | const auto data = storage->GetData(); | 107 | const auto data = storage->GetData(); |
| 90 | const auto status = static_cast<bool>(data[0]); | 108 | if (!is_inline) { |
| 91 | 109 | const auto status = static_cast<bool>(data[0]); | |
| 92 | if (status == INTERACTIVE_STATUS_OK) { | 110 | if (status == INTERACTIVE_STATUS_OK) { |
| 93 | complete = true; | 111 | complete = true; |
| 112 | } else { | ||
| 113 | std::array<char16_t, SWKBD_OUTPUT_INTERACTIVE_BUFFER_SIZE / 2 - 2> string; | ||
| 114 | std::memcpy(string.data(), data.data() + 4, string.size() * 2); | ||
| 115 | frontend.SendTextCheckDialog( | ||
| 116 | Common::UTF16StringFromFixedZeroTerminatedBuffer(string.data(), string.size()), | ||
| 117 | [this] { broker.SignalStateChanged(); }); | ||
| 118 | } | ||
| 94 | } else { | 119 | } else { |
| 95 | std::array<char16_t, SWKBD_OUTPUT_INTERACTIVE_BUFFER_SIZE / 2 - 2> string; | 120 | Request request{}; |
| 96 | std::memcpy(string.data(), data.data() + 4, string.size() * 2); | 121 | std::memcpy(&request, data.data(), sizeof(Request)); |
| 97 | frontend.SendTextCheckDialog( | 122 | |
| 98 | Common::UTF16StringFromFixedZeroTerminatedBuffer(string.data(), string.size()), | 123 | switch (request) { |
| 99 | [this] { broker.SignalStateChanged(); }); | 124 | case Request::Calc: { |
| 125 | broker.PushNormalDataFromApplet( | ||
| 126 | std::make_shared<IStorage>(std::move(std::vector<u8>{1}))); | ||
| 127 | broker.SignalStateChanged(); | ||
| 128 | break; | ||
| 129 | } | ||
| 130 | default: | ||
| 131 | UNIMPLEMENTED_MSG("Request {:X} is not implemented", request); | ||
| 132 | break; | ||
| 133 | } | ||
| 100 | } | 134 | } |
| 101 | } | 135 | } |
| 102 | 136 | ||
| @@ -108,9 +142,10 @@ void SoftwareKeyboard::Execute() { | |||
| 108 | } | 142 | } |
| 109 | 143 | ||
| 110 | const auto parameters = ConvertToFrontendParameters(config, initial_text); | 144 | const auto parameters = ConvertToFrontendParameters(config, initial_text); |
| 111 | 145 | if (!is_inline) { | |
| 112 | frontend.RequestText([this](std::optional<std::u16string> text) { WriteText(std::move(text)); }, | 146 | frontend.RequestText( |
| 113 | parameters); | 147 | [this](std::optional<std::u16string> text) { WriteText(std::move(text)); }, parameters); |
| 148 | } | ||
| 114 | } | 149 | } |
| 115 | 150 | ||
| 116 | void SoftwareKeyboard::WriteText(std::optional<std::u16string> text) { | 151 | void SoftwareKeyboard::WriteText(std::optional<std::u16string> text) { |
diff --git a/src/core/hle/service/am/applets/software_keyboard.h b/src/core/hle/service/am/applets/software_keyboard.h index ef4801fc6..5a3824b5a 100644 --- a/src/core/hle/service/am/applets/software_keyboard.h +++ b/src/core/hle/service/am/applets/software_keyboard.h | |||
| @@ -78,6 +78,7 @@ private: | |||
| 78 | KeyboardConfig config; | 78 | KeyboardConfig config; |
| 79 | std::u16string initial_text; | 79 | std::u16string initial_text; |
| 80 | bool complete = false; | 80 | bool complete = false; |
| 81 | bool is_inline = false; | ||
| 81 | std::vector<u8> final_data; | 82 | std::vector<u8> final_data; |
| 82 | }; | 83 | }; |
| 83 | 84 | ||
diff --git a/src/core/hle/service/hid/controllers/debug_pad.cpp b/src/core/hle/service/hid/controllers/debug_pad.cpp index cb35919e9..ad251ed4a 100644 --- a/src/core/hle/service/hid/controllers/debug_pad.cpp +++ b/src/core/hle/service/hid/controllers/debug_pad.cpp | |||
| @@ -39,33 +39,36 @@ void Controller_DebugPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, | |||
| 39 | 39 | ||
| 40 | cur_entry.sampling_number = last_entry.sampling_number + 1; | 40 | cur_entry.sampling_number = last_entry.sampling_number + 1; |
| 41 | cur_entry.sampling_number2 = cur_entry.sampling_number; | 41 | cur_entry.sampling_number2 = cur_entry.sampling_number; |
| 42 | cur_entry.attribute.connected.Assign(1); | ||
| 43 | auto& pad = cur_entry.pad_state; | ||
| 44 | 42 | ||
| 45 | using namespace Settings::NativeButton; | 43 | if (Settings::values.debug_pad_enabled) { |
| 46 | pad.a.Assign(buttons[A - BUTTON_HID_BEGIN]->GetStatus()); | 44 | cur_entry.attribute.connected.Assign(1); |
| 47 | pad.b.Assign(buttons[B - BUTTON_HID_BEGIN]->GetStatus()); | 45 | auto& pad = cur_entry.pad_state; |
| 48 | pad.x.Assign(buttons[X - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 49 | pad.y.Assign(buttons[Y - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 50 | pad.l.Assign(buttons[L - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 51 | pad.r.Assign(buttons[R - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 52 | pad.zl.Assign(buttons[ZL - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 53 | pad.zr.Assign(buttons[ZR - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 54 | pad.plus.Assign(buttons[Plus - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 55 | pad.minus.Assign(buttons[Minus - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 56 | pad.d_left.Assign(buttons[DLeft - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 57 | pad.d_up.Assign(buttons[DUp - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 58 | pad.d_right.Assign(buttons[DRight - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 59 | pad.d_down.Assign(buttons[DDown - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 60 | 46 | ||
| 61 | const auto [stick_l_x_f, stick_l_y_f] = | 47 | using namespace Settings::NativeButton; |
| 62 | analogs[static_cast<std::size_t>(JoystickId::Joystick_Left)]->GetStatus(); | 48 | pad.a.Assign(buttons[A - BUTTON_HID_BEGIN]->GetStatus()); |
| 63 | const auto [stick_r_x_f, stick_r_y_f] = | 49 | pad.b.Assign(buttons[B - BUTTON_HID_BEGIN]->GetStatus()); |
| 64 | analogs[static_cast<std::size_t>(JoystickId::Joystick_Right)]->GetStatus(); | 50 | pad.x.Assign(buttons[X - BUTTON_HID_BEGIN]->GetStatus()); |
| 65 | cur_entry.l_stick.x = static_cast<s32>(stick_l_x_f * HID_JOYSTICK_MAX); | 51 | pad.y.Assign(buttons[Y - BUTTON_HID_BEGIN]->GetStatus()); |
| 66 | cur_entry.l_stick.y = static_cast<s32>(stick_l_y_f * HID_JOYSTICK_MAX); | 52 | pad.l.Assign(buttons[L - BUTTON_HID_BEGIN]->GetStatus()); |
| 67 | cur_entry.r_stick.x = static_cast<s32>(stick_r_x_f * HID_JOYSTICK_MAX); | 53 | pad.r.Assign(buttons[R - BUTTON_HID_BEGIN]->GetStatus()); |
| 68 | cur_entry.r_stick.y = static_cast<s32>(stick_r_y_f * HID_JOYSTICK_MAX); | 54 | pad.zl.Assign(buttons[ZL - BUTTON_HID_BEGIN]->GetStatus()); |
| 55 | pad.zr.Assign(buttons[ZR - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 56 | pad.plus.Assign(buttons[Plus - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 57 | pad.minus.Assign(buttons[Minus - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 58 | pad.d_left.Assign(buttons[DLeft - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 59 | pad.d_up.Assign(buttons[DUp - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 60 | pad.d_right.Assign(buttons[DRight - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 61 | pad.d_down.Assign(buttons[DDown - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 62 | |||
| 63 | const auto [stick_l_x_f, stick_l_y_f] = | ||
| 64 | analogs[static_cast<std::size_t>(JoystickId::Joystick_Left)]->GetStatus(); | ||
| 65 | const auto [stick_r_x_f, stick_r_y_f] = | ||
| 66 | analogs[static_cast<std::size_t>(JoystickId::Joystick_Right)]->GetStatus(); | ||
| 67 | cur_entry.l_stick.x = static_cast<s32>(stick_l_x_f * HID_JOYSTICK_MAX); | ||
| 68 | cur_entry.l_stick.y = static_cast<s32>(stick_l_y_f * HID_JOYSTICK_MAX); | ||
| 69 | cur_entry.r_stick.x = static_cast<s32>(stick_r_x_f * HID_JOYSTICK_MAX); | ||
| 70 | cur_entry.r_stick.y = static_cast<s32>(stick_r_y_f * HID_JOYSTICK_MAX); | ||
| 71 | } | ||
| 69 | 72 | ||
| 70 | std::memcpy(data, &shared_memory, sizeof(SharedMemory)); | 73 | std::memcpy(data, &shared_memory, sizeof(SharedMemory)); |
| 71 | } | 74 | } |
diff --git a/src/core/hle/service/hid/controllers/keyboard.cpp b/src/core/hle/service/hid/controllers/keyboard.cpp index feae89525..0b896d5ad 100644 --- a/src/core/hle/service/hid/controllers/keyboard.cpp +++ b/src/core/hle/service/hid/controllers/keyboard.cpp | |||
| @@ -40,15 +40,16 @@ void Controller_Keyboard::OnUpdate(const Core::Timing::CoreTiming& core_timing, | |||
| 40 | 40 | ||
| 41 | cur_entry.key.fill(0); | 41 | cur_entry.key.fill(0); |
| 42 | cur_entry.modifier = 0; | 42 | cur_entry.modifier = 0; |
| 43 | 43 | if (Settings::values.keyboard_enabled) { | |
| 44 | for (std::size_t i = 0; i < keyboard_keys.size(); ++i) { | 44 | for (std::size_t i = 0; i < keyboard_keys.size(); ++i) { |
| 45 | cur_entry.key[i / KEYS_PER_BYTE] |= (keyboard_keys[i]->GetStatus() << (i % KEYS_PER_BYTE)); | 45 | cur_entry.key[i / KEYS_PER_BYTE] |= |
| 46 | } | 46 | (keyboard_keys[i]->GetStatus() << (i % KEYS_PER_BYTE)); |
| 47 | 47 | } | |
| 48 | for (std::size_t i = 0; i < keyboard_mods.size(); ++i) { | 48 | |
| 49 | cur_entry.modifier |= (keyboard_mods[i]->GetStatus() << i); | 49 | for (std::size_t i = 0; i < keyboard_mods.size(); ++i) { |
| 50 | cur_entry.modifier |= (keyboard_mods[i]->GetStatus() << i); | ||
| 51 | } | ||
| 50 | } | 52 | } |
| 51 | |||
| 52 | std::memcpy(data + SHARED_MEMORY_OFFSET, &shared_memory, sizeof(SharedMemory)); | 53 | std::memcpy(data + SHARED_MEMORY_OFFSET, &shared_memory, sizeof(SharedMemory)); |
| 53 | } | 54 | } |
| 54 | 55 | ||
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 789856118..e561bf654 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp | |||
| @@ -68,7 +68,7 @@ NVFlinger::NVFlinger(Core::System& system) : system(system) { | |||
| 68 | // Schedule the screen composition events | 68 | // Schedule the screen composition events |
| 69 | composition_event = Core::Timing::CreateEvent( | 69 | composition_event = Core::Timing::CreateEvent( |
| 70 | "ScreenComposition", [this](u64, std::chrono::nanoseconds ns_late) { | 70 | "ScreenComposition", [this](u64, std::chrono::nanoseconds ns_late) { |
| 71 | Lock(); | 71 | const auto guard = Lock(); |
| 72 | Compose(); | 72 | Compose(); |
| 73 | 73 | ||
| 74 | const auto ticks = std::chrono::nanoseconds{GetNextTicks()}; | 74 | const auto ticks = std::chrono::nanoseconds{GetNextTicks()}; |
diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h index e4959a9af..ff85cbba6 100644 --- a/src/core/hle/service/nvflinger/nvflinger.h +++ b/src/core/hle/service/nvflinger/nvflinger.h | |||
| @@ -54,12 +54,12 @@ public: | |||
| 54 | /// Opens the specified display and returns the ID. | 54 | /// Opens the specified display and returns the ID. |
| 55 | /// | 55 | /// |
| 56 | /// If an invalid display name is provided, then an empty optional is returned. | 56 | /// If an invalid display name is provided, then an empty optional is returned. |
| 57 | std::optional<u64> OpenDisplay(std::string_view name); | 57 | [[nodiscard]] std::optional<u64> OpenDisplay(std::string_view name); |
| 58 | 58 | ||
| 59 | /// Creates a layer on the specified display and returns the layer ID. | 59 | /// Creates a layer on the specified display and returns the layer ID. |
| 60 | /// | 60 | /// |
| 61 | /// If an invalid display ID is specified, then an empty optional is returned. | 61 | /// If an invalid display ID is specified, then an empty optional is returned. |
| 62 | std::optional<u64> CreateLayer(u64 display_id); | 62 | [[nodiscard]] std::optional<u64> CreateLayer(u64 display_id); |
| 63 | 63 | ||
| 64 | /// Closes a layer on all displays for the given layer ID. | 64 | /// Closes a layer on all displays for the given layer ID. |
| 65 | void CloseLayer(u64 layer_id); | 65 | void CloseLayer(u64 layer_id); |
| @@ -67,41 +67,39 @@ public: | |||
| 67 | /// Finds the buffer queue ID of the specified layer in the specified display. | 67 | /// Finds the buffer queue ID of the specified layer in the specified display. |
| 68 | /// | 68 | /// |
| 69 | /// If an invalid display ID or layer ID is provided, then an empty optional is returned. | 69 | /// If an invalid display ID or layer ID is provided, then an empty optional is returned. |
| 70 | std::optional<u32> FindBufferQueueId(u64 display_id, u64 layer_id) const; | 70 | [[nodiscard]] std::optional<u32> FindBufferQueueId(u64 display_id, u64 layer_id) const; |
| 71 | 71 | ||
| 72 | /// Gets the vsync event for the specified display. | 72 | /// Gets the vsync event for the specified display. |
| 73 | /// | 73 | /// |
| 74 | /// If an invalid display ID is provided, then nullptr is returned. | 74 | /// If an invalid display ID is provided, then nullptr is returned. |
| 75 | std::shared_ptr<Kernel::ReadableEvent> FindVsyncEvent(u64 display_id) const; | 75 | [[nodiscard]] std::shared_ptr<Kernel::ReadableEvent> FindVsyncEvent(u64 display_id) const; |
| 76 | 76 | ||
| 77 | /// Obtains a buffer queue identified by the ID. | 77 | /// Obtains a buffer queue identified by the ID. |
| 78 | BufferQueue& FindBufferQueue(u32 id); | 78 | [[nodiscard]] BufferQueue& FindBufferQueue(u32 id); |
| 79 | 79 | ||
| 80 | /// Obtains a buffer queue identified by the ID. | 80 | /// Obtains a buffer queue identified by the ID. |
| 81 | const BufferQueue& FindBufferQueue(u32 id) const; | 81 | [[nodiscard]] const BufferQueue& FindBufferQueue(u32 id) const; |
| 82 | 82 | ||
| 83 | /// Performs a composition request to the emulated nvidia GPU and triggers the vsync events when | 83 | /// Performs a composition request to the emulated nvidia GPU and triggers the vsync events when |
| 84 | /// finished. | 84 | /// finished. |
| 85 | void Compose(); | 85 | void Compose(); |
| 86 | 86 | ||
| 87 | s64 GetNextTicks() const; | 87 | [[nodiscard]] s64 GetNextTicks() const; |
| 88 | 88 | ||
| 89 | std::unique_lock<std::mutex> Lock() { | 89 | [[nodiscard]] std::unique_lock<std::mutex> Lock() const { return std::unique_lock{*guard}; } |
| 90 | return std::unique_lock{*guard}; | ||
| 91 | } | ||
| 92 | 90 | ||
| 93 | private: | 91 | private : |
| 94 | /// Finds the display identified by the specified ID. | 92 | /// Finds the display identified by the specified ID. |
| 95 | VI::Display* FindDisplay(u64 display_id); | 93 | [[nodiscard]] VI::Display* FindDisplay(u64 display_id); |
| 96 | 94 | ||
| 97 | /// Finds the display identified by the specified ID. | 95 | /// Finds the display identified by the specified ID. |
| 98 | const VI::Display* FindDisplay(u64 display_id) const; | 96 | [[nodiscard]] const VI::Display* FindDisplay(u64 display_id) const; |
| 99 | 97 | ||
| 100 | /// Finds the layer identified by the specified ID in the desired display. | 98 | /// Finds the layer identified by the specified ID in the desired display. |
| 101 | VI::Layer* FindLayer(u64 display_id, u64 layer_id); | 99 | [[nodiscard]] VI::Layer* FindLayer(u64 display_id, u64 layer_id); |
| 102 | 100 | ||
| 103 | /// Finds the layer identified by the specified ID in the desired display. | 101 | /// Finds the layer identified by the specified ID in the desired display. |
| 104 | const VI::Layer* FindLayer(u64 display_id, u64 layer_id) const; | 102 | [[nodiscard]] const VI::Layer* FindLayer(u64 display_id, u64 layer_id) const; |
| 105 | 103 | ||
| 106 | static void VSyncThread(NVFlinger& nv_flinger); | 104 | static void VSyncThread(NVFlinger& nv_flinger); |
| 107 | 105 | ||
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index ea7b4ae13..825d11a3f 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -511,7 +511,7 @@ private: | |||
| 511 | LOG_DEBUG(Service_VI, "called. id=0x{:08X} transaction={:X}, flags=0x{:08X}", id, | 511 | LOG_DEBUG(Service_VI, "called. id=0x{:08X} transaction={:X}, flags=0x{:08X}", id, |
| 512 | static_cast<u32>(transaction), flags); | 512 | static_cast<u32>(transaction), flags); |
| 513 | 513 | ||
| 514 | nv_flinger->Lock(); | 514 | const auto guard = nv_flinger->Lock(); |
| 515 | auto& buffer_queue = nv_flinger->FindBufferQueue(id); | 515 | auto& buffer_queue = nv_flinger->FindBufferQueue(id); |
| 516 | 516 | ||
| 517 | switch (transaction) { | 517 | switch (transaction) { |
| @@ -551,7 +551,7 @@ private: | |||
| 551 | [=](std::shared_ptr<Kernel::Thread> thread, Kernel::HLERequestContext& ctx, | 551 | [=](std::shared_ptr<Kernel::Thread> thread, Kernel::HLERequestContext& ctx, |
| 552 | Kernel::ThreadWakeupReason reason) { | 552 | Kernel::ThreadWakeupReason reason) { |
| 553 | // Repeat TransactParcel DequeueBuffer when a buffer is available | 553 | // Repeat TransactParcel DequeueBuffer when a buffer is available |
| 554 | nv_flinger->Lock(); | 554 | const auto guard = nv_flinger->Lock(); |
| 555 | auto& buffer_queue = nv_flinger->FindBufferQueue(id); | 555 | auto& buffer_queue = nv_flinger->FindBufferQueue(id); |
| 556 | auto result = buffer_queue.DequeueBuffer(width, height); | 556 | auto result = buffer_queue.DequeueBuffer(width, height); |
| 557 | ASSERT_MSG(result != std::nullopt, "Could not dequeue buffer."); | 557 | ASSERT_MSG(result != std::nullopt, "Could not dequeue buffer."); |
diff --git a/src/input_common/gcadapter/gc_adapter.cpp b/src/input_common/gcadapter/gc_adapter.cpp index 02d06876f..74759ea7d 100644 --- a/src/input_common/gcadapter/gc_adapter.cpp +++ b/src/input_common/gcadapter/gc_adapter.cpp | |||
| @@ -254,7 +254,7 @@ void Adapter::GetGCEndpoint(libusb_device* device) { | |||
| 254 | sizeof(clear_payload), nullptr, 16); | 254 | sizeof(clear_payload), nullptr, 16); |
| 255 | 255 | ||
| 256 | adapter_thread_running = true; | 256 | adapter_thread_running = true; |
| 257 | adapter_input_thread = std::thread([=] { Read(); }); // Read input | 257 | adapter_input_thread = std::thread(&Adapter::Read, this); |
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | Adapter::~Adapter() { | 260 | Adapter::~Adapter() { |
| @@ -265,7 +265,9 @@ void Adapter::Reset() { | |||
| 265 | if (adapter_thread_running) { | 265 | if (adapter_thread_running) { |
| 266 | adapter_thread_running = false; | 266 | adapter_thread_running = false; |
| 267 | } | 267 | } |
| 268 | adapter_input_thread.join(); | 268 | if (adapter_input_thread.joinable()) { |
| 269 | adapter_input_thread.join(); | ||
| 270 | } | ||
| 269 | 271 | ||
| 270 | adapter_controllers_status.fill(ControllerTypes::None); | 272 | adapter_controllers_status.fill(ControllerTypes::None); |
| 271 | get_origin.fill(true); | 273 | get_origin.fill(true); |
diff --git a/src/input_common/gcadapter/gc_poller.cpp b/src/input_common/gcadapter/gc_poller.cpp index 96e22d3ad..f45983f3f 100644 --- a/src/input_common/gcadapter/gc_poller.cpp +++ b/src/input_common/gcadapter/gc_poller.cpp | |||
| @@ -76,8 +76,7 @@ std::unique_ptr<Input::ButtonDevice> GCButtonFactory::Create(const Common::Param | |||
| 76 | 76 | ||
| 77 | // button is not an axis/stick button | 77 | // button is not an axis/stick button |
| 78 | if (button_id != PAD_STICK_ID) { | 78 | if (button_id != PAD_STICK_ID) { |
| 79 | auto button = std::make_unique<GCButton>(port, button_id, adapter.get()); | 79 | return std::make_unique<GCButton>(port, button_id, adapter.get()); |
| 80 | return std::move(button); | ||
| 81 | } | 80 | } |
| 82 | 81 | ||
| 83 | // For Axis buttons, used by the binary sticks. | 82 | // For Axis buttons, used by the binary sticks. |
| @@ -264,7 +263,8 @@ Common::ParamPackage GCAnalogFactory::GetNextInput() { | |||
| 264 | if (analog_x_axis == -1) { | 263 | if (analog_x_axis == -1) { |
| 265 | analog_x_axis = axis; | 264 | analog_x_axis = axis; |
| 266 | controller_number = static_cast<int>(port); | 265 | controller_number = static_cast<int>(port); |
| 267 | } else if (analog_y_axis == -1 && analog_x_axis != axis && controller_number == port) { | 266 | } else if (analog_y_axis == -1 && analog_x_axis != axis && |
| 267 | controller_number == static_cast<int>(port)) { | ||
| 268 | analog_y_axis = axis; | 268 | analog_y_axis = axis; |
| 269 | } | 269 | } |
| 270 | } | 270 | } |
diff --git a/src/input_common/udp/client.cpp b/src/input_common/udp/client.cpp index e63c73c4f..6c95a8b42 100644 --- a/src/input_common/udp/client.cpp +++ b/src/input_common/udp/client.cpp | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | #include <functional> | 9 | #include <functional> |
| 10 | #include <thread> | 10 | #include <thread> |
| 11 | #include <boost/asio.hpp> | 11 | #include <boost/asio.hpp> |
| 12 | #include <boost/bind.hpp> | ||
| 13 | #include "common/logging/log.h" | 12 | #include "common/logging/log.h" |
| 14 | #include "input_common/udp/client.h" | 13 | #include "input_common/udp/client.h" |
| 15 | #include "input_common/udp/protocol.h" | 14 | #include "input_common/udp/protocol.h" |
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 19a34c402..ebfc7b0c7 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -252,7 +252,7 @@ public: | |||
| 252 | const Tegra::DmaPusher& DmaPusher() const; | 252 | const Tegra::DmaPusher& DmaPusher() const; |
| 253 | 253 | ||
| 254 | struct Regs { | 254 | struct Regs { |
| 255 | static constexpr size_t NUM_REGS = 0x100; | 255 | static constexpr size_t NUM_REGS = 0x40; |
| 256 | 256 | ||
| 257 | union { | 257 | union { |
| 258 | struct { | 258 | struct { |
| @@ -271,7 +271,7 @@ public: | |||
| 271 | u32 semaphore_trigger; | 271 | u32 semaphore_trigger; |
| 272 | INSERT_UNION_PADDING_WORDS(0xC); | 272 | INSERT_UNION_PADDING_WORDS(0xC); |
| 273 | 273 | ||
| 274 | // The puser and the puller share the reference counter, the pusher only has read | 274 | // The pusher and the puller share the reference counter, the pusher only has read |
| 275 | // access | 275 | // access |
| 276 | u32 reference_count; | 276 | u32 reference_count; |
| 277 | INSERT_UNION_PADDING_WORDS(0x5); | 277 | INSERT_UNION_PADDING_WORDS(0x5); |
diff --git a/src/yuzu/configuration/configure_debug.ui b/src/yuzu/configuration/configure_debug.ui index 272bdd6b8..9d6feb9f7 100644 --- a/src/yuzu/configuration/configure_debug.ui +++ b/src/yuzu/configuration/configure_debug.ui | |||
| @@ -171,26 +171,6 @@ | |||
| 171 | </property> | 171 | </property> |
| 172 | <layout class="QVBoxLayout" name="verticalLayout_6"> | 172 | <layout class="QVBoxLayout" name="verticalLayout_6"> |
| 173 | <item> | 173 | <item> |
| 174 | <widget class="QCheckBox" name="dump_decompressed_nso"> | ||
| 175 | <property name="whatsThis"> | ||
| 176 | <string>When checked, any NSO yuzu tries to load or patch will be copied decompressed to the yuzu/dump directory.</string> | ||
| 177 | </property> | ||
| 178 | <property name="text"> | ||
| 179 | <string>Dump Decompressed NSOs</string> | ||
| 180 | </property> | ||
| 181 | </widget> | ||
| 182 | </item> | ||
| 183 | <item> | ||
| 184 | <widget class="QCheckBox" name="dump_exefs"> | ||
| 185 | <property name="whatsThis"> | ||
| 186 | <string>When checked, any game that yuzu loads will have its ExeFS dumped to the yuzu/dump directory.</string> | ||
| 187 | </property> | ||
| 188 | <property name="text"> | ||
| 189 | <string>Dump ExeFS</string> | ||
| 190 | </property> | ||
| 191 | </widget> | ||
| 192 | </item> | ||
| 193 | <item> | ||
| 194 | <widget class="QCheckBox" name="reporting_services"> | 174 | <widget class="QCheckBox" name="reporting_services"> |
| 195 | <property name="text"> | 175 | <property name="text"> |
| 196 | <string>Enable Verbose Reporting Services</string> | 176 | <string>Enable Verbose Reporting Services</string> |
| @@ -257,8 +237,6 @@ | |||
| 257 | <tabstop>open_log_button</tabstop> | 237 | <tabstop>open_log_button</tabstop> |
| 258 | <tabstop>homebrew_args_edit</tabstop> | 238 | <tabstop>homebrew_args_edit</tabstop> |
| 259 | <tabstop>enable_graphics_debugging</tabstop> | 239 | <tabstop>enable_graphics_debugging</tabstop> |
| 260 | <tabstop>dump_decompressed_nso</tabstop> | ||
| 261 | <tabstop>dump_exefs</tabstop> | ||
| 262 | <tabstop>reporting_services</tabstop> | 240 | <tabstop>reporting_services</tabstop> |
| 263 | <tabstop>quest_flag</tabstop> | 241 | <tabstop>quest_flag</tabstop> |
| 264 | </tabstops> | 242 | </tabstops> |