diff options
Diffstat (limited to 'src')
120 files changed, 600 insertions, 439 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9182dbfd4..39d038493 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt | |||
| @@ -65,6 +65,10 @@ if (MSVC) | |||
| 65 | /we4305 # 'context': truncation from 'type1' to 'type2' | 65 | /we4305 # 'context': truncation from 'type1' to 'type2' |
| 66 | /we4388 # 'expression': signed/unsigned mismatch | 66 | /we4388 # 'expression': signed/unsigned mismatch |
| 67 | /we4389 # 'operator': signed/unsigned mismatch | 67 | /we4389 # 'operator': signed/unsigned mismatch |
| 68 | /we4456 # Declaration of 'identifier' hides previous local declaration | ||
| 69 | /we4457 # Declaration of 'identifier' hides function parameter | ||
| 70 | /we4458 # Declaration of 'identifier' hides class member | ||
| 71 | /we4459 # Declaration of 'identifier' hides global declaration | ||
| 68 | /we4505 # 'function': unreferenced local function has been removed | 72 | /we4505 # 'function': unreferenced local function has been removed |
| 69 | /we4547 # 'operator': operator before comma has no effect; expected operator with side-effect | 73 | /we4547 # 'operator': operator before comma has no effect; expected operator with side-effect |
| 70 | /we4549 # 'operator1': operator before comma has no effect; did you intend 'operator2'? | 74 | /we4549 # 'operator1': operator before comma has no effect; did you intend 'operator2'? |
| @@ -92,6 +96,7 @@ else() | |||
| 92 | -Werror=missing-declarations | 96 | -Werror=missing-declarations |
| 93 | -Werror=missing-field-initializers | 97 | -Werror=missing-field-initializers |
| 94 | -Werror=reorder | 98 | -Werror=reorder |
| 99 | -Werror=shadow | ||
| 95 | -Werror=sign-compare | 100 | -Werror=sign-compare |
| 96 | -Werror=switch | 101 | -Werror=switch |
| 97 | -Werror=uninitialized | 102 | -Werror=uninitialized |
diff --git a/src/audio_core/CMakeLists.txt b/src/audio_core/CMakeLists.txt index e553b8203..89575a53e 100644 --- a/src/audio_core/CMakeLists.txt +++ b/src/audio_core/CMakeLists.txt | |||
| @@ -49,9 +49,6 @@ if (NOT MSVC) | |||
| 49 | target_compile_options(audio_core PRIVATE | 49 | target_compile_options(audio_core PRIVATE |
| 50 | -Werror=conversion | 50 | -Werror=conversion |
| 51 | -Werror=ignored-qualifiers | 51 | -Werror=ignored-qualifiers |
| 52 | -Werror=shadow | ||
| 53 | -Werror=unused-parameter | ||
| 54 | -Werror=unused-variable | ||
| 55 | 52 | ||
| 56 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter> | 53 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter> |
| 57 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable> | 54 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable> |
diff --git a/src/audio_core/command_generator.cpp b/src/audio_core/command_generator.cpp index ff20ed00f..f97520820 100644 --- a/src/audio_core/command_generator.cpp +++ b/src/audio_core/command_generator.cpp | |||
| @@ -429,7 +429,7 @@ void CommandGenerator::GenerateDataSourceCommand(ServerVoiceInfo& voice_info, Vo | |||
| 429 | in_params.node_id); | 429 | in_params.node_id); |
| 430 | break; | 430 | break; |
| 431 | default: | 431 | default: |
| 432 | UNREACHABLE_MSG("Unimplemented sample format={}", in_params.sample_format); | 432 | ASSERT_MSG(false, "Unimplemented sample format={}", in_params.sample_format); |
| 433 | } | 433 | } |
| 434 | } | 434 | } |
| 435 | } | 435 | } |
| @@ -1312,7 +1312,7 @@ void CommandGenerator::DecodeFromWaveBuffers(ServerVoiceInfo& voice_info, std::s | |||
| 1312 | samples_to_read - samples_read, channel, temp_mix_offset); | 1312 | samples_to_read - samples_read, channel, temp_mix_offset); |
| 1313 | break; | 1313 | break; |
| 1314 | default: | 1314 | default: |
| 1315 | UNREACHABLE_MSG("Unimplemented sample format={}", in_params.sample_format); | 1315 | ASSERT_MSG(false, "Unimplemented sample format={}", in_params.sample_format); |
| 1316 | } | 1316 | } |
| 1317 | 1317 | ||
| 1318 | temp_mix_offset += samples_decoded; | 1318 | temp_mix_offset += samples_decoded; |
diff --git a/src/audio_core/effect_context.cpp b/src/audio_core/effect_context.cpp index 51059580e..79bcd1192 100644 --- a/src/audio_core/effect_context.cpp +++ b/src/audio_core/effect_context.cpp | |||
| @@ -50,7 +50,7 @@ EffectBase* EffectContext::RetargetEffect(std::size_t i, EffectType effect) { | |||
| 50 | effects[i] = std::make_unique<EffectBiquadFilter>(); | 50 | effects[i] = std::make_unique<EffectBiquadFilter>(); |
| 51 | break; | 51 | break; |
| 52 | default: | 52 | default: |
| 53 | UNREACHABLE_MSG("Unimplemented effect {}", effect); | 53 | ASSERT_MSG(false, "Unimplemented effect {}", effect); |
| 54 | effects[i] = std::make_unique<EffectStubbed>(); | 54 | effects[i] = std::make_unique<EffectStubbed>(); |
| 55 | } | 55 | } |
| 56 | return GetInfo(i); | 56 | return GetInfo(i); |
| @@ -104,7 +104,7 @@ void EffectI3dl2Reverb::Update(EffectInfo::InParams& in_params) { | |||
| 104 | auto& params = GetParams(); | 104 | auto& params = GetParams(); |
| 105 | const auto* reverb_params = reinterpret_cast<I3dl2ReverbParams*>(in_params.raw.data()); | 105 | const auto* reverb_params = reinterpret_cast<I3dl2ReverbParams*>(in_params.raw.data()); |
| 106 | if (!ValidChannelCountForEffect(reverb_params->max_channels)) { | 106 | if (!ValidChannelCountForEffect(reverb_params->max_channels)) { |
| 107 | UNREACHABLE_MSG("Invalid reverb max channel count {}", reverb_params->max_channels); | 107 | ASSERT_MSG(false, "Invalid reverb max channel count {}", reverb_params->max_channels); |
| 108 | return; | 108 | return; |
| 109 | } | 109 | } |
| 110 | 110 | ||
diff --git a/src/audio_core/splitter_context.cpp b/src/audio_core/splitter_context.cpp index 1751d0212..10646dc05 100644 --- a/src/audio_core/splitter_context.cpp +++ b/src/audio_core/splitter_context.cpp | |||
| @@ -483,7 +483,7 @@ bool NodeStates::DepthFirstSearch(EdgeMatrix& edge_matrix) { | |||
| 483 | // Add more work | 483 | // Add more work |
| 484 | index_stack.push(j); | 484 | index_stack.push(j); |
| 485 | } else if (node_state == NodeStates::State::InFound) { | 485 | } else if (node_state == NodeStates::State::InFound) { |
| 486 | UNREACHABLE_MSG("Node start marked as found"); | 486 | ASSERT_MSG(false, "Node start marked as found"); |
| 487 | ResetState(); | 487 | ResetState(); |
| 488 | return false; | 488 | return false; |
| 489 | } | 489 | } |
diff --git a/src/audio_core/voice_context.cpp b/src/audio_core/voice_context.cpp index c8e4a6caf..f58a5c754 100644 --- a/src/audio_core/voice_context.cpp +++ b/src/audio_core/voice_context.cpp | |||
| @@ -114,7 +114,7 @@ void ServerVoiceInfo::UpdateParameters(const VoiceInfo::InParams& voice_in, | |||
| 114 | in_params.current_playstate = ServerPlayState::Play; | 114 | in_params.current_playstate = ServerPlayState::Play; |
| 115 | break; | 115 | break; |
| 116 | default: | 116 | default: |
| 117 | UNREACHABLE_MSG("Unknown playstate {}", voice_in.play_state); | 117 | ASSERT_MSG(false, "Unknown playstate {}", voice_in.play_state); |
| 118 | break; | 118 | break; |
| 119 | } | 119 | } |
| 120 | 120 | ||
| @@ -410,7 +410,7 @@ bool ServerVoiceInfo::UpdateParametersForCommandGeneration( | |||
| 410 | return in_params.should_depop; | 410 | return in_params.should_depop; |
| 411 | } | 411 | } |
| 412 | default: | 412 | default: |
| 413 | UNREACHABLE_MSG("Invalid playstate {}", in_params.current_playstate); | 413 | ASSERT_MSG(false, "Invalid playstate {}", in_params.current_playstate); |
| 414 | } | 414 | } |
| 415 | 415 | ||
| 416 | return false; | 416 | return false; |
diff --git a/src/common/assert.cpp b/src/common/assert.cpp index b44570528..6026b7dc2 100644 --- a/src/common/assert.cpp +++ b/src/common/assert.cpp | |||
| @@ -6,8 +6,13 @@ | |||
| 6 | 6 | ||
| 7 | #include "common/settings.h" | 7 | #include "common/settings.h" |
| 8 | 8 | ||
| 9 | void assert_handle_failure() { | 9 | void assert_fail_impl() { |
| 10 | if (Settings::values.use_debug_asserts) { | 10 | if (Settings::values.use_debug_asserts) { |
| 11 | Crash(); | 11 | Crash(); |
| 12 | } | 12 | } |
| 13 | } | 13 | } |
| 14 | |||
| 15 | [[noreturn]] void unreachable_impl() { | ||
| 16 | Crash(); | ||
| 17 | throw std::runtime_error("Unreachable code"); | ||
| 18 | } | ||
diff --git a/src/common/assert.h b/src/common/assert.h index dbfd8abaf..8c927fcc0 100644 --- a/src/common/assert.h +++ b/src/common/assert.h | |||
| @@ -9,44 +9,43 @@ | |||
| 9 | // Sometimes we want to try to continue even after hitting an assert. | 9 | // Sometimes we want to try to continue even after hitting an assert. |
| 10 | // However touching this file yields a global recompilation as this header is included almost | 10 | // However touching this file yields a global recompilation as this header is included almost |
| 11 | // everywhere. So let's just move the handling of the failed assert to a single cpp file. | 11 | // everywhere. So let's just move the handling of the failed assert to a single cpp file. |
| 12 | void assert_handle_failure(); | ||
| 13 | 12 | ||
| 14 | // For asserts we'd like to keep all the junk executed when an assert happens away from the | 13 | void assert_fail_impl(); |
| 15 | // important code in the function. One way of doing this is to put all the relevant code inside a | 14 | [[noreturn]] void unreachable_impl(); |
| 16 | // lambda and force the compiler to not inline it. Unfortunately, MSVC seems to have no syntax to | 15 | |
| 17 | // specify __declspec on lambda functions, so what we do instead is define a noinline wrapper | 16 | #ifdef _MSC_VER |
| 18 | // template that calls the lambda. This seems to generate an extra instruction at the call-site | 17 | #define YUZU_NO_INLINE __declspec(noinline) |
| 19 | // compared to the ideal implementation (which wouldn't support ASSERT_MSG parameters), but is good | 18 | #else |
| 20 | // enough for our purposes. | 19 | #define YUZU_NO_INLINE __attribute__((noinline)) |
| 21 | template <typename Fn> | ||
| 22 | #if defined(_MSC_VER) | ||
| 23 | [[msvc::noinline]] | ||
| 24 | #elif defined(__GNUC__) | ||
| 25 | [[gnu::cold, gnu::noinline]] | ||
| 26 | #endif | 20 | #endif |
| 27 | static void | ||
| 28 | assert_noinline_call(const Fn& fn) { | ||
| 29 | fn(); | ||
| 30 | assert_handle_failure(); | ||
| 31 | } | ||
| 32 | 21 | ||
| 33 | #define ASSERT(_a_) \ | 22 | #define ASSERT(_a_) \ |
| 34 | do \ | 23 | ([&]() YUZU_NO_INLINE { \ |
| 35 | if (!(_a_)) { \ | 24 | if (!(_a_)) [[unlikely]] { \ |
| 36 | assert_noinline_call([] { LOG_CRITICAL(Debug, "Assertion Failed!"); }); \ | 25 | LOG_CRITICAL(Debug, "Assertion Failed!"); \ |
| 26 | assert_fail_impl(); \ | ||
| 37 | } \ | 27 | } \ |
| 38 | while (0) | 28 | }()) |
| 39 | 29 | ||
| 40 | #define ASSERT_MSG(_a_, ...) \ | 30 | #define ASSERT_MSG(_a_, ...) \ |
| 41 | do \ | 31 | ([&]() YUZU_NO_INLINE { \ |
| 42 | if (!(_a_)) { \ | 32 | if (!(_a_)) [[unlikely]] { \ |
| 43 | assert_noinline_call([&] { LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \ | 33 | LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); \ |
| 34 | assert_fail_impl(); \ | ||
| 44 | } \ | 35 | } \ |
| 45 | while (0) | 36 | }()) |
| 37 | |||
| 38 | #define UNREACHABLE() \ | ||
| 39 | do { \ | ||
| 40 | LOG_CRITICAL(Debug, "Unreachable code!"); \ | ||
| 41 | unreachable_impl(); \ | ||
| 42 | } while (0) | ||
| 46 | 43 | ||
| 47 | #define UNREACHABLE() assert_noinline_call([] { LOG_CRITICAL(Debug, "Unreachable code!"); }) | ||
| 48 | #define UNREACHABLE_MSG(...) \ | 44 | #define UNREACHABLE_MSG(...) \ |
| 49 | assert_noinline_call([&] { LOG_CRITICAL(Debug, "Unreachable code!\n" __VA_ARGS__); }) | 45 | do { \ |
| 46 | LOG_CRITICAL(Debug, "Unreachable code!\n" __VA_ARGS__); \ | ||
| 47 | unreachable_impl(); \ | ||
| 48 | } while (0) | ||
| 50 | 49 | ||
| 51 | #ifdef _DEBUG | 50 | #ifdef _DEBUG |
| 52 | #define DEBUG_ASSERT(_a_) ASSERT(_a_) | 51 | #define DEBUG_ASSERT(_a_) ASSERT(_a_) |
diff --git a/src/common/detached_tasks.cpp b/src/common/detached_tasks.cpp index c1362631e..ec31d0b88 100644 --- a/src/common/detached_tasks.cpp +++ b/src/common/detached_tasks.cpp | |||
| @@ -33,9 +33,9 @@ void DetachedTasks::AddTask(std::function<void()> task) { | |||
| 33 | ++instance->count; | 33 | ++instance->count; |
| 34 | std::thread([task{std::move(task)}]() { | 34 | std::thread([task{std::move(task)}]() { |
| 35 | task(); | 35 | task(); |
| 36 | std::unique_lock lock{instance->mutex}; | 36 | std::unique_lock thread_lock{instance->mutex}; |
| 37 | --instance->count; | 37 | --instance->count; |
| 38 | std::notify_all_at_thread_exit(instance->cv, std::move(lock)); | 38 | std::notify_all_at_thread_exit(instance->cv, std::move(thread_lock)); |
| 39 | }).detach(); | 39 | }).detach(); |
| 40 | } | 40 | } |
| 41 | 41 | ||
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 6ffab63af..751549583 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -147,7 +147,7 @@ void UpdateRescalingInfo() { | |||
| 147 | info.down_shift = 0; | 147 | info.down_shift = 0; |
| 148 | break; | 148 | break; |
| 149 | default: | 149 | default: |
| 150 | UNREACHABLE(); | 150 | ASSERT(false); |
| 151 | info.up_scale = 1; | 151 | info.up_scale = 1; |
| 152 | info.down_shift = 0; | 152 | info.down_shift = 0; |
| 153 | } | 153 | } |
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 2bd720f08..670410e75 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -743,16 +743,11 @@ if (MSVC) | |||
| 743 | /we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data | 743 | /we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data |
| 744 | /we4245 # 'conversion': conversion from 'type1' to 'type2', signed/unsigned mismatch | 744 | /we4245 # 'conversion': conversion from 'type1' to 'type2', signed/unsigned mismatch |
| 745 | /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data | 745 | /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data |
| 746 | /we4456 # Declaration of 'identifier' hides previous local declaration | ||
| 747 | /we4457 # Declaration of 'identifier' hides function parameter | ||
| 748 | /we4458 # Declaration of 'identifier' hides class member | ||
| 749 | /we4459 # Declaration of 'identifier' hides global declaration | ||
| 750 | ) | 746 | ) |
| 751 | else() | 747 | else() |
| 752 | target_compile_options(core PRIVATE | 748 | target_compile_options(core PRIVATE |
| 753 | -Werror=conversion | 749 | -Werror=conversion |
| 754 | -Werror=ignored-qualifiers | 750 | -Werror=ignored-qualifiers |
| 755 | -Werror=shadow | ||
| 756 | 751 | ||
| 757 | $<$<CXX_COMPILER_ID:GNU>:-Werror=class-memaccess> | 752 | $<$<CXX_COMPILER_ID:GNU>:-Werror=class-memaccess> |
| 758 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter> | 753 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter> |
diff --git a/src/core/arm/arm_interface.cpp b/src/core/arm/arm_interface.cpp index 9b5a5ca57..9a285dfc6 100644 --- a/src/core/arm/arm_interface.cpp +++ b/src/core/arm/arm_interface.cpp | |||
| @@ -107,6 +107,7 @@ void ARM_Interface::Run() { | |||
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | // Otherwise, run the thread. | 109 | // Otherwise, run the thread. |
| 110 | system.EnterDynarmicProfile(); | ||
| 110 | if (current_thread->GetStepState() == StepState::StepPending) { | 111 | if (current_thread->GetStepState() == StepState::StepPending) { |
| 111 | hr = StepJit(); | 112 | hr = StepJit(); |
| 112 | 113 | ||
| @@ -116,6 +117,7 @@ void ARM_Interface::Run() { | |||
| 116 | } else { | 117 | } else { |
| 117 | hr = RunJit(); | 118 | hr = RunJit(); |
| 118 | } | 119 | } |
| 120 | system.ExitDynarmicProfile(); | ||
| 119 | 121 | ||
| 120 | // Notify the debugger and go to sleep if a breakpoint was hit. | 122 | // Notify the debugger and go to sleep if a breakpoint was hit. |
| 121 | if (Has(hr, breakpoint)) { | 123 | if (Has(hr, breakpoint)) { |
diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp index b4718fbbe..132fe5b60 100644 --- a/src/core/cpu_manager.cpp +++ b/src/core/cpu_manager.cpp | |||
| @@ -113,12 +113,10 @@ void CpuManager::MultiCoreRunGuestLoop() { | |||
| 113 | 113 | ||
| 114 | while (true) { | 114 | while (true) { |
| 115 | auto* physical_core = &kernel.CurrentPhysicalCore(); | 115 | auto* physical_core = &kernel.CurrentPhysicalCore(); |
| 116 | system.EnterDynarmicProfile(); | ||
| 117 | while (!physical_core->IsInterrupted()) { | 116 | while (!physical_core->IsInterrupted()) { |
| 118 | physical_core->Run(); | 117 | physical_core->Run(); |
| 119 | physical_core = &kernel.CurrentPhysicalCore(); | 118 | physical_core = &kernel.CurrentPhysicalCore(); |
| 120 | } | 119 | } |
| 121 | system.ExitDynarmicProfile(); | ||
| 122 | { | 120 | { |
| 123 | Kernel::KScopedDisableDispatch dd(kernel); | 121 | Kernel::KScopedDisableDispatch dd(kernel); |
| 124 | physical_core->ArmInterface().ClearExclusiveState(); | 122 | physical_core->ArmInterface().ClearExclusiveState(); |
| @@ -166,12 +164,10 @@ void CpuManager::SingleCoreRunGuestLoop() { | |||
| 166 | auto& kernel = system.Kernel(); | 164 | auto& kernel = system.Kernel(); |
| 167 | while (true) { | 165 | while (true) { |
| 168 | auto* physical_core = &kernel.CurrentPhysicalCore(); | 166 | auto* physical_core = &kernel.CurrentPhysicalCore(); |
| 169 | system.EnterDynarmicProfile(); | ||
| 170 | if (!physical_core->IsInterrupted()) { | 167 | if (!physical_core->IsInterrupted()) { |
| 171 | physical_core->Run(); | 168 | physical_core->Run(); |
| 172 | physical_core = &kernel.CurrentPhysicalCore(); | 169 | physical_core = &kernel.CurrentPhysicalCore(); |
| 173 | } | 170 | } |
| 174 | system.ExitDynarmicProfile(); | ||
| 175 | kernel.SetIsPhantomModeForSingleCore(true); | 171 | kernel.SetIsPhantomModeForSingleCore(true); |
| 176 | system.CoreTiming().Advance(); | 172 | system.CoreTiming().Advance(); |
| 177 | kernel.SetIsPhantomModeForSingleCore(false); | 173 | kernel.SetIsPhantomModeForSingleCore(false); |
diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp index e3c4f80eb..443323390 100644 --- a/src/core/crypto/key_manager.cpp +++ b/src/core/crypto/key_manager.cpp | |||
| @@ -140,7 +140,6 @@ u64 GetSignatureTypeDataSize(SignatureType type) { | |||
| 140 | return 0x3C; | 140 | return 0x3C; |
| 141 | } | 141 | } |
| 142 | UNREACHABLE(); | 142 | UNREACHABLE(); |
| 143 | return 0; | ||
| 144 | } | 143 | } |
| 145 | 144 | ||
| 146 | u64 GetSignatureTypePaddingSize(SignatureType type) { | 145 | u64 GetSignatureTypePaddingSize(SignatureType type) { |
| @@ -155,7 +154,6 @@ u64 GetSignatureTypePaddingSize(SignatureType type) { | |||
| 155 | return 0x40; | 154 | return 0x40; |
| 156 | } | 155 | } |
| 157 | UNREACHABLE(); | 156 | UNREACHABLE(); |
| 158 | return 0; | ||
| 159 | } | 157 | } |
| 160 | 158 | ||
| 161 | SignatureType Ticket::GetSignatureType() const { | 159 | SignatureType Ticket::GetSignatureType() const { |
diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp index 93f784418..78e56bbbd 100644 --- a/src/core/file_sys/content_archive.cpp +++ b/src/core/file_sys/content_archive.cpp | |||
| @@ -419,7 +419,7 @@ std::optional<Core::Crypto::Key128> NCA::GetKeyAreaKey(NCASectionCryptoType type | |||
| 419 | Core::Crypto::Mode::ECB); | 419 | Core::Crypto::Mode::ECB); |
| 420 | cipher.Transcode(key_area.data(), key_area.size(), key_area.data(), Core::Crypto::Op::Decrypt); | 420 | cipher.Transcode(key_area.data(), key_area.size(), key_area.data(), Core::Crypto::Op::Decrypt); |
| 421 | 421 | ||
| 422 | Core::Crypto::Key128 out; | 422 | Core::Crypto::Key128 out{}; |
| 423 | if (type == NCASectionCryptoType::XTS) { | 423 | if (type == NCASectionCryptoType::XTS) { |
| 424 | std::copy(key_area.begin(), key_area.begin() + 0x10, out.begin()); | 424 | std::copy(key_area.begin(), key_area.begin() + 0x10, out.begin()); |
| 425 | } else if (type == NCASectionCryptoType::CTR || type == NCASectionCryptoType::BKTR) { | 425 | } else if (type == NCASectionCryptoType::CTR || type == NCASectionCryptoType::BKTR) { |
diff --git a/src/core/file_sys/nca_patch.cpp b/src/core/file_sys/nca_patch.cpp index d4c0a974a..2735d053b 100644 --- a/src/core/file_sys/nca_patch.cpp +++ b/src/core/file_sys/nca_patch.cpp | |||
| @@ -50,7 +50,7 @@ std::pair<std::size_t, std::size_t> SearchBucketEntry(u64 offset, const BlockTyp | |||
| 50 | low = mid + 1; | 50 | low = mid + 1; |
| 51 | } | 51 | } |
| 52 | } | 52 | } |
| 53 | UNREACHABLE_MSG("Offset could not be found in BKTR block."); | 53 | ASSERT_MSG(false, "Offset could not be found in BKTR block."); |
| 54 | return {0, 0}; | 54 | return {0, 0}; |
| 55 | } | 55 | } |
| 56 | } // Anonymous namespace | 56 | } // Anonymous namespace |
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index 2eaac73ef..878d832c2 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp | |||
| @@ -108,7 +108,7 @@ ContentRecordType GetCRTypeFromNCAType(NCAContentType type) { | |||
| 108 | // TODO(DarkLordZach): Peek at NCA contents to differentiate Manual and Legal. | 108 | // TODO(DarkLordZach): Peek at NCA contents to differentiate Manual and Legal. |
| 109 | return ContentRecordType::HtmlDocument; | 109 | return ContentRecordType::HtmlDocument; |
| 110 | default: | 110 | default: |
| 111 | UNREACHABLE_MSG("Invalid NCAContentType={:02X}", type); | 111 | ASSERT_MSG(false, "Invalid NCAContentType={:02X}", type); |
| 112 | return ContentRecordType{}; | 112 | return ContentRecordType{}; |
| 113 | } | 113 | } |
| 114 | } | 114 | } |
diff --git a/src/core/file_sys/vfs_real.cpp b/src/core/file_sys/vfs_real.cpp index e42d7c9f6..cc0076238 100644 --- a/src/core/file_sys/vfs_real.cpp +++ b/src/core/file_sys/vfs_real.cpp | |||
| @@ -144,7 +144,7 @@ VirtualFile RealVfsFilesystem::MoveFile(std::string_view old_path_, std::string_ | |||
| 144 | LOG_ERROR(Service_FS, "Failed to open path {} in order to re-cache it", new_path); | 144 | LOG_ERROR(Service_FS, "Failed to open path {} in order to re-cache it", new_path); |
| 145 | } | 145 | } |
| 146 | } else { | 146 | } else { |
| 147 | UNREACHABLE(); | 147 | ASSERT(false); |
| 148 | return nullptr; | 148 | return nullptr; |
| 149 | } | 149 | } |
| 150 | 150 | ||
diff --git a/src/core/frontend/applets/controller.cpp b/src/core/frontend/applets/controller.cpp index 0ff2a338e..6c230f619 100644 --- a/src/core/frontend/applets/controller.cpp +++ b/src/core/frontend/applets/controller.cpp | |||
| @@ -65,7 +65,7 @@ void DefaultControllerApplet::ReconfigureControllers(std::function<void()> callb | |||
| 65 | controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::Handheld); | 65 | controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::Handheld); |
| 66 | controller->Connect(true); | 66 | controller->Connect(true); |
| 67 | } else { | 67 | } else { |
| 68 | UNREACHABLE_MSG("Unable to add a new controller based on the given parameters!"); | 68 | ASSERT_MSG(false, "Unable to add a new controller based on the given parameters!"); |
| 69 | } | 69 | } |
| 70 | } | 70 | } |
| 71 | 71 | ||
diff --git a/src/core/hid/hid_core.cpp b/src/core/hid/hid_core.cpp index 7eed52593..7d6373414 100644 --- a/src/core/hid/hid_core.cpp +++ b/src/core/hid/hid_core.cpp | |||
| @@ -48,7 +48,7 @@ EmulatedController* HIDCore::GetEmulatedController(NpadIdType npad_id_type) { | |||
| 48 | return handheld.get(); | 48 | return handheld.get(); |
| 49 | case NpadIdType::Invalid: | 49 | case NpadIdType::Invalid: |
| 50 | default: | 50 | default: |
| 51 | UNREACHABLE_MSG("Invalid NpadIdType={}", npad_id_type); | 51 | ASSERT_MSG(false, "Invalid NpadIdType={}", npad_id_type); |
| 52 | return nullptr; | 52 | return nullptr; |
| 53 | } | 53 | } |
| 54 | } | 54 | } |
| @@ -77,7 +77,7 @@ const EmulatedController* HIDCore::GetEmulatedController(NpadIdType npad_id_type | |||
| 77 | return handheld.get(); | 77 | return handheld.get(); |
| 78 | case NpadIdType::Invalid: | 78 | case NpadIdType::Invalid: |
| 79 | default: | 79 | default: |
| 80 | UNREACHABLE_MSG("Invalid NpadIdType={}", npad_id_type); | 80 | ASSERT_MSG(false, "Invalid NpadIdType={}", npad_id_type); |
| 81 | return nullptr; | 81 | return nullptr; |
| 82 | } | 82 | } |
| 83 | } | 83 | } |
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index a427cbc93..0ddc8df9e 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h | |||
| @@ -141,7 +141,7 @@ public: | |||
| 141 | if (index < DomainHandlerCount()) { | 141 | if (index < DomainHandlerCount()) { |
| 142 | domain_handlers[index] = nullptr; | 142 | domain_handlers[index] = nullptr; |
| 143 | } else { | 143 | } else { |
| 144 | UNREACHABLE_MSG("Unexpected handler index {}", index); | 144 | ASSERT_MSG(false, "Unexpected handler index {}", index); |
| 145 | } | 145 | } |
| 146 | } | 146 | } |
| 147 | 147 | ||
diff --git a/src/core/hle/kernel/init/init_slab_setup.cpp b/src/core/hle/kernel/init/init_slab_setup.cpp index 34a8be052..9b6b284d0 100644 --- a/src/core/hle/kernel/init/init_slab_setup.cpp +++ b/src/core/hle/kernel/init/init_slab_setup.cpp | |||
| @@ -244,7 +244,7 @@ void InitializeSlabHeaps(Core::System& system, KMemoryLayout& memory_layout) { | |||
| 244 | FOREACH_SLAB_TYPE(INITIALIZE_SLAB_HEAP) | 244 | FOREACH_SLAB_TYPE(INITIALIZE_SLAB_HEAP) |
| 245 | // If we somehow get an invalid type, abort. | 245 | // If we somehow get an invalid type, abort. |
| 246 | default: | 246 | default: |
| 247 | UNREACHABLE_MSG("Unknown slab type: {}", slab_types[i]); | 247 | ASSERT_MSG(false, "Unknown slab type: {}", slab_types[i]); |
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | // If we've hit the end of a gap, free it. | 250 | // If we've hit the end of a gap, free it. |
diff --git a/src/core/hle/kernel/k_address_arbiter.h b/src/core/hle/kernel/k_address_arbiter.h index e46e0d848..5fa19d386 100644 --- a/src/core/hle/kernel/k_address_arbiter.h +++ b/src/core/hle/kernel/k_address_arbiter.h | |||
| @@ -35,7 +35,7 @@ public: | |||
| 35 | case Svc::SignalType::SignalAndModifyByWaitingCountIfEqual: | 35 | case Svc::SignalType::SignalAndModifyByWaitingCountIfEqual: |
| 36 | return SignalAndModifyByWaitingCountIfEqual(addr, value, count); | 36 | return SignalAndModifyByWaitingCountIfEqual(addr, value, count); |
| 37 | } | 37 | } |
| 38 | UNREACHABLE(); | 38 | ASSERT(false); |
| 39 | return ResultUnknown; | 39 | return ResultUnknown; |
| 40 | } | 40 | } |
| 41 | 41 | ||
| @@ -49,7 +49,7 @@ public: | |||
| 49 | case Svc::ArbitrationType::WaitIfEqual: | 49 | case Svc::ArbitrationType::WaitIfEqual: |
| 50 | return WaitIfEqual(addr, value, timeout); | 50 | return WaitIfEqual(addr, value, timeout); |
| 51 | } | 51 | } |
| 52 | UNREACHABLE(); | 52 | ASSERT(false); |
| 53 | return ResultUnknown; | 53 | return ResultUnknown; |
| 54 | } | 54 | } |
| 55 | 55 | ||
diff --git a/src/core/hle/kernel/k_address_space_info.cpp b/src/core/hle/kernel/k_address_space_info.cpp index bc37cadda..3e612a207 100644 --- a/src/core/hle/kernel/k_address_space_info.cpp +++ b/src/core/hle/kernel/k_address_space_info.cpp | |||
| @@ -84,7 +84,7 @@ u64 KAddressSpaceInfo::GetAddressSpaceStart(std::size_t width, Type type) { | |||
| 84 | ASSERT(IsAllowedIndexForAddress(AddressSpaceIndices39Bit[index])); | 84 | ASSERT(IsAllowedIndexForAddress(AddressSpaceIndices39Bit[index])); |
| 85 | return AddressSpaceInfos[AddressSpaceIndices39Bit[index]].address; | 85 | return AddressSpaceInfos[AddressSpaceIndices39Bit[index]].address; |
| 86 | } | 86 | } |
| 87 | UNREACHABLE(); | 87 | ASSERT(false); |
| 88 | return 0; | 88 | return 0; |
| 89 | } | 89 | } |
| 90 | 90 | ||
| @@ -101,7 +101,7 @@ std::size_t KAddressSpaceInfo::GetAddressSpaceSize(std::size_t width, Type type) | |||
| 101 | ASSERT(IsAllowed39BitType(type)); | 101 | ASSERT(IsAllowed39BitType(type)); |
| 102 | return AddressSpaceInfos[AddressSpaceIndices39Bit[index]].size; | 102 | return AddressSpaceInfos[AddressSpaceIndices39Bit[index]].size; |
| 103 | } | 103 | } |
| 104 | UNREACHABLE(); | 104 | ASSERT(false); |
| 105 | return 0; | 105 | return 0; |
| 106 | } | 106 | } |
| 107 | 107 | ||
diff --git a/src/core/hle/kernel/k_auto_object.h b/src/core/hle/kernel/k_auto_object.h index ea47fc600..2827763d5 100644 --- a/src/core/hle/kernel/k_auto_object.h +++ b/src/core/hle/kernel/k_auto_object.h | |||
| @@ -18,7 +18,7 @@ namespace Kernel { | |||
| 18 | class KernelCore; | 18 | class KernelCore; |
| 19 | class KProcess; | 19 | class KProcess; |
| 20 | 20 | ||
| 21 | #define KERNEL_AUTOOBJECT_TRAITS(CLASS, BASE_CLASS) \ | 21 | #define KERNEL_AUTOOBJECT_TRAITS_IMPL(CLASS, BASE_CLASS, ATTRIBUTE) \ |
| 22 | \ | 22 | \ |
| 23 | private: \ | 23 | private: \ |
| 24 | friend class ::Kernel::KClassTokenGenerator; \ | 24 | friend class ::Kernel::KClassTokenGenerator; \ |
| @@ -40,16 +40,19 @@ public: | |||
| 40 | static constexpr const char* GetStaticTypeName() { \ | 40 | static constexpr const char* GetStaticTypeName() { \ |
| 41 | return TypeName; \ | 41 | return TypeName; \ |
| 42 | } \ | 42 | } \ |
| 43 | virtual TypeObj GetTypeObj() const { \ | 43 | virtual TypeObj GetTypeObj() ATTRIBUTE { \ |
| 44 | return GetStaticTypeObj(); \ | 44 | return GetStaticTypeObj(); \ |
| 45 | } \ | 45 | } \ |
| 46 | virtual const char* GetTypeName() const { \ | 46 | virtual const char* GetTypeName() ATTRIBUTE { \ |
| 47 | return GetStaticTypeName(); \ | 47 | return GetStaticTypeName(); \ |
| 48 | } \ | 48 | } \ |
| 49 | \ | 49 | \ |
| 50 | private: \ | 50 | private: \ |
| 51 | constexpr bool operator!=(const TypeObj& rhs) | 51 | constexpr bool operator!=(const TypeObj& rhs) |
| 52 | 52 | ||
| 53 | #define KERNEL_AUTOOBJECT_TRAITS(CLASS, BASE_CLASS) \ | ||
| 54 | KERNEL_AUTOOBJECT_TRAITS_IMPL(CLASS, BASE_CLASS, const override) | ||
| 55 | |||
| 53 | class KAutoObject { | 56 | class KAutoObject { |
| 54 | protected: | 57 | protected: |
| 55 | class TypeObj { | 58 | class TypeObj { |
| @@ -82,7 +85,7 @@ protected: | |||
| 82 | }; | 85 | }; |
| 83 | 86 | ||
| 84 | private: | 87 | private: |
| 85 | KERNEL_AUTOOBJECT_TRAITS(KAutoObject, KAutoObject); | 88 | KERNEL_AUTOOBJECT_TRAITS_IMPL(KAutoObject, KAutoObject, const); |
| 86 | 89 | ||
| 87 | public: | 90 | public: |
| 88 | explicit KAutoObject(KernelCore& kernel_) : kernel(kernel_) { | 91 | explicit KAutoObject(KernelCore& kernel_) : kernel(kernel_) { |
diff --git a/src/core/hle/kernel/k_class_token.h b/src/core/hle/kernel/k_class_token.h index be9e3c357..c9001ae3d 100644 --- a/src/core/hle/kernel/k_class_token.h +++ b/src/core/hle/kernel/k_class_token.h | |||
| @@ -49,6 +49,7 @@ private: | |||
| 49 | } | 49 | } |
| 50 | } | 50 | } |
| 51 | } | 51 | } |
| 52 | UNREACHABLE(); | ||
| 52 | }(); | 53 | }(); |
| 53 | 54 | ||
| 54 | template <typename T> | 55 | template <typename T> |
diff --git a/src/core/hle/kernel/k_memory_manager.cpp b/src/core/hle/kernel/k_memory_manager.cpp index a55db3088..58e540f31 100644 --- a/src/core/hle/kernel/k_memory_manager.cpp +++ b/src/core/hle/kernel/k_memory_manager.cpp | |||
| @@ -29,7 +29,7 @@ constexpr KMemoryManager::Pool GetPoolFromMemoryRegionType(u32 type) { | |||
| 29 | } else if ((type | KMemoryRegionType_DramSystemNonSecurePool) == type) { | 29 | } else if ((type | KMemoryRegionType_DramSystemNonSecurePool) == type) { |
| 30 | return KMemoryManager::Pool::SystemNonSecure; | 30 | return KMemoryManager::Pool::SystemNonSecure; |
| 31 | } else { | 31 | } else { |
| 32 | UNREACHABLE_MSG("InvalidMemoryRegionType for conversion to Pool"); | 32 | ASSERT_MSG(false, "InvalidMemoryRegionType for conversion to Pool"); |
| 33 | return {}; | 33 | return {}; |
| 34 | } | 34 | } |
| 35 | } | 35 | } |
diff --git a/src/core/hle/kernel/k_page_table.cpp b/src/core/hle/kernel/k_page_table.cpp index 68867a2bb..504e22cb9 100644 --- a/src/core/hle/kernel/k_page_table.cpp +++ b/src/core/hle/kernel/k_page_table.cpp | |||
| @@ -35,7 +35,7 @@ constexpr std::size_t GetAddressSpaceWidthFromType(FileSys::ProgramAddressSpaceT | |||
| 35 | case FileSys::ProgramAddressSpaceType::Is39Bit: | 35 | case FileSys::ProgramAddressSpaceType::Is39Bit: |
| 36 | return 39; | 36 | return 39; |
| 37 | default: | 37 | default: |
| 38 | UNREACHABLE(); | 38 | ASSERT(false); |
| 39 | return {}; | 39 | return {}; |
| 40 | } | 40 | } |
| 41 | } | 41 | } |
| @@ -128,7 +128,7 @@ ResultCode KPageTable::InitializeForProcess(FileSys::ProgramAddressSpaceType as_ | |||
| 128 | const std::size_t needed_size{ | 128 | const std::size_t needed_size{ |
| 129 | (alias_region_size + heap_region_size + stack_region_size + kernel_map_region_size)}; | 129 | (alias_region_size + heap_region_size + stack_region_size + kernel_map_region_size)}; |
| 130 | if (alloc_size < needed_size) { | 130 | if (alloc_size < needed_size) { |
| 131 | UNREACHABLE(); | 131 | ASSERT(false); |
| 132 | return ResultOutOfMemory; | 132 | return ResultOutOfMemory; |
| 133 | } | 133 | } |
| 134 | 134 | ||
| @@ -1430,7 +1430,7 @@ ResultCode KPageTable::SetProcessMemoryPermission(VAddr addr, std::size_t size, | |||
| 1430 | new_state = KMemoryState::AliasCodeData; | 1430 | new_state = KMemoryState::AliasCodeData; |
| 1431 | break; | 1431 | break; |
| 1432 | default: | 1432 | default: |
| 1433 | UNREACHABLE(); | 1433 | ASSERT(false); |
| 1434 | } | 1434 | } |
| 1435 | } | 1435 | } |
| 1436 | 1436 | ||
| @@ -1823,9 +1823,7 @@ void KPageTable::AddRegionToPages(VAddr start, std::size_t num_pages, | |||
| 1823 | VAddr addr{start}; | 1823 | VAddr addr{start}; |
| 1824 | while (addr < start + (num_pages * PageSize)) { | 1824 | while (addr < start + (num_pages * PageSize)) { |
| 1825 | const PAddr paddr{GetPhysicalAddr(addr)}; | 1825 | const PAddr paddr{GetPhysicalAddr(addr)}; |
| 1826 | if (!paddr) { | 1826 | ASSERT(paddr != 0); |
| 1827 | UNREACHABLE(); | ||
| 1828 | } | ||
| 1829 | page_linked_list.AddBlock(paddr, 1); | 1827 | page_linked_list.AddBlock(paddr, 1); |
| 1830 | addr += PageSize; | 1828 | addr += PageSize; |
| 1831 | } | 1829 | } |
| @@ -1856,7 +1854,7 @@ ResultCode KPageTable::Operate(VAddr addr, std::size_t num_pages, const KPageLin | |||
| 1856 | system.Memory().MapMemoryRegion(page_table_impl, addr, size, node.GetAddress()); | 1854 | system.Memory().MapMemoryRegion(page_table_impl, addr, size, node.GetAddress()); |
| 1857 | break; | 1855 | break; |
| 1858 | default: | 1856 | default: |
| 1859 | UNREACHABLE(); | 1857 | ASSERT(false); |
| 1860 | } | 1858 | } |
| 1861 | 1859 | ||
| 1862 | addr += size; | 1860 | addr += size; |
| @@ -1887,7 +1885,7 @@ ResultCode KPageTable::Operate(VAddr addr, std::size_t num_pages, KMemoryPermiss | |||
| 1887 | case OperationType::ChangePermissionsAndRefresh: | 1885 | case OperationType::ChangePermissionsAndRefresh: |
| 1888 | break; | 1886 | break; |
| 1889 | default: | 1887 | default: |
| 1890 | UNREACHABLE(); | 1888 | ASSERT(false); |
| 1891 | } | 1889 | } |
| 1892 | return ResultSuccess; | 1890 | return ResultSuccess; |
| 1893 | } | 1891 | } |
| @@ -1924,7 +1922,6 @@ VAddr KPageTable::GetRegionAddress(KMemoryState state) const { | |||
| 1924 | return code_region_start; | 1922 | return code_region_start; |
| 1925 | default: | 1923 | default: |
| 1926 | UNREACHABLE(); | 1924 | UNREACHABLE(); |
| 1927 | return {}; | ||
| 1928 | } | 1925 | } |
| 1929 | } | 1926 | } |
| 1930 | 1927 | ||
| @@ -1960,7 +1957,6 @@ std::size_t KPageTable::GetRegionSize(KMemoryState state) const { | |||
| 1960 | return code_region_end - code_region_start; | 1957 | return code_region_end - code_region_start; |
| 1961 | default: | 1958 | default: |
| 1962 | UNREACHABLE(); | 1959 | UNREACHABLE(); |
| 1963 | return {}; | ||
| 1964 | } | 1960 | } |
| 1965 | } | 1961 | } |
| 1966 | 1962 | ||
diff --git a/src/core/hle/kernel/k_port.cpp b/src/core/hle/kernel/k_port.cpp index a31861cdb..51c2cd1ef 100644 --- a/src/core/hle/kernel/k_port.cpp +++ b/src/core/hle/kernel/k_port.cpp | |||
| @@ -60,7 +60,7 @@ ResultCode KPort::EnqueueSession(KServerSession* session) { | |||
| 60 | if (auto session_ptr = server.GetSessionRequestHandler().lock()) { | 60 | if (auto session_ptr = server.GetSessionRequestHandler().lock()) { |
| 61 | session_ptr->ClientConnected(server.AcceptSession()); | 61 | session_ptr->ClientConnected(server.AcceptSession()); |
| 62 | } else { | 62 | } else { |
| 63 | UNREACHABLE(); | 63 | ASSERT(false); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | return ResultSuccess; | 66 | return ResultSuccess; |
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp index dcfeacccd..8c79b4f0f 100644 --- a/src/core/hle/kernel/k_process.cpp +++ b/src/core/hle/kernel/k_process.cpp | |||
| @@ -350,7 +350,7 @@ ResultCode KProcess::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, | |||
| 350 | break; | 350 | break; |
| 351 | 351 | ||
| 352 | default: | 352 | default: |
| 353 | UNREACHABLE(); | 353 | ASSERT(false); |
| 354 | } | 354 | } |
| 355 | 355 | ||
| 356 | // Create TLS region | 356 | // Create TLS region |
diff --git a/src/core/hle/kernel/k_server_session.cpp b/src/core/hle/kernel/k_server_session.cpp index 7e39f6d50..60f8ed470 100644 --- a/src/core/hle/kernel/k_server_session.cpp +++ b/src/core/hle/kernel/k_server_session.cpp | |||
| @@ -97,13 +97,13 @@ ResultCode KServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& co | |||
| 97 | "object_id {} is too big! This probably means a recent service call " | 97 | "object_id {} is too big! This probably means a recent service call " |
| 98 | "to {} needed to return a new interface!", | 98 | "to {} needed to return a new interface!", |
| 99 | object_id, name); | 99 | object_id, name); |
| 100 | UNREACHABLE(); | 100 | ASSERT(false); |
| 101 | return ResultSuccess; // Ignore error if asserts are off | 101 | return ResultSuccess; // Ignore error if asserts are off |
| 102 | } | 102 | } |
| 103 | if (auto strong_ptr = manager->DomainHandler(object_id - 1).lock()) { | 103 | if (auto strong_ptr = manager->DomainHandler(object_id - 1).lock()) { |
| 104 | return strong_ptr->HandleSyncRequest(*this, context); | 104 | return strong_ptr->HandleSyncRequest(*this, context); |
| 105 | } else { | 105 | } else { |
| 106 | UNREACHABLE(); | 106 | ASSERT(false); |
| 107 | return ResultSuccess; | 107 | return ResultSuccess; |
| 108 | } | 108 | } |
| 109 | 109 | ||
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp index 940334f59..ea2160099 100644 --- a/src/core/hle/kernel/k_thread.cpp +++ b/src/core/hle/kernel/k_thread.cpp | |||
| @@ -133,7 +133,7 @@ ResultCode KThread::Initialize(KThreadFunction func, uintptr_t arg, VAddr user_s | |||
| 133 | UNIMPLEMENTED(); | 133 | UNIMPLEMENTED(); |
| 134 | break; | 134 | break; |
| 135 | default: | 135 | default: |
| 136 | UNREACHABLE_MSG("KThread::Initialize: Unknown ThreadType {}", static_cast<u32>(type)); | 136 | ASSERT_MSG(false, "KThread::Initialize: Unknown ThreadType {}", static_cast<u32>(type)); |
| 137 | break; | 137 | break; |
| 138 | } | 138 | } |
| 139 | thread_type = type; | 139 | thread_type = type; |
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 7eb961912..b2c4f12b4 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -212,7 +212,9 @@ struct KernelCore::Impl { | |||
| 212 | system_resource_limit = KResourceLimit::Create(system.Kernel()); | 212 | system_resource_limit = KResourceLimit::Create(system.Kernel()); |
| 213 | system_resource_limit->Initialize(&core_timing); | 213 | system_resource_limit->Initialize(&core_timing); |
| 214 | 214 | ||
| 215 | const auto [total_size, kernel_size] = memory_layout->GetTotalAndKernelMemorySizes(); | 215 | const auto sizes{memory_layout->GetTotalAndKernelMemorySizes()}; |
| 216 | const auto total_size{sizes.first}; | ||
| 217 | const auto kernel_size{sizes.second}; | ||
| 216 | 218 | ||
| 217 | // If setting the default system values fails, then something seriously wrong has occurred. | 219 | // If setting the default system values fails, then something seriously wrong has occurred. |
| 218 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::PhysicalMemory, total_size) | 220 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::PhysicalMemory, total_size) |
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 66e0ce2d0..4f0a44363 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include "common/scope_exit.h" | 15 | #include "common/scope_exit.h" |
| 16 | #include "core/core.h" | 16 | #include "core/core.h" |
| 17 | #include "core/core_timing.h" | 17 | #include "core/core_timing.h" |
| 18 | #include "core/debugger/debugger.h" | ||
| 18 | #include "core/hle/kernel/k_client_port.h" | 19 | #include "core/hle/kernel/k_client_port.h" |
| 19 | #include "core/hle/kernel/k_client_session.h" | 20 | #include "core/hle/kernel/k_client_session.h" |
| 20 | #include "core/hle/kernel/k_code_memory.h" | 21 | #include "core/hle/kernel/k_code_memory.h" |
| @@ -627,6 +628,12 @@ static void Break(Core::System& system, u32 reason, u64 info1, u64 info2) { | |||
| 627 | const auto thread_processor_id = current_thread->GetActiveCore(); | 628 | const auto thread_processor_id = current_thread->GetActiveCore(); |
| 628 | system.ArmInterface(static_cast<std::size_t>(thread_processor_id)).LogBacktrace(); | 629 | system.ArmInterface(static_cast<std::size_t>(thread_processor_id)).LogBacktrace(); |
| 629 | } | 630 | } |
| 631 | |||
| 632 | if (system.DebuggerEnabled()) { | ||
| 633 | auto* thread = system.Kernel().GetCurrentEmuThread(); | ||
| 634 | system.GetDebugger().NotifyThreadStopped(thread); | ||
| 635 | thread->RequestSuspend(Kernel::SuspendType::Debug); | ||
| 636 | } | ||
| 630 | } | 637 | } |
| 631 | 638 | ||
| 632 | static void Break32(Core::System& system, u32 reason, u32 info1, u32 info2) { | 639 | static void Break32(Core::System& system, u32 reason, u32 info1, u32 info2) { |
| @@ -1876,7 +1883,7 @@ static void SleepThread(Core::System& system, s64 nanoseconds) { | |||
| 1876 | KScheduler::YieldToAnyThread(kernel); | 1883 | KScheduler::YieldToAnyThread(kernel); |
| 1877 | } else { | 1884 | } else { |
| 1878 | // Nintendo does nothing at all if an otherwise invalid value is passed. | 1885 | // Nintendo does nothing at all if an otherwise invalid value is passed. |
| 1879 | UNREACHABLE_MSG("Unimplemented sleep yield type '{:016X}'!", nanoseconds); | 1886 | ASSERT_MSG(false, "Unimplemented sleep yield type '{:016X}'!", nanoseconds); |
| 1880 | } | 1887 | } |
| 1881 | } | 1888 | } |
| 1882 | 1889 | ||
| @@ -2982,7 +2989,6 @@ static const FunctionDef* GetSVCInfo64(u32 func_num) { | |||
| 2982 | } | 2989 | } |
| 2983 | 2990 | ||
| 2984 | void Call(Core::System& system, u32 immediate) { | 2991 | void Call(Core::System& system, u32 immediate) { |
| 2985 | system.ExitDynarmicProfile(); | ||
| 2986 | auto& kernel = system.Kernel(); | 2992 | auto& kernel = system.Kernel(); |
| 2987 | kernel.EnterSVCProfile(); | 2993 | kernel.EnterSVCProfile(); |
| 2988 | 2994 | ||
| @@ -3007,8 +3013,6 @@ void Call(Core::System& system, u32 immediate) { | |||
| 3007 | auto* host_context = thread->GetHostContext().get(); | 3013 | auto* host_context = thread->GetHostContext().get(); |
| 3008 | host_context->Rewind(); | 3014 | host_context->Rewind(); |
| 3009 | } | 3015 | } |
| 3010 | |||
| 3011 | system.EnterDynarmicProfile(); | ||
| 3012 | } | 3016 | } |
| 3013 | 3017 | ||
| 3014 | } // namespace Kernel::Svc | 3018 | } // namespace Kernel::Svc |
diff --git a/src/core/hle/service/am/applets/applet_controller.cpp b/src/core/hle/service/am/applets/applet_controller.cpp index 655f2e936..0a5603d18 100644 --- a/src/core/hle/service/am/applets/applet_controller.cpp +++ b/src/core/hle/service/am/applets/applet_controller.cpp | |||
| @@ -178,7 +178,7 @@ ResultCode Controller::GetStatus() const { | |||
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | void Controller::ExecuteInteractive() { | 180 | void Controller::ExecuteInteractive() { |
| 181 | UNREACHABLE_MSG("Attempted to call interactive execution on non-interactive applet."); | 181 | ASSERT_MSG(false, "Attempted to call interactive execution on non-interactive applet."); |
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | void Controller::Execute() { | 184 | void Controller::Execute() { |
diff --git a/src/core/hle/service/am/applets/applet_error.cpp b/src/core/hle/service/am/applets/applet_error.cpp index 911b2c229..0b87c60b9 100644 --- a/src/core/hle/service/am/applets/applet_error.cpp +++ b/src/core/hle/service/am/applets/applet_error.cpp | |||
| @@ -156,7 +156,7 @@ ResultCode Error::GetStatus() const { | |||
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | void Error::ExecuteInteractive() { | 158 | void Error::ExecuteInteractive() { |
| 159 | UNREACHABLE_MSG("Unexpected interactive applet data!"); | 159 | ASSERT_MSG(false, "Unexpected interactive applet data!"); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | void Error::Execute() { | 162 | void Error::Execute() { |
diff --git a/src/core/hle/service/am/applets/applet_general_backend.cpp b/src/core/hle/service/am/applets/applet_general_backend.cpp index 3fe1a390a..41c002ef2 100644 --- a/src/core/hle/service/am/applets/applet_general_backend.cpp +++ b/src/core/hle/service/am/applets/applet_general_backend.cpp | |||
| @@ -76,7 +76,7 @@ ResultCode Auth::GetStatus() const { | |||
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | void Auth::ExecuteInteractive() { | 78 | void Auth::ExecuteInteractive() { |
| 79 | UNREACHABLE_MSG("Unexpected interactive applet data."); | 79 | ASSERT_MSG(false, "Unexpected interactive applet data."); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | void Auth::Execute() { | 82 | void Auth::Execute() { |
| @@ -175,7 +175,7 @@ ResultCode PhotoViewer::GetStatus() const { | |||
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | void PhotoViewer::ExecuteInteractive() { | 177 | void PhotoViewer::ExecuteInteractive() { |
| 178 | UNREACHABLE_MSG("Unexpected interactive applet data."); | 178 | ASSERT_MSG(false, "Unexpected interactive applet data."); |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | void PhotoViewer::Execute() { | 181 | void PhotoViewer::Execute() { |
diff --git a/src/core/hle/service/am/applets/applet_mii_edit.cpp b/src/core/hle/service/am/applets/applet_mii_edit.cpp index 3acde1630..8d847c3f6 100644 --- a/src/core/hle/service/am/applets/applet_mii_edit.cpp +++ b/src/core/hle/service/am/applets/applet_mii_edit.cpp | |||
| @@ -67,7 +67,7 @@ ResultCode MiiEdit::GetStatus() const { | |||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | void MiiEdit::ExecuteInteractive() { | 69 | void MiiEdit::ExecuteInteractive() { |
| 70 | UNREACHABLE_MSG("Attempted to call interactive execution on non-interactive applet."); | 70 | ASSERT_MSG(false, "Attempted to call interactive execution on non-interactive applet."); |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | void MiiEdit::Execute() { | 73 | void MiiEdit::Execute() { |
diff --git a/src/core/hle/service/am/applets/applet_profile_select.cpp b/src/core/hle/service/am/applets/applet_profile_select.cpp index fd16f2e49..02049fd9f 100644 --- a/src/core/hle/service/am/applets/applet_profile_select.cpp +++ b/src/core/hle/service/am/applets/applet_profile_select.cpp | |||
| @@ -44,7 +44,7 @@ ResultCode ProfileSelect::GetStatus() const { | |||
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | void ProfileSelect::ExecuteInteractive() { | 46 | void ProfileSelect::ExecuteInteractive() { |
| 47 | UNREACHABLE_MSG("Attempted to call interactive execution on non-interactive applet."); | 47 | ASSERT_MSG(false, "Attempted to call interactive execution on non-interactive applet."); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | void ProfileSelect::Execute() { | 50 | void ProfileSelect::Execute() { |
diff --git a/src/core/hle/service/am/applets/applet_software_keyboard.cpp b/src/core/hle/service/am/applets/applet_software_keyboard.cpp index 7c21365e4..4116fbaa7 100644 --- a/src/core/hle/service/am/applets/applet_software_keyboard.cpp +++ b/src/core/hle/service/am/applets/applet_software_keyboard.cpp | |||
| @@ -71,7 +71,7 @@ void SoftwareKeyboard::Initialize() { | |||
| 71 | InitializeBackground(applet_mode); | 71 | InitializeBackground(applet_mode); |
| 72 | break; | 72 | break; |
| 73 | default: | 73 | default: |
| 74 | UNREACHABLE_MSG("Invalid LibraryAppletMode={}", applet_mode); | 74 | ASSERT_MSG(false, "Invalid LibraryAppletMode={}", applet_mode); |
| 75 | break; | 75 | break; |
| 76 | } | 76 | } |
| 77 | } | 77 | } |
diff --git a/src/core/hle/service/am/applets/applet_web_browser.cpp b/src/core/hle/service/am/applets/applet_web_browser.cpp index 2aa4a00ad..7b3f77a51 100644 --- a/src/core/hle/service/am/applets/applet_web_browser.cpp +++ b/src/core/hle/service/am/applets/applet_web_browser.cpp | |||
| @@ -279,7 +279,7 @@ void WebBrowser::Initialize() { | |||
| 279 | InitializeLobby(); | 279 | InitializeLobby(); |
| 280 | break; | 280 | break; |
| 281 | default: | 281 | default: |
| 282 | UNREACHABLE_MSG("Invalid ShimKind={}", web_arg_header.shim_kind); | 282 | ASSERT_MSG(false, "Invalid ShimKind={}", web_arg_header.shim_kind); |
| 283 | break; | 283 | break; |
| 284 | } | 284 | } |
| 285 | } | 285 | } |
| @@ -320,7 +320,7 @@ void WebBrowser::Execute() { | |||
| 320 | ExecuteLobby(); | 320 | ExecuteLobby(); |
| 321 | break; | 321 | break; |
| 322 | default: | 322 | default: |
| 323 | UNREACHABLE_MSG("Invalid ShimKind={}", web_arg_header.shim_kind); | 323 | ASSERT_MSG(false, "Invalid ShimKind={}", web_arg_header.shim_kind); |
| 324 | WebBrowserExit(WebExitReason::EndButtonPressed); | 324 | WebBrowserExit(WebExitReason::EndButtonPressed); |
| 325 | break; | 325 | break; |
| 326 | } | 326 | } |
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index ddfcba0f1..fae6e5aff 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp | |||
| @@ -899,7 +899,7 @@ void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) { | |||
| 899 | case FileSys::SaveDataSpaceId::TemporaryStorage: | 899 | case FileSys::SaveDataSpaceId::TemporaryStorage: |
| 900 | case FileSys::SaveDataSpaceId::ProperSystem: | 900 | case FileSys::SaveDataSpaceId::ProperSystem: |
| 901 | case FileSys::SaveDataSpaceId::SafeMode: | 901 | case FileSys::SaveDataSpaceId::SafeMode: |
| 902 | UNREACHABLE(); | 902 | ASSERT(false); |
| 903 | } | 903 | } |
| 904 | 904 | ||
| 905 | auto filesystem = std::make_shared<IFileSystem>(system, std::move(dir.Unwrap()), | 905 | auto filesystem = std::make_shared<IFileSystem>(system, std::move(dir.Unwrap()), |
diff --git a/src/core/hle/service/glue/notif.cpp b/src/core/hle/service/glue/notif.cpp index b971846e7..3ace2dabd 100644 --- a/src/core/hle/service/glue/notif.cpp +++ b/src/core/hle/service/glue/notif.cpp | |||
| @@ -1,6 +1,11 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <algorithm> | ||
| 5 | #include <cstring> | ||
| 6 | |||
| 7 | #include "common/assert.h" | ||
| 8 | #include "common/logging/log.h" | ||
| 4 | #include "core/hle/ipc_helpers.h" | 9 | #include "core/hle/ipc_helpers.h" |
| 5 | #include "core/hle/service/glue/notif.h" | 10 | #include "core/hle/service/glue/notif.h" |
| 6 | 11 | ||
| @@ -9,11 +14,11 @@ namespace Service::Glue { | |||
| 9 | NOTIF_A::NOTIF_A(Core::System& system_) : ServiceFramework{system_, "notif:a"} { | 14 | NOTIF_A::NOTIF_A(Core::System& system_) : ServiceFramework{system_, "notif:a"} { |
| 10 | // clang-format off | 15 | // clang-format off |
| 11 | static const FunctionInfo functions[] = { | 16 | static const FunctionInfo functions[] = { |
| 12 | {500, nullptr, "RegisterAlarmSetting"}, | 17 | {500, &NOTIF_A::RegisterAlarmSetting, "RegisterAlarmSetting"}, |
| 13 | {510, nullptr, "UpdateAlarmSetting"}, | 18 | {510, &NOTIF_A::UpdateAlarmSetting, "UpdateAlarmSetting"}, |
| 14 | {520, &NOTIF_A::ListAlarmSettings, "ListAlarmSettings"}, | 19 | {520, &NOTIF_A::ListAlarmSettings, "ListAlarmSettings"}, |
| 15 | {530, nullptr, "LoadApplicationParameter"}, | 20 | {530, &NOTIF_A::LoadApplicationParameter, "LoadApplicationParameter"}, |
| 16 | {540, nullptr, "DeleteAlarmSetting"}, | 21 | {540, &NOTIF_A::DeleteAlarmSetting, "DeleteAlarmSetting"}, |
| 17 | {1000, &NOTIF_A::Initialize, "Initialize"}, | 22 | {1000, &NOTIF_A::Initialize, "Initialize"}, |
| 18 | }; | 23 | }; |
| 19 | // clang-format on | 24 | // clang-format on |
| @@ -23,21 +28,132 @@ NOTIF_A::NOTIF_A(Core::System& system_) : ServiceFramework{system_, "notif:a"} { | |||
| 23 | 28 | ||
| 24 | NOTIF_A::~NOTIF_A() = default; | 29 | NOTIF_A::~NOTIF_A() = default; |
| 25 | 30 | ||
| 31 | void NOTIF_A::RegisterAlarmSetting(Kernel::HLERequestContext& ctx) { | ||
| 32 | const auto alarm_setting_buffer_size = ctx.GetReadBufferSize(0); | ||
| 33 | const auto application_parameter_size = ctx.GetReadBufferSize(1); | ||
| 34 | |||
| 35 | ASSERT_MSG(alarm_setting_buffer_size == sizeof(AlarmSetting), | ||
| 36 | "alarm_setting_buffer_size is not 0x40 bytes"); | ||
| 37 | ASSERT_MSG(application_parameter_size <= sizeof(ApplicationParameter), | ||
| 38 | "application_parameter_size is bigger than 0x400 bytes"); | ||
| 39 | |||
| 40 | AlarmSetting new_alarm{}; | ||
| 41 | memcpy(&new_alarm, ctx.ReadBuffer(0).data(), sizeof(AlarmSetting)); | ||
| 42 | |||
| 43 | // TODO: Count alarms per game id | ||
| 44 | if (alarms.size() >= max_alarms) { | ||
| 45 | LOG_ERROR(Service_NOTIF, "Alarm limit reached"); | ||
| 46 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 47 | rb.Push(ResultUnknown); | ||
| 48 | return; | ||
| 49 | } | ||
| 50 | |||
| 51 | new_alarm.alarm_setting_id = last_alarm_setting_id++; | ||
| 52 | alarms.push_back(new_alarm); | ||
| 53 | |||
| 54 | // TODO: Save application parameter data | ||
| 55 | |||
| 56 | LOG_WARNING(Service_NOTIF, | ||
| 57 | "(STUBBED) called, application_parameter_size={}, setting_id={}, kind={}, muted={}", | ||
| 58 | application_parameter_size, new_alarm.alarm_setting_id, new_alarm.kind, | ||
| 59 | new_alarm.muted); | ||
| 60 | |||
| 61 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 62 | rb.Push(ResultSuccess); | ||
| 63 | rb.Push(new_alarm.alarm_setting_id); | ||
| 64 | } | ||
| 65 | |||
| 66 | void NOTIF_A::UpdateAlarmSetting(Kernel::HLERequestContext& ctx) { | ||
| 67 | const auto alarm_setting_buffer_size = ctx.GetReadBufferSize(0); | ||
| 68 | const auto application_parameter_size = ctx.GetReadBufferSize(1); | ||
| 69 | |||
| 70 | ASSERT_MSG(alarm_setting_buffer_size == sizeof(AlarmSetting), | ||
| 71 | "alarm_setting_buffer_size is not 0x40 bytes"); | ||
| 72 | ASSERT_MSG(application_parameter_size <= sizeof(ApplicationParameter), | ||
| 73 | "application_parameter_size is bigger than 0x400 bytes"); | ||
| 74 | |||
| 75 | AlarmSetting alarm_setting{}; | ||
| 76 | memcpy(&alarm_setting, ctx.ReadBuffer(0).data(), sizeof(AlarmSetting)); | ||
| 77 | |||
| 78 | const auto alarm_it = GetAlarmFromId(alarm_setting.alarm_setting_id); | ||
| 79 | if (alarm_it != alarms.end()) { | ||
| 80 | LOG_DEBUG(Service_NOTIF, "Alarm updated"); | ||
| 81 | *alarm_it = alarm_setting; | ||
| 82 | // TODO: Save application parameter data | ||
| 83 | } | ||
| 84 | |||
| 85 | LOG_WARNING(Service_NOTIF, | ||
| 86 | "(STUBBED) called, application_parameter_size={}, setting_id={}, kind={}, muted={}", | ||
| 87 | application_parameter_size, alarm_setting.alarm_setting_id, alarm_setting.kind, | ||
| 88 | alarm_setting.muted); | ||
| 89 | |||
| 90 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 91 | rb.Push(ResultSuccess); | ||
| 92 | } | ||
| 93 | |||
| 26 | void NOTIF_A::ListAlarmSettings(Kernel::HLERequestContext& ctx) { | 94 | void NOTIF_A::ListAlarmSettings(Kernel::HLERequestContext& ctx) { |
| 27 | // Returns an array of AlarmSetting | 95 | LOG_INFO(Service_NOTIF, "called, alarm_count={}", alarms.size()); |
| 28 | constexpr s32 alarm_count = 0; | ||
| 29 | 96 | ||
| 30 | LOG_WARNING(Service_NOTIF, "(STUBBED) called"); | 97 | // TODO: Only return alarms of this game id |
| 98 | ctx.WriteBuffer(alarms); | ||
| 31 | 99 | ||
| 32 | IPC::ResponseBuilder rb{ctx, 3}; | 100 | IPC::ResponseBuilder rb{ctx, 3}; |
| 33 | rb.Push(ResultSuccess); | 101 | rb.Push(ResultSuccess); |
| 34 | rb.Push(alarm_count); | 102 | rb.Push(static_cast<u32>(alarms.size())); |
| 103 | } | ||
| 104 | |||
| 105 | void NOTIF_A::LoadApplicationParameter(Kernel::HLERequestContext& ctx) { | ||
| 106 | IPC::RequestParser rp{ctx}; | ||
| 107 | const auto alarm_setting_id{rp.Pop<AlarmSettingId>()}; | ||
| 108 | |||
| 109 | const auto alarm_it = GetAlarmFromId(alarm_setting_id); | ||
| 110 | if (alarm_it == alarms.end()) { | ||
| 111 | LOG_ERROR(Service_NOTIF, "Invalid alarm setting id={}", alarm_setting_id); | ||
| 112 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 113 | rb.Push(ResultUnknown); | ||
| 114 | return; | ||
| 115 | } | ||
| 116 | |||
| 117 | // TODO: Read application parameter related to this setting id | ||
| 118 | ApplicationParameter application_parameter{}; | ||
| 119 | |||
| 120 | LOG_WARNING(Service_NOTIF, "(STUBBED) called, alarm_setting_id={}", alarm_setting_id); | ||
| 121 | |||
| 122 | ctx.WriteBuffer(application_parameter); | ||
| 123 | |||
| 124 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 125 | rb.Push(ResultSuccess); | ||
| 126 | rb.Push(static_cast<u32>(application_parameter.size())); | ||
| 127 | } | ||
| 128 | |||
| 129 | void NOTIF_A::DeleteAlarmSetting(Kernel::HLERequestContext& ctx) { | ||
| 130 | IPC::RequestParser rp{ctx}; | ||
| 131 | const auto alarm_setting_id{rp.Pop<AlarmSettingId>()}; | ||
| 132 | |||
| 133 | std::erase_if(alarms, [alarm_setting_id](const AlarmSetting& alarm) { | ||
| 134 | return alarm.alarm_setting_id == alarm_setting_id; | ||
| 135 | }); | ||
| 136 | |||
| 137 | LOG_INFO(Service_NOTIF, "called, alarm_setting_id={}", alarm_setting_id); | ||
| 138 | |||
| 139 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 140 | rb.Push(ResultSuccess); | ||
| 35 | } | 141 | } |
| 36 | 142 | ||
| 37 | void NOTIF_A::Initialize(Kernel::HLERequestContext& ctx) { | 143 | void NOTIF_A::Initialize(Kernel::HLERequestContext& ctx) { |
| 144 | // TODO: Load previous alarms from config | ||
| 145 | |||
| 38 | LOG_WARNING(Service_NOTIF, "(STUBBED) called"); | 146 | LOG_WARNING(Service_NOTIF, "(STUBBED) called"); |
| 39 | IPC::ResponseBuilder rb{ctx, 2}; | 147 | IPC::ResponseBuilder rb{ctx, 2}; |
| 40 | rb.Push(ResultSuccess); | 148 | rb.Push(ResultSuccess); |
| 41 | } | 149 | } |
| 42 | 150 | ||
| 151 | std::vector<NOTIF_A::AlarmSetting>::iterator NOTIF_A::GetAlarmFromId( | ||
| 152 | AlarmSettingId alarm_setting_id) { | ||
| 153 | return std::find_if(alarms.begin(), alarms.end(), | ||
| 154 | [alarm_setting_id](const AlarmSetting& alarm) { | ||
| 155 | return alarm.alarm_setting_id == alarm_setting_id; | ||
| 156 | }); | ||
| 157 | } | ||
| 158 | |||
| 43 | } // namespace Service::Glue | 159 | } // namespace Service::Glue |
diff --git a/src/core/hle/service/glue/notif.h b/src/core/hle/service/glue/notif.h index 7310d7f72..4467e1f35 100644 --- a/src/core/hle/service/glue/notif.h +++ b/src/core/hle/service/glue/notif.h | |||
| @@ -3,6 +3,10 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include <array> | ||
| 7 | #include <vector> | ||
| 8 | |||
| 9 | #include "common/uuid.h" | ||
| 6 | #include "core/hle/service/service.h" | 10 | #include "core/hle/service/service.h" |
| 7 | 11 | ||
| 8 | namespace Core { | 12 | namespace Core { |
| @@ -17,8 +21,52 @@ public: | |||
| 17 | ~NOTIF_A() override; | 21 | ~NOTIF_A() override; |
| 18 | 22 | ||
| 19 | private: | 23 | private: |
| 24 | static constexpr std::size_t max_alarms = 8; | ||
| 25 | |||
| 26 | // This is nn::notification::AlarmSettingId | ||
| 27 | using AlarmSettingId = u16; | ||
| 28 | static_assert(sizeof(AlarmSettingId) == 0x2, "AlarmSettingId is an invalid size"); | ||
| 29 | |||
| 30 | using ApplicationParameter = std::array<u8, 0x400>; | ||
| 31 | static_assert(sizeof(ApplicationParameter) == 0x400, "ApplicationParameter is an invalid size"); | ||
| 32 | |||
| 33 | struct DailyAlarmSetting { | ||
| 34 | s8 hour; | ||
| 35 | s8 minute; | ||
| 36 | }; | ||
| 37 | static_assert(sizeof(DailyAlarmSetting) == 0x2, "DailyAlarmSetting is an invalid size"); | ||
| 38 | |||
| 39 | struct WeeklyScheduleAlarmSetting { | ||
| 40 | INSERT_PADDING_BYTES(0xA); | ||
| 41 | std::array<DailyAlarmSetting, 0x7> day_of_week; | ||
| 42 | }; | ||
| 43 | static_assert(sizeof(WeeklyScheduleAlarmSetting) == 0x18, | ||
| 44 | "WeeklyScheduleAlarmSetting is an invalid size"); | ||
| 45 | |||
| 46 | // This is nn::notification::AlarmSetting | ||
| 47 | struct AlarmSetting { | ||
| 48 | AlarmSettingId alarm_setting_id; | ||
| 49 | u8 kind; | ||
| 50 | u8 muted; | ||
| 51 | INSERT_PADDING_BYTES(0x4); | ||
| 52 | Common::UUID account_id; | ||
| 53 | u64 application_id; | ||
| 54 | INSERT_PADDING_BYTES(0x8); | ||
| 55 | WeeklyScheduleAlarmSetting schedule; | ||
| 56 | }; | ||
| 57 | static_assert(sizeof(AlarmSetting) == 0x40, "AlarmSetting is an invalid size"); | ||
| 58 | |||
| 59 | void RegisterAlarmSetting(Kernel::HLERequestContext& ctx); | ||
| 60 | void UpdateAlarmSetting(Kernel::HLERequestContext& ctx); | ||
| 20 | void ListAlarmSettings(Kernel::HLERequestContext& ctx); | 61 | void ListAlarmSettings(Kernel::HLERequestContext& ctx); |
| 62 | void LoadApplicationParameter(Kernel::HLERequestContext& ctx); | ||
| 63 | void DeleteAlarmSetting(Kernel::HLERequestContext& ctx); | ||
| 21 | void Initialize(Kernel::HLERequestContext& ctx); | 64 | void Initialize(Kernel::HLERequestContext& ctx); |
| 65 | |||
| 66 | std::vector<AlarmSetting>::iterator GetAlarmFromId(AlarmSettingId alarm_setting_id); | ||
| 67 | |||
| 68 | std::vector<AlarmSetting> alarms{}; | ||
| 69 | AlarmSettingId last_alarm_setting_id{}; | ||
| 22 | }; | 70 | }; |
| 23 | 71 | ||
| 24 | } // namespace Service::Glue | 72 | } // namespace Service::Glue |
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 1e04ee3f2..ac5c38cc6 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -160,7 +160,7 @@ void Controller_NPad::InitNewlyAddedController(Core::HID::NpadIdType npad_id) { | |||
| 160 | shared_memory->system_properties.raw = 0; | 160 | shared_memory->system_properties.raw = 0; |
| 161 | switch (controller_type) { | 161 | switch (controller_type) { |
| 162 | case Core::HID::NpadStyleIndex::None: | 162 | case Core::HID::NpadStyleIndex::None: |
| 163 | UNREACHABLE(); | 163 | ASSERT(false); |
| 164 | break; | 164 | break; |
| 165 | case Core::HID::NpadStyleIndex::ProController: | 165 | case Core::HID::NpadStyleIndex::ProController: |
| 166 | shared_memory->style_tag.fullkey.Assign(1); | 166 | shared_memory->style_tag.fullkey.Assign(1); |
| @@ -422,7 +422,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing) { | |||
| 422 | libnx_state.connection_status.is_connected.Assign(1); | 422 | libnx_state.connection_status.is_connected.Assign(1); |
| 423 | switch (controller_type) { | 423 | switch (controller_type) { |
| 424 | case Core::HID::NpadStyleIndex::None: | 424 | case Core::HID::NpadStyleIndex::None: |
| 425 | UNREACHABLE(); | 425 | ASSERT(false); |
| 426 | break; | 426 | break; |
| 427 | case Core::HID::NpadStyleIndex::ProController: | 427 | case Core::HID::NpadStyleIndex::ProController: |
| 428 | case Core::HID::NpadStyleIndex::NES: | 428 | case Core::HID::NpadStyleIndex::NES: |
| @@ -597,7 +597,7 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing | |||
| 597 | 597 | ||
| 598 | switch (controller_type) { | 598 | switch (controller_type) { |
| 599 | case Core::HID::NpadStyleIndex::None: | 599 | case Core::HID::NpadStyleIndex::None: |
| 600 | UNREACHABLE(); | 600 | ASSERT(false); |
| 601 | break; | 601 | break; |
| 602 | case Core::HID::NpadStyleIndex::ProController: | 602 | case Core::HID::NpadStyleIndex::ProController: |
| 603 | case Core::HID::NpadStyleIndex::Pokeball: | 603 | case Core::HID::NpadStyleIndex::Pokeball: |
| @@ -856,7 +856,7 @@ void Controller_NPad::VibrateController( | |||
| 856 | } | 856 | } |
| 857 | 857 | ||
| 858 | if (vibration_device_handle.device_index == Core::HID::DeviceIndex::None) { | 858 | if (vibration_device_handle.device_index == Core::HID::DeviceIndex::None) { |
| 859 | UNREACHABLE_MSG("DeviceIndex should never be None!"); | 859 | ASSERT_MSG(false, "DeviceIndex should never be None!"); |
| 860 | return; | 860 | return; |
| 861 | } | 861 | } |
| 862 | 862 | ||
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 8a496c38c..dc5d0366d 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -1441,7 +1441,7 @@ void Hid::GetVibrationDeviceInfo(Kernel::HLERequestContext& ctx) { | |||
| 1441 | break; | 1441 | break; |
| 1442 | case Core::HID::DeviceIndex::None: | 1442 | case Core::HID::DeviceIndex::None: |
| 1443 | default: | 1443 | default: |
| 1444 | UNREACHABLE_MSG("DeviceIndex should never be None!"); | 1444 | ASSERT_MSG(false, "DeviceIndex should never be None!"); |
| 1445 | vibration_device_info.position = Core::HID::VibrationDevicePosition::None; | 1445 | vibration_device_info.position = Core::HID::VibrationDevicePosition::None; |
| 1446 | break; | 1446 | break; |
| 1447 | } | 1447 | } |
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp index fa72fcba9..72e4902cb 100644 --- a/src/core/hle/service/ldr/ldr.cpp +++ b/src/core/hle/service/ldr/ldr.cpp | |||
| @@ -347,7 +347,7 @@ public: | |||
| 347 | } | 347 | } |
| 348 | 348 | ||
| 349 | if (!succeeded) { | 349 | if (!succeeded) { |
| 350 | UNREACHABLE_MSG("Out of address space!"); | 350 | ASSERT_MSG(false, "Out of address space!"); |
| 351 | return Kernel::ResultOutOfMemory; | 351 | return Kernel::ResultOutOfMemory; |
| 352 | } | 352 | } |
| 353 | 353 | ||
diff --git a/src/core/hle/service/mii/mii_manager.cpp b/src/core/hle/service/mii/mii_manager.cpp index 4964539f9..08300a1a6 100644 --- a/src/core/hle/service/mii/mii_manager.cpp +++ b/src/core/hle/service/mii/mii_manager.cpp | |||
| @@ -290,7 +290,7 @@ MiiStoreData BuildRandomStoreData(Age age, Gender gender, Race race, const Commo | |||
| 290 | u8 glasses_type{}; | 290 | u8 glasses_type{}; |
| 291 | while (glasses_type_start < glasses_type_info.values[glasses_type]) { | 291 | while (glasses_type_start < glasses_type_info.values[glasses_type]) { |
| 292 | if (++glasses_type >= glasses_type_info.values_count) { | 292 | if (++glasses_type >= glasses_type_info.values_count) { |
| 293 | UNREACHABLE(); | 293 | ASSERT(false); |
| 294 | break; | 294 | break; |
| 295 | } | 295 | } |
| 296 | } | 296 | } |
diff --git a/src/core/hle/service/nvdrv/syncpoint_manager.cpp b/src/core/hle/service/nvdrv/syncpoint_manager.cpp index f77f0df27..a6fa943e8 100644 --- a/src/core/hle/service/nvdrv/syncpoint_manager.cpp +++ b/src/core/hle/service/nvdrv/syncpoint_manager.cpp | |||
| @@ -23,7 +23,7 @@ u32 SyncpointManager::AllocateSyncpoint() { | |||
| 23 | return syncpoint_id; | 23 | return syncpoint_id; |
| 24 | } | 24 | } |
| 25 | } | 25 | } |
| 26 | UNREACHABLE_MSG("No more available syncpoints!"); | 26 | ASSERT_MSG(false, "No more available syncpoints!"); |
| 27 | return {}; | 27 | return {}; |
| 28 | } | 28 | } |
| 29 | 29 | ||
diff --git a/src/core/hle/service/nvflinger/buffer_queue_producer.cpp b/src/core/hle/service/nvflinger/buffer_queue_producer.cpp index fe95d1b73..337431488 100644 --- a/src/core/hle/service/nvflinger/buffer_queue_producer.cpp +++ b/src/core/hle/service/nvflinger/buffer_queue_producer.cpp | |||
| @@ -659,7 +659,7 @@ Status BufferQueueProducer::Query(NativeWindow what, s32* out_value) { | |||
| 659 | value = core->consumer_usage_bit; | 659 | value = core->consumer_usage_bit; |
| 660 | break; | 660 | break; |
| 661 | default: | 661 | default: |
| 662 | UNREACHABLE(); | 662 | ASSERT(false); |
| 663 | return Status::BadValue; | 663 | return Status::BadValue; |
| 664 | } | 664 | } |
| 665 | 665 | ||
diff --git a/src/core/hle/service/time/standard_user_system_clock_core.cpp b/src/core/hle/service/time/standard_user_system_clock_core.cpp index f0cc9a155..508091dc2 100644 --- a/src/core/hle/service/time/standard_user_system_clock_core.cpp +++ b/src/core/hle/service/time/standard_user_system_clock_core.cpp | |||
| @@ -48,12 +48,12 @@ ResultCode StandardUserSystemClockCore::GetClockContext(Core::System& system, | |||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | ResultCode StandardUserSystemClockCore::Flush(const SystemClockContext&) { | 50 | ResultCode StandardUserSystemClockCore::Flush(const SystemClockContext&) { |
| 51 | UNREACHABLE(); | 51 | UNIMPLEMENTED(); |
| 52 | return ERROR_NOT_IMPLEMENTED; | 52 | return ERROR_NOT_IMPLEMENTED; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | ResultCode StandardUserSystemClockCore::SetClockContext(const SystemClockContext&) { | 55 | ResultCode StandardUserSystemClockCore::SetClockContext(const SystemClockContext&) { |
| 56 | UNREACHABLE(); | 56 | UNIMPLEMENTED(); |
| 57 | return ERROR_NOT_IMPLEMENTED; | 57 | return ERROR_NOT_IMPLEMENTED; |
| 58 | } | 58 | } |
| 59 | 59 | ||
diff --git a/src/core/hle/service/time/time_manager.cpp b/src/core/hle/service/time/time_manager.cpp index acc038dbf..28667710e 100644 --- a/src/core/hle/service/time/time_manager.cpp +++ b/src/core/hle/service/time/time_manager.cpp | |||
| @@ -111,7 +111,7 @@ struct TimeManager::Impl final { | |||
| 111 | FileSys::VirtualFile& vfs_file) { | 111 | FileSys::VirtualFile& vfs_file) { |
| 112 | if (time_zone_content_manager.GetTimeZoneManager().SetDeviceLocationNameWithTimeZoneRule( | 112 | if (time_zone_content_manager.GetTimeZoneManager().SetDeviceLocationNameWithTimeZoneRule( |
| 113 | location_name, vfs_file) != ResultSuccess) { | 113 | location_name, vfs_file) != ResultSuccess) { |
| 114 | UNREACHABLE(); | 114 | ASSERT(false); |
| 115 | return; | 115 | return; |
| 116 | } | 116 | } |
| 117 | 117 | ||
| @@ -155,7 +155,7 @@ struct TimeManager::Impl final { | |||
| 155 | } else { | 155 | } else { |
| 156 | if (standard_local_system_clock_core.SetCurrentTime(system_, posix_time) != | 156 | if (standard_local_system_clock_core.SetCurrentTime(system_, posix_time) != |
| 157 | ResultSuccess) { | 157 | ResultSuccess) { |
| 158 | UNREACHABLE(); | 158 | ASSERT(false); |
| 159 | return; | 159 | return; |
| 160 | } | 160 | } |
| 161 | } | 161 | } |
| @@ -170,7 +170,7 @@ struct TimeManager::Impl final { | |||
| 170 | 170 | ||
| 171 | if (standard_network_system_clock_core.SetSystemClockContext(clock_context) != | 171 | if (standard_network_system_clock_core.SetSystemClockContext(clock_context) != |
| 172 | ResultSuccess) { | 172 | ResultSuccess) { |
| 173 | UNREACHABLE(); | 173 | ASSERT(false); |
| 174 | return; | 174 | return; |
| 175 | } | 175 | } |
| 176 | 176 | ||
| @@ -183,7 +183,7 @@ struct TimeManager::Impl final { | |||
| 183 | Clock::SteadyClockTimePoint steady_clock_time_point) { | 183 | Clock::SteadyClockTimePoint steady_clock_time_point) { |
| 184 | if (standard_user_system_clock_core.SetAutomaticCorrectionEnabled( | 184 | if (standard_user_system_clock_core.SetAutomaticCorrectionEnabled( |
| 185 | system_, is_automatic_correction_enabled) != ResultSuccess) { | 185 | system_, is_automatic_correction_enabled) != ResultSuccess) { |
| 186 | UNREACHABLE(); | 186 | ASSERT(false); |
| 187 | return; | 187 | return; |
| 188 | } | 188 | } |
| 189 | 189 | ||
| @@ -203,7 +203,7 @@ struct TimeManager::Impl final { | |||
| 203 | if (GetStandardLocalSystemClockCore() | 203 | if (GetStandardLocalSystemClockCore() |
| 204 | .SetCurrentTime(system_, timespan.ToSeconds()) | 204 | .SetCurrentTime(system_, timespan.ToSeconds()) |
| 205 | .IsError()) { | 205 | .IsError()) { |
| 206 | UNREACHABLE(); | 206 | ASSERT(false); |
| 207 | return; | 207 | return; |
| 208 | } | 208 | } |
| 209 | } | 209 | } |
diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp index eeec34436..fee05ec7a 100644 --- a/src/core/hle/service/time/time_zone_manager.cpp +++ b/src/core/hle/service/time/time_zone_manager.cpp | |||
| @@ -279,7 +279,7 @@ static constexpr int TransitionTime(int year, Rule rule, int offset) { | |||
| 279 | break; | 279 | break; |
| 280 | } | 280 | } |
| 281 | default: | 281 | default: |
| 282 | UNREACHABLE(); | 282 | ASSERT(false); |
| 283 | } | 283 | } |
| 284 | return value + rule.transition_time + offset; | 284 | return value + rule.transition_time + offset; |
| 285 | } | 285 | } |
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 8a938aa83..8dd956fc6 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp | |||
| @@ -128,11 +128,10 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::KProcess& process, Core:: | |||
| 128 | 128 | ||
| 129 | // Apply patches if necessary | 129 | // Apply patches if necessary |
| 130 | if (pm && (pm->HasNSOPatch(nso_header.build_id) || Settings::values.dump_nso)) { | 130 | if (pm && (pm->HasNSOPatch(nso_header.build_id) || Settings::values.dump_nso)) { |
| 131 | std::vector<u8> pi_header; | 131 | std::vector<u8> pi_header(sizeof(NSOHeader) + program_image.size()); |
| 132 | pi_header.insert(pi_header.begin(), reinterpret_cast<u8*>(&nso_header), | 132 | std::memcpy(pi_header.data(), &nso_header, sizeof(NSOHeader)); |
| 133 | reinterpret_cast<u8*>(&nso_header) + sizeof(NSOHeader)); | 133 | std::memcpy(pi_header.data() + sizeof(NSOHeader), program_image.data(), |
| 134 | pi_header.insert(pi_header.begin() + sizeof(NSOHeader), program_image.data(), | 134 | program_image.size()); |
| 135 | program_image.data() + program_image.size()); | ||
| 136 | 135 | ||
| 137 | pi_header = pm->PatchNSO(pi_header, nso_file.GetName()); | 136 | pi_header = pm->PatchNSO(pi_header, nso_file.GetName()); |
| 138 | 137 | ||
diff --git a/src/core/tools/freezer.cpp b/src/core/tools/freezer.cpp index 7a0b73eca..5cc99fbe4 100644 --- a/src/core/tools/freezer.cpp +++ b/src/core/tools/freezer.cpp | |||
| @@ -25,7 +25,6 @@ u64 MemoryReadWidth(Core::Memory::Memory& memory, u32 width, VAddr addr) { | |||
| 25 | return memory.Read64(addr); | 25 | return memory.Read64(addr); |
| 26 | default: | 26 | default: |
| 27 | UNREACHABLE(); | 27 | UNREACHABLE(); |
| 28 | return 0; | ||
| 29 | } | 28 | } |
| 30 | } | 29 | } |
| 31 | 30 | ||
diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt index d4fa69a77..48e799cf5 100644 --- a/src/input_common/CMakeLists.txt +++ b/src/input_common/CMakeLists.txt | |||
| @@ -44,7 +44,6 @@ else() | |||
| 44 | -Werror | 44 | -Werror |
| 45 | -Werror=conversion | 45 | -Werror=conversion |
| 46 | -Werror=ignored-qualifiers | 46 | -Werror=ignored-qualifiers |
| 47 | -Werror=shadow | ||
| 48 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter> | 47 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter> |
| 49 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable> | 48 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable> |
| 50 | -Werror=unused-variable | 49 | -Werror=unused-variable |
diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index 1a14ef10b..446c027d3 100644 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp | |||
| @@ -13,11 +13,11 @@ | |||
| 13 | namespace InputCommon { | 13 | namespace InputCommon { |
| 14 | 14 | ||
| 15 | namespace { | 15 | namespace { |
| 16 | std::string GetGUID(SDL_Joystick* joystick) { | 16 | Common::UUID GetGUID(SDL_Joystick* joystick) { |
| 17 | const SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick); | 17 | const SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick); |
| 18 | char guid_str[33]; | 18 | std::array<u8, 16> data{}; |
| 19 | SDL_JoystickGetGUIDString(guid, guid_str, sizeof(guid_str)); | 19 | std::memcpy(data.data(), guid.data, sizeof(data)); |
| 20 | return guid_str; | 20 | return Common::UUID{data}; |
| 21 | } | 21 | } |
| 22 | } // Anonymous namespace | 22 | } // Anonymous namespace |
| 23 | 23 | ||
| @@ -31,9 +31,9 @@ static int SDLEventWatcher(void* user_data, SDL_Event* event) { | |||
| 31 | 31 | ||
| 32 | class SDLJoystick { | 32 | class SDLJoystick { |
| 33 | public: | 33 | public: |
| 34 | SDLJoystick(std::string guid_, int port_, SDL_Joystick* joystick, | 34 | SDLJoystick(Common::UUID guid_, int port_, SDL_Joystick* joystick, |
| 35 | SDL_GameController* game_controller) | 35 | SDL_GameController* game_controller) |
| 36 | : guid{std::move(guid_)}, port{port_}, sdl_joystick{joystick, &SDL_JoystickClose}, | 36 | : guid{guid_}, port{port_}, sdl_joystick{joystick, &SDL_JoystickClose}, |
| 37 | sdl_controller{game_controller, &SDL_GameControllerClose} { | 37 | sdl_controller{game_controller, &SDL_GameControllerClose} { |
| 38 | EnableMotion(); | 38 | EnableMotion(); |
| 39 | } | 39 | } |
| @@ -120,7 +120,7 @@ public: | |||
| 120 | */ | 120 | */ |
| 121 | const PadIdentifier GetPadIdentifier() const { | 121 | const PadIdentifier GetPadIdentifier() const { |
| 122 | return { | 122 | return { |
| 123 | .guid = Common::UUID{guid}, | 123 | .guid = guid, |
| 124 | .port = static_cast<std::size_t>(port), | 124 | .port = static_cast<std::size_t>(port), |
| 125 | .pad = 0, | 125 | .pad = 0, |
| 126 | }; | 126 | }; |
| @@ -129,7 +129,7 @@ public: | |||
| 129 | /** | 129 | /** |
| 130 | * The guid of the joystick | 130 | * The guid of the joystick |
| 131 | */ | 131 | */ |
| 132 | const std::string& GetGUID() const { | 132 | const Common::UUID& GetGUID() const { |
| 133 | return guid; | 133 | return guid; |
| 134 | } | 134 | } |
| 135 | 135 | ||
| @@ -228,7 +228,7 @@ public: | |||
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | private: | 230 | private: |
| 231 | std::string guid; | 231 | Common::UUID guid; |
| 232 | int port; | 232 | int port; |
| 233 | std::unique_ptr<SDL_Joystick, decltype(&SDL_JoystickClose)> sdl_joystick; | 233 | std::unique_ptr<SDL_Joystick, decltype(&SDL_JoystickClose)> sdl_joystick; |
| 234 | std::unique_ptr<SDL_GameController, decltype(&SDL_GameControllerClose)> sdl_controller; | 234 | std::unique_ptr<SDL_GameController, decltype(&SDL_GameControllerClose)> sdl_controller; |
| @@ -240,7 +240,7 @@ private: | |||
| 240 | BasicMotion motion; | 240 | BasicMotion motion; |
| 241 | }; | 241 | }; |
| 242 | 242 | ||
| 243 | std::shared_ptr<SDLJoystick> SDLDriver::GetSDLJoystickByGUID(const std::string& guid, int port) { | 243 | std::shared_ptr<SDLJoystick> SDLDriver::GetSDLJoystickByGUID(const Common::UUID& guid, int port) { |
| 244 | std::scoped_lock lock{joystick_map_mutex}; | 244 | std::scoped_lock lock{joystick_map_mutex}; |
| 245 | const auto it = joystick_map.find(guid); | 245 | const auto it = joystick_map.find(guid); |
| 246 | 246 | ||
| @@ -259,9 +259,13 @@ std::shared_ptr<SDLJoystick> SDLDriver::GetSDLJoystickByGUID(const std::string& | |||
| 259 | return joystick_map[guid].emplace_back(std::move(joystick)); | 259 | return joystick_map[guid].emplace_back(std::move(joystick)); |
| 260 | } | 260 | } |
| 261 | 261 | ||
| 262 | std::shared_ptr<SDLJoystick> SDLDriver::GetSDLJoystickByGUID(const std::string& guid, int port) { | ||
| 263 | return GetSDLJoystickByGUID(Common::UUID{guid}, port); | ||
| 264 | } | ||
| 265 | |||
| 262 | std::shared_ptr<SDLJoystick> SDLDriver::GetSDLJoystickBySDLID(SDL_JoystickID sdl_id) { | 266 | std::shared_ptr<SDLJoystick> SDLDriver::GetSDLJoystickBySDLID(SDL_JoystickID sdl_id) { |
| 263 | auto sdl_joystick = SDL_JoystickFromInstanceID(sdl_id); | 267 | auto sdl_joystick = SDL_JoystickFromInstanceID(sdl_id); |
| 264 | const std::string guid = GetGUID(sdl_joystick); | 268 | const auto guid = GetGUID(sdl_joystick); |
| 265 | 269 | ||
| 266 | std::scoped_lock lock{joystick_map_mutex}; | 270 | std::scoped_lock lock{joystick_map_mutex}; |
| 267 | const auto map_it = joystick_map.find(guid); | 271 | const auto map_it = joystick_map.find(guid); |
| @@ -295,7 +299,7 @@ void SDLDriver::InitJoystick(int joystick_index) { | |||
| 295 | return; | 299 | return; |
| 296 | } | 300 | } |
| 297 | 301 | ||
| 298 | const std::string guid = GetGUID(sdl_joystick); | 302 | const auto guid = GetGUID(sdl_joystick); |
| 299 | 303 | ||
| 300 | std::scoped_lock lock{joystick_map_mutex}; | 304 | std::scoped_lock lock{joystick_map_mutex}; |
| 301 | if (joystick_map.find(guid) == joystick_map.end()) { | 305 | if (joystick_map.find(guid) == joystick_map.end()) { |
| @@ -324,7 +328,7 @@ void SDLDriver::InitJoystick(int joystick_index) { | |||
| 324 | } | 328 | } |
| 325 | 329 | ||
| 326 | void SDLDriver::CloseJoystick(SDL_Joystick* sdl_joystick) { | 330 | void SDLDriver::CloseJoystick(SDL_Joystick* sdl_joystick) { |
| 327 | const std::string guid = GetGUID(sdl_joystick); | 331 | const auto guid = GetGUID(sdl_joystick); |
| 328 | 332 | ||
| 329 | std::scoped_lock lock{joystick_map_mutex}; | 333 | std::scoped_lock lock{joystick_map_mutex}; |
| 330 | // This call to guid is safe since the joystick is guaranteed to be in the map | 334 | // This call to guid is safe since the joystick is guaranteed to be in the map |
| @@ -470,7 +474,7 @@ std::vector<Common::ParamPackage> SDLDriver::GetInputDevices() const { | |||
| 470 | devices.emplace_back(Common::ParamPackage{ | 474 | devices.emplace_back(Common::ParamPackage{ |
| 471 | {"engine", GetEngineName()}, | 475 | {"engine", GetEngineName()}, |
| 472 | {"display", std::move(name)}, | 476 | {"display", std::move(name)}, |
| 473 | {"guid", joystick->GetGUID()}, | 477 | {"guid", joystick->GetGUID().RawString()}, |
| 474 | {"port", std::to_string(joystick->GetPort())}, | 478 | {"port", std::to_string(joystick->GetPort())}, |
| 475 | }); | 479 | }); |
| 476 | if (joystick->IsJoyconLeft()) { | 480 | if (joystick->IsJoyconLeft()) { |
| @@ -493,8 +497,8 @@ std::vector<Common::ParamPackage> SDLDriver::GetInputDevices() const { | |||
| 493 | devices.emplace_back(Common::ParamPackage{ | 497 | devices.emplace_back(Common::ParamPackage{ |
| 494 | {"engine", GetEngineName()}, | 498 | {"engine", GetEngineName()}, |
| 495 | {"display", std::move(name)}, | 499 | {"display", std::move(name)}, |
| 496 | {"guid", joystick->GetGUID()}, | 500 | {"guid", joystick->GetGUID().RawString()}, |
| 497 | {"guid2", joystick2->GetGUID()}, | 501 | {"guid2", joystick2->GetGUID().RawString()}, |
| 498 | {"port", std::to_string(joystick->GetPort())}, | 502 | {"port", std::to_string(joystick->GetPort())}, |
| 499 | }); | 503 | }); |
| 500 | } | 504 | } |
| @@ -557,50 +561,50 @@ void SDLDriver::SendVibrations() { | |||
| 557 | } | 561 | } |
| 558 | } | 562 | } |
| 559 | 563 | ||
| 560 | Common::ParamPackage SDLDriver::BuildAnalogParamPackageForButton(int port, std::string guid, | 564 | Common::ParamPackage SDLDriver::BuildAnalogParamPackageForButton(int port, const Common::UUID& guid, |
| 561 | s32 axis, float value) const { | 565 | s32 axis, float value) const { |
| 562 | Common::ParamPackage params{}; | 566 | Common::ParamPackage params{}; |
| 563 | params.Set("engine", GetEngineName()); | 567 | params.Set("engine", GetEngineName()); |
| 564 | params.Set("port", port); | 568 | params.Set("port", port); |
| 565 | params.Set("guid", std::move(guid)); | 569 | params.Set("guid", guid.RawString()); |
| 566 | params.Set("axis", axis); | 570 | params.Set("axis", axis); |
| 567 | params.Set("threshold", "0.5"); | 571 | params.Set("threshold", "0.5"); |
| 568 | params.Set("invert", value < 0 ? "-" : "+"); | 572 | params.Set("invert", value < 0 ? "-" : "+"); |
| 569 | return params; | 573 | return params; |
| 570 | } | 574 | } |
| 571 | 575 | ||
| 572 | Common::ParamPackage SDLDriver::BuildButtonParamPackageForButton(int port, std::string guid, | 576 | Common::ParamPackage SDLDriver::BuildButtonParamPackageForButton(int port, const Common::UUID& guid, |
| 573 | s32 button) const { | 577 | s32 button) const { |
| 574 | Common::ParamPackage params{}; | 578 | Common::ParamPackage params{}; |
| 575 | params.Set("engine", GetEngineName()); | 579 | params.Set("engine", GetEngineName()); |
| 576 | params.Set("port", port); | 580 | params.Set("port", port); |
| 577 | params.Set("guid", std::move(guid)); | 581 | params.Set("guid", guid.RawString()); |
| 578 | params.Set("button", button); | 582 | params.Set("button", button); |
| 579 | return params; | 583 | return params; |
| 580 | } | 584 | } |
| 581 | 585 | ||
| 582 | Common::ParamPackage SDLDriver::BuildHatParamPackageForButton(int port, std::string guid, s32 hat, | 586 | Common::ParamPackage SDLDriver::BuildHatParamPackageForButton(int port, const Common::UUID& guid, |
| 583 | u8 value) const { | 587 | s32 hat, u8 value) const { |
| 584 | Common::ParamPackage params{}; | 588 | Common::ParamPackage params{}; |
| 585 | params.Set("engine", GetEngineName()); | 589 | params.Set("engine", GetEngineName()); |
| 586 | params.Set("port", port); | 590 | params.Set("port", port); |
| 587 | params.Set("guid", std::move(guid)); | 591 | params.Set("guid", guid.RawString()); |
| 588 | params.Set("hat", hat); | 592 | params.Set("hat", hat); |
| 589 | params.Set("direction", GetHatButtonName(value)); | 593 | params.Set("direction", GetHatButtonName(value)); |
| 590 | return params; | 594 | return params; |
| 591 | } | 595 | } |
| 592 | 596 | ||
| 593 | Common::ParamPackage SDLDriver::BuildMotionParam(int port, std::string guid) const { | 597 | Common::ParamPackage SDLDriver::BuildMotionParam(int port, const Common::UUID& guid) const { |
| 594 | Common::ParamPackage params{}; | 598 | Common::ParamPackage params{}; |
| 595 | params.Set("engine", GetEngineName()); | 599 | params.Set("engine", GetEngineName()); |
| 596 | params.Set("motion", 0); | 600 | params.Set("motion", 0); |
| 597 | params.Set("port", port); | 601 | params.Set("port", port); |
| 598 | params.Set("guid", std::move(guid)); | 602 | params.Set("guid", guid.RawString()); |
| 599 | return params; | 603 | return params; |
| 600 | } | 604 | } |
| 601 | 605 | ||
| 602 | Common::ParamPackage SDLDriver::BuildParamPackageForBinding( | 606 | Common::ParamPackage SDLDriver::BuildParamPackageForBinding( |
| 603 | int port, const std::string& guid, const SDL_GameControllerButtonBind& binding) const { | 607 | int port, const Common::UUID& guid, const SDL_GameControllerButtonBind& binding) const { |
| 604 | switch (binding.bindType) { | 608 | switch (binding.bindType) { |
| 605 | case SDL_CONTROLLER_BINDTYPE_NONE: | 609 | case SDL_CONTROLLER_BINDTYPE_NONE: |
| 606 | break; | 610 | break; |
diff --git a/src/input_common/drivers/sdl_driver.h b/src/input_common/drivers/sdl_driver.h index c82632506..0846fbb50 100644 --- a/src/input_common/drivers/sdl_driver.h +++ b/src/input_common/drivers/sdl_driver.h | |||
| @@ -47,6 +47,7 @@ public: | |||
| 47 | * Check how many identical joysticks (by guid) were connected before the one with sdl_id and so | 47 | * Check how many identical joysticks (by guid) were connected before the one with sdl_id and so |
| 48 | * tie it to a SDLJoystick with the same guid and that port | 48 | * tie it to a SDLJoystick with the same guid and that port |
| 49 | */ | 49 | */ |
| 50 | std::shared_ptr<SDLJoystick> GetSDLJoystickByGUID(const Common::UUID& guid, int port); | ||
| 50 | std::shared_ptr<SDLJoystick> GetSDLJoystickByGUID(const std::string& guid, int port); | 51 | std::shared_ptr<SDLJoystick> GetSDLJoystickByGUID(const std::string& guid, int port); |
| 51 | 52 | ||
| 52 | std::vector<Common::ParamPackage> GetInputDevices() const override; | 53 | std::vector<Common::ParamPackage> GetInputDevices() const override; |
| @@ -79,18 +80,18 @@ private: | |||
| 79 | /// Takes all vibrations from the queue and sends the command to the controller | 80 | /// Takes all vibrations from the queue and sends the command to the controller |
| 80 | void SendVibrations(); | 81 | void SendVibrations(); |
| 81 | 82 | ||
| 82 | Common::ParamPackage BuildAnalogParamPackageForButton(int port, std::string guid, s32 axis, | 83 | Common::ParamPackage BuildAnalogParamPackageForButton(int port, const Common::UUID& guid, |
| 83 | float value = 0.1f) const; | 84 | s32 axis, float value = 0.1f) const; |
| 84 | Common::ParamPackage BuildButtonParamPackageForButton(int port, std::string guid, | 85 | Common::ParamPackage BuildButtonParamPackageForButton(int port, const Common::UUID& guid, |
| 85 | s32 button) const; | 86 | s32 button) const; |
| 86 | 87 | ||
| 87 | Common::ParamPackage BuildHatParamPackageForButton(int port, std::string guid, s32 hat, | 88 | Common::ParamPackage BuildHatParamPackageForButton(int port, const Common::UUID& guid, s32 hat, |
| 88 | u8 value) const; | 89 | u8 value) const; |
| 89 | 90 | ||
| 90 | Common::ParamPackage BuildMotionParam(int port, std::string guid) const; | 91 | Common::ParamPackage BuildMotionParam(int port, const Common::UUID& guid) const; |
| 91 | 92 | ||
| 92 | Common::ParamPackage BuildParamPackageForBinding( | 93 | Common::ParamPackage BuildParamPackageForBinding( |
| 93 | int port, const std::string& guid, const SDL_GameControllerButtonBind& binding) const; | 94 | int port, const Common::UUID& guid, const SDL_GameControllerButtonBind& binding) const; |
| 94 | 95 | ||
| 95 | Common::ParamPackage BuildParamPackageForAnalog(PadIdentifier identifier, int axis_x, | 96 | Common::ParamPackage BuildParamPackageForAnalog(PadIdentifier identifier, int axis_x, |
| 96 | int axis_y, float offset_x, | 97 | int axis_y, float offset_x, |
| @@ -120,7 +121,7 @@ private: | |||
| 120 | Common::SPSCQueue<VibrationRequest> vibration_queue; | 121 | Common::SPSCQueue<VibrationRequest> vibration_queue; |
| 121 | 122 | ||
| 122 | /// Map of GUID of a list of corresponding virtual Joysticks | 123 | /// Map of GUID of a list of corresponding virtual Joysticks |
| 123 | std::unordered_map<std::string, std::vector<std::shared_ptr<SDLJoystick>>> joystick_map; | 124 | std::unordered_map<Common::UUID, std::vector<std::shared_ptr<SDLJoystick>>> joystick_map; |
| 124 | std::mutex joystick_map_mutex; | 125 | std::mutex joystick_map_mutex; |
| 125 | 126 | ||
| 126 | bool start_thread = false; | 127 | bool start_thread = false; |
diff --git a/src/shader_recompiler/CMakeLists.txt b/src/shader_recompiler/CMakeLists.txt index 4c76ce1ea..ae1dbe619 100644 --- a/src/shader_recompiler/CMakeLists.txt +++ b/src/shader_recompiler/CMakeLists.txt | |||
| @@ -253,9 +253,6 @@ else() | |||
| 253 | -Werror | 253 | -Werror |
| 254 | -Werror=conversion | 254 | -Werror=conversion |
| 255 | -Werror=ignored-qualifiers | 255 | -Werror=ignored-qualifiers |
| 256 | -Werror=implicit-fallthrough | ||
| 257 | -Werror=shadow | ||
| 258 | -Werror=sign-compare | ||
| 259 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter> | 256 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter> |
| 260 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable> | 257 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable> |
| 261 | -Werror=unused-variable | 258 | -Werror=unused-variable |
diff --git a/src/shader_recompiler/frontend/maxwell/control_flow.h b/src/shader_recompiler/frontend/maxwell/control_flow.h index 2487b9b0b..1ce45b3a5 100644 --- a/src/shader_recompiler/frontend/maxwell/control_flow.h +++ b/src/shader_recompiler/frontend/maxwell/control_flow.h | |||
| @@ -58,7 +58,7 @@ public: | |||
| 58 | [[nodiscard]] Stack Remove(Token token) const; | 58 | [[nodiscard]] Stack Remove(Token token) const; |
| 59 | 59 | ||
| 60 | private: | 60 | private: |
| 61 | boost::container::small_vector<StackEntry, 3> entries; | 61 | std::vector<StackEntry> entries; |
| 62 | }; | 62 | }; |
| 63 | 63 | ||
| 64 | struct IndirectBranch { | 64 | struct IndirectBranch { |
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 256695804..14de7bc89 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt | |||
| @@ -258,10 +258,6 @@ if (MSVC) | |||
| 258 | target_compile_options(video_core PRIVATE | 258 | target_compile_options(video_core PRIVATE |
| 259 | /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data | 259 | /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data |
| 260 | /we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data | 260 | /we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data |
| 261 | /we4456 # Declaration of 'identifier' hides previous local declaration | ||
| 262 | /we4457 # Declaration of 'identifier' hides function parameter | ||
| 263 | /we4458 # Declaration of 'identifier' hides class member | ||
| 264 | /we4459 # Declaration of 'identifier' hides global declaration | ||
| 265 | ) | 261 | ) |
| 266 | else() | 262 | else() |
| 267 | target_compile_options(video_core PRIVATE | 263 | target_compile_options(video_core PRIVATE |
| @@ -269,7 +265,6 @@ else() | |||
| 269 | -Wno-error=sign-conversion | 265 | -Wno-error=sign-conversion |
| 270 | -Werror=pessimizing-move | 266 | -Werror=pessimizing-move |
| 271 | -Werror=redundant-move | 267 | -Werror=redundant-move |
| 272 | -Werror=shadow | ||
| 273 | -Werror=type-limits | 268 | -Werror=type-limits |
| 274 | 269 | ||
| 275 | $<$<CXX_COMPILER_ID:GNU>:-Werror=class-memaccess> | 270 | $<$<CXX_COMPILER_ID:GNU>:-Werror=class-memaccess> |
diff --git a/src/video_core/command_classes/codecs/codec.cpp b/src/video_core/command_classes/codecs/codec.cpp index 83b2e0fc4..a5eb97b7f 100644 --- a/src/video_core/command_classes/codecs/codec.cpp +++ b/src/video_core/command_classes/codecs/codec.cpp | |||
| @@ -224,7 +224,7 @@ void Codec::Decode() { | |||
| 224 | vp9_hidden_frame = vp9_decoder->WasFrameHidden(); | 224 | vp9_hidden_frame = vp9_decoder->WasFrameHidden(); |
| 225 | return vp9_decoder->GetFrameBytes(); | 225 | return vp9_decoder->GetFrameBytes(); |
| 226 | default: | 226 | default: |
| 227 | UNREACHABLE(); | 227 | ASSERT(false); |
| 228 | return std::vector<u8>{}; | 228 | return std::vector<u8>{}; |
| 229 | } | 229 | } |
| 230 | }(); | 230 | }(); |
diff --git a/src/video_core/command_classes/vic.cpp b/src/video_core/command_classes/vic.cpp index bef321b6e..7c17df353 100644 --- a/src/video_core/command_classes/vic.cpp +++ b/src/video_core/command_classes/vic.cpp | |||
| @@ -228,7 +228,7 @@ void Vic::WriteYUVFrame(const AVFrame* frame, const VicConfig& config) { | |||
| 228 | break; | 228 | break; |
| 229 | } | 229 | } |
| 230 | default: | 230 | default: |
| 231 | UNREACHABLE(); | 231 | ASSERT(false); |
| 232 | break; | 232 | break; |
| 233 | } | 233 | } |
| 234 | gpu.MemoryManager().WriteBlock(output_surface_chroma_address, chroma_buffer.data(), | 234 | gpu.MemoryManager().WriteBlock(output_surface_chroma_address, chroma_buffer.data(), |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 434ba0877..5f9eb208c 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -202,7 +202,7 @@ public: | |||
| 202 | case Size::Size_11_11_10: | 202 | case Size::Size_11_11_10: |
| 203 | return 3; | 203 | return 3; |
| 204 | default: | 204 | default: |
| 205 | UNREACHABLE(); | 205 | ASSERT(false); |
| 206 | return 1; | 206 | return 1; |
| 207 | } | 207 | } |
| 208 | } | 208 | } |
| @@ -238,7 +238,7 @@ public: | |||
| 238 | case Size::Size_11_11_10: | 238 | case Size::Size_11_11_10: |
| 239 | return 4; | 239 | return 4; |
| 240 | default: | 240 | default: |
| 241 | UNREACHABLE(); | 241 | ASSERT(false); |
| 242 | return 1; | 242 | return 1; |
| 243 | } | 243 | } |
| 244 | } | 244 | } |
| @@ -274,7 +274,7 @@ public: | |||
| 274 | case Size::Size_11_11_10: | 274 | case Size::Size_11_11_10: |
| 275 | return "11_11_10"; | 275 | return "11_11_10"; |
| 276 | default: | 276 | default: |
| 277 | UNREACHABLE(); | 277 | ASSERT(false); |
| 278 | return {}; | 278 | return {}; |
| 279 | } | 279 | } |
| 280 | } | 280 | } |
| @@ -296,7 +296,7 @@ public: | |||
| 296 | case Type::Float: | 296 | case Type::Float: |
| 297 | return "FLOAT"; | 297 | return "FLOAT"; |
| 298 | } | 298 | } |
| 299 | UNREACHABLE(); | 299 | ASSERT(false); |
| 300 | return {}; | 300 | return {}; |
| 301 | } | 301 | } |
| 302 | 302 | ||
| @@ -336,7 +336,7 @@ public: | |||
| 336 | case 3: | 336 | case 3: |
| 337 | return {x3, y3}; | 337 | return {x3, y3}; |
| 338 | default: | 338 | default: |
| 339 | UNREACHABLE(); | 339 | ASSERT(false); |
| 340 | return {0, 0}; | 340 | return {0, 0}; |
| 341 | } | 341 | } |
| 342 | } | 342 | } |
| @@ -1193,7 +1193,7 @@ public: | |||
| 1193 | case IndexFormat::UnsignedInt: | 1193 | case IndexFormat::UnsignedInt: |
| 1194 | return 4; | 1194 | return 4; |
| 1195 | } | 1195 | } |
| 1196 | UNREACHABLE(); | 1196 | ASSERT(false); |
| 1197 | return 1; | 1197 | return 1; |
| 1198 | } | 1198 | } |
| 1199 | 1199 | ||
diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index a7302f7c1..0efe58282 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp | |||
| @@ -62,7 +62,7 @@ void MaxwellDMA::Launch() { | |||
| 62 | 62 | ||
| 63 | if (!is_src_pitch && !is_dst_pitch) { | 63 | if (!is_src_pitch && !is_dst_pitch) { |
| 64 | // If both the source and the destination are in block layout, assert. | 64 | // If both the source and the destination are in block layout, assert. |
| 65 | UNREACHABLE_MSG("Tiled->Tiled DMA transfers are not yet implemented"); | 65 | UNIMPLEMENTED_MSG("Tiled->Tiled DMA transfers are not yet implemented"); |
| 66 | return; | 66 | return; |
| 67 | } | 67 | } |
| 68 | 68 | ||
| @@ -260,7 +260,7 @@ void MaxwellDMA::ReleaseSemaphore() { | |||
| 260 | memory_manager.Write<u64>(address + 8, system.GPU().GetTicks()); | 260 | memory_manager.Write<u64>(address + 8, system.GPU().GetTicks()); |
| 261 | break; | 261 | break; |
| 262 | default: | 262 | default: |
| 263 | UNREACHABLE_MSG("Unknown semaphore type: {}", static_cast<u32>(type.Value())); | 263 | ASSERT_MSG(false, "Unknown semaphore type: {}", static_cast<u32>(type.Value())); |
| 264 | } | 264 | } |
| 265 | } | 265 | } |
| 266 | 266 | ||
diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp index 8479dc6d2..b0ce9f000 100644 --- a/src/video_core/gpu_thread.cpp +++ b/src/video_core/gpu_thread.cpp | |||
| @@ -50,7 +50,7 @@ static void RunThread(std::stop_token stop_token, Core::System& system, | |||
| 50 | } else if (const auto* invalidate = std::get_if<InvalidateRegionCommand>(&next.data)) { | 50 | } else if (const auto* invalidate = std::get_if<InvalidateRegionCommand>(&next.data)) { |
| 51 | rasterizer->OnCPUWrite(invalidate->addr, invalidate->size); | 51 | rasterizer->OnCPUWrite(invalidate->addr, invalidate->size); |
| 52 | } else { | 52 | } else { |
| 53 | UNREACHABLE(); | 53 | ASSERT(false); |
| 54 | } | 54 | } |
| 55 | state.signaled_fence.store(next.fence); | 55 | state.signaled_fence.store(next.fence); |
| 56 | if (next.block) { | 56 | if (next.block) { |
diff --git a/src/video_core/macro/macro.cpp b/src/video_core/macro/macro.cpp index e7279efcd..43f8b5904 100644 --- a/src/video_core/macro/macro.cpp +++ b/src/video_core/macro/macro.cpp | |||
| @@ -71,7 +71,7 @@ void MacroEngine::Execute(u32 method, const std::vector<u32>& parameters) { | |||
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| 73 | if (!mid_method.has_value()) { | 73 | if (!mid_method.has_value()) { |
| 74 | UNREACHABLE_MSG("Macro 0x{0:x} was not uploaded", method); | 74 | ASSERT_MSG(false, "Macro 0x{0:x} was not uploaded", method); |
| 75 | return; | 75 | return; |
| 76 | } | 76 | } |
| 77 | } | 77 | } |
diff --git a/src/video_core/macro/macro_interpreter.cpp b/src/video_core/macro/macro_interpreter.cpp index 87d2e8721..f670b1bca 100644 --- a/src/video_core/macro/macro_interpreter.cpp +++ b/src/video_core/macro/macro_interpreter.cpp | |||
| @@ -308,7 +308,6 @@ bool MacroInterpreterImpl::EvaluateBranchCondition(Macro::BranchCondition cond, | |||
| 308 | return value != 0; | 308 | return value != 0; |
| 309 | } | 309 | } |
| 310 | UNREACHABLE(); | 310 | UNREACHABLE(); |
| 311 | return true; | ||
| 312 | } | 311 | } |
| 313 | 312 | ||
| 314 | Macro::Opcode MacroInterpreterImpl::GetOpcode() const { | 313 | Macro::Opcode MacroInterpreterImpl::GetOpcode() const { |
diff --git a/src/video_core/macro/macro_jit_x64.cpp b/src/video_core/macro/macro_jit_x64.cpp index dc5376501..aca25d902 100644 --- a/src/video_core/macro/macro_jit_x64.cpp +++ b/src/video_core/macro/macro_jit_x64.cpp | |||
| @@ -411,7 +411,7 @@ void MacroJITx64Impl::Compile_Branch(Macro::Opcode opcode) { | |||
| 411 | 411 | ||
| 412 | Xbyak::Label end; | 412 | Xbyak::Label end; |
| 413 | auto value = Compile_GetRegister(opcode.src_a, eax); | 413 | auto value = Compile_GetRegister(opcode.src_a, eax); |
| 414 | test(value, value); | 414 | cmp(value, 0); // test(value, value); |
| 415 | if (optimizer.has_delayed_pc) { | 415 | if (optimizer.has_delayed_pc) { |
| 416 | switch (opcode.branch_condition) { | 416 | switch (opcode.branch_condition) { |
| 417 | case Macro::BranchCondition::Zero: | 417 | case Macro::BranchCondition::Zero: |
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index c8d99fdb5..d373be0ba 100644 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp | |||
| @@ -67,7 +67,7 @@ void MemoryManager::Unmap(GPUVAddr gpu_addr, std::size_t size) { | |||
| 67 | ASSERT(it->first == gpu_addr); | 67 | ASSERT(it->first == gpu_addr); |
| 68 | map_ranges.erase(it); | 68 | map_ranges.erase(it); |
| 69 | } else { | 69 | } else { |
| 70 | UNREACHABLE_MSG("Unmapping non-existent GPU address=0x{:x}", gpu_addr); | 70 | ASSERT_MSG(false, "Unmapping non-existent GPU address=0x{:x}", gpu_addr); |
| 71 | } | 71 | } |
| 72 | const auto submapped_ranges = GetSubmappedRange(gpu_addr, size); | 72 | const auto submapped_ranges = GetSubmappedRange(gpu_addr, size); |
| 73 | 73 | ||
| @@ -206,7 +206,7 @@ T MemoryManager::Read(GPUVAddr addr) const { | |||
| 206 | return value; | 206 | return value; |
| 207 | } | 207 | } |
| 208 | 208 | ||
| 209 | UNREACHABLE(); | 209 | ASSERT(false); |
| 210 | 210 | ||
| 211 | return {}; | 211 | return {}; |
| 212 | } | 212 | } |
| @@ -219,7 +219,7 @@ void MemoryManager::Write(GPUVAddr addr, T data) { | |||
| 219 | return; | 219 | return; |
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | UNREACHABLE(); | 222 | ASSERT(false); |
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | template u8 MemoryManager::Read<u8>(GPUVAddr addr) const; | 225 | template u8 MemoryManager::Read<u8>(GPUVAddr addr) const; |
diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp index 35f42f2f8..67eae369d 100644 --- a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp +++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp | |||
| @@ -48,7 +48,7 @@ GLenum Stage(size_t stage_index) { | |||
| 48 | case 4: | 48 | case 4: |
| 49 | return GL_FRAGMENT_SHADER; | 49 | return GL_FRAGMENT_SHADER; |
| 50 | } | 50 | } |
| 51 | UNREACHABLE_MSG("{}", stage_index); | 51 | ASSERT_MSG(false, "{}", stage_index); |
| 52 | return GL_NONE; | 52 | return GL_NONE; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| @@ -65,7 +65,7 @@ GLenum AssemblyStage(size_t stage_index) { | |||
| 65 | case 4: | 65 | case 4: |
| 66 | return GL_FRAGMENT_PROGRAM_NV; | 66 | return GL_FRAGMENT_PROGRAM_NV; |
| 67 | } | 67 | } |
| 68 | UNREACHABLE_MSG("{}", stage_index); | 68 | ASSERT_MSG(false, "{}", stage_index); |
| 69 | return GL_NONE; | 69 | return GL_NONE; |
| 70 | } | 70 | } |
| 71 | 71 | ||
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index cd48fef26..07d4b7cf0 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp | |||
| @@ -85,7 +85,7 @@ Shader::RuntimeInfo MakeRuntimeInfo(const GraphicsPipelineKey& key, | |||
| 85 | case Maxwell::TessellationPrimitive::Quads: | 85 | case Maxwell::TessellationPrimitive::Quads: |
| 86 | return Shader::TessPrimitive::Quads; | 86 | return Shader::TessPrimitive::Quads; |
| 87 | } | 87 | } |
| 88 | UNREACHABLE(); | 88 | ASSERT(false); |
| 89 | return Shader::TessPrimitive::Triangles; | 89 | return Shader::TessPrimitive::Triangles; |
| 90 | }(); | 90 | }(); |
| 91 | info.tess_spacing = [&] { | 91 | info.tess_spacing = [&] { |
| @@ -97,7 +97,7 @@ Shader::RuntimeInfo MakeRuntimeInfo(const GraphicsPipelineKey& key, | |||
| 97 | case Maxwell::TessellationSpacing::FractionalEven: | 97 | case Maxwell::TessellationSpacing::FractionalEven: |
| 98 | return Shader::TessSpacing::FractionalEven; | 98 | return Shader::TessSpacing::FractionalEven; |
| 99 | } | 99 | } |
| 100 | UNREACHABLE(); | 100 | ASSERT(false); |
| 101 | return Shader::TessSpacing::Equal; | 101 | return Shader::TessSpacing::Equal; |
| 102 | }(); | 102 | }(); |
| 103 | break; | 103 | break; |
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 29ff736fb..8c0fffc67 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -83,7 +83,7 @@ GLenum ImageTarget(const VideoCommon::ImageInfo& info) { | |||
| 83 | case ImageType::Buffer: | 83 | case ImageType::Buffer: |
| 84 | return GL_TEXTURE_BUFFER; | 84 | return GL_TEXTURE_BUFFER; |
| 85 | } | 85 | } |
| 86 | UNREACHABLE_MSG("Invalid image type={}", info.type); | 86 | ASSERT_MSG(false, "Invalid image type={}", info.type); |
| 87 | return GL_NONE; | 87 | return GL_NONE; |
| 88 | } | 88 | } |
| 89 | 89 | ||
| @@ -107,7 +107,7 @@ GLenum ImageTarget(Shader::TextureType type, int num_samples = 1) { | |||
| 107 | case Shader::TextureType::Buffer: | 107 | case Shader::TextureType::Buffer: |
| 108 | return GL_TEXTURE_BUFFER; | 108 | return GL_TEXTURE_BUFFER; |
| 109 | } | 109 | } |
| 110 | UNREACHABLE_MSG("Invalid image view type={}", type); | 110 | ASSERT_MSG(false, "Invalid image view type={}", type); |
| 111 | return GL_NONE; | 111 | return GL_NONE; |
| 112 | } | 112 | } |
| 113 | 113 | ||
| @@ -119,7 +119,7 @@ GLenum TextureMode(PixelFormat format, bool is_first) { | |||
| 119 | case PixelFormat::S8_UINT_D24_UNORM: | 119 | case PixelFormat::S8_UINT_D24_UNORM: |
| 120 | return is_first ? GL_STENCIL_INDEX : GL_DEPTH_COMPONENT; | 120 | return is_first ? GL_STENCIL_INDEX : GL_DEPTH_COMPONENT; |
| 121 | default: | 121 | default: |
| 122 | UNREACHABLE(); | 122 | ASSERT(false); |
| 123 | return GL_DEPTH_COMPONENT; | 123 | return GL_DEPTH_COMPONENT; |
| 124 | } | 124 | } |
| 125 | } | 125 | } |
| @@ -140,7 +140,7 @@ GLint Swizzle(SwizzleSource source) { | |||
| 140 | case SwizzleSource::OneFloat: | 140 | case SwizzleSource::OneFloat: |
| 141 | return GL_ONE; | 141 | return GL_ONE; |
| 142 | } | 142 | } |
| 143 | UNREACHABLE_MSG("Invalid swizzle source={}", source); | 143 | ASSERT_MSG(false, "Invalid swizzle source={}", source); |
| 144 | return GL_NONE; | 144 | return GL_NONE; |
| 145 | } | 145 | } |
| 146 | 146 | ||
| @@ -197,7 +197,7 @@ GLint ConvertA5B5G5R1_UNORM(SwizzleSource source) { | |||
| 197 | case SwizzleSource::OneFloat: | 197 | case SwizzleSource::OneFloat: |
| 198 | return GL_ONE; | 198 | return GL_ONE; |
| 199 | } | 199 | } |
| 200 | UNREACHABLE_MSG("Invalid swizzle source={}", source); | 200 | ASSERT_MSG(false, "Invalid swizzle source={}", source); |
| 201 | return GL_NONE; | 201 | return GL_NONE; |
| 202 | } | 202 | } |
| 203 | 203 | ||
| @@ -381,10 +381,10 @@ OGLTexture MakeImage(const VideoCommon::ImageInfo& info, GLenum gl_internal_form | |||
| 381 | glTextureStorage3D(handle, gl_num_levels, gl_internal_format, width, height, depth); | 381 | glTextureStorage3D(handle, gl_num_levels, gl_internal_format, width, height, depth); |
| 382 | break; | 382 | break; |
| 383 | case GL_TEXTURE_BUFFER: | 383 | case GL_TEXTURE_BUFFER: |
| 384 | UNREACHABLE(); | 384 | ASSERT(false); |
| 385 | break; | 385 | break; |
| 386 | default: | 386 | default: |
| 387 | UNREACHABLE_MSG("Invalid target=0x{:x}", target); | 387 | ASSERT_MSG(false, "Invalid target=0x{:x}", target); |
| 388 | break; | 388 | break; |
| 389 | } | 389 | } |
| 390 | return texture; | 390 | return texture; |
| @@ -420,7 +420,7 @@ OGLTexture MakeImage(const VideoCommon::ImageInfo& info, GLenum gl_internal_form | |||
| 420 | case Shader::ImageFormat::R32G32B32A32_UINT: | 420 | case Shader::ImageFormat::R32G32B32A32_UINT: |
| 421 | return GL_RGBA32UI; | 421 | return GL_RGBA32UI; |
| 422 | } | 422 | } |
| 423 | UNREACHABLE_MSG("Invalid image format={}", format); | 423 | ASSERT_MSG(false, "Invalid image format={}", format); |
| 424 | return GL_R32UI; | 424 | return GL_R32UI; |
| 425 | } | 425 | } |
| 426 | 426 | ||
| @@ -579,7 +579,7 @@ void TextureCacheRuntime::EmulateCopyImage(Image& dst, Image& src, | |||
| 579 | } else if (IsPixelFormatBGR(dst.info.format) || IsPixelFormatBGR(src.info.format)) { | 579 | } else if (IsPixelFormatBGR(dst.info.format) || IsPixelFormatBGR(src.info.format)) { |
| 580 | format_conversion_pass.ConvertImage(dst, src, copies); | 580 | format_conversion_pass.ConvertImage(dst, src, copies); |
| 581 | } else { | 581 | } else { |
| 582 | UNREACHABLE(); | 582 | ASSERT(false); |
| 583 | } | 583 | } |
| 584 | } | 584 | } |
| 585 | 585 | ||
| @@ -620,7 +620,7 @@ void TextureCacheRuntime::AccelerateImageUpload(Image& image, const ImageBufferM | |||
| 620 | case ImageType::Linear: | 620 | case ImageType::Linear: |
| 621 | return util_shaders.PitchUpload(image, map, swizzles); | 621 | return util_shaders.PitchUpload(image, map, swizzles); |
| 622 | default: | 622 | default: |
| 623 | UNREACHABLE(); | 623 | ASSERT(false); |
| 624 | break; | 624 | break; |
| 625 | } | 625 | } |
| 626 | } | 626 | } |
| @@ -639,7 +639,7 @@ FormatProperties TextureCacheRuntime::FormatInfo(ImageType type, GLenum internal | |||
| 639 | case ImageType::e3D: | 639 | case ImageType::e3D: |
| 640 | return format_properties[2].at(internal_format); | 640 | return format_properties[2].at(internal_format); |
| 641 | default: | 641 | default: |
| 642 | UNREACHABLE(); | 642 | ASSERT(false); |
| 643 | return FormatProperties{}; | 643 | return FormatProperties{}; |
| 644 | } | 644 | } |
| 645 | } | 645 | } |
| @@ -888,7 +888,7 @@ void Image::CopyBufferToImage(const VideoCommon::BufferImageCopy& copy, size_t b | |||
| 888 | } | 888 | } |
| 889 | break; | 889 | break; |
| 890 | default: | 890 | default: |
| 891 | UNREACHABLE(); | 891 | ASSERT(false); |
| 892 | } | 892 | } |
| 893 | } | 893 | } |
| 894 | 894 | ||
| @@ -924,7 +924,7 @@ void Image::CopyImageToBuffer(const VideoCommon::BufferImageCopy& copy, size_t b | |||
| 924 | depth = copy.image_extent.depth; | 924 | depth = copy.image_extent.depth; |
| 925 | break; | 925 | break; |
| 926 | default: | 926 | default: |
| 927 | UNREACHABLE(); | 927 | ASSERT(false); |
| 928 | } | 928 | } |
| 929 | // Compressed formats don't have a pixel format or type | 929 | // Compressed formats don't have a pixel format or type |
| 930 | const bool is_compressed = gl_format == GL_NONE; | 930 | const bool is_compressed = gl_format == GL_NONE; |
| @@ -950,7 +950,7 @@ void Image::Scale(bool up_scale) { | |||
| 950 | case SurfaceType::DepthStencil: | 950 | case SurfaceType::DepthStencil: |
| 951 | return GL_DEPTH_STENCIL_ATTACHMENT; | 951 | return GL_DEPTH_STENCIL_ATTACHMENT; |
| 952 | default: | 952 | default: |
| 953 | UNREACHABLE(); | 953 | ASSERT(false); |
| 954 | return GL_COLOR_ATTACHMENT0; | 954 | return GL_COLOR_ATTACHMENT0; |
| 955 | } | 955 | } |
| 956 | }(); | 956 | }(); |
| @@ -965,7 +965,7 @@ void Image::Scale(bool up_scale) { | |||
| 965 | case SurfaceType::DepthStencil: | 965 | case SurfaceType::DepthStencil: |
| 966 | return GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; | 966 | return GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; |
| 967 | default: | 967 | default: |
| 968 | UNREACHABLE(); | 968 | ASSERT(false); |
| 969 | return GL_COLOR_BUFFER_BIT; | 969 | return GL_COLOR_BUFFER_BIT; |
| 970 | } | 970 | } |
| 971 | }(); | 971 | }(); |
| @@ -980,7 +980,7 @@ void Image::Scale(bool up_scale) { | |||
| 980 | case SurfaceType::DepthStencil: | 980 | case SurfaceType::DepthStencil: |
| 981 | return 3; | 981 | return 3; |
| 982 | default: | 982 | default: |
| 983 | UNREACHABLE(); | 983 | ASSERT(false); |
| 984 | return 0; | 984 | return 0; |
| 985 | } | 985 | } |
| 986 | }(); | 986 | }(); |
| @@ -1045,7 +1045,7 @@ bool Image::ScaleUp(bool ignore) { | |||
| 1045 | return false; | 1045 | return false; |
| 1046 | } | 1046 | } |
| 1047 | if (info.type == ImageType::Linear) { | 1047 | if (info.type == ImageType::Linear) { |
| 1048 | UNREACHABLE(); | 1048 | ASSERT(false); |
| 1049 | return false; | 1049 | return false; |
| 1050 | } | 1050 | } |
| 1051 | flags |= ImageFlagBits::Rescaled; | 1051 | flags |= ImageFlagBits::Rescaled; |
| @@ -1139,7 +1139,7 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI | |||
| 1139 | UNIMPLEMENTED(); | 1139 | UNIMPLEMENTED(); |
| 1140 | break; | 1140 | break; |
| 1141 | case ImageViewType::Buffer: | 1141 | case ImageViewType::Buffer: |
| 1142 | UNREACHABLE(); | 1142 | ASSERT(false); |
| 1143 | break; | 1143 | break; |
| 1144 | } | 1144 | } |
| 1145 | switch (info.type) { | 1145 | switch (info.type) { |
| @@ -1319,7 +1319,7 @@ Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM | |||
| 1319 | buffer_bits |= GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; | 1319 | buffer_bits |= GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; |
| 1320 | break; | 1320 | break; |
| 1321 | default: | 1321 | default: |
| 1322 | UNREACHABLE(); | 1322 | ASSERT(false); |
| 1323 | buffer_bits |= GL_DEPTH_BUFFER_BIT; | 1323 | buffer_bits |= GL_DEPTH_BUFFER_BIT; |
| 1324 | break; | 1324 | break; |
| 1325 | } | 1325 | } |
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h index c2a6da5a7..644b60d73 100644 --- a/src/video_core/renderer_opengl/maxwell_to_gl.h +++ b/src/video_core/renderer_opengl/maxwell_to_gl.h | |||
| @@ -206,7 +206,7 @@ inline GLenum IndexFormat(Maxwell::IndexFormat index_format) { | |||
| 206 | case Maxwell::IndexFormat::UnsignedInt: | 206 | case Maxwell::IndexFormat::UnsignedInt: |
| 207 | return GL_UNSIGNED_INT; | 207 | return GL_UNSIGNED_INT; |
| 208 | } | 208 | } |
| 209 | UNREACHABLE_MSG("Invalid index_format={}", index_format); | 209 | ASSERT_MSG(false, "Invalid index_format={}", index_format); |
| 210 | return {}; | 210 | return {}; |
| 211 | } | 211 | } |
| 212 | 212 | ||
| @@ -243,7 +243,7 @@ inline GLenum PrimitiveTopology(Maxwell::PrimitiveTopology topology) { | |||
| 243 | case Maxwell::PrimitiveTopology::Patches: | 243 | case Maxwell::PrimitiveTopology::Patches: |
| 244 | return GL_PATCHES; | 244 | return GL_PATCHES; |
| 245 | } | 245 | } |
| 246 | UNREACHABLE_MSG("Invalid topology={}", topology); | 246 | ASSERT_MSG(false, "Invalid topology={}", topology); |
| 247 | return GL_POINTS; | 247 | return GL_POINTS; |
| 248 | } | 248 | } |
| 249 | 249 | ||
| @@ -271,8 +271,8 @@ inline GLenum TextureFilterMode(Tegra::Texture::TextureFilter filter_mode, | |||
| 271 | } | 271 | } |
| 272 | break; | 272 | break; |
| 273 | } | 273 | } |
| 274 | UNREACHABLE_MSG("Invalid texture filter mode={} and mipmap filter mode={}", filter_mode, | 274 | ASSERT_MSG(false, "Invalid texture filter mode={} and mipmap filter mode={}", filter_mode, |
| 275 | mipmap_filter_mode); | 275 | mipmap_filter_mode); |
| 276 | return GL_NEAREST; | 276 | return GL_NEAREST; |
| 277 | } | 277 | } |
| 278 | 278 | ||
| @@ -550,7 +550,7 @@ inline GLenum PolygonMode(Maxwell::PolygonMode polygon_mode) { | |||
| 550 | case Maxwell::PolygonMode::Fill: | 550 | case Maxwell::PolygonMode::Fill: |
| 551 | return GL_FILL; | 551 | return GL_FILL; |
| 552 | } | 552 | } |
| 553 | UNREACHABLE_MSG("Invalid polygon mode={}", polygon_mode); | 553 | ASSERT_MSG(false, "Invalid polygon mode={}", polygon_mode); |
| 554 | return GL_FILL; | 554 | return GL_FILL; |
| 555 | } | 555 | } |
| 556 | 556 | ||
| @@ -563,7 +563,7 @@ inline GLenum ReductionFilter(Tegra::Texture::SamplerReduction filter) { | |||
| 563 | case Tegra::Texture::SamplerReduction::Max: | 563 | case Tegra::Texture::SamplerReduction::Max: |
| 564 | return GL_MAX; | 564 | return GL_MAX; |
| 565 | } | 565 | } |
| 566 | UNREACHABLE_MSG("Invalid reduction filter={}", static_cast<int>(filter)); | 566 | ASSERT_MSG(false, "Invalid reduction filter={}", static_cast<int>(filter)); |
| 567 | return GL_WEIGHTED_AVERAGE_ARB; | 567 | return GL_WEIGHTED_AVERAGE_ARB; |
| 568 | } | 568 | } |
| 569 | 569 | ||
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 3a3c213bb..9a9243544 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -79,7 +79,7 @@ const char* GetSource(GLenum source) { | |||
| 79 | case GL_DEBUG_SOURCE_OTHER: | 79 | case GL_DEBUG_SOURCE_OTHER: |
| 80 | return "OTHER"; | 80 | return "OTHER"; |
| 81 | default: | 81 | default: |
| 82 | UNREACHABLE(); | 82 | ASSERT(false); |
| 83 | return "Unknown source"; | 83 | return "Unknown source"; |
| 84 | } | 84 | } |
| 85 | } | 85 | } |
| @@ -101,7 +101,7 @@ const char* GetType(GLenum type) { | |||
| 101 | case GL_DEBUG_TYPE_MARKER: | 101 | case GL_DEBUG_TYPE_MARKER: |
| 102 | return "MARKER"; | 102 | return "MARKER"; |
| 103 | default: | 103 | default: |
| 104 | UNREACHABLE(); | 104 | ASSERT(false); |
| 105 | return "Unknown type"; | 105 | return "Unknown type"; |
| 106 | } | 106 | } |
| 107 | } | 107 | } |
diff --git a/src/video_core/renderer_opengl/util_shaders.cpp b/src/video_core/renderer_opengl/util_shaders.cpp index 837825737..404def62e 100644 --- a/src/video_core/renderer_opengl/util_shaders.cpp +++ b/src/video_core/renderer_opengl/util_shaders.cpp | |||
| @@ -282,7 +282,7 @@ GLenum StoreFormat(u32 bytes_per_block) { | |||
| 282 | case 16: | 282 | case 16: |
| 283 | return GL_RGBA32UI; | 283 | return GL_RGBA32UI; |
| 284 | } | 284 | } |
| 285 | UNREACHABLE(); | 285 | ASSERT(false); |
| 286 | return GL_R8UI; | 286 | return GL_R8UI; |
| 287 | } | 287 | } |
| 288 | 288 | ||
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp index ea360f339..193cbe15e 100644 --- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp +++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp | |||
| @@ -25,7 +25,7 @@ VkFilter Filter(Tegra::Texture::TextureFilter filter) { | |||
| 25 | case Tegra::Texture::TextureFilter::Linear: | 25 | case Tegra::Texture::TextureFilter::Linear: |
| 26 | return VK_FILTER_LINEAR; | 26 | return VK_FILTER_LINEAR; |
| 27 | } | 27 | } |
| 28 | UNREACHABLE_MSG("Invalid sampler filter={}", filter); | 28 | ASSERT_MSG(false, "Invalid sampler filter={}", filter); |
| 29 | return {}; | 29 | return {}; |
| 30 | } | 30 | } |
| 31 | 31 | ||
| @@ -42,7 +42,7 @@ VkSamplerMipmapMode MipmapMode(Tegra::Texture::TextureMipmapFilter mipmap_filter | |||
| 42 | case Tegra::Texture::TextureMipmapFilter::Linear: | 42 | case Tegra::Texture::TextureMipmapFilter::Linear: |
| 43 | return VK_SAMPLER_MIPMAP_MODE_LINEAR; | 43 | return VK_SAMPLER_MIPMAP_MODE_LINEAR; |
| 44 | } | 44 | } |
| 45 | UNREACHABLE_MSG("Invalid sampler mipmap mode={}", mipmap_filter); | 45 | ASSERT_MSG(false, "Invalid sampler mipmap mode={}", mipmap_filter); |
| 46 | return {}; | 46 | return {}; |
| 47 | } | 47 | } |
| 48 | 48 | ||
| @@ -70,7 +70,7 @@ VkSamplerAddressMode WrapMode(const Device& device, Tegra::Texture::WrapMode wra | |||
| 70 | case Tegra::Texture::TextureFilter::Linear: | 70 | case Tegra::Texture::TextureFilter::Linear: |
| 71 | return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; | 71 | return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; |
| 72 | } | 72 | } |
| 73 | UNREACHABLE(); | 73 | ASSERT(false); |
| 74 | return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; | 74 | return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; |
| 75 | case Tegra::Texture::WrapMode::MirrorOnceClampToEdge: | 75 | case Tegra::Texture::WrapMode::MirrorOnceClampToEdge: |
| 76 | return VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE; | 76 | return VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE; |
| @@ -744,7 +744,7 @@ VkViewportCoordinateSwizzleNV ViewportSwizzle(Maxwell::ViewportSwizzle swizzle) | |||
| 744 | case Maxwell::ViewportSwizzle::NegativeW: | 744 | case Maxwell::ViewportSwizzle::NegativeW: |
| 745 | return VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV; | 745 | return VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV; |
| 746 | } | 746 | } |
| 747 | UNREACHABLE_MSG("Invalid swizzle={}", swizzle); | 747 | ASSERT_MSG(false, "Invalid swizzle={}", swizzle); |
| 748 | return {}; | 748 | return {}; |
| 749 | } | 749 | } |
| 750 | 750 | ||
| @@ -757,7 +757,7 @@ VkSamplerReductionMode SamplerReduction(Tegra::Texture::SamplerReduction reducti | |||
| 757 | case Tegra::Texture::SamplerReduction::Max: | 757 | case Tegra::Texture::SamplerReduction::Max: |
| 758 | return VK_SAMPLER_REDUCTION_MODE_MAX_EXT; | 758 | return VK_SAMPLER_REDUCTION_MODE_MAX_EXT; |
| 759 | } | 759 | } |
| 760 | UNREACHABLE_MSG("Invalid sampler mode={}", static_cast<int>(reduction)); | 760 | ASSERT_MSG(false, "Invalid sampler mode={}", static_cast<int>(reduction)); |
| 761 | return VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT; | 761 | return VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT; |
| 762 | } | 762 | } |
| 763 | 763 | ||
| @@ -780,7 +780,7 @@ VkSampleCountFlagBits MsaaMode(Tegra::Texture::MsaaMode msaa_mode) { | |||
| 780 | case Tegra::Texture::MsaaMode::Msaa4x4: | 780 | case Tegra::Texture::MsaaMode::Msaa4x4: |
| 781 | return VK_SAMPLE_COUNT_16_BIT; | 781 | return VK_SAMPLE_COUNT_16_BIT; |
| 782 | default: | 782 | default: |
| 783 | UNREACHABLE_MSG("Invalid msaa_mode={}", static_cast<int>(msaa_mode)); | 783 | ASSERT_MSG(false, "Invalid msaa_mode={}", static_cast<int>(msaa_mode)); |
| 784 | return VK_SAMPLE_COUNT_1_BIT; | 784 | return VK_SAMPLE_COUNT_1_BIT; |
| 785 | } | 785 | } |
| 786 | } | 786 | } |
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 0aeb37538..450905197 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp | |||
| @@ -46,7 +46,7 @@ size_t BytesPerIndex(VkIndexType index_type) { | |||
| 46 | case VK_INDEX_TYPE_UINT32: | 46 | case VK_INDEX_TYPE_UINT32: |
| 47 | return 4; | 47 | return 4; |
| 48 | default: | 48 | default: |
| 49 | UNREACHABLE_MSG("Invalid index type={}", index_type); | 49 | ASSERT_MSG(false, "Invalid index type={}", index_type); |
| 50 | return 1; | 50 | return 1; |
| 51 | } | 51 | } |
| 52 | } | 52 | } |
| @@ -366,7 +366,7 @@ void BufferCacheRuntime::ReserveQuadArrayLUT(u32 num_indices, bool wait_for_idle | |||
| 366 | std::memcpy(staging_data, MakeQuadIndices<u32>(quad, first).data(), quad_size); | 366 | std::memcpy(staging_data, MakeQuadIndices<u32>(quad, first).data(), quad_size); |
| 367 | break; | 367 | break; |
| 368 | default: | 368 | default: |
| 369 | UNREACHABLE(); | 369 | ASSERT(false); |
| 370 | break; | 370 | break; |
| 371 | } | 371 | } |
| 372 | staging_data += quad_size; | 372 | staging_data += quad_size; |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 29481a102..4cba777e6 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp | |||
| @@ -265,7 +265,7 @@ std::pair<VkBuffer, VkDeviceSize> QuadIndexedPass::Assemble( | |||
| 265 | case Tegra::Engines::Maxwell3D::Regs::IndexFormat::UnsignedInt: | 265 | case Tegra::Engines::Maxwell3D::Regs::IndexFormat::UnsignedInt: |
| 266 | return 2; | 266 | return 2; |
| 267 | } | 267 | } |
| 268 | UNREACHABLE(); | 268 | ASSERT(false); |
| 269 | return 2; | 269 | return 2; |
| 270 | }(); | 270 | }(); |
| 271 | const u32 input_size = num_vertices << index_shift; | 271 | const u32 input_size = num_vertices << index_shift; |
| @@ -328,31 +328,32 @@ void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map, | |||
| 328 | const VkImageAspectFlags aspect_mask = image.AspectMask(); | 328 | const VkImageAspectFlags aspect_mask = image.AspectMask(); |
| 329 | const VkImage vk_image = image.Handle(); | 329 | const VkImage vk_image = image.Handle(); |
| 330 | const bool is_initialized = image.ExchangeInitialization(); | 330 | const bool is_initialized = image.ExchangeInitialization(); |
| 331 | scheduler.Record( | 331 | scheduler.Record([vk_pipeline, vk_image, aspect_mask, |
| 332 | [vk_pipeline, vk_image, aspect_mask, is_initialized](vk::CommandBuffer cmdbuf) { | 332 | is_initialized](vk::CommandBuffer cmdbuf) { |
| 333 | const VkImageMemoryBarrier image_barrier{ | 333 | const VkImageMemoryBarrier image_barrier{ |
| 334 | .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, | 334 | .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, |
| 335 | .pNext = nullptr, | 335 | .pNext = nullptr, |
| 336 | .srcAccessMask = is_initialized ? VK_ACCESS_SHADER_WRITE_BIT : VkAccessFlags{}, | 336 | .srcAccessMask = static_cast<VkAccessFlags>(is_initialized ? VK_ACCESS_SHADER_WRITE_BIT |
| 337 | .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, | 337 | : VK_ACCESS_NONE), |
| 338 | .oldLayout = is_initialized ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_UNDEFINED, | 338 | .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, |
| 339 | .newLayout = VK_IMAGE_LAYOUT_GENERAL, | 339 | .oldLayout = is_initialized ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_UNDEFINED, |
| 340 | .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, | 340 | .newLayout = VK_IMAGE_LAYOUT_GENERAL, |
| 341 | .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, | 341 | .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, |
| 342 | .image = vk_image, | 342 | .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, |
| 343 | .subresourceRange{ | 343 | .image = vk_image, |
| 344 | .aspectMask = aspect_mask, | 344 | .subresourceRange{ |
| 345 | .baseMipLevel = 0, | 345 | .aspectMask = aspect_mask, |
| 346 | .levelCount = VK_REMAINING_MIP_LEVELS, | 346 | .baseMipLevel = 0, |
| 347 | .baseArrayLayer = 0, | 347 | .levelCount = VK_REMAINING_MIP_LEVELS, |
| 348 | .layerCount = VK_REMAINING_ARRAY_LAYERS, | 348 | .baseArrayLayer = 0, |
| 349 | }, | 349 | .layerCount = VK_REMAINING_ARRAY_LAYERS, |
| 350 | }; | 350 | }, |
| 351 | cmdbuf.PipelineBarrier(is_initialized ? VK_PIPELINE_STAGE_ALL_COMMANDS_BIT | 351 | }; |
| 352 | : VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, | 352 | cmdbuf.PipelineBarrier(is_initialized ? VK_PIPELINE_STAGE_ALL_COMMANDS_BIT |
| 353 | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, image_barrier); | 353 | : VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, |
| 354 | cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, vk_pipeline); | 354 | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, image_barrier); |
| 355 | }); | 355 | cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, vk_pipeline); |
| 356 | }); | ||
| 356 | for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { | 357 | for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { |
| 357 | const size_t input_offset = swizzle.buffer_offset + map.offset; | 358 | const size_t input_offset = swizzle.buffer_offset + map.offset; |
| 358 | const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 8U); | 359 | const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 8U); |
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 5196bdcf2..978e827f5 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -174,7 +174,7 @@ Shader::RuntimeInfo MakeRuntimeInfo(std::span<const Shader::IR::Program> program | |||
| 174 | case Maxwell::TessellationPrimitive::Quads: | 174 | case Maxwell::TessellationPrimitive::Quads: |
| 175 | return Shader::TessPrimitive::Quads; | 175 | return Shader::TessPrimitive::Quads; |
| 176 | } | 176 | } |
| 177 | UNREACHABLE(); | 177 | ASSERT(false); |
| 178 | return Shader::TessPrimitive::Triangles; | 178 | return Shader::TessPrimitive::Triangles; |
| 179 | }(); | 179 | }(); |
| 180 | info.tess_spacing = [&] { | 180 | info.tess_spacing = [&] { |
| @@ -187,7 +187,7 @@ Shader::RuntimeInfo MakeRuntimeInfo(std::span<const Shader::IR::Program> program | |||
| 187 | case Maxwell::TessellationSpacing::FractionalEven: | 187 | case Maxwell::TessellationSpacing::FractionalEven: |
| 188 | return Shader::TessSpacing::FractionalEven; | 188 | return Shader::TessSpacing::FractionalEven; |
| 189 | } | 189 | } |
| 190 | UNREACHABLE(); | 190 | ASSERT(false); |
| 191 | return Shader::TessSpacing::Equal; | 191 | return Shader::TessSpacing::Equal; |
| 192 | }(); | 192 | }(); |
| 193 | break; | 193 | break; |
diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp index 31ce2f815..9a6afaca6 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp | |||
| @@ -263,7 +263,7 @@ StagingBufferPool::StagingBuffersCache& StagingBufferPool::GetCache(MemoryUsage | |||
| 263 | case MemoryUsage::Download: | 263 | case MemoryUsage::Download: |
| 264 | return download_cache; | 264 | return download_cache; |
| 265 | default: | 265 | default: |
| 266 | UNREACHABLE_MSG("Invalid memory usage={}", usage); | 266 | ASSERT_MSG(false, "Invalid memory usage={}", usage); |
| 267 | return upload_cache; | 267 | return upload_cache; |
| 268 | } | 268 | } |
| 269 | } | 269 | } |
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 353594293..43ecb9647 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp | |||
| @@ -70,7 +70,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) { | |||
| 70 | case ImageType::Buffer: | 70 | case ImageType::Buffer: |
| 71 | break; | 71 | break; |
| 72 | } | 72 | } |
| 73 | UNREACHABLE_MSG("Invalid image type={}", type); | 73 | ASSERT_MSG(false, "Invalid image type={}", type); |
| 74 | return {}; | 74 | return {}; |
| 75 | } | 75 | } |
| 76 | 76 | ||
| @@ -87,7 +87,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) { | |||
| 87 | case 16: | 87 | case 16: |
| 88 | return VK_SAMPLE_COUNT_16_BIT; | 88 | return VK_SAMPLE_COUNT_16_BIT; |
| 89 | default: | 89 | default: |
| 90 | UNREACHABLE_MSG("Invalid number of samples={}", num_samples); | 90 | ASSERT_MSG(false, "Invalid number of samples={}", num_samples); |
| 91 | return VK_SAMPLE_COUNT_1_BIT; | 91 | return VK_SAMPLE_COUNT_1_BIT; |
| 92 | } | 92 | } |
| 93 | } | 93 | } |
| @@ -107,7 +107,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) { | |||
| 107 | usage |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT; | 107 | usage |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT; |
| 108 | break; | 108 | break; |
| 109 | default: | 109 | default: |
| 110 | UNREACHABLE_MSG("Invalid surface type"); | 110 | ASSERT_MSG(false, "Invalid surface type"); |
| 111 | } | 111 | } |
| 112 | } | 112 | } |
| 113 | if (info.storage) { | 113 | if (info.storage) { |
| @@ -179,7 +179,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) { | |||
| 179 | case VideoCore::Surface::SurfaceType::DepthStencil: | 179 | case VideoCore::Surface::SurfaceType::DepthStencil: |
| 180 | return VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT; | 180 | return VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT; |
| 181 | default: | 181 | default: |
| 182 | UNREACHABLE_MSG("Invalid surface type"); | 182 | ASSERT_MSG(false, "Invalid surface type"); |
| 183 | return VkImageAspectFlags{}; | 183 | return VkImageAspectFlags{}; |
| 184 | } | 184 | } |
| 185 | } | 185 | } |
| @@ -221,7 +221,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) { | |||
| 221 | case SwizzleSource::OneInt: | 221 | case SwizzleSource::OneInt: |
| 222 | return VK_COMPONENT_SWIZZLE_ONE; | 222 | return VK_COMPONENT_SWIZZLE_ONE; |
| 223 | } | 223 | } |
| 224 | UNREACHABLE_MSG("Invalid swizzle={}", swizzle); | 224 | ASSERT_MSG(false, "Invalid swizzle={}", swizzle); |
| 225 | return VK_COMPONENT_SWIZZLE_ZERO; | 225 | return VK_COMPONENT_SWIZZLE_ZERO; |
| 226 | } | 226 | } |
| 227 | 227 | ||
| @@ -242,10 +242,10 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) { | |||
| 242 | case Shader::TextureType::ColorArrayCube: | 242 | case Shader::TextureType::ColorArrayCube: |
| 243 | return VK_IMAGE_VIEW_TYPE_CUBE_ARRAY; | 243 | return VK_IMAGE_VIEW_TYPE_CUBE_ARRAY; |
| 244 | case Shader::TextureType::Buffer: | 244 | case Shader::TextureType::Buffer: |
| 245 | UNREACHABLE_MSG("Texture buffers can't be image views"); | 245 | ASSERT_MSG(false, "Texture buffers can't be image views"); |
| 246 | return VK_IMAGE_VIEW_TYPE_1D; | 246 | return VK_IMAGE_VIEW_TYPE_1D; |
| 247 | } | 247 | } |
| 248 | UNREACHABLE_MSG("Invalid image view type={}", type); | 248 | ASSERT_MSG(false, "Invalid image view type={}", type); |
| 249 | return VK_IMAGE_VIEW_TYPE_2D; | 249 | return VK_IMAGE_VIEW_TYPE_2D; |
| 250 | } | 250 | } |
| 251 | 251 | ||
| @@ -269,10 +269,10 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) { | |||
| 269 | UNIMPLEMENTED_MSG("Rect image view"); | 269 | UNIMPLEMENTED_MSG("Rect image view"); |
| 270 | return VK_IMAGE_VIEW_TYPE_2D; | 270 | return VK_IMAGE_VIEW_TYPE_2D; |
| 271 | case VideoCommon::ImageViewType::Buffer: | 271 | case VideoCommon::ImageViewType::Buffer: |
| 272 | UNREACHABLE_MSG("Texture buffers can't be image views"); | 272 | ASSERT_MSG(false, "Texture buffers can't be image views"); |
| 273 | return VK_IMAGE_VIEW_TYPE_1D; | 273 | return VK_IMAGE_VIEW_TYPE_1D; |
| 274 | } | 274 | } |
| 275 | UNREACHABLE_MSG("Invalid image view type={}", type); | 275 | ASSERT_MSG(false, "Invalid image view type={}", type); |
| 276 | return VK_IMAGE_VIEW_TYPE_2D; | 276 | return VK_IMAGE_VIEW_TYPE_2D; |
| 277 | } | 277 | } |
| 278 | 278 | ||
| @@ -644,7 +644,7 @@ struct RangedBarrierRange { | |||
| 644 | case Shader::ImageFormat::R32G32B32A32_UINT: | 644 | case Shader::ImageFormat::R32G32B32A32_UINT: |
| 645 | return VK_FORMAT_R32G32B32A32_UINT; | 645 | return VK_FORMAT_R32G32B32A32_UINT; |
| 646 | } | 646 | } |
| 647 | UNREACHABLE_MSG("Invalid image format={}", format); | 647 | ASSERT_MSG(false, "Invalid image format={}", format); |
| 648 | return VK_FORMAT_R32_UINT; | 648 | return VK_FORMAT_R32_UINT; |
| 649 | } | 649 | } |
| 650 | 650 | ||
| @@ -1596,7 +1596,7 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI | |||
| 1596 | UNIMPLEMENTED(); | 1596 | UNIMPLEMENTED(); |
| 1597 | break; | 1597 | break; |
| 1598 | case VideoCommon::ImageViewType::Buffer: | 1598 | case VideoCommon::ImageViewType::Buffer: |
| 1599 | UNREACHABLE(); | 1599 | ASSERT(false); |
| 1600 | break; | 1600 | break; |
| 1601 | } | 1601 | } |
| 1602 | } | 1602 | } |
| @@ -1822,7 +1822,7 @@ void TextureCacheRuntime::AccelerateImageUpload( | |||
| 1822 | if (IsPixelFormatASTC(image.info.format)) { | 1822 | if (IsPixelFormatASTC(image.info.format)) { |
| 1823 | return astc_decoder_pass.Assemble(image, map, swizzles); | 1823 | return astc_decoder_pass.Assemble(image, map, swizzles); |
| 1824 | } | 1824 | } |
| 1825 | UNREACHABLE(); | 1825 | ASSERT(false); |
| 1826 | } | 1826 | } |
| 1827 | 1827 | ||
| 1828 | } // namespace Vulkan | 1828 | } // namespace Vulkan |
diff --git a/src/video_core/shader_environment.cpp b/src/video_core/shader_environment.cpp index d469964f6..c4e923bbf 100644 --- a/src/video_core/shader_environment.cpp +++ b/src/video_core/shader_environment.cpp | |||
| @@ -280,7 +280,7 @@ GraphicsEnvironment::GraphicsEnvironment(Tegra::Engines::Maxwell3D& maxwell3d_, | |||
| 280 | stage_index = 4; | 280 | stage_index = 4; |
| 281 | break; | 281 | break; |
| 282 | default: | 282 | default: |
| 283 | UNREACHABLE_MSG("Invalid program={}", program); | 283 | ASSERT_MSG(false, "Invalid program={}", program); |
| 284 | break; | 284 | break; |
| 285 | } | 285 | } |
| 286 | const u64 local_size{sph.LocalMemorySize()}; | 286 | const u64 local_size{sph.LocalMemorySize()}; |
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index 5f428d35d..69c1b1e6d 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp | |||
| @@ -29,7 +29,7 @@ SurfaceTarget SurfaceTargetFromTextureType(Tegra::Texture::TextureType texture_t | |||
| 29 | return SurfaceTarget::Texture2DArray; | 29 | return SurfaceTarget::Texture2DArray; |
| 30 | default: | 30 | default: |
| 31 | LOG_CRITICAL(HW_GPU, "Unimplemented texture_type={}", texture_type); | 31 | LOG_CRITICAL(HW_GPU, "Unimplemented texture_type={}", texture_type); |
| 32 | UNREACHABLE(); | 32 | ASSERT(false); |
| 33 | return SurfaceTarget::Texture2D; | 33 | return SurfaceTarget::Texture2D; |
| 34 | } | 34 | } |
| 35 | } | 35 | } |
| @@ -48,7 +48,7 @@ bool SurfaceTargetIsLayered(SurfaceTarget target) { | |||
| 48 | return true; | 48 | return true; |
| 49 | default: | 49 | default: |
| 50 | LOG_CRITICAL(HW_GPU, "Unimplemented surface_target={}", target); | 50 | LOG_CRITICAL(HW_GPU, "Unimplemented surface_target={}", target); |
| 51 | UNREACHABLE(); | 51 | ASSERT(false); |
| 52 | return false; | 52 | return false; |
| 53 | } | 53 | } |
| 54 | } | 54 | } |
| @@ -67,7 +67,7 @@ bool SurfaceTargetIsArray(SurfaceTarget target) { | |||
| 67 | return true; | 67 | return true; |
| 68 | default: | 68 | default: |
| 69 | LOG_CRITICAL(HW_GPU, "Unimplemented surface_target={}", target); | 69 | LOG_CRITICAL(HW_GPU, "Unimplemented surface_target={}", target); |
| 70 | UNREACHABLE(); | 70 | ASSERT(false); |
| 71 | return false; | 71 | return false; |
| 72 | } | 72 | } |
| 73 | } | 73 | } |
diff --git a/src/video_core/texture_cache/image_info.cpp b/src/video_core/texture_cache/image_info.cpp index 802939f6c..6c073ee57 100644 --- a/src/video_core/texture_cache/image_info.cpp +++ b/src/video_core/texture_cache/image_info.cpp | |||
| @@ -94,7 +94,7 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept { | |||
| 94 | resources.layers = 1; | 94 | resources.layers = 1; |
| 95 | break; | 95 | break; |
| 96 | default: | 96 | default: |
| 97 | UNREACHABLE_MSG("Invalid texture_type={}", static_cast<int>(config.texture_type.Value())); | 97 | ASSERT_MSG(false, "Invalid texture_type={}", static_cast<int>(config.texture_type.Value())); |
| 98 | break; | 98 | break; |
| 99 | } | 99 | } |
| 100 | if (type != ImageType::Linear) { | 100 | if (type != ImageType::Linear) { |
diff --git a/src/video_core/texture_cache/image_view_info.cpp b/src/video_core/texture_cache/image_view_info.cpp index 0cee5e45f..f47885147 100644 --- a/src/video_core/texture_cache/image_view_info.cpp +++ b/src/video_core/texture_cache/image_view_info.cpp | |||
| @@ -71,7 +71,7 @@ ImageViewInfo::ImageViewInfo(const TICEntry& config, s32 base_layer) noexcept | |||
| 71 | range.extent.layers = config.Depth() * 6; | 71 | range.extent.layers = config.Depth() * 6; |
| 72 | break; | 72 | break; |
| 73 | default: | 73 | default: |
| 74 | UNREACHABLE_MSG("Invalid texture_type={}", static_cast<int>(config.texture_type.Value())); | 74 | ASSERT_MSG(false, "Invalid texture_type={}", static_cast<int>(config.texture_type.Value())); |
| 75 | break; | 75 | break; |
| 76 | } | 76 | } |
| 77 | } | 77 | } |
diff --git a/src/video_core/texture_cache/samples_helper.h b/src/video_core/texture_cache/samples_helper.h index 91fec60bd..d552bccf0 100644 --- a/src/video_core/texture_cache/samples_helper.h +++ b/src/video_core/texture_cache/samples_helper.h | |||
| @@ -23,7 +23,7 @@ namespace VideoCommon { | |||
| 23 | case 16: | 23 | case 16: |
| 24 | return {2, 2}; | 24 | return {2, 2}; |
| 25 | } | 25 | } |
| 26 | UNREACHABLE_MSG("Invalid number of samples={}", num_samples); | 26 | ASSERT_MSG(false, "Invalid number of samples={}", num_samples); |
| 27 | return {1, 1}; | 27 | return {1, 1}; |
| 28 | } | 28 | } |
| 29 | 29 | ||
| @@ -47,7 +47,7 @@ namespace VideoCommon { | |||
| 47 | case MsaaMode::Msaa4x4: | 47 | case MsaaMode::Msaa4x4: |
| 48 | return 16; | 48 | return 16; |
| 49 | } | 49 | } |
| 50 | UNREACHABLE_MSG("Invalid MSAA mode={}", static_cast<int>(msaa_mode)); | 50 | ASSERT_MSG(false, "Invalid MSAA mode={}", static_cast<int>(msaa_mode)); |
| 51 | return 1; | 51 | return 1; |
| 52 | } | 52 | } |
| 53 | 53 | ||
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 6622d7818..cf3ca06a6 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -1485,14 +1485,14 @@ void TextureCache<P>::UnregisterImage(ImageId image_id) { | |||
| 1485 | std::unordered_map<u64, std::vector<ImageId>, IdentityHash<u64>>& selected_page_table) { | 1485 | std::unordered_map<u64, std::vector<ImageId>, IdentityHash<u64>>& selected_page_table) { |
| 1486 | const auto page_it = selected_page_table.find(page); | 1486 | const auto page_it = selected_page_table.find(page); |
| 1487 | if (page_it == selected_page_table.end()) { | 1487 | if (page_it == selected_page_table.end()) { |
| 1488 | UNREACHABLE_MSG("Unregistering unregistered page=0x{:x}", page << PAGE_BITS); | 1488 | ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << PAGE_BITS); |
| 1489 | return; | 1489 | return; |
| 1490 | } | 1490 | } |
| 1491 | std::vector<ImageId>& image_ids = page_it->second; | 1491 | std::vector<ImageId>& image_ids = page_it->second; |
| 1492 | const auto vector_it = std::ranges::find(image_ids, image_id); | 1492 | const auto vector_it = std::ranges::find(image_ids, image_id); |
| 1493 | if (vector_it == image_ids.end()) { | 1493 | if (vector_it == image_ids.end()) { |
| 1494 | UNREACHABLE_MSG("Unregistering unregistered image in page=0x{:x}", | 1494 | ASSERT_MSG(false, "Unregistering unregistered image in page=0x{:x}", |
| 1495 | page << PAGE_BITS); | 1495 | page << PAGE_BITS); |
| 1496 | return; | 1496 | return; |
| 1497 | } | 1497 | } |
| 1498 | image_ids.erase(vector_it); | 1498 | image_ids.erase(vector_it); |
| @@ -1504,14 +1504,14 @@ void TextureCache<P>::UnregisterImage(ImageId image_id) { | |||
| 1504 | ForEachCPUPage(image.cpu_addr, image.guest_size_bytes, [this, map_id](u64 page) { | 1504 | ForEachCPUPage(image.cpu_addr, image.guest_size_bytes, [this, map_id](u64 page) { |
| 1505 | const auto page_it = page_table.find(page); | 1505 | const auto page_it = page_table.find(page); |
| 1506 | if (page_it == page_table.end()) { | 1506 | if (page_it == page_table.end()) { |
| 1507 | UNREACHABLE_MSG("Unregistering unregistered page=0x{:x}", page << PAGE_BITS); | 1507 | ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << PAGE_BITS); |
| 1508 | return; | 1508 | return; |
| 1509 | } | 1509 | } |
| 1510 | std::vector<ImageMapId>& image_map_ids = page_it->second; | 1510 | std::vector<ImageMapId>& image_map_ids = page_it->second; |
| 1511 | const auto vector_it = std::ranges::find(image_map_ids, map_id); | 1511 | const auto vector_it = std::ranges::find(image_map_ids, map_id); |
| 1512 | if (vector_it == image_map_ids.end()) { | 1512 | if (vector_it == image_map_ids.end()) { |
| 1513 | UNREACHABLE_MSG("Unregistering unregistered image in page=0x{:x}", | 1513 | ASSERT_MSG(false, "Unregistering unregistered image in page=0x{:x}", |
| 1514 | page << PAGE_BITS); | 1514 | page << PAGE_BITS); |
| 1515 | return; | 1515 | return; |
| 1516 | } | 1516 | } |
| 1517 | image_map_ids.erase(vector_it); | 1517 | image_map_ids.erase(vector_it); |
| @@ -1532,7 +1532,7 @@ void TextureCache<P>::UnregisterImage(ImageId image_id) { | |||
| 1532 | ForEachCPUPage(cpu_addr, size, [this, image_id](u64 page) { | 1532 | ForEachCPUPage(cpu_addr, size, [this, image_id](u64 page) { |
| 1533 | const auto page_it = page_table.find(page); | 1533 | const auto page_it = page_table.find(page); |
| 1534 | if (page_it == page_table.end()) { | 1534 | if (page_it == page_table.end()) { |
| 1535 | UNREACHABLE_MSG("Unregistering unregistered page=0x{:x}", page << PAGE_BITS); | 1535 | ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << PAGE_BITS); |
| 1536 | return; | 1536 | return; |
| 1537 | } | 1537 | } |
| 1538 | std::vector<ImageMapId>& image_map_ids = page_it->second; | 1538 | std::vector<ImageMapId>& image_map_ids = page_it->second; |
| @@ -1616,15 +1616,15 @@ void TextureCache<P>::DeleteImage(ImageId image_id, bool immediate_delete) { | |||
| 1616 | const GPUVAddr gpu_addr = image.gpu_addr; | 1616 | const GPUVAddr gpu_addr = image.gpu_addr; |
| 1617 | const auto alloc_it = image_allocs_table.find(gpu_addr); | 1617 | const auto alloc_it = image_allocs_table.find(gpu_addr); |
| 1618 | if (alloc_it == image_allocs_table.end()) { | 1618 | if (alloc_it == image_allocs_table.end()) { |
| 1619 | UNREACHABLE_MSG("Trying to delete an image alloc that does not exist in address 0x{:x}", | 1619 | ASSERT_MSG(false, "Trying to delete an image alloc that does not exist in address 0x{:x}", |
| 1620 | gpu_addr); | 1620 | gpu_addr); |
| 1621 | return; | 1621 | return; |
| 1622 | } | 1622 | } |
| 1623 | const ImageAllocId alloc_id = alloc_it->second; | 1623 | const ImageAllocId alloc_id = alloc_it->second; |
| 1624 | std::vector<ImageId>& alloc_images = slot_image_allocs[alloc_id].images; | 1624 | std::vector<ImageId>& alloc_images = slot_image_allocs[alloc_id].images; |
| 1625 | const auto alloc_image_it = std::ranges::find(alloc_images, image_id); | 1625 | const auto alloc_image_it = std::ranges::find(alloc_images, image_id); |
| 1626 | if (alloc_image_it == alloc_images.end()) { | 1626 | if (alloc_image_it == alloc_images.end()) { |
| 1627 | UNREACHABLE_MSG("Trying to delete an image that does not exist"); | 1627 | ASSERT_MSG(false, "Trying to delete an image that does not exist"); |
| 1628 | return; | 1628 | return; |
| 1629 | } | 1629 | } |
| 1630 | ASSERT_MSG(False(image.flags & ImageFlagBits::Tracked), "Image was not untracked"); | 1630 | ASSERT_MSG(False(image.flags & ImageFlagBits::Tracked), "Image was not untracked"); |
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index c81343850..9b6b8527b 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp | |||
| @@ -87,7 +87,7 @@ void Swizzle(std::span<u8> output, std::span<const u8> input, u32 bytes_per_pixe | |||
| 87 | BPP_CASE(16) | 87 | BPP_CASE(16) |
| 88 | #undef BPP_CASE | 88 | #undef BPP_CASE |
| 89 | default: | 89 | default: |
| 90 | UNREACHABLE_MSG("Invalid bytes_per_pixel={}", bytes_per_pixel); | 90 | ASSERT_MSG(false, "Invalid bytes_per_pixel={}", bytes_per_pixel); |
| 91 | } | 91 | } |
| 92 | } | 92 | } |
| 93 | 93 | ||
| @@ -209,7 +209,7 @@ void SwizzleSubrect(u32 subrect_width, u32 subrect_height, u32 source_pitch, u32 | |||
| 209 | BPP_CASE(16) | 209 | BPP_CASE(16) |
| 210 | #undef BPP_CASE | 210 | #undef BPP_CASE |
| 211 | default: | 211 | default: |
| 212 | UNREACHABLE_MSG("Invalid bytes_per_pixel={}", bytes_per_pixel); | 212 | ASSERT_MSG(false, "Invalid bytes_per_pixel={}", bytes_per_pixel); |
| 213 | } | 213 | } |
| 214 | } | 214 | } |
| 215 | 215 | ||
| @@ -230,7 +230,7 @@ void UnswizzleSubrect(u32 line_length_in, u32 line_count, u32 pitch, u32 width, | |||
| 230 | BPP_CASE(16) | 230 | BPP_CASE(16) |
| 231 | #undef BPP_CASE | 231 | #undef BPP_CASE |
| 232 | default: | 232 | default: |
| 233 | UNREACHABLE_MSG("Invalid bytes_per_pixel={}", bytes_per_pixel); | 233 | ASSERT_MSG(false, "Invalid bytes_per_pixel={}", bytes_per_pixel); |
| 234 | } | 234 | } |
| 235 | } | 235 | } |
| 236 | 236 | ||
| @@ -253,7 +253,7 @@ void SwizzleSliceToVoxel(u32 line_length_in, u32 line_count, u32 pitch, u32 widt | |||
| 253 | BPP_CASE(16) | 253 | BPP_CASE(16) |
| 254 | #undef BPP_CASE | 254 | #undef BPP_CASE |
| 255 | default: | 255 | default: |
| 256 | UNREACHABLE_MSG("Invalid bytes_per_pixel={}", bytes_per_pixel); | 256 | ASSERT_MSG(false, "Invalid bytes_per_pixel={}", bytes_per_pixel); |
| 257 | } | 257 | } |
| 258 | } | 258 | } |
| 259 | 259 | ||
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index b3a77e07f..11ce865a7 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp | |||
| @@ -738,9 +738,10 @@ VkFormat Device::GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags | |||
| 738 | // The wanted format is not supported by hardware, search for alternatives | 738 | // The wanted format is not supported by hardware, search for alternatives |
| 739 | const VkFormat* alternatives = GetFormatAlternatives(wanted_format); | 739 | const VkFormat* alternatives = GetFormatAlternatives(wanted_format); |
| 740 | if (alternatives == nullptr) { | 740 | if (alternatives == nullptr) { |
| 741 | UNREACHABLE_MSG("Format={} with usage={} and type={} has no defined alternatives and host " | 741 | ASSERT_MSG(false, |
| 742 | "hardware does not support it", | 742 | "Format={} with usage={} and type={} has no defined alternatives and host " |
| 743 | wanted_format, wanted_usage, format_type); | 743 | "hardware does not support it", |
| 744 | wanted_format, wanted_usage, format_type); | ||
| 744 | return wanted_format; | 745 | return wanted_format; |
| 745 | } | 746 | } |
| 746 | 747 | ||
| @@ -756,9 +757,10 @@ VkFormat Device::GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags | |||
| 756 | } | 757 | } |
| 757 | 758 | ||
| 758 | // No alternatives found, panic | 759 | // No alternatives found, panic |
| 759 | UNREACHABLE_MSG("Format={} with usage={} and type={} is not supported by the host hardware and " | 760 | ASSERT_MSG(false, |
| 760 | "doesn't support any of the alternatives", | 761 | "Format={} with usage={} and type={} is not supported by the host hardware and " |
| 761 | wanted_format, wanted_usage, format_type); | 762 | "doesn't support any of the alternatives", |
| 763 | wanted_format, wanted_usage, format_type); | ||
| 762 | return wanted_format; | 764 | return wanted_format; |
| 763 | } | 765 | } |
| 764 | 766 | ||
diff --git a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp index caae6dfdc..6442898bd 100644 --- a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp +++ b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp | |||
| @@ -49,7 +49,7 @@ struct Range { | |||
| 49 | return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | | 49 | return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | |
| 50 | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; | 50 | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; |
| 51 | } | 51 | } |
| 52 | UNREACHABLE_MSG("Invalid memory usage={}", usage); | 52 | ASSERT_MSG(false, "Invalid memory usage={}", usage); |
| 53 | return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; | 53 | return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| @@ -325,7 +325,7 @@ VkMemoryPropertyFlags MemoryAllocator::MemoryPropertyFlags(u32 type_mask, | |||
| 325 | // Remove device local, if it's not supported by the requested resource | 325 | // Remove device local, if it's not supported by the requested resource |
| 326 | return MemoryPropertyFlags(type_mask, flags & ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); | 326 | return MemoryPropertyFlags(type_mask, flags & ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); |
| 327 | } | 327 | } |
| 328 | UNREACHABLE_MSG("No compatible memory types found"); | 328 | ASSERT_MSG(false, "No compatible memory types found"); |
| 329 | return 0; | 329 | return 0; |
| 330 | } | 330 | } |
| 331 | 331 | ||
| @@ -349,7 +349,7 @@ bool IsHostVisible(MemoryUsage usage) noexcept { | |||
| 349 | case MemoryUsage::Download: | 349 | case MemoryUsage::Download: |
| 350 | return true; | 350 | return true; |
| 351 | } | 351 | } |
| 352 | UNREACHABLE_MSG("Invalid memory usage={}", usage); | 352 | ASSERT_MSG(false, "Invalid memory usage={}", usage); |
| 353 | return false; | 353 | return false; |
| 354 | } | 354 | } |
| 355 | 355 | ||
diff --git a/src/web_service/telemetry_json.cpp b/src/web_service/telemetry_json.cpp index 6215c914f..46faddb61 100644 --- a/src/web_service/telemetry_json.cpp +++ b/src/web_service/telemetry_json.cpp | |||
| @@ -13,8 +13,8 @@ namespace WebService { | |||
| 13 | namespace Telemetry = Common::Telemetry; | 13 | namespace Telemetry = Common::Telemetry; |
| 14 | 14 | ||
| 15 | struct TelemetryJson::Impl { | 15 | struct TelemetryJson::Impl { |
| 16 | Impl(std::string host, std::string username, std::string token) | 16 | Impl(std::string host_, std::string username_, std::string token_) |
| 17 | : host{std::move(host)}, username{std::move(username)}, token{std::move(token)} {} | 17 | : host{std::move(host_)}, username{std::move(username_)}, token{std::move(token_)} {} |
| 18 | 18 | ||
| 19 | nlohmann::json& TopSection() { | 19 | nlohmann::json& TopSection() { |
| 20 | return sections[static_cast<u8>(Telemetry::FieldType::None)]; | 20 | return sections[static_cast<u8>(Telemetry::FieldType::None)]; |
diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index 58b0c2f10..dce9772fe 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp | |||
| @@ -30,10 +30,10 @@ constexpr std::array<const char, 1> API_VERSION{'1'}; | |||
| 30 | constexpr std::size_t TIMEOUT_SECONDS = 30; | 30 | constexpr std::size_t TIMEOUT_SECONDS = 30; |
| 31 | 31 | ||
| 32 | struct Client::Impl { | 32 | struct Client::Impl { |
| 33 | Impl(std::string host, std::string username, std::string token) | 33 | Impl(std::string host_, std::string username_, std::string token_) |
| 34 | : host{std::move(host)}, username{std::move(username)}, token{std::move(token)} { | 34 | : host{std::move(host_)}, username{std::move(username_)}, token{std::move(token_)} { |
| 35 | std::scoped_lock lock{jwt_cache.mutex}; | 35 | std::scoped_lock lock{jwt_cache.mutex}; |
| 36 | if (this->username == jwt_cache.username && this->token == jwt_cache.token) { | 36 | if (username == jwt_cache.username && token == jwt_cache.token) { |
| 37 | jwt = jwt_cache.jwt; | 37 | jwt = jwt_cache.jwt; |
| 38 | } | 38 | } |
| 39 | } | 39 | } |
| @@ -69,8 +69,8 @@ struct Client::Impl { | |||
| 69 | */ | 69 | */ |
| 70 | WebResult GenericRequest(const std::string& method, const std::string& path, | 70 | WebResult GenericRequest(const std::string& method, const std::string& path, |
| 71 | const std::string& data, const std::string& accept, | 71 | const std::string& data, const std::string& accept, |
| 72 | const std::string& jwt = "", const std::string& username = "", | 72 | const std::string& jwt_ = "", const std::string& username_ = "", |
| 73 | const std::string& token = "") { | 73 | const std::string& token_ = "") { |
| 74 | if (cli == nullptr) { | 74 | if (cli == nullptr) { |
| 75 | cli = std::make_unique<httplib::Client>(host.c_str()); | 75 | cli = std::make_unique<httplib::Client>(host.c_str()); |
| 76 | } | 76 | } |
| @@ -85,14 +85,14 @@ struct Client::Impl { | |||
| 85 | cli->set_write_timeout(TIMEOUT_SECONDS); | 85 | cli->set_write_timeout(TIMEOUT_SECONDS); |
| 86 | 86 | ||
| 87 | httplib::Headers params; | 87 | httplib::Headers params; |
| 88 | if (!jwt.empty()) { | 88 | if (!jwt_.empty()) { |
| 89 | params = { | 89 | params = { |
| 90 | {std::string("Authorization"), fmt::format("Bearer {}", jwt)}, | 90 | {std::string("Authorization"), fmt::format("Bearer {}", jwt_)}, |
| 91 | }; | 91 | }; |
| 92 | } else if (!username.empty()) { | 92 | } else if (!username_.empty()) { |
| 93 | params = { | 93 | params = { |
| 94 | {std::string("x-username"), username}, | 94 | {std::string("x-username"), username_}, |
| 95 | {std::string("x-token"), token}, | 95 | {std::string("x-token"), token_}, |
| 96 | }; | 96 | }; |
| 97 | } | 97 | } |
| 98 | 98 | ||
diff --git a/src/yuzu/applets/qt_controller.cpp b/src/yuzu/applets/qt_controller.cpp index c924cb0cb..8be311fcb 100644 --- a/src/yuzu/applets/qt_controller.cpp +++ b/src/yuzu/applets/qt_controller.cpp | |||
| @@ -631,7 +631,7 @@ void QtControllerSelectorDialog::DisableUnsupportedPlayers() { | |||
| 631 | switch (max_supported_players) { | 631 | switch (max_supported_players) { |
| 632 | case 0: | 632 | case 0: |
| 633 | default: | 633 | default: |
| 634 | UNREACHABLE(); | 634 | ASSERT(false); |
| 635 | return; | 635 | return; |
| 636 | case 1: | 636 | case 1: |
| 637 | ui->widgetSpacer->hide(); | 637 | ui->widgetSpacer->hide(); |
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index bde465485..cbe4e2daa 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp | |||
| @@ -127,7 +127,7 @@ void EmuThread::run() { | |||
| 127 | class OpenGLSharedContext : public Core::Frontend::GraphicsContext { | 127 | class OpenGLSharedContext : public Core::Frontend::GraphicsContext { |
| 128 | public: | 128 | public: |
| 129 | /// Create the original context that should be shared from | 129 | /// Create the original context that should be shared from |
| 130 | explicit OpenGLSharedContext(QSurface* surface) : surface(surface) { | 130 | explicit OpenGLSharedContext(QSurface* surface_) : surface{surface_} { |
| 131 | QSurfaceFormat format; | 131 | QSurfaceFormat format; |
| 132 | format.setVersion(4, 6); | 132 | format.setVersion(4, 6); |
| 133 | format.setProfile(QSurfaceFormat::CompatibilityProfile); | 133 | format.setProfile(QSurfaceFormat::CompatibilityProfile); |
| @@ -364,9 +364,9 @@ void GRenderWindow::RestoreGeometry() { | |||
| 364 | QWidget::restoreGeometry(geometry); | 364 | QWidget::restoreGeometry(geometry); |
| 365 | } | 365 | } |
| 366 | 366 | ||
| 367 | void GRenderWindow::restoreGeometry(const QByteArray& geometry) { | 367 | void GRenderWindow::restoreGeometry(const QByteArray& geometry_) { |
| 368 | // Make sure users of this class don't need to deal with backing up the geometry themselves | 368 | // Make sure users of this class don't need to deal with backing up the geometry themselves |
| 369 | QWidget::restoreGeometry(geometry); | 369 | QWidget::restoreGeometry(geometry_); |
| 370 | BackupGeometry(); | 370 | BackupGeometry(); |
| 371 | } | 371 | } |
| 372 | 372 | ||
| @@ -1014,8 +1014,8 @@ QStringList GRenderWindow::GetUnsupportedGLExtensions() const { | |||
| 1014 | return unsupported_ext; | 1014 | return unsupported_ext; |
| 1015 | } | 1015 | } |
| 1016 | 1016 | ||
| 1017 | void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread) { | 1017 | void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread_) { |
| 1018 | this->emu_thread = emu_thread; | 1018 | emu_thread = emu_thread_; |
| 1019 | } | 1019 | } |
| 1020 | 1020 | ||
| 1021 | void GRenderWindow::OnEmulationStopping() { | 1021 | void GRenderWindow::OnEmulationStopping() { |
diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h index d01538039..81fe52c0e 100644 --- a/src/yuzu/bootmanager.h +++ b/src/yuzu/bootmanager.h | |||
| @@ -56,12 +56,12 @@ public: | |||
| 56 | 56 | ||
| 57 | /** | 57 | /** |
| 58 | * Sets whether the emulation thread is running or not | 58 | * Sets whether the emulation thread is running or not |
| 59 | * @param running Boolean value, set the emulation thread to running if true | 59 | * @param running_ Boolean value, set the emulation thread to running if true |
| 60 | * @note This function is thread-safe | 60 | * @note This function is thread-safe |
| 61 | */ | 61 | */ |
| 62 | void SetRunning(bool running) { | 62 | void SetRunning(bool running_) { |
| 63 | std::unique_lock lock{running_mutex}; | 63 | std::unique_lock lock{running_mutex}; |
| 64 | this->running = running; | 64 | running = running_; |
| 65 | lock.unlock(); | 65 | lock.unlock(); |
| 66 | running_cv.notify_all(); | 66 | running_cv.notify_all(); |
| 67 | if (!running) { | 67 | if (!running) { |
| @@ -138,8 +138,8 @@ public: | |||
| 138 | 138 | ||
| 139 | void BackupGeometry(); | 139 | void BackupGeometry(); |
| 140 | void RestoreGeometry(); | 140 | void RestoreGeometry(); |
| 141 | void restoreGeometry(const QByteArray& geometry); // overridden | 141 | void restoreGeometry(const QByteArray& geometry_); // overridden |
| 142 | QByteArray saveGeometry(); // overridden | 142 | QByteArray saveGeometry(); // overridden |
| 143 | 143 | ||
| 144 | qreal windowPixelRatio() const; | 144 | qreal windowPixelRatio() const; |
| 145 | 145 | ||
| @@ -189,7 +189,7 @@ public: | |||
| 189 | void Exit(); | 189 | void Exit(); |
| 190 | 190 | ||
| 191 | public slots: | 191 | public slots: |
| 192 | void OnEmulationStarting(EmuThread* emu_thread); | 192 | void OnEmulationStarting(EmuThread* emu_thread_); |
| 193 | void OnEmulationStopping(); | 193 | void OnEmulationStopping(); |
| 194 | void OnFramebufferSizeChanged(); | 194 | void OnFramebufferSizeChanged(); |
| 195 | 195 | ||
diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp index b415a1cc4..e99657bd6 100644 --- a/src/yuzu/configuration/configure_dialog.cpp +++ b/src/yuzu/configuration/configure_dialog.cpp | |||
| @@ -27,12 +27,11 @@ | |||
| 27 | #include "yuzu/hotkeys.h" | 27 | #include "yuzu/hotkeys.h" |
| 28 | #include "yuzu/uisettings.h" | 28 | #include "yuzu/uisettings.h" |
| 29 | 29 | ||
| 30 | ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry, | 30 | ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_, |
| 31 | InputCommon::InputSubsystem* input_subsystem, | 31 | InputCommon::InputSubsystem* input_subsystem, |
| 32 | Core::System& system_) | 32 | Core::System& system_) |
| 33 | : QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()}, | 33 | : QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()}, registry{registry_}, |
| 34 | registry(registry), system{system_}, audio_tab{std::make_unique<ConfigureAudio>(system_, | 34 | system{system_}, audio_tab{std::make_unique<ConfigureAudio>(system_, this)}, |
| 35 | this)}, | ||
| 36 | cpu_tab{std::make_unique<ConfigureCpu>(system_, this)}, | 35 | cpu_tab{std::make_unique<ConfigureCpu>(system_, this)}, |
| 37 | debug_tab_tab{std::make_unique<ConfigureDebugTab>(system_, this)}, | 36 | debug_tab_tab{std::make_unique<ConfigureDebugTab>(system_, this)}, |
| 38 | filesystem_tab{std::make_unique<ConfigureFilesystem>(this)}, | 37 | filesystem_tab{std::make_unique<ConfigureFilesystem>(this)}, |
diff --git a/src/yuzu/configuration/configure_dialog.h b/src/yuzu/configuration/configure_dialog.h index 32ddfd4e0..12cf25daf 100644 --- a/src/yuzu/configuration/configure_dialog.h +++ b/src/yuzu/configuration/configure_dialog.h | |||
| @@ -40,7 +40,7 @@ class ConfigureDialog : public QDialog { | |||
| 40 | Q_OBJECT | 40 | Q_OBJECT |
| 41 | 41 | ||
| 42 | public: | 42 | public: |
| 43 | explicit ConfigureDialog(QWidget* parent, HotkeyRegistry& registry, | 43 | explicit ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_, |
| 44 | InputCommon::InputSubsystem* input_subsystem, Core::System& system_); | 44 | InputCommon::InputSubsystem* input_subsystem, Core::System& system_); |
| 45 | ~ConfigureDialog() override; | 45 | ~ConfigureDialog() override; |
| 46 | 46 | ||
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index 1c05dd0f3..f3be9a374 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp | |||
| @@ -264,15 +264,16 @@ QString ConfigureInputPlayer::AnalogToText(const Common::ParamPackage& param, | |||
| 264 | return QObject::tr("[unknown]"); | 264 | return QObject::tr("[unknown]"); |
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_index, | 267 | ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_index_, |
| 268 | QWidget* bottom_row, | 268 | QWidget* bottom_row_, |
| 269 | InputCommon::InputSubsystem* input_subsystem_, | 269 | InputCommon::InputSubsystem* input_subsystem_, |
| 270 | InputProfiles* profiles_, Core::HID::HIDCore& hid_core_, | 270 | InputProfiles* profiles_, Core::HID::HIDCore& hid_core_, |
| 271 | bool is_powered_on_, bool debug) | 271 | bool is_powered_on_, bool debug_) |
| 272 | : QWidget(parent), ui(std::make_unique<Ui::ConfigureInputPlayer>()), player_index(player_index), | 272 | : QWidget(parent), |
| 273 | debug(debug), is_powered_on{is_powered_on_}, input_subsystem{input_subsystem_}, | 273 | ui(std::make_unique<Ui::ConfigureInputPlayer>()), player_index{player_index_}, debug{debug_}, |
| 274 | profiles(profiles_), timeout_timer(std::make_unique<QTimer>()), | 274 | is_powered_on{is_powered_on_}, input_subsystem{input_subsystem_}, profiles(profiles_), |
| 275 | poll_timer(std::make_unique<QTimer>()), bottom_row(bottom_row), hid_core{hid_core_} { | 275 | timeout_timer(std::make_unique<QTimer>()), |
| 276 | poll_timer(std::make_unique<QTimer>()), bottom_row{bottom_row_}, hid_core{hid_core_} { | ||
| 276 | if (player_index == 0) { | 277 | if (player_index == 0) { |
| 277 | auto* emulated_controller_p1 = | 278 | auto* emulated_controller_p1 = |
| 278 | hid_core.GetEmulatedController(Core::HID::NpadIdType::Player1); | 279 | hid_core.GetEmulatedController(Core::HID::NpadIdType::Player1); |
| @@ -696,39 +697,38 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i | |||
| 696 | UpdateControllerEnabledButtons(); | 697 | UpdateControllerEnabledButtons(); |
| 697 | UpdateControllerButtonNames(); | 698 | UpdateControllerButtonNames(); |
| 698 | UpdateMotionButtons(); | 699 | UpdateMotionButtons(); |
| 699 | connect(ui->comboControllerType, qOverload<int>(&QComboBox::currentIndexChanged), | 700 | connect(ui->comboControllerType, qOverload<int>(&QComboBox::currentIndexChanged), [this](int) { |
| 700 | [this, player_index](int) { | 701 | UpdateControllerAvailableButtons(); |
| 701 | UpdateControllerAvailableButtons(); | 702 | UpdateControllerEnabledButtons(); |
| 702 | UpdateControllerEnabledButtons(); | 703 | UpdateControllerButtonNames(); |
| 703 | UpdateControllerButtonNames(); | 704 | UpdateMotionButtons(); |
| 704 | UpdateMotionButtons(); | 705 | const Core::HID::NpadStyleIndex type = |
| 705 | const Core::HID::NpadStyleIndex type = | 706 | GetControllerTypeFromIndex(ui->comboControllerType->currentIndex()); |
| 706 | GetControllerTypeFromIndex(ui->comboControllerType->currentIndex()); | 707 | |
| 707 | 708 | if (player_index == 0) { | |
| 708 | if (player_index == 0) { | 709 | auto* emulated_controller_p1 = |
| 709 | auto* emulated_controller_p1 = | 710 | hid_core.GetEmulatedController(Core::HID::NpadIdType::Player1); |
| 710 | hid_core.GetEmulatedController(Core::HID::NpadIdType::Player1); | 711 | auto* emulated_controller_handheld = |
| 711 | auto* emulated_controller_handheld = | 712 | hid_core.GetEmulatedController(Core::HID::NpadIdType::Handheld); |
| 712 | hid_core.GetEmulatedController(Core::HID::NpadIdType::Handheld); | 713 | bool is_connected = emulated_controller->IsConnected(true); |
| 713 | bool is_connected = emulated_controller->IsConnected(true); | 714 | |
| 714 | 715 | emulated_controller_p1->SetNpadStyleIndex(type); | |
| 715 | emulated_controller_p1->SetNpadStyleIndex(type); | 716 | emulated_controller_handheld->SetNpadStyleIndex(type); |
| 716 | emulated_controller_handheld->SetNpadStyleIndex(type); | 717 | if (is_connected) { |
| 717 | if (is_connected) { | 718 | if (type == Core::HID::NpadStyleIndex::Handheld) { |
| 718 | if (type == Core::HID::NpadStyleIndex::Handheld) { | 719 | emulated_controller_p1->Disconnect(); |
| 719 | emulated_controller_p1->Disconnect(); | 720 | emulated_controller_handheld->Connect(true); |
| 720 | emulated_controller_handheld->Connect(true); | 721 | emulated_controller = emulated_controller_handheld; |
| 721 | emulated_controller = emulated_controller_handheld; | 722 | } else { |
| 722 | } else { | 723 | emulated_controller_handheld->Disconnect(); |
| 723 | emulated_controller_handheld->Disconnect(); | 724 | emulated_controller_p1->Connect(true); |
| 724 | emulated_controller_p1->Connect(true); | 725 | emulated_controller = emulated_controller_p1; |
| 725 | emulated_controller = emulated_controller_p1; | ||
| 726 | } | ||
| 727 | } | ||
| 728 | ui->controllerFrame->SetController(emulated_controller); | ||
| 729 | } | 726 | } |
| 730 | emulated_controller->SetNpadStyleIndex(type); | 727 | } |
| 731 | }); | 728 | ui->controllerFrame->SetController(emulated_controller); |
| 729 | } | ||
| 730 | emulated_controller->SetNpadStyleIndex(type); | ||
| 731 | }); | ||
| 732 | 732 | ||
| 733 | connect(ui->comboDevices, qOverload<int>(&QComboBox::activated), this, | 733 | connect(ui->comboDevices, qOverload<int>(&QComboBox::activated), this, |
| 734 | &ConfigureInputPlayer::UpdateMappingWithDefaults); | 734 | &ConfigureInputPlayer::UpdateMappingWithDefaults); |
diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index 54b3fe150..af8343b2e 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp | |||
| @@ -35,10 +35,10 @@ | |||
| 35 | #include "yuzu/uisettings.h" | 35 | #include "yuzu/uisettings.h" |
| 36 | #include "yuzu/util/util.h" | 36 | #include "yuzu/util/util.h" |
| 37 | 37 | ||
| 38 | ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id, const std::string& file_name, | 38 | ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::string& file_name, |
| 39 | Core::System& system_) | 39 | Core::System& system_) |
| 40 | : QDialog(parent), ui(std::make_unique<Ui::ConfigurePerGame>()), | 40 | : QDialog(parent), |
| 41 | title_id(title_id), system{system_} { | 41 | ui(std::make_unique<Ui::ConfigurePerGame>()), title_id{title_id_}, system{system_} { |
| 42 | const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name)); | 42 | const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name)); |
| 43 | const auto config_file_name = title_id == 0 ? Common::FS::PathToUTF8String(file_path.filename()) | 43 | const auto config_file_name = title_id == 0 ? Common::FS::PathToUTF8String(file_path.filename()) |
| 44 | : fmt::format("{:016X}", title_id); | 44 | : fmt::format("{:016X}", title_id); |
| @@ -116,8 +116,8 @@ void ConfigurePerGame::HandleApplyButtonClicked() { | |||
| 116 | ApplyConfiguration(); | 116 | ApplyConfiguration(); |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | void ConfigurePerGame::LoadFromFile(FileSys::VirtualFile file) { | 119 | void ConfigurePerGame::LoadFromFile(FileSys::VirtualFile file_) { |
| 120 | this->file = std::move(file); | 120 | file = std::move(file_); |
| 121 | LoadConfiguration(); | 121 | LoadConfiguration(); |
| 122 | } | 122 | } |
| 123 | 123 | ||
diff --git a/src/yuzu/configuration/configure_per_game.h b/src/yuzu/configuration/configure_per_game.h index e6dc05546..17a98a0f3 100644 --- a/src/yuzu/configuration/configure_per_game.h +++ b/src/yuzu/configuration/configure_per_game.h | |||
| @@ -39,14 +39,14 @@ class ConfigurePerGame : public QDialog { | |||
| 39 | 39 | ||
| 40 | public: | 40 | public: |
| 41 | // Cannot use std::filesystem::path due to https://bugreports.qt.io/browse/QTBUG-73263 | 41 | // Cannot use std::filesystem::path due to https://bugreports.qt.io/browse/QTBUG-73263 |
| 42 | explicit ConfigurePerGame(QWidget* parent, u64 title_id, const std::string& file_name, | 42 | explicit ConfigurePerGame(QWidget* parent, u64 title_id_, const std::string& file_name, |
| 43 | Core::System& system_); | 43 | Core::System& system_); |
| 44 | ~ConfigurePerGame() override; | 44 | ~ConfigurePerGame() override; |
| 45 | 45 | ||
| 46 | /// Save all button configurations to settings file | 46 | /// Save all button configurations to settings file |
| 47 | void ApplyConfiguration(); | 47 | void ApplyConfiguration(); |
| 48 | 48 | ||
| 49 | void LoadFromFile(FileSys::VirtualFile file); | 49 | void LoadFromFile(FileSys::VirtualFile file_); |
| 50 | 50 | ||
| 51 | private: | 51 | private: |
| 52 | void changeEvent(QEvent* event) override; | 52 | void changeEvent(QEvent* event) override; |
diff --git a/src/yuzu/configuration/configure_per_game_addons.cpp b/src/yuzu/configuration/configure_per_game_addons.cpp index 7893a85bb..4906997ab 100644 --- a/src/yuzu/configuration/configure_per_game_addons.cpp +++ b/src/yuzu/configuration/configure_per_game_addons.cpp | |||
| @@ -89,8 +89,8 @@ void ConfigurePerGameAddons::ApplyConfiguration() { | |||
| 89 | Settings::values.disabled_addons[title_id] = disabled_addons; | 89 | Settings::values.disabled_addons[title_id] = disabled_addons; |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | void ConfigurePerGameAddons::LoadFromFile(FileSys::VirtualFile file) { | 92 | void ConfigurePerGameAddons::LoadFromFile(FileSys::VirtualFile file_) { |
| 93 | this->file = std::move(file); | 93 | file = std::move(file_); |
| 94 | LoadConfiguration(); | 94 | LoadConfiguration(); |
| 95 | } | 95 | } |
| 96 | 96 | ||
diff --git a/src/yuzu/configuration/configure_per_game_addons.h b/src/yuzu/configuration/configure_per_game_addons.h index 24b017494..14690fba8 100644 --- a/src/yuzu/configuration/configure_per_game_addons.h +++ b/src/yuzu/configuration/configure_per_game_addons.h | |||
| @@ -35,7 +35,7 @@ public: | |||
| 35 | /// Save all button configurations to settings file | 35 | /// Save all button configurations to settings file |
| 36 | void ApplyConfiguration(); | 36 | void ApplyConfiguration(); |
| 37 | 37 | ||
| 38 | void LoadFromFile(FileSys::VirtualFile file); | 38 | void LoadFromFile(FileSys::VirtualFile file_); |
| 39 | 39 | ||
| 40 | void SetTitleId(u64 id); | 40 | void SetTitleId(u64 id); |
| 41 | 41 | ||
diff --git a/src/yuzu/configuration/configure_ringcon.cpp b/src/yuzu/configuration/configure_ringcon.cpp index 4fcc22b7a..688c2dd38 100644 --- a/src/yuzu/configuration/configure_ringcon.cpp +++ b/src/yuzu/configuration/configure_ringcon.cpp | |||
| @@ -165,10 +165,10 @@ ConfigureRingController::ConfigureRingController(QWidget* parent, | |||
| 165 | const std::string invert_str = invert_value ? "+" : "-"; | 165 | const std::string invert_str = invert_value ? "+" : "-"; |
| 166 | param.Set("invert_x", invert_str); | 166 | param.Set("invert_x", invert_str); |
| 167 | emulated_device->SetRingParam(param); | 167 | emulated_device->SetRingParam(param); |
| 168 | for (int sub_button_id = 0; sub_button_id < ANALOG_SUB_BUTTONS_NUM; | 168 | for (int sub_button_id2 = 0; sub_button_id2 < ANALOG_SUB_BUTTONS_NUM; |
| 169 | ++sub_button_id) { | 169 | ++sub_button_id2) { |
| 170 | analog_map_buttons[sub_button_id]->setText( | 170 | analog_map_buttons[sub_button_id2]->setText( |
| 171 | AnalogToText(param, analog_sub_buttons[sub_button_id])); | 171 | AnalogToText(param, analog_sub_buttons[sub_button_id2])); |
| 172 | } | 172 | } |
| 173 | }); | 173 | }); |
| 174 | context_menu.exec( | 174 | context_menu.exec( |
diff --git a/src/yuzu/configuration/configure_touch_from_button.cpp b/src/yuzu/configuration/configure_touch_from_button.cpp index c17da6fd1..06cc452c3 100644 --- a/src/yuzu/configuration/configure_touch_from_button.cpp +++ b/src/yuzu/configuration/configure_touch_from_button.cpp | |||
| @@ -68,10 +68,10 @@ static QString ButtonToText(const Common::ParamPackage& param) { | |||
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | ConfigureTouchFromButton::ConfigureTouchFromButton( | 70 | ConfigureTouchFromButton::ConfigureTouchFromButton( |
| 71 | QWidget* parent, const std::vector<Settings::TouchFromButtonMap>& touch_maps, | 71 | QWidget* parent, const std::vector<Settings::TouchFromButtonMap>& touch_maps_, |
| 72 | InputCommon::InputSubsystem* input_subsystem_, const int default_index) | 72 | InputCommon::InputSubsystem* input_subsystem_, const int default_index) |
| 73 | : QDialog(parent), ui(std::make_unique<Ui::ConfigureTouchFromButton>()), | 73 | : QDialog(parent), ui(std::make_unique<Ui::ConfigureTouchFromButton>()), |
| 74 | touch_maps(touch_maps), input_subsystem{input_subsystem_}, selected_index(default_index), | 74 | touch_maps{touch_maps_}, input_subsystem{input_subsystem_}, selected_index{default_index}, |
| 75 | timeout_timer(std::make_unique<QTimer>()), poll_timer(std::make_unique<QTimer>()) { | 75 | timeout_timer(std::make_unique<QTimer>()), poll_timer(std::make_unique<QTimer>()) { |
| 76 | ui->setupUi(this); | 76 | ui->setupUi(this); |
| 77 | binding_list_model = new QStandardItemModel(0, 3, this); | 77 | binding_list_model = new QStandardItemModel(0, 3, this); |
diff --git a/src/yuzu/configuration/configure_touch_from_button.h b/src/yuzu/configuration/configure_touch_from_button.h index e1400481a..b8c55db66 100644 --- a/src/yuzu/configuration/configure_touch_from_button.h +++ b/src/yuzu/configuration/configure_touch_from_button.h | |||
| @@ -37,7 +37,7 @@ class ConfigureTouchFromButton : public QDialog { | |||
| 37 | 37 | ||
| 38 | public: | 38 | public: |
| 39 | explicit ConfigureTouchFromButton(QWidget* parent, | 39 | explicit ConfigureTouchFromButton(QWidget* parent, |
| 40 | const std::vector<Settings::TouchFromButtonMap>& touch_maps, | 40 | const std::vector<Settings::TouchFromButtonMap>& touch_maps_, |
| 41 | InputCommon::InputSubsystem* input_subsystem_, | 41 | InputCommon::InputSubsystem* input_subsystem_, |
| 42 | int default_index = 0); | 42 | int default_index = 0); |
| 43 | ~ConfigureTouchFromButton() override; | 43 | ~ConfigureTouchFromButton() override; |
diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp index 8f486a131..0ea31cd33 100644 --- a/src/yuzu/debugger/wait_tree.cpp +++ b/src/yuzu/debugger/wait_tree.cpp | |||
| @@ -113,9 +113,9 @@ QString WaitTreeText::GetText() const { | |||
| 113 | return text; | 113 | return text; |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | WaitTreeMutexInfo::WaitTreeMutexInfo(VAddr mutex_address, const Kernel::KHandleTable& handle_table, | 116 | WaitTreeMutexInfo::WaitTreeMutexInfo(VAddr mutex_address_, const Kernel::KHandleTable& handle_table, |
| 117 | Core::System& system_) | 117 | Core::System& system_) |
| 118 | : mutex_address(mutex_address), system{system_} { | 118 | : mutex_address{mutex_address_}, system{system_} { |
| 119 | mutex_value = system.Memory().Read32(mutex_address); | 119 | mutex_value = system.Memory().Read32(mutex_address); |
| 120 | owner_handle = static_cast<Kernel::Handle>(mutex_value & Kernel::Svc::HandleWaitMask); | 120 | owner_handle = static_cast<Kernel::Handle>(mutex_value & Kernel::Svc::HandleWaitMask); |
| 121 | owner = handle_table.GetObject<Kernel::KThread>(owner_handle).GetPointerUnsafe(); | 121 | owner = handle_table.GetObject<Kernel::KThread>(owner_handle).GetPointerUnsafe(); |
| @@ -140,8 +140,8 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeMutexInfo::GetChildren() cons | |||
| 140 | return list; | 140 | return list; |
| 141 | } | 141 | } |
| 142 | 142 | ||
| 143 | WaitTreeCallstack::WaitTreeCallstack(const Kernel::KThread& thread, Core::System& system_) | 143 | WaitTreeCallstack::WaitTreeCallstack(const Kernel::KThread& thread_, Core::System& system_) |
| 144 | : thread(thread), system{system_} {} | 144 | : thread{thread_}, system{system_} {} |
| 145 | WaitTreeCallstack::~WaitTreeCallstack() = default; | 145 | WaitTreeCallstack::~WaitTreeCallstack() = default; |
| 146 | 146 | ||
| 147 | QString WaitTreeCallstack::GetText() const { | 147 | QString WaitTreeCallstack::GetText() const { |
| @@ -171,8 +171,8 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeCallstack::GetChildren() cons | |||
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | WaitTreeSynchronizationObject::WaitTreeSynchronizationObject( | 173 | WaitTreeSynchronizationObject::WaitTreeSynchronizationObject( |
| 174 | const Kernel::KSynchronizationObject& o, Core::System& system_) | 174 | const Kernel::KSynchronizationObject& object_, Core::System& system_) |
| 175 | : object(o), system{system_} {} | 175 | : object{object_}, system{system_} {} |
| 176 | WaitTreeSynchronizationObject::~WaitTreeSynchronizationObject() = default; | 176 | WaitTreeSynchronizationObject::~WaitTreeSynchronizationObject() = default; |
| 177 | 177 | ||
| 178 | WaitTreeExpandableItem::WaitTreeExpandableItem() = default; | 178 | WaitTreeExpandableItem::WaitTreeExpandableItem() = default; |
| @@ -380,8 +380,8 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const { | |||
| 380 | return list; | 380 | return list; |
| 381 | } | 381 | } |
| 382 | 382 | ||
| 383 | WaitTreeEvent::WaitTreeEvent(const Kernel::KReadableEvent& object, Core::System& system_) | 383 | WaitTreeEvent::WaitTreeEvent(const Kernel::KReadableEvent& object_, Core::System& system_) |
| 384 | : WaitTreeSynchronizationObject(object, system_) {} | 384 | : WaitTreeSynchronizationObject(object_, system_) {} |
| 385 | WaitTreeEvent::~WaitTreeEvent() = default; | 385 | WaitTreeEvent::~WaitTreeEvent() = default; |
| 386 | 386 | ||
| 387 | WaitTreeThreadList::WaitTreeThreadList(std::vector<Kernel::KThread*>&& list, Core::System& system_) | 387 | WaitTreeThreadList::WaitTreeThreadList(std::vector<Kernel::KThread*>&& list, Core::System& system_) |
diff --git a/src/yuzu/debugger/wait_tree.h b/src/yuzu/debugger/wait_tree.h index 4a36dfc48..f21b9f467 100644 --- a/src/yuzu/debugger/wait_tree.h +++ b/src/yuzu/debugger/wait_tree.h | |||
| @@ -78,7 +78,7 @@ public: | |||
| 78 | class WaitTreeMutexInfo : public WaitTreeExpandableItem { | 78 | class WaitTreeMutexInfo : public WaitTreeExpandableItem { |
| 79 | Q_OBJECT | 79 | Q_OBJECT |
| 80 | public: | 80 | public: |
| 81 | explicit WaitTreeMutexInfo(VAddr mutex_address, const Kernel::KHandleTable& handle_table, | 81 | explicit WaitTreeMutexInfo(VAddr mutex_address_, const Kernel::KHandleTable& handle_table, |
| 82 | Core::System& system_); | 82 | Core::System& system_); |
| 83 | ~WaitTreeMutexInfo() override; | 83 | ~WaitTreeMutexInfo() override; |
| 84 | 84 | ||
| @@ -97,7 +97,7 @@ private: | |||
| 97 | class WaitTreeCallstack : public WaitTreeExpandableItem { | 97 | class WaitTreeCallstack : public WaitTreeExpandableItem { |
| 98 | Q_OBJECT | 98 | Q_OBJECT |
| 99 | public: | 99 | public: |
| 100 | explicit WaitTreeCallstack(const Kernel::KThread& thread, Core::System& system_); | 100 | explicit WaitTreeCallstack(const Kernel::KThread& thread_, Core::System& system_); |
| 101 | ~WaitTreeCallstack() override; | 101 | ~WaitTreeCallstack() override; |
| 102 | 102 | ||
| 103 | QString GetText() const override; | 103 | QString GetText() const override; |
| @@ -112,7 +112,7 @@ private: | |||
| 112 | class WaitTreeSynchronizationObject : public WaitTreeExpandableItem { | 112 | class WaitTreeSynchronizationObject : public WaitTreeExpandableItem { |
| 113 | Q_OBJECT | 113 | Q_OBJECT |
| 114 | public: | 114 | public: |
| 115 | explicit WaitTreeSynchronizationObject(const Kernel::KSynchronizationObject& object, | 115 | explicit WaitTreeSynchronizationObject(const Kernel::KSynchronizationObject& object_, |
| 116 | Core::System& system_); | 116 | Core::System& system_); |
| 117 | ~WaitTreeSynchronizationObject() override; | 117 | ~WaitTreeSynchronizationObject() override; |
| 118 | 118 | ||
| @@ -162,7 +162,7 @@ private: | |||
| 162 | class WaitTreeEvent : public WaitTreeSynchronizationObject { | 162 | class WaitTreeEvent : public WaitTreeSynchronizationObject { |
| 163 | Q_OBJECT | 163 | Q_OBJECT |
| 164 | public: | 164 | public: |
| 165 | explicit WaitTreeEvent(const Kernel::KReadableEvent& object, Core::System& system_); | 165 | explicit WaitTreeEvent(const Kernel::KReadableEvent& object_, Core::System& system_); |
| 166 | ~WaitTreeEvent() override; | 166 | ~WaitTreeEvent() override; |
| 167 | }; | 167 | }; |
| 168 | 168 | ||
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 6321afc83..05d309827 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp | |||
| @@ -28,8 +28,8 @@ | |||
| 28 | #include "yuzu/uisettings.h" | 28 | #include "yuzu/uisettings.h" |
| 29 | #include "yuzu/util/controller_navigation.h" | 29 | #include "yuzu/util/controller_navigation.h" |
| 30 | 30 | ||
| 31 | GameListSearchField::KeyReleaseEater::KeyReleaseEater(GameList* gamelist, QObject* parent) | 31 | GameListSearchField::KeyReleaseEater::KeyReleaseEater(GameList* gamelist_, QObject* parent) |
| 32 | : QObject(parent), gamelist{gamelist} {} | 32 | : QObject(parent), gamelist{gamelist_} {} |
| 33 | 33 | ||
| 34 | // EventFilter in order to process systemkeys while editing the searchfield | 34 | // EventFilter in order to process systemkeys while editing the searchfield |
| 35 | bool GameListSearchField::KeyReleaseEater::eventFilter(QObject* obj, QEvent* event) { | 35 | bool GameListSearchField::KeyReleaseEater::eventFilter(QObject* obj, QEvent* event) { |
| @@ -80,9 +80,9 @@ bool GameListSearchField::KeyReleaseEater::eventFilter(QObject* obj, QEvent* eve | |||
| 80 | return QObject::eventFilter(obj, event); | 80 | return QObject::eventFilter(obj, event); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | void GameListSearchField::setFilterResult(int visible, int total) { | 83 | void GameListSearchField::setFilterResult(int visible_, int total_) { |
| 84 | this->visible = visible; | 84 | visible = visible_; |
| 85 | this->total = total; | 85 | total = total_; |
| 86 | 86 | ||
| 87 | label_filter_result->setText(tr("%1 of %n result(s)", "", total).arg(visible)); | 87 | label_filter_result->setText(tr("%1 of %n result(s)", "", total).arg(visible)); |
| 88 | } | 88 | } |
| @@ -309,9 +309,9 @@ void GameList::OnFilterCloseClicked() { | |||
| 309 | main_window->filterBarSetChecked(false); | 309 | main_window->filterBarSetChecked(false); |
| 310 | } | 310 | } |
| 311 | 311 | ||
| 312 | GameList::GameList(FileSys::VirtualFilesystem vfs, FileSys::ManualContentProvider* provider, | 312 | GameList::GameList(FileSys::VirtualFilesystem vfs_, FileSys::ManualContentProvider* provider_, |
| 313 | Core::System& system_, GMainWindow* parent) | 313 | Core::System& system_, GMainWindow* parent) |
| 314 | : QWidget{parent}, vfs(std::move(vfs)), provider(provider), system{system_} { | 314 | : QWidget{parent}, vfs{std::move(vfs_)}, provider{provider_}, system{system_} { |
| 315 | watcher = new QFileSystemWatcher(this); | 315 | watcher = new QFileSystemWatcher(this); |
| 316 | connect(watcher, &QFileSystemWatcher::directoryChanged, this, &GameList::RefreshGameDirectory); | 316 | connect(watcher, &QFileSystemWatcher::directoryChanged, this, &GameList::RefreshGameDirectory); |
| 317 | 317 | ||
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h index 464da98ad..bc36d015a 100644 --- a/src/yuzu/game_list.h +++ b/src/yuzu/game_list.h | |||
| @@ -67,8 +67,8 @@ public: | |||
| 67 | COLUMN_COUNT, // Number of columns | 67 | COLUMN_COUNT, // Number of columns |
| 68 | }; | 68 | }; |
| 69 | 69 | ||
| 70 | explicit GameList(std::shared_ptr<FileSys::VfsFilesystem> vfs, | 70 | explicit GameList(std::shared_ptr<FileSys::VfsFilesystem> vfs_, |
| 71 | FileSys::ManualContentProvider* provider, Core::System& system_, | 71 | FileSys::ManualContentProvider* provider_, Core::System& system_, |
| 72 | GMainWindow* parent = nullptr); | 72 | GMainWindow* parent = nullptr); |
| 73 | ~GameList() override; | 73 | ~GameList() override; |
| 74 | 74 | ||
diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index f2a986ed8..cd7d63536 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h | |||
| @@ -225,8 +225,8 @@ public: | |||
| 225 | static constexpr int GameDirRole = Qt::UserRole + 2; | 225 | static constexpr int GameDirRole = Qt::UserRole + 2; |
| 226 | 226 | ||
| 227 | explicit GameListDir(UISettings::GameDir& directory, | 227 | explicit GameListDir(UISettings::GameDir& directory, |
| 228 | GameListItemType dir_type = GameListItemType::CustomDir) | 228 | GameListItemType dir_type_ = GameListItemType::CustomDir) |
| 229 | : dir_type{dir_type} { | 229 | : dir_type{dir_type_} { |
| 230 | setData(type(), TypeRole); | 230 | setData(type(), TypeRole); |
| 231 | 231 | ||
| 232 | UISettings::GameDir* game_dir = &directory; | 232 | UISettings::GameDir* game_dir = &directory; |
| @@ -348,7 +348,7 @@ public: | |||
| 348 | explicit GameListSearchField(GameList* parent = nullptr); | 348 | explicit GameListSearchField(GameList* parent = nullptr); |
| 349 | 349 | ||
| 350 | QString filterText() const; | 350 | QString filterText() const; |
| 351 | void setFilterResult(int visible, int total); | 351 | void setFilterResult(int visible_, int total_); |
| 352 | 352 | ||
| 353 | void clear(); | 353 | void clear(); |
| 354 | void setFocus(); | 354 | void setFocus(); |
| @@ -356,7 +356,7 @@ public: | |||
| 356 | private: | 356 | private: |
| 357 | class KeyReleaseEater : public QObject { | 357 | class KeyReleaseEater : public QObject { |
| 358 | public: | 358 | public: |
| 359 | explicit KeyReleaseEater(GameList* gamelist, QObject* parent = nullptr); | 359 | explicit KeyReleaseEater(GameList* gamelist_, QObject* parent = nullptr); |
| 360 | 360 | ||
| 361 | private: | 361 | private: |
| 362 | GameList* gamelist = nullptr; | 362 | GameList* gamelist = nullptr; |
diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp index ca1899b5c..63326968b 100644 --- a/src/yuzu/game_list_worker.cpp +++ b/src/yuzu/game_list_worker.cpp | |||
| @@ -223,12 +223,12 @@ QList<QStandardItem*> MakeGameListEntry(const std::string& path, const std::stri | |||
| 223 | } | 223 | } |
| 224 | } // Anonymous namespace | 224 | } // Anonymous namespace |
| 225 | 225 | ||
| 226 | GameListWorker::GameListWorker(FileSys::VirtualFilesystem vfs, | 226 | GameListWorker::GameListWorker(FileSys::VirtualFilesystem vfs_, |
| 227 | FileSys::ManualContentProvider* provider, | 227 | FileSys::ManualContentProvider* provider_, |
| 228 | QVector<UISettings::GameDir>& game_dirs, | 228 | QVector<UISettings::GameDir>& game_dirs_, |
| 229 | const CompatibilityList& compatibility_list, Core::System& system_) | 229 | const CompatibilityList& compatibility_list_, Core::System& system_) |
| 230 | : vfs(std::move(vfs)), provider(provider), game_dirs(game_dirs), | 230 | : vfs{std::move(vfs_)}, provider{provider_}, game_dirs{game_dirs_}, |
| 231 | compatibility_list(compatibility_list), system{system_} {} | 231 | compatibility_list{compatibility_list_}, system{system_} {} |
| 232 | 232 | ||
| 233 | GameListWorker::~GameListWorker() = default; | 233 | GameListWorker::~GameListWorker() = default; |
| 234 | 234 | ||
diff --git a/src/yuzu/game_list_worker.h b/src/yuzu/game_list_worker.h index 622d241fb..24a4e92c3 100644 --- a/src/yuzu/game_list_worker.h +++ b/src/yuzu/game_list_worker.h | |||
| @@ -33,10 +33,10 @@ class GameListWorker : public QObject, public QRunnable { | |||
| 33 | Q_OBJECT | 33 | Q_OBJECT |
| 34 | 34 | ||
| 35 | public: | 35 | public: |
| 36 | explicit GameListWorker(std::shared_ptr<FileSys::VfsFilesystem> vfs, | 36 | explicit GameListWorker(std::shared_ptr<FileSys::VfsFilesystem> vfs_, |
| 37 | FileSys::ManualContentProvider* provider, | 37 | FileSys::ManualContentProvider* provider_, |
| 38 | QVector<UISettings::GameDir>& game_dirs, | 38 | QVector<UISettings::GameDir>& game_dirs_, |
| 39 | const CompatibilityList& compatibility_list, Core::System& system_); | 39 | const CompatibilityList& compatibility_list_, Core::System& system_); |
| 40 | ~GameListWorker() override; | 40 | ~GameListWorker() override; |
| 41 | 41 | ||
| 42 | /// Starts the processing of directory tree information. | 42 | /// Starts the processing of directory tree information. |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 33886e50e..b460020b1 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -934,8 +934,7 @@ void GMainWindow::InitializeWidgets() { | |||
| 934 | Settings::values.renderer_backend.SetValue(Settings::RendererBackend::Vulkan); | 934 | Settings::values.renderer_backend.SetValue(Settings::RendererBackend::Vulkan); |
| 935 | } else { | 935 | } else { |
| 936 | Settings::values.renderer_backend.SetValue(Settings::RendererBackend::OpenGL); | 936 | Settings::values.renderer_backend.SetValue(Settings::RendererBackend::OpenGL); |
| 937 | const auto filter = Settings::values.scaling_filter.GetValue(); | 937 | if (Settings::values.scaling_filter.GetValue() == Settings::ScalingFilter::Fsr) { |
| 938 | if (filter == Settings::ScalingFilter::Fsr) { | ||
| 939 | Settings::values.scaling_filter.SetValue(Settings::ScalingFilter::NearestNeighbor); | 938 | Settings::values.scaling_filter.SetValue(Settings::ScalingFilter::NearestNeighbor); |
| 940 | UpdateFilterText(); | 939 | UpdateFilterText(); |
| 941 | } | 940 | } |
| @@ -1442,7 +1441,7 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p | |||
| 1442 | } | 1441 | } |
| 1443 | return false; | 1442 | return false; |
| 1444 | } | 1443 | } |
| 1445 | game_path = filename; | 1444 | current_game_path = filename; |
| 1446 | 1445 | ||
| 1447 | system->TelemetrySession().AddField(Common::Telemetry::FieldType::App, "Frontend", "Qt"); | 1446 | system->TelemetrySession().AddField(Common::Telemetry::FieldType::App, "Frontend", "Qt"); |
| 1448 | return true; | 1447 | return true; |
| @@ -1508,7 +1507,7 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t | |||
| 1508 | 1507 | ||
| 1509 | // Register an ExecuteProgram callback such that Core can execute a sub-program | 1508 | // Register an ExecuteProgram callback such that Core can execute a sub-program |
| 1510 | system->RegisterExecuteProgramCallback( | 1509 | system->RegisterExecuteProgramCallback( |
| 1511 | [this](std::size_t program_index) { render_window->ExecuteProgram(program_index); }); | 1510 | [this](std::size_t program_index_) { render_window->ExecuteProgram(program_index_); }); |
| 1512 | 1511 | ||
| 1513 | // Register an Exit callback such that Core can exit the currently running application. | 1512 | // Register an Exit callback such that Core can exit the currently running application. |
| 1514 | system->RegisterExitCallback([this]() { render_window->Exit(); }); | 1513 | system->RegisterExitCallback([this]() { render_window->Exit(); }); |
| @@ -1641,7 +1640,7 @@ void GMainWindow::ShutdownGame() { | |||
| 1641 | emu_frametime_label->setVisible(false); | 1640 | emu_frametime_label->setVisible(false); |
| 1642 | renderer_status_button->setEnabled(!UISettings::values.has_broken_vulkan); | 1641 | renderer_status_button->setEnabled(!UISettings::values.has_broken_vulkan); |
| 1643 | 1642 | ||
| 1644 | game_path.clear(); | 1643 | current_game_path.clear(); |
| 1645 | 1644 | ||
| 1646 | // When closing the game, destroy the GLWindow to clear the context after the game is closed | 1645 | // When closing the game, destroy the GLWindow to clear the context after the game is closed |
| 1647 | render_window->ReleaseRenderTarget(); | 1646 | render_window->ReleaseRenderTarget(); |
| @@ -2560,7 +2559,7 @@ void GMainWindow::OnRestartGame() { | |||
| 2560 | return; | 2559 | return; |
| 2561 | } | 2560 | } |
| 2562 | // Make a copy since BootGame edits game_path | 2561 | // Make a copy since BootGame edits game_path |
| 2563 | BootGame(QString(game_path)); | 2562 | BootGame(QString(current_game_path)); |
| 2564 | } | 2563 | } |
| 2565 | 2564 | ||
| 2566 | void GMainWindow::OnPauseGame() { | 2565 | void GMainWindow::OnPauseGame() { |
| @@ -2989,7 +2988,7 @@ void GMainWindow::OnToggleAdaptingFilter() { | |||
| 2989 | 2988 | ||
| 2990 | void GMainWindow::OnConfigurePerGame() { | 2989 | void GMainWindow::OnConfigurePerGame() { |
| 2991 | const u64 title_id = system->GetCurrentProcessProgramID(); | 2990 | const u64 title_id = system->GetCurrentProcessProgramID(); |
| 2992 | OpenPerGameConfiguration(title_id, game_path.toStdString()); | 2991 | OpenPerGameConfiguration(title_id, current_game_path.toStdString()); |
| 2993 | } | 2992 | } |
| 2994 | 2993 | ||
| 2995 | void GMainWindow::OpenPerGameConfiguration(u64 title_id, const std::string& file_name) { | 2994 | void GMainWindow::OpenPerGameConfiguration(u64 title_id, const std::string& file_name) { |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 600647015..8cf224c9c 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -369,7 +369,7 @@ private: | |||
| 369 | bool emulation_running = false; | 369 | bool emulation_running = false; |
| 370 | std::unique_ptr<EmuThread> emu_thread; | 370 | std::unique_ptr<EmuThread> emu_thread; |
| 371 | // The path to the game currently running | 371 | // The path to the game currently running |
| 372 | QString game_path; | 372 | QString current_game_path; |
| 373 | 373 | ||
| 374 | bool auto_paused = false; | 374 | bool auto_paused = false; |
| 375 | bool auto_muted = false; | 375 | bool auto_muted = false; |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.h b/src/yuzu_cmd/emu_window/emu_window_sdl2.h index 9746585f5..58b885465 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.h +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.h | |||
| @@ -20,7 +20,7 @@ enum class MouseButton; | |||
| 20 | 20 | ||
| 21 | class EmuWindow_SDL2 : public Core::Frontend::EmuWindow { | 21 | class EmuWindow_SDL2 : public Core::Frontend::EmuWindow { |
| 22 | public: | 22 | public: |
| 23 | explicit EmuWindow_SDL2(InputCommon::InputSubsystem* input_subsystem, Core::System& system_); | 23 | explicit EmuWindow_SDL2(InputCommon::InputSubsystem* input_subsystem_, Core::System& system_); |
| 24 | ~EmuWindow_SDL2(); | 24 | ~EmuWindow_SDL2(); |
| 25 | 25 | ||
| 26 | /// Whether the window is still open, and a close request hasn't yet been sent | 26 | /// Whether the window is still open, and a close request hasn't yet been sent |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp index 8075c9082..9b660c13c 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | |||
| @@ -73,9 +73,9 @@ bool EmuWindow_SDL2_GL::SupportsRequiredGLExtensions() { | |||
| 73 | return unsupported_ext.empty(); | 73 | return unsupported_ext.empty(); |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | EmuWindow_SDL2_GL::EmuWindow_SDL2_GL(InputCommon::InputSubsystem* input_subsystem, | 76 | EmuWindow_SDL2_GL::EmuWindow_SDL2_GL(InputCommon::InputSubsystem* input_subsystem_, |
| 77 | Core::System& system_, bool fullscreen) | 77 | Core::System& system_, bool fullscreen) |
| 78 | : EmuWindow_SDL2{input_subsystem, system_} { | 78 | : EmuWindow_SDL2{input_subsystem_, system_} { |
| 79 | SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4); | 79 | SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4); |
| 80 | SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 6); | 80 | SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 6); |
| 81 | SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY); | 81 | SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY); |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.h b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.h index d159166fd..39346e704 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.h +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.h | |||
| @@ -17,7 +17,7 @@ class InputSubsystem; | |||
| 17 | 17 | ||
| 18 | class EmuWindow_SDL2_GL final : public EmuWindow_SDL2 { | 18 | class EmuWindow_SDL2_GL final : public EmuWindow_SDL2 { |
| 19 | public: | 19 | public: |
| 20 | explicit EmuWindow_SDL2_GL(InputCommon::InputSubsystem* input_subsystem, Core::System& system_, | 20 | explicit EmuWindow_SDL2_GL(InputCommon::InputSubsystem* input_subsystem_, Core::System& system_, |
| 21 | bool fullscreen); | 21 | bool fullscreen); |
| 22 | ~EmuWindow_SDL2_GL(); | 22 | ~EmuWindow_SDL2_GL(); |
| 23 | 23 | ||
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp index d5fe35aa0..65455c86e 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | |||
| @@ -21,9 +21,9 @@ | |||
| 21 | #include <SDL.h> | 21 | #include <SDL.h> |
| 22 | #include <SDL_syswm.h> | 22 | #include <SDL_syswm.h> |
| 23 | 23 | ||
| 24 | EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem, | 24 | EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem_, |
| 25 | Core::System& system_, bool fullscreen) | 25 | Core::System& system_, bool fullscreen) |
| 26 | : EmuWindow_SDL2{input_subsystem, system_} { | 26 | : EmuWindow_SDL2{input_subsystem_, system_} { |
| 27 | const std::string window_title = fmt::format("yuzu {} | {}-{} (Vulkan)", Common::g_build_name, | 27 | const std::string window_title = fmt::format("yuzu {} | {}-{} (Vulkan)", Common::g_build_name, |
| 28 | Common::g_scm_branch, Common::g_scm_desc); | 28 | Common::g_scm_branch, Common::g_scm_desc); |
| 29 | render_window = | 29 | render_window = |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h index d92e3aaab..e39ad754d 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h | |||
| @@ -18,7 +18,7 @@ class InputSubsystem; | |||
| 18 | 18 | ||
| 19 | class EmuWindow_SDL2_VK final : public EmuWindow_SDL2 { | 19 | class EmuWindow_SDL2_VK final : public EmuWindow_SDL2 { |
| 20 | public: | 20 | public: |
| 21 | explicit EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem, Core::System& system, | 21 | explicit EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem_, Core::System& system, |
| 22 | bool fullscreen); | 22 | bool fullscreen); |
| 23 | ~EmuWindow_SDL2_VK() override; | 23 | ~EmuWindow_SDL2_VK() override; |
| 24 | 24 | ||