diff options
Diffstat (limited to 'src')
57 files changed, 343 insertions, 135 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt index 93c8ce922..9b08f008d 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt | |||
| @@ -49,7 +49,6 @@ import org.yuzu.yuzu_emu.utils.ForegroundService | |||
| 49 | import org.yuzu.yuzu_emu.utils.InputHandler | 49 | import org.yuzu.yuzu_emu.utils.InputHandler |
| 50 | import org.yuzu.yuzu_emu.utils.Log | 50 | import org.yuzu.yuzu_emu.utils.Log |
| 51 | import org.yuzu.yuzu_emu.utils.MemoryUtil | 51 | import org.yuzu.yuzu_emu.utils.MemoryUtil |
| 52 | import org.yuzu.yuzu_emu.utils.NativeConfig | ||
| 53 | import org.yuzu.yuzu_emu.utils.NfcReader | 52 | import org.yuzu.yuzu_emu.utils.NfcReader |
| 54 | import org.yuzu.yuzu_emu.utils.ThemeHelper | 53 | import org.yuzu.yuzu_emu.utils.ThemeHelper |
| 55 | import java.text.NumberFormat | 54 | import java.text.NumberFormat |
| @@ -171,11 +170,6 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { | |||
| 171 | stopMotionSensorListener() | 170 | stopMotionSensorListener() |
| 172 | } | 171 | } |
| 173 | 172 | ||
| 174 | override fun onStop() { | ||
| 175 | super.onStop() | ||
| 176 | NativeConfig.saveGlobalConfig() | ||
| 177 | } | ||
| 178 | |||
| 179 | override fun onUserLeaveHint() { | 173 | override fun onUserLeaveHint() { |
| 180 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) { | 174 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) { |
| 181 | if (BooleanSetting.PICTURE_IN_PICTURE.getBoolean() && !isInPictureInPictureMode) { | 175 | if (BooleanSetting.PICTURE_IN_PICTURE.getBoolean() && !isInPictureInPictureMode) { |
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt index 9efc1705d..47767454a 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt | |||
| @@ -554,6 +554,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { | |||
| 554 | findItem(R.id.menu_touchscreen).isChecked = BooleanSetting.TOUCHSCREEN.getBoolean() | 554 | findItem(R.id.menu_touchscreen).isChecked = BooleanSetting.TOUCHSCREEN.getBoolean() |
| 555 | } | 555 | } |
| 556 | 556 | ||
| 557 | popup.setOnDismissListener { NativeConfig.saveGlobalConfig() } | ||
| 557 | popup.setOnMenuItemClickListener { | 558 | popup.setOnMenuItemClickListener { |
| 558 | when (it.itemId) { | 559 | when (it.itemId) { |
| 559 | R.id.menu_toggle_fps -> { | 560 | R.id.menu_toggle_fps -> { |
| @@ -720,7 +721,9 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { | |||
| 720 | MaterialAlertDialogBuilder(requireContext()) | 721 | MaterialAlertDialogBuilder(requireContext()) |
| 721 | .setTitle(R.string.emulation_control_adjust) | 722 | .setTitle(R.string.emulation_control_adjust) |
| 722 | .setView(adjustBinding.root) | 723 | .setView(adjustBinding.root) |
| 723 | .setPositiveButton(android.R.string.ok, null) | 724 | .setPositiveButton(android.R.string.ok) { _: DialogInterface?, _: Int -> |
| 725 | NativeConfig.saveGlobalConfig() | ||
| 726 | } | ||
| 724 | .setNeutralButton(R.string.slider_default) { _: DialogInterface?, _: Int -> | 727 | .setNeutralButton(R.string.slider_default) { _: DialogInterface?, _: Int -> |
| 725 | setControlScale(50) | 728 | setControlScale(50) |
| 726 | setControlOpacity(100) | 729 | setControlOpacity(100) |
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/FileUtil.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/FileUtil.kt index 132f002fb..b54a19c65 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/FileUtil.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/FileUtil.kt | |||
| @@ -104,7 +104,7 @@ object FileUtil { | |||
| 104 | 104 | ||
| 105 | /** | 105 | /** |
| 106 | * Reference: https://stackoverflow.com/questions/42186820/documentfile-is-very-slow | 106 | * Reference: https://stackoverflow.com/questions/42186820/documentfile-is-very-slow |
| 107 | * This function will be faster than DoucmentFile.listFiles | 107 | * This function will be faster than DocumentFile.listFiles |
| 108 | * @param uri Directory uri. | 108 | * @param uri Directory uri. |
| 109 | * @return CheapDocument lists. | 109 | * @return CheapDocument lists. |
| 110 | */ | 110 | */ |
diff --git a/src/android/app/src/main/jni/android_config.cpp b/src/android/app/src/main/jni/android_config.cpp index 08aed3216..e147560c3 100644 --- a/src/android/app/src/main/jni/android_config.cpp +++ b/src/android/app/src/main/jni/android_config.cpp | |||
| @@ -21,7 +21,7 @@ void AndroidConfig::ReloadAllValues() { | |||
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | void AndroidConfig::SaveAllValues() { | 23 | void AndroidConfig::SaveAllValues() { |
| 24 | Save(); | 24 | SaveValues(); |
| 25 | SaveAndroidValues(); | 25 | SaveAndroidValues(); |
| 26 | } | 26 | } |
| 27 | 27 | ||
diff --git a/src/android/app/src/main/jni/native_config.cpp b/src/android/app/src/main/jni/native_config.cpp index 535902483..c6c3343dc 100644 --- a/src/android/app/src/main/jni/native_config.cpp +++ b/src/android/app/src/main/jni/native_config.cpp | |||
| @@ -205,7 +205,7 @@ jboolean Java_org_yuzu_yuzu_1emu_utils_NativeConfig_getIsRuntimeModifiable(JNIEn | |||
| 205 | jstring jkey) { | 205 | jstring jkey) { |
| 206 | auto setting = getSetting<std::string>(env, jkey); | 206 | auto setting = getSetting<std::string>(env, jkey); |
| 207 | if (setting != nullptr) { | 207 | if (setting != nullptr) { |
| 208 | return setting->RuntimeModfiable(); | 208 | return setting->RuntimeModifiable(); |
| 209 | } | 209 | } |
| 210 | return true; | 210 | return true; |
| 211 | } | 211 | } |
diff --git a/src/android/app/src/main/res/values/arrays.xml b/src/android/app/src/main/res/values/arrays.xml index 78e855bde..4701913eb 100644 --- a/src/android/app/src/main/res/values/arrays.xml +++ b/src/android/app/src/main/res/values/arrays.xml | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | <item>@string/language_dutch</item> | 29 | <item>@string/language_dutch</item> |
| 30 | <item>@string/language_english</item> | 30 | <item>@string/language_english</item> |
| 31 | <item>@string/language_french</item> | 31 | <item>@string/language_french</item> |
| 32 | <item>@string/langauge_german</item> | 32 | <item>@string/language_german</item> |
| 33 | <item>@string/language_italian</item> | 33 | <item>@string/language_italian</item> |
| 34 | <item>@string/language_japanese</item> | 34 | <item>@string/language_japanese</item> |
| 35 | <item>@string/language_korean</item> | 35 | <item>@string/language_korean</item> |
diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 3bb92ad67..547752bda 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml | |||
| @@ -410,7 +410,7 @@ | |||
| 410 | <string name="language_japanese" translatable="false">日本語</string> | 410 | <string name="language_japanese" translatable="false">日本語</string> |
| 411 | <string name="language_english" translatable="false">English</string> | 411 | <string name="language_english" translatable="false">English</string> |
| 412 | <string name="language_french" translatable="false">Français</string> | 412 | <string name="language_french" translatable="false">Français</string> |
| 413 | <string name="langauge_german" translatable="false">Deutsch</string> | 413 | <string name="language_german" translatable="false">Deutsch</string> |
| 414 | <string name="language_italian" translatable="false">Italiano</string> | 414 | <string name="language_italian" translatable="false">Italiano</string> |
| 415 | <string name="language_spanish" translatable="false">Español</string> | 415 | <string name="language_spanish" translatable="false">Español</string> |
| 416 | <string name="language_chinese" translatable="false">ç®€ä½“ä¸æ–‡</string> | 416 | <string name="language_chinese" translatable="false">ç®€ä½“ä¸æ–‡</string> |
diff --git a/src/audio_core/adsp/adsp.cpp b/src/audio_core/adsp/adsp.cpp index 6c53c98fd..48f0a63d4 100644 --- a/src/audio_core/adsp/adsp.cpp +++ b/src/audio_core/adsp/adsp.cpp | |||
| @@ -11,7 +11,7 @@ ADSP::ADSP(Core::System& system, Sink::Sink& sink) { | |||
| 11 | opus_decoder = std::make_unique<OpusDecoder::OpusDecoder>(system); | 11 | opus_decoder = std::make_unique<OpusDecoder::OpusDecoder>(system); |
| 12 | opus_decoder->Send(Direction::DSP, OpusDecoder::Message::Start); | 12 | opus_decoder->Send(Direction::DSP, OpusDecoder::Message::Start); |
| 13 | if (opus_decoder->Receive(Direction::Host) != OpusDecoder::Message::StartOK) { | 13 | if (opus_decoder->Receive(Direction::Host) != OpusDecoder::Message::StartOK) { |
| 14 | LOG_ERROR(Service_Audio, "OpusDeocder failed to initialize."); | 14 | LOG_ERROR(Service_Audio, "OpusDecoder failed to initialize."); |
| 15 | return; | 15 | return; |
| 16 | } | 16 | } |
| 17 | } | 17 | } |
diff --git a/src/audio_core/renderer/command/command_generator.cpp b/src/audio_core/renderer/command/command_generator.cpp index ccb186209..f97db5899 100644 --- a/src/audio_core/renderer/command/command_generator.cpp +++ b/src/audio_core/renderer/command/command_generator.cpp | |||
| @@ -41,7 +41,7 @@ void CommandGenerator::GenerateDataSourceCommand(VoiceInfo& voice_info, | |||
| 41 | const VoiceState& voice_state, const s8 channel) { | 41 | const VoiceState& voice_state, const s8 channel) { |
| 42 | if (voice_info.mix_id == UnusedMixId) { | 42 | if (voice_info.mix_id == UnusedMixId) { |
| 43 | if (voice_info.splitter_id != UnusedSplitterId) { | 43 | if (voice_info.splitter_id != UnusedSplitterId) { |
| 44 | auto destination{splitter_context.GetDesintationData(voice_info.splitter_id, 0)}; | 44 | auto destination{splitter_context.GetDestinationData(voice_info.splitter_id, 0)}; |
| 45 | u32 dest_id{0}; | 45 | u32 dest_id{0}; |
| 46 | while (destination != nullptr) { | 46 | while (destination != nullptr) { |
| 47 | if (destination->IsConfigured()) { | 47 | if (destination->IsConfigured()) { |
| @@ -55,7 +55,7 @@ void CommandGenerator::GenerateDataSourceCommand(VoiceInfo& voice_info, | |||
| 55 | } | 55 | } |
| 56 | } | 56 | } |
| 57 | dest_id++; | 57 | dest_id++; |
| 58 | destination = splitter_context.GetDesintationData(voice_info.splitter_id, dest_id); | 58 | destination = splitter_context.GetDestinationData(voice_info.splitter_id, dest_id); |
| 59 | } | 59 | } |
| 60 | } | 60 | } |
| 61 | } else { | 61 | } else { |
| @@ -234,7 +234,7 @@ void CommandGenerator::GenerateVoiceCommand(VoiceInfo& voice_info) { | |||
| 234 | if (voice_info.mix_id == UnusedMixId) { | 234 | if (voice_info.mix_id == UnusedMixId) { |
| 235 | if (voice_info.splitter_id != UnusedSplitterId) { | 235 | if (voice_info.splitter_id != UnusedSplitterId) { |
| 236 | auto i{channel}; | 236 | auto i{channel}; |
| 237 | auto destination{splitter_context.GetDesintationData(voice_info.splitter_id, i)}; | 237 | auto destination{splitter_context.GetDestinationData(voice_info.splitter_id, i)}; |
| 238 | while (destination != nullptr) { | 238 | while (destination != nullptr) { |
| 239 | if (destination->IsConfigured()) { | 239 | if (destination->IsConfigured()) { |
| 240 | const auto mix_id{destination->GetMixId()}; | 240 | const auto mix_id{destination->GetMixId()}; |
| @@ -249,7 +249,7 @@ void CommandGenerator::GenerateVoiceCommand(VoiceInfo& voice_info) { | |||
| 249 | } | 249 | } |
| 250 | } | 250 | } |
| 251 | i += voice_info.channel_count; | 251 | i += voice_info.channel_count; |
| 252 | destination = splitter_context.GetDesintationData(voice_info.splitter_id, i); | 252 | destination = splitter_context.GetDestinationData(voice_info.splitter_id, i); |
| 253 | } | 253 | } |
| 254 | } | 254 | } |
| 255 | } else { | 255 | } else { |
| @@ -591,7 +591,7 @@ void CommandGenerator::GenerateMixCommands(MixInfo& mix_info) { | |||
| 591 | if (mix_info.dst_splitter_id != UnusedSplitterId) { | 591 | if (mix_info.dst_splitter_id != UnusedSplitterId) { |
| 592 | s16 dest_id{0}; | 592 | s16 dest_id{0}; |
| 593 | auto destination{ | 593 | auto destination{ |
| 594 | splitter_context.GetDesintationData(mix_info.dst_splitter_id, dest_id)}; | 594 | splitter_context.GetDestinationData(mix_info.dst_splitter_id, dest_id)}; |
| 595 | while (destination != nullptr) { | 595 | while (destination != nullptr) { |
| 596 | if (destination->IsConfigured()) { | 596 | if (destination->IsConfigured()) { |
| 597 | auto splitter_mix_id{destination->GetMixId()}; | 597 | auto splitter_mix_id{destination->GetMixId()}; |
| @@ -612,7 +612,7 @@ void CommandGenerator::GenerateMixCommands(MixInfo& mix_info) { | |||
| 612 | } | 612 | } |
| 613 | dest_id++; | 613 | dest_id++; |
| 614 | destination = | 614 | destination = |
| 615 | splitter_context.GetDesintationData(mix_info.dst_splitter_id, dest_id); | 615 | splitter_context.GetDestinationData(mix_info.dst_splitter_id, dest_id); |
| 616 | } | 616 | } |
| 617 | } | 617 | } |
| 618 | } else { | 618 | } else { |
diff --git a/src/audio_core/renderer/mix/mix_info.cpp b/src/audio_core/renderer/mix/mix_info.cpp index 5e44bde18..68bbe0aed 100644 --- a/src/audio_core/renderer/mix/mix_info.cpp +++ b/src/audio_core/renderer/mix/mix_info.cpp | |||
| @@ -93,7 +93,7 @@ bool MixInfo::UpdateConnection(EdgeMatrix& edge_matrix, const InParameter& in_pa | |||
| 93 | 93 | ||
| 94 | for (u32 i = 0; i < destination_count; i++) { | 94 | for (u32 i = 0; i < destination_count; i++) { |
| 95 | auto destination{ | 95 | auto destination{ |
| 96 | splitter_context.GetDesintationData(in_params.dest_splitter_id, i)}; | 96 | splitter_context.GetDestinationData(in_params.dest_splitter_id, i)}; |
| 97 | 97 | ||
| 98 | if (destination) { | 98 | if (destination) { |
| 99 | const auto destination_id{destination->GetMixId()}; | 99 | const auto destination_id{destination->GetMixId()}; |
diff --git a/src/audio_core/renderer/splitter/splitter_context.cpp b/src/audio_core/renderer/splitter/splitter_context.cpp index 686150ea6..d0f3b60c2 100644 --- a/src/audio_core/renderer/splitter/splitter_context.cpp +++ b/src/audio_core/renderer/splitter/splitter_context.cpp | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | namespace AudioCore::Renderer { | 10 | namespace AudioCore::Renderer { |
| 11 | 11 | ||
| 12 | SplitterDestinationData* SplitterContext::GetDesintationData(const s32 splitter_id, | 12 | SplitterDestinationData* SplitterContext::GetDestinationData(const s32 splitter_id, |
| 13 | const s32 destination_id) { | 13 | const s32 destination_id) { |
| 14 | return splitter_infos[splitter_id].GetData(destination_id); | 14 | return splitter_infos[splitter_id].GetData(destination_id); |
| 15 | } | 15 | } |
diff --git a/src/audio_core/renderer/splitter/splitter_context.h b/src/audio_core/renderer/splitter/splitter_context.h index 556e6dcc3..1c0b84671 100644 --- a/src/audio_core/renderer/splitter/splitter_context.h +++ b/src/audio_core/renderer/splitter/splitter_context.h | |||
| @@ -42,7 +42,7 @@ public: | |||
| 42 | * @param destination_id - Destination index within the splitter. | 42 | * @param destination_id - Destination index within the splitter. |
| 43 | * @return Pointer to the found destination. May be nullptr. | 43 | * @return Pointer to the found destination. May be nullptr. |
| 44 | */ | 44 | */ |
| 45 | SplitterDestinationData* GetDesintationData(s32 splitter_id, s32 destination_id); | 45 | SplitterDestinationData* GetDestinationData(s32 splitter_id, s32 destination_id); |
| 46 | 46 | ||
| 47 | /** | 47 | /** |
| 48 | * Get a splitter from the given index. | 48 | * Get a splitter from the given index. |
diff --git a/src/common/settings_common.cpp b/src/common/settings_common.cpp index 5960b78aa..b90e3509c 100644 --- a/src/common/settings_common.cpp +++ b/src/common/settings_common.cpp | |||
| @@ -35,7 +35,7 @@ bool BasicSetting::Save() const { | |||
| 35 | return save; | 35 | return save; |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | bool BasicSetting::RuntimeModfiable() const { | 38 | bool BasicSetting::RuntimeModifiable() const { |
| 39 | return runtime_modifiable; | 39 | return runtime_modifiable; |
| 40 | } | 40 | } |
| 41 | 41 | ||
diff --git a/src/common/settings_common.h b/src/common/settings_common.h index 1a290ad77..987489e8a 100644 --- a/src/common/settings_common.h +++ b/src/common/settings_common.h | |||
| @@ -186,7 +186,7 @@ public: | |||
| 186 | /** | 186 | /** |
| 187 | * @returns true if the current setting can be changed while the guest is running. | 187 | * @returns true if the current setting can be changed while the guest is running. |
| 188 | */ | 188 | */ |
| 189 | [[nodiscard]] bool RuntimeModfiable() const; | 189 | [[nodiscard]] bool RuntimeModifiable() const; |
| 190 | 190 | ||
| 191 | /** | 191 | /** |
| 192 | * @returns A unique number corresponding to the setting. | 192 | * @returns A unique number corresponding to the setting. |
diff --git a/src/frontend_common/config.cpp b/src/frontend_common/config.cpp index 9eb4799a6..46277e288 100644 --- a/src/frontend_common/config.cpp +++ b/src/frontend_common/config.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <array> | 5 | #include <array> |
| 6 | #include "common/fs/fs.h" | 6 | #include "common/fs/fs.h" |
| 7 | #include "common/fs/path_util.h" | 7 | #include "common/fs/path_util.h" |
| 8 | #include "common/logging/log.h" | ||
| 8 | #include "common/settings.h" | 9 | #include "common/settings.h" |
| 9 | #include "common/settings_common.h" | 10 | #include "common/settings_common.h" |
| 10 | #include "common/settings_enums.h" | 11 | #include "common/settings_enums.h" |
| @@ -58,6 +59,19 @@ void Config::Initialize(const std::optional<std::string> config_path) { | |||
| 58 | } | 59 | } |
| 59 | 60 | ||
| 60 | void Config::WriteToIni() const { | 61 | void Config::WriteToIni() const { |
| 62 | std::string config_type; | ||
| 63 | switch (type) { | ||
| 64 | case ConfigType::GlobalConfig: | ||
| 65 | config_type = "Global"; | ||
| 66 | break; | ||
| 67 | case ConfigType::PerGameConfig: | ||
| 68 | config_type = "Game Specific"; | ||
| 69 | break; | ||
| 70 | case ConfigType::InputProfile: | ||
| 71 | config_type = "Input Profile"; | ||
| 72 | break; | ||
| 73 | } | ||
| 74 | LOG_INFO(Config, "Writing {} configuration to: {}", config_type, config_loc); | ||
| 61 | FILE* fp = nullptr; | 75 | FILE* fp = nullptr; |
| 62 | #ifdef _WIN32 | 76 | #ifdef _WIN32 |
| 63 | fp = _wfopen(Common::UTF8ToUTF16W(config_loc).data(), L"wb"); | 77 | fp = _wfopen(Common::UTF8ToUTF16W(config_loc).data(), L"wb"); |
| @@ -117,10 +131,10 @@ void Config::ReadPlayerValues(const std::size_t player_index) { | |||
| 117 | player_prefix.append("player_").append(ToString(player_index)).append("_"); | 131 | player_prefix.append("player_").append(ToString(player_index)).append("_"); |
| 118 | } | 132 | } |
| 119 | 133 | ||
| 134 | const auto profile_name = ReadStringSetting(std::string(player_prefix).append("profile_name")); | ||
| 135 | |||
| 120 | auto& player = Settings::values.players.GetValue()[player_index]; | 136 | auto& player = Settings::values.players.GetValue()[player_index]; |
| 121 | if (IsCustomConfig()) { | 137 | if (IsCustomConfig()) { |
| 122 | const auto profile_name = | ||
| 123 | ReadStringSetting(std::string(player_prefix).append("profile_name")); | ||
| 124 | if (profile_name.empty()) { | 138 | if (profile_name.empty()) { |
| 125 | // Use the global input config | 139 | // Use the global input config |
| 126 | player = Settings::values.players.GetValue(true)[player_index]; | 140 | player = Settings::values.players.GetValue(true)[player_index]; |
| @@ -139,6 +153,10 @@ void Config::ReadPlayerValues(const std::size_t player_index) { | |||
| 139 | player.controller_type = controller; | 153 | player.controller_type = controller; |
| 140 | } | 154 | } |
| 141 | } else { | 155 | } else { |
| 156 | if (global) { | ||
| 157 | auto& player_global = Settings::values.players.GetValue(true)[player_index]; | ||
| 158 | player_global.profile_name = profile_name; | ||
| 159 | } | ||
| 142 | std::string connected_key = player_prefix; | 160 | std::string connected_key = player_prefix; |
| 143 | player.connected = ReadBooleanSetting(connected_key.append("connected"), | 161 | player.connected = ReadBooleanSetting(connected_key.append("connected"), |
| 144 | std::make_optional(player_index == 0)); | 162 | std::make_optional(player_index == 0)); |
| @@ -412,6 +430,11 @@ void Config::SavePlayerValues(const std::size_t player_index) { | |||
| 412 | std::make_optional(static_cast<u8>(Settings::ControllerType::ProController))); | 430 | std::make_optional(static_cast<u8>(Settings::ControllerType::ProController))); |
| 413 | 431 | ||
| 414 | if (!player_prefix.empty() || !Settings::IsConfiguringGlobal()) { | 432 | if (!player_prefix.empty() || !Settings::IsConfiguringGlobal()) { |
| 433 | if (global) { | ||
| 434 | const auto& player_global = Settings::values.players.GetValue(true)[player_index]; | ||
| 435 | WriteStringSetting(std::string(player_prefix).append("profile_name"), | ||
| 436 | player_global.profile_name, std::make_optional(std::string(""))); | ||
| 437 | } | ||
| 415 | WriteBooleanSetting(std::string(player_prefix).append("connected"), player.connected, | 438 | WriteBooleanSetting(std::string(player_prefix).append("connected"), player.connected, |
| 416 | std::make_optional(player_index == 0)); | 439 | std::make_optional(player_index == 0)); |
| 417 | WriteIntegerSetting(std::string(player_prefix).append("vibration_enabled"), | 440 | WriteIntegerSetting(std::string(player_prefix).append("vibration_enabled"), |
| @@ -468,12 +491,15 @@ void Config::SaveMotionTouchValues() { | |||
| 468 | 491 | ||
| 469 | void Config::SaveValues() { | 492 | void Config::SaveValues() { |
| 470 | if (global) { | 493 | if (global) { |
| 494 | LOG_DEBUG(Config, "Saving global generic configuration values"); | ||
| 471 | SaveDataStorageValues(); | 495 | SaveDataStorageValues(); |
| 472 | SaveDebuggingValues(); | 496 | SaveDebuggingValues(); |
| 473 | SaveDisabledAddOnValues(); | 497 | SaveDisabledAddOnValues(); |
| 474 | SaveNetworkValues(); | 498 | SaveNetworkValues(); |
| 475 | SaveWebServiceValues(); | 499 | SaveWebServiceValues(); |
| 476 | SaveMiscellaneousValues(); | 500 | SaveMiscellaneousValues(); |
| 501 | } else { | ||
| 502 | LOG_DEBUG(Config, "Saving only generic configuration values"); | ||
| 477 | } | 503 | } |
| 478 | SaveControlValues(); | 504 | SaveControlValues(); |
| 479 | SaveCoreValues(); | 505 | SaveCoreValues(); |
| @@ -814,10 +840,6 @@ void Config::Reload() { | |||
| 814 | SaveValues(); | 840 | SaveValues(); |
| 815 | } | 841 | } |
| 816 | 842 | ||
| 817 | void Config::Save() { | ||
| 818 | SaveValues(); | ||
| 819 | } | ||
| 820 | |||
| 821 | void Config::ClearControlPlayerValues() const { | 843 | void Config::ClearControlPlayerValues() const { |
| 822 | // If key is an empty string, all keys in the current group() are removed. | 844 | // If key is an empty string, all keys in the current group() are removed. |
| 823 | const char* section = Settings::TranslateCategory(Settings::Category::Controls); | 845 | const char* section = Settings::TranslateCategory(Settings::Category::Controls); |
diff --git a/src/frontend_common/config.h b/src/frontend_common/config.h index b01631649..4798d6432 100644 --- a/src/frontend_common/config.h +++ b/src/frontend_common/config.h | |||
| @@ -51,7 +51,6 @@ protected: | |||
| 51 | [[nodiscard]] bool IsCustomConfig() const; | 51 | [[nodiscard]] bool IsCustomConfig() const; |
| 52 | 52 | ||
| 53 | void Reload(); | 53 | void Reload(); |
| 54 | void Save(); | ||
| 55 | 54 | ||
| 56 | /** | 55 | /** |
| 57 | * Derived config classes must implement this so they can reload all platform-specific | 56 | * Derived config classes must implement this so they can reload all platform-specific |
diff --git a/src/hid_core/frontend/emulated_controller.cpp b/src/hid_core/frontend/emulated_controller.cpp index a6a96935d..2ab93402d 100644 --- a/src/hid_core/frontend/emulated_controller.cpp +++ b/src/hid_core/frontend/emulated_controller.cpp | |||
| @@ -509,11 +509,11 @@ void EmulatedController::ReloadInput() { | |||
| 509 | }); | 509 | }); |
| 510 | } | 510 | } |
| 511 | turbo_button_state = 0; | 511 | turbo_button_state = 0; |
| 512 | is_initalized = true; | 512 | is_initialized = true; |
| 513 | } | 513 | } |
| 514 | 514 | ||
| 515 | void EmulatedController::UnloadInput() { | 515 | void EmulatedController::UnloadInput() { |
| 516 | is_initalized = false; | 516 | is_initialized = false; |
| 517 | for (auto& button : button_devices) { | 517 | for (auto& button : button_devices) { |
| 518 | button.reset(); | 518 | button.reset(); |
| 519 | } | 519 | } |
| @@ -1209,7 +1209,7 @@ void EmulatedController::SetNfc(const Common::Input::CallbackStatus& callback) { | |||
| 1209 | } | 1209 | } |
| 1210 | 1210 | ||
| 1211 | bool EmulatedController::SetVibration(std::size_t device_index, VibrationValue vibration) { | 1211 | bool EmulatedController::SetVibration(std::size_t device_index, VibrationValue vibration) { |
| 1212 | if (!is_initalized) { | 1212 | if (!is_initialized) { |
| 1213 | return false; | 1213 | return false; |
| 1214 | } | 1214 | } |
| 1215 | if (device_index >= output_devices.size()) { | 1215 | if (device_index >= output_devices.size()) { |
| @@ -1247,7 +1247,7 @@ bool EmulatedController::IsVibrationEnabled(std::size_t device_index) { | |||
| 1247 | const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type); | 1247 | const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type); |
| 1248 | const auto& player = Settings::values.players.GetValue()[player_index]; | 1248 | const auto& player = Settings::values.players.GetValue()[player_index]; |
| 1249 | 1249 | ||
| 1250 | if (!is_initalized) { | 1250 | if (!is_initialized) { |
| 1251 | return false; | 1251 | return false; |
| 1252 | } | 1252 | } |
| 1253 | 1253 | ||
| @@ -1270,7 +1270,7 @@ Common::Input::DriverResult EmulatedController::SetPollingMode( | |||
| 1270 | EmulatedDeviceIndex device_index, Common::Input::PollingMode polling_mode) { | 1270 | EmulatedDeviceIndex device_index, Common::Input::PollingMode polling_mode) { |
| 1271 | LOG_INFO(Service_HID, "Set polling mode {}, device_index={}", polling_mode, device_index); | 1271 | LOG_INFO(Service_HID, "Set polling mode {}, device_index={}", polling_mode, device_index); |
| 1272 | 1272 | ||
| 1273 | if (!is_initalized) { | 1273 | if (!is_initialized) { |
| 1274 | return Common::Input::DriverResult::InvalidHandle; | 1274 | return Common::Input::DriverResult::InvalidHandle; |
| 1275 | } | 1275 | } |
| 1276 | 1276 | ||
| @@ -1319,7 +1319,7 @@ bool EmulatedController::SetCameraFormat( | |||
| 1319 | Core::IrSensor::ImageTransferProcessorFormat camera_format) { | 1319 | Core::IrSensor::ImageTransferProcessorFormat camera_format) { |
| 1320 | LOG_INFO(Service_HID, "Set camera format {}", camera_format); | 1320 | LOG_INFO(Service_HID, "Set camera format {}", camera_format); |
| 1321 | 1321 | ||
| 1322 | if (!is_initalized) { | 1322 | if (!is_initialized) { |
| 1323 | return false; | 1323 | return false; |
| 1324 | } | 1324 | } |
| 1325 | 1325 | ||
| @@ -1347,7 +1347,7 @@ void EmulatedController::SetRingParam(Common::ParamPackage param) { | |||
| 1347 | 1347 | ||
| 1348 | bool EmulatedController::HasNfc() const { | 1348 | bool EmulatedController::HasNfc() const { |
| 1349 | 1349 | ||
| 1350 | if (!is_initalized) { | 1350 | if (!is_initialized) { |
| 1351 | return false; | 1351 | return false; |
| 1352 | } | 1352 | } |
| 1353 | 1353 | ||
| @@ -1388,7 +1388,7 @@ bool EmulatedController::RemoveNfcHandle() { | |||
| 1388 | } | 1388 | } |
| 1389 | 1389 | ||
| 1390 | bool EmulatedController::StartNfcPolling() { | 1390 | bool EmulatedController::StartNfcPolling() { |
| 1391 | if (!is_initalized) { | 1391 | if (!is_initialized) { |
| 1392 | return false; | 1392 | return false; |
| 1393 | } | 1393 | } |
| 1394 | 1394 | ||
| @@ -1403,7 +1403,7 @@ bool EmulatedController::StartNfcPolling() { | |||
| 1403 | } | 1403 | } |
| 1404 | 1404 | ||
| 1405 | bool EmulatedController::StopNfcPolling() { | 1405 | bool EmulatedController::StopNfcPolling() { |
| 1406 | if (!is_initalized) { | 1406 | if (!is_initialized) { |
| 1407 | return false; | 1407 | return false; |
| 1408 | } | 1408 | } |
| 1409 | 1409 | ||
| @@ -1418,7 +1418,7 @@ bool EmulatedController::StopNfcPolling() { | |||
| 1418 | } | 1418 | } |
| 1419 | 1419 | ||
| 1420 | bool EmulatedController::ReadAmiiboData(std::vector<u8>& data) { | 1420 | bool EmulatedController::ReadAmiiboData(std::vector<u8>& data) { |
| 1421 | if (!is_initalized) { | 1421 | if (!is_initialized) { |
| 1422 | return false; | 1422 | return false; |
| 1423 | } | 1423 | } |
| 1424 | 1424 | ||
| @@ -1434,7 +1434,7 @@ bool EmulatedController::ReadAmiiboData(std::vector<u8>& data) { | |||
| 1434 | 1434 | ||
| 1435 | bool EmulatedController::ReadMifareData(const Common::Input::MifareRequest& request, | 1435 | bool EmulatedController::ReadMifareData(const Common::Input::MifareRequest& request, |
| 1436 | Common::Input::MifareRequest& out_data) { | 1436 | Common::Input::MifareRequest& out_data) { |
| 1437 | if (!is_initalized) { | 1437 | if (!is_initialized) { |
| 1438 | return false; | 1438 | return false; |
| 1439 | } | 1439 | } |
| 1440 | 1440 | ||
| @@ -1450,7 +1450,7 @@ bool EmulatedController::ReadMifareData(const Common::Input::MifareRequest& requ | |||
| 1450 | } | 1450 | } |
| 1451 | 1451 | ||
| 1452 | bool EmulatedController::WriteMifareData(const Common::Input::MifareRequest& request) { | 1452 | bool EmulatedController::WriteMifareData(const Common::Input::MifareRequest& request) { |
| 1453 | if (!is_initalized) { | 1453 | if (!is_initialized) { |
| 1454 | return false; | 1454 | return false; |
| 1455 | } | 1455 | } |
| 1456 | 1456 | ||
| @@ -1465,7 +1465,7 @@ bool EmulatedController::WriteMifareData(const Common::Input::MifareRequest& req | |||
| 1465 | } | 1465 | } |
| 1466 | 1466 | ||
| 1467 | bool EmulatedController::WriteNfc(const std::vector<u8>& data) { | 1467 | bool EmulatedController::WriteNfc(const std::vector<u8>& data) { |
| 1468 | if (!is_initalized) { | 1468 | if (!is_initialized) { |
| 1469 | return false; | 1469 | return false; |
| 1470 | } | 1470 | } |
| 1471 | 1471 | ||
| @@ -1480,7 +1480,7 @@ bool EmulatedController::WriteNfc(const std::vector<u8>& data) { | |||
| 1480 | } | 1480 | } |
| 1481 | 1481 | ||
| 1482 | void EmulatedController::SetLedPattern() { | 1482 | void EmulatedController::SetLedPattern() { |
| 1483 | if (!is_initalized) { | 1483 | if (!is_initialized) { |
| 1484 | return; | 1484 | return; |
| 1485 | } | 1485 | } |
| 1486 | 1486 | ||
| @@ -1508,8 +1508,8 @@ void EmulatedController::SetGyroscopeZeroDriftMode(GyroscopeZeroDriftMode mode) | |||
| 1508 | motion.emulated.SetGyroThreshold(motion.emulated.ThresholdLoose); | 1508 | motion.emulated.SetGyroThreshold(motion.emulated.ThresholdLoose); |
| 1509 | break; | 1509 | break; |
| 1510 | case GyroscopeZeroDriftMode::Tight: | 1510 | case GyroscopeZeroDriftMode::Tight: |
| 1511 | motion_sensitivity = motion.emulated.IsAtRestThight; | 1511 | motion_sensitivity = motion.emulated.IsAtRestTight; |
| 1512 | motion.emulated.SetGyroThreshold(motion.emulated.ThresholdThight); | 1512 | motion.emulated.SetGyroThreshold(motion.emulated.ThresholdTight); |
| 1513 | break; | 1513 | break; |
| 1514 | case GyroscopeZeroDriftMode::Standard: | 1514 | case GyroscopeZeroDriftMode::Standard: |
| 1515 | default: | 1515 | default: |
diff --git a/src/hid_core/frontend/emulated_controller.h b/src/hid_core/frontend/emulated_controller.h index 94798164d..90e536e07 100644 --- a/src/hid_core/frontend/emulated_controller.h +++ b/src/hid_core/frontend/emulated_controller.h | |||
| @@ -559,7 +559,7 @@ private: | |||
| 559 | NpadStyleTag supported_style_tag{NpadStyleSet::All}; | 559 | NpadStyleTag supported_style_tag{NpadStyleSet::All}; |
| 560 | bool is_connected{false}; | 560 | bool is_connected{false}; |
| 561 | bool is_configuring{false}; | 561 | bool is_configuring{false}; |
| 562 | bool is_initalized{false}; | 562 | bool is_initialized{false}; |
| 563 | bool system_buttons_enabled{true}; | 563 | bool system_buttons_enabled{true}; |
| 564 | f32 motion_sensitivity{Core::HID::MotionInput::IsAtRestStandard}; | 564 | f32 motion_sensitivity{Core::HID::MotionInput::IsAtRestStandard}; |
| 565 | u32 turbo_button_state{0}; | 565 | u32 turbo_button_state{0}; |
diff --git a/src/hid_core/frontend/motion_input.h b/src/hid_core/frontend/motion_input.h index 11678983d..c902a3a6e 100644 --- a/src/hid_core/frontend/motion_input.h +++ b/src/hid_core/frontend/motion_input.h | |||
| @@ -13,12 +13,12 @@ class MotionInput { | |||
| 13 | public: | 13 | public: |
| 14 | static constexpr float ThresholdLoose = 0.01f; | 14 | static constexpr float ThresholdLoose = 0.01f; |
| 15 | static constexpr float ThresholdStandard = 0.007f; | 15 | static constexpr float ThresholdStandard = 0.007f; |
| 16 | static constexpr float ThresholdThight = 0.002f; | 16 | static constexpr float ThresholdTight = 0.002f; |
| 17 | 17 | ||
| 18 | static constexpr float IsAtRestRelaxed = 0.05f; | 18 | static constexpr float IsAtRestRelaxed = 0.05f; |
| 19 | static constexpr float IsAtRestLoose = 0.02f; | 19 | static constexpr float IsAtRestLoose = 0.02f; |
| 20 | static constexpr float IsAtRestStandard = 0.01f; | 20 | static constexpr float IsAtRestStandard = 0.01f; |
| 21 | static constexpr float IsAtRestThight = 0.005f; | 21 | static constexpr float IsAtRestTight = 0.005f; |
| 22 | 22 | ||
| 23 | static constexpr float GyroMaxValue = 5.0f; | 23 | static constexpr float GyroMaxValue = 5.0f; |
| 24 | static constexpr float AccelMaxValue = 7.0f; | 24 | static constexpr float AccelMaxValue = 7.0f; |
diff --git a/src/hid_core/hid_result.h b/src/hid_core/hid_result.h index bb14aa61e..df9b28c9a 100644 --- a/src/hid_core/hid_result.h +++ b/src/hid_core/hid_result.h | |||
| @@ -15,7 +15,7 @@ constexpr Result ResultVibrationNotInitialized{ErrorModule::HID, 121}; | |||
| 15 | constexpr Result ResultVibrationInvalidStyleIndex{ErrorModule::HID, 122}; | 15 | constexpr Result ResultVibrationInvalidStyleIndex{ErrorModule::HID, 122}; |
| 16 | constexpr Result ResultVibrationInvalidNpadId{ErrorModule::HID, 123}; | 16 | constexpr Result ResultVibrationInvalidNpadId{ErrorModule::HID, 123}; |
| 17 | constexpr Result ResultVibrationDeviceIndexOutOfRange{ErrorModule::HID, 124}; | 17 | constexpr Result ResultVibrationDeviceIndexOutOfRange{ErrorModule::HID, 124}; |
| 18 | constexpr Result ResultVibrationStrenghtOutOfRange{ErrorModule::HID, 126}; | 18 | constexpr Result ResultVibrationStrengthOutOfRange{ErrorModule::HID, 126}; |
| 19 | constexpr Result ResultVibrationArraySizeMismatch{ErrorModule::HID, 131}; | 19 | constexpr Result ResultVibrationArraySizeMismatch{ErrorModule::HID, 131}; |
| 20 | 20 | ||
| 21 | constexpr Result InvalidSixAxisFusionRange{ErrorModule::HID, 423}; | 21 | constexpr Result InvalidSixAxisFusionRange{ErrorModule::HID, 423}; |
diff --git a/src/hid_core/irsensor/irs_types.h b/src/hid_core/irsensor/irs_types.h index 017f38e6c..d7354de21 100644 --- a/src/hid_core/irsensor/irs_types.h +++ b/src/hid_core/irsensor/irs_types.h | |||
| @@ -106,8 +106,8 @@ enum class HandAnalysisMode : u32 { | |||
| 106 | None, | 106 | None, |
| 107 | Silhouette, | 107 | Silhouette, |
| 108 | Image, | 108 | Image, |
| 109 | SilhoueteAndImage, | 109 | SilhouetteAndImage, |
| 110 | SilhuetteOnly, | 110 | SilhouetteOnly, |
| 111 | }; | 111 | }; |
| 112 | 112 | ||
| 113 | // This is nn::irsensor::IrSensorFunctionLevel | 113 | // This is nn::irsensor::IrSensorFunctionLevel |
diff --git a/src/hid_core/resources/hid_firmware_settings.cpp b/src/hid_core/resources/hid_firmware_settings.cpp index e76b3a016..9fa0db17e 100644 --- a/src/hid_core/resources/hid_firmware_settings.cpp +++ b/src/hid_core/resources/hid_firmware_settings.cpp | |||
| @@ -14,7 +14,7 @@ void HidFirmwareSettings::Reload() { | |||
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | void HidFirmwareSettings::LoadSettings(bool reload_config) { | 16 | void HidFirmwareSettings::LoadSettings(bool reload_config) { |
| 17 | if (is_initalized && !reload_config) { | 17 | if (is_initialized && !reload_config) { |
| 18 | return; | 18 | return; |
| 19 | } | 19 | } |
| 20 | 20 | ||
| @@ -33,7 +33,7 @@ void HidFirmwareSettings::LoadSettings(bool reload_config) { | |||
| 33 | is_handheld_forced = true; | 33 | is_handheld_forced = true; |
| 34 | features_per_id_disabled = {}; | 34 | features_per_id_disabled = {}; |
| 35 | is_touch_firmware_auto_update_disabled = false; | 35 | is_touch_firmware_auto_update_disabled = false; |
| 36 | is_initalized = true; | 36 | is_initialized = true; |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | bool HidFirmwareSettings::IsDebugPadEnabled() { | 39 | bool HidFirmwareSettings::IsDebugPadEnabled() { |
diff --git a/src/hid_core/resources/hid_firmware_settings.h b/src/hid_core/resources/hid_firmware_settings.h index 6c10c440b..00201fd94 100644 --- a/src/hid_core/resources/hid_firmware_settings.h +++ b/src/hid_core/resources/hid_firmware_settings.h | |||
| @@ -33,7 +33,7 @@ public: | |||
| 33 | FeaturesPerId FeaturesDisabledPerId(); | 33 | FeaturesPerId FeaturesDisabledPerId(); |
| 34 | 34 | ||
| 35 | private: | 35 | private: |
| 36 | bool is_initalized{}; | 36 | bool is_initialized{}; |
| 37 | 37 | ||
| 38 | // Debug settings | 38 | // Debug settings |
| 39 | bool is_debug_pad_enabled{}; | 39 | bool is_debug_pad_enabled{}; |
diff --git a/src/hid_core/resources/npad/npad_types.h b/src/hid_core/resources/npad/npad_types.h index 074dd40cf..fd86c8e40 100644 --- a/src/hid_core/resources/npad/npad_types.h +++ b/src/hid_core/resources/npad/npad_types.h | |||
| @@ -318,7 +318,7 @@ struct InternalFlags { | |||
| 318 | BitField<1, 1, u32> is_connected; | 318 | BitField<1, 1, u32> is_connected; |
| 319 | BitField<2, 1, u32> is_battery_low_ovln_required; | 319 | BitField<2, 1, u32> is_battery_low_ovln_required; |
| 320 | BitField<3, 1, u32> is_battery_low_ovln_delay_required; | 320 | BitField<3, 1, u32> is_battery_low_ovln_delay_required; |
| 321 | BitField<4, 1, u32> is_sample_recieved; | 321 | BitField<4, 1, u32> is_sample_received; |
| 322 | BitField<5, 1, u32> is_virtual_input; | 322 | BitField<5, 1, u32> is_virtual_input; |
| 323 | BitField<6, 1, u32> is_wired; | 323 | BitField<6, 1, u32> is_wired; |
| 324 | BitField<8, 1, u32> use_center_clamp; | 324 | BitField<8, 1, u32> use_center_clamp; |
diff --git a/src/hid_core/resources/npad/npad_vibration.cpp b/src/hid_core/resources/npad/npad_vibration.cpp index 3bdd55dec..7056e8eab 100644 --- a/src/hid_core/resources/npad/npad_vibration.cpp +++ b/src/hid_core/resources/npad/npad_vibration.cpp | |||
| @@ -15,7 +15,7 @@ Result NpadVibration::Activate() { | |||
| 15 | 15 | ||
| 16 | const f32 master_volume = 1.0f; // nn::settings::system::GetVibrationMasterVolume(); | 16 | const f32 master_volume = 1.0f; // nn::settings::system::GetVibrationMasterVolume(); |
| 17 | // if (master_volume < 0.0f || master_volume > 1.0f) { | 17 | // if (master_volume < 0.0f || master_volume > 1.0f) { |
| 18 | // return ResultVibrationStrenghtOutOfRange; | 18 | // return ResultVibrationStrengthOutOfRange; |
| 19 | // } | 19 | // } |
| 20 | 20 | ||
| 21 | volume = master_volume; | 21 | volume = master_volume; |
| @@ -30,7 +30,7 @@ Result NpadVibration::SetVibrationMasterVolume(f32 master_volume) { | |||
| 30 | std::scoped_lock lock{mutex}; | 30 | std::scoped_lock lock{mutex}; |
| 31 | 31 | ||
| 32 | if (master_volume < 0.0f && master_volume > 1.0f) { | 32 | if (master_volume < 0.0f && master_volume > 1.0f) { |
| 33 | return ResultVibrationStrenghtOutOfRange; | 33 | return ResultVibrationStrengthOutOfRange; |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | volume = master_volume; | 36 | volume = master_volume; |
| @@ -50,7 +50,7 @@ Result NpadVibration::GetVibrationMasterVolume(f32& out_volume) const { | |||
| 50 | 50 | ||
| 51 | const f32 master_volume = 1.0f; // nn::settings::system::GetVibrationMasterVolume(); | 51 | const f32 master_volume = 1.0f; // nn::settings::system::GetVibrationMasterVolume(); |
| 52 | // if (master_volume < 0.0f || master_volume > 1.0f) { | 52 | // if (master_volume < 0.0f || master_volume > 1.0f) { |
| 53 | // return ResultVibrationStrenghtOutOfRange; | 53 | // return ResultVibrationStrengthOutOfRange; |
| 54 | // } | 54 | // } |
| 55 | 55 | ||
| 56 | out_volume = master_volume; | 56 | out_volume = master_volume; |
| @@ -69,7 +69,7 @@ Result NpadVibration::EndPermitVibrationSession() { | |||
| 69 | 69 | ||
| 70 | const f32 master_volume = 1.0f; // nn::settings::system::GetVibrationMasterVolume(); | 70 | const f32 master_volume = 1.0f; // nn::settings::system::GetVibrationMasterVolume(); |
| 71 | // if (master_volume < 0.0f || master_volume > 1.0f) { | 71 | // if (master_volume < 0.0f || master_volume > 1.0f) { |
| 72 | // return ResultVibrationStrenghtOutOfRange; | 72 | // return ResultVibrationStrengthOutOfRange; |
| 73 | // } | 73 | // } |
| 74 | 74 | ||
| 75 | volume = master_volume; | 75 | volume = master_volume; |
diff --git a/src/hid_core/resources/six_axis/six_axis.cpp b/src/hid_core/resources/six_axis/six_axis.cpp index da12d2d5a..abb6fd152 100644 --- a/src/hid_core/resources/six_axis/six_axis.cpp +++ b/src/hid_core/resources/six_axis/six_axis.cpp | |||
| @@ -249,7 +249,7 @@ Result SixAxis::EnableSixAxisSensorUnalteredPassthrough( | |||
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | auto& sixaxis = GetSixaxisState(sixaxis_handle); | 251 | auto& sixaxis = GetSixaxisState(sixaxis_handle); |
| 252 | sixaxis.unaltered_passtrough = is_enabled; | 252 | sixaxis.unaltered_passthrough = is_enabled; |
| 253 | return ResultSuccess; | 253 | return ResultSuccess; |
| 254 | } | 254 | } |
| 255 | 255 | ||
| @@ -262,7 +262,7 @@ Result SixAxis::IsSixAxisSensorUnalteredPassthroughEnabled( | |||
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | const auto& sixaxis = GetSixaxisState(sixaxis_handle); | 264 | const auto& sixaxis = GetSixaxisState(sixaxis_handle); |
| 265 | is_enabled = sixaxis.unaltered_passtrough; | 265 | is_enabled = sixaxis.unaltered_passthrough; |
| 266 | return ResultSuccess; | 266 | return ResultSuccess; |
| 267 | } | 267 | } |
| 268 | 268 | ||
diff --git a/src/hid_core/resources/six_axis/six_axis.h b/src/hid_core/resources/six_axis/six_axis.h index 1054e1b27..b4b00a441 100644 --- a/src/hid_core/resources/six_axis/six_axis.h +++ b/src/hid_core/resources/six_axis/six_axis.h | |||
| @@ -62,7 +62,7 @@ private: | |||
| 62 | 62 | ||
| 63 | struct SixaxisParameters { | 63 | struct SixaxisParameters { |
| 64 | bool is_fusion_enabled{true}; | 64 | bool is_fusion_enabled{true}; |
| 65 | bool unaltered_passtrough{false}; | 65 | bool unaltered_passthrough{false}; |
| 66 | Core::HID::SixAxisSensorFusionParameters fusion{}; | 66 | Core::HID::SixAxisSensorFusionParameters fusion{}; |
| 67 | Core::HID::SixAxisSensorCalibrationParameter calibration{}; | 67 | Core::HID::SixAxisSensorCalibrationParameter calibration{}; |
| 68 | Core::HID::SixAxisSensorIcInformation ic_information{}; | 68 | Core::HID::SixAxisSensorIcInformation ic_information{}; |
diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt index d2fbea488..d0a71a15b 100644 --- a/src/input_common/CMakeLists.txt +++ b/src/input_common/CMakeLists.txt | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | # SPDX-License-Identifier: GPL-2.0-or-later | 2 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | add_library(input_common STATIC | 4 | add_library(input_common STATIC |
| 5 | drivers/android.cpp | ||
| 6 | drivers/android.h | ||
| 5 | drivers/camera.cpp | 7 | drivers/camera.cpp |
| 6 | drivers/camera.h | 8 | drivers/camera.h |
| 7 | drivers/keyboard.cpp | 9 | drivers/keyboard.cpp |
diff --git a/src/input_common/drivers/android.cpp b/src/input_common/drivers/android.cpp new file mode 100644 index 000000000..b6a03fdc0 --- /dev/null +++ b/src/input_common/drivers/android.cpp | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 4 | #include "input_common/drivers/android.h" | ||
| 5 | |||
| 6 | namespace InputCommon { | ||
| 7 | |||
| 8 | Android::Android(std::string input_engine_) : InputEngine(std::move(input_engine_)) {} | ||
| 9 | |||
| 10 | void Android::RegisterController(std::size_t controller_number) { | ||
| 11 | PreSetController(GetIdentifier(controller_number)); | ||
| 12 | } | ||
| 13 | |||
| 14 | void Android::SetButtonState(std::size_t controller_number, int button_id, bool value) { | ||
| 15 | const auto identifier = GetIdentifier(controller_number); | ||
| 16 | SetButton(identifier, button_id, value); | ||
| 17 | } | ||
| 18 | |||
| 19 | void Android::SetAxisState(std::size_t controller_number, int axis_id, float value) { | ||
| 20 | const auto identifier = GetIdentifier(controller_number); | ||
| 21 | SetAxis(identifier, axis_id, value); | ||
| 22 | } | ||
| 23 | |||
| 24 | void Android::SetMotionState(std::size_t controller_number, u64 delta_timestamp, float gyro_x, | ||
| 25 | float gyro_y, float gyro_z, float accel_x, float accel_y, | ||
| 26 | float accel_z) { | ||
| 27 | const auto identifier = GetIdentifier(controller_number); | ||
| 28 | const BasicMotion motion_data{ | ||
| 29 | .gyro_x = gyro_x, | ||
| 30 | .gyro_y = gyro_y, | ||
| 31 | .gyro_z = gyro_z, | ||
| 32 | .accel_x = accel_x, | ||
| 33 | .accel_y = accel_y, | ||
| 34 | .accel_z = accel_z, | ||
| 35 | .delta_timestamp = delta_timestamp, | ||
| 36 | }; | ||
| 37 | SetMotion(identifier, 0, motion_data); | ||
| 38 | } | ||
| 39 | |||
| 40 | PadIdentifier Android::GetIdentifier(std::size_t controller_number) const { | ||
| 41 | return { | ||
| 42 | .guid = Common::UUID{}, | ||
| 43 | .port = controller_number, | ||
| 44 | .pad = 0, | ||
| 45 | }; | ||
| 46 | } | ||
| 47 | |||
| 48 | } // namespace InputCommon | ||
diff --git a/src/input_common/drivers/android.h b/src/input_common/drivers/android.h new file mode 100644 index 000000000..3f01817f6 --- /dev/null +++ b/src/input_common/drivers/android.h | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include "input_common/input_engine.h" | ||
| 7 | |||
| 8 | namespace InputCommon { | ||
| 9 | |||
| 10 | /** | ||
| 11 | * A virtual controller that is always assigned to the game input | ||
| 12 | */ | ||
| 13 | class Android final : public InputEngine { | ||
| 14 | public: | ||
| 15 | explicit Android(std::string input_engine_); | ||
| 16 | |||
| 17 | /** | ||
| 18 | * Registers controller number to accept new inputs | ||
| 19 | * @param controller_number the controller number that will take this action | ||
| 20 | */ | ||
| 21 | void RegisterController(std::size_t controller_number); | ||
| 22 | |||
| 23 | /** | ||
| 24 | * Sets the status of all buttons bound with the key to pressed | ||
| 25 | * @param controller_number the controller number that will take this action | ||
| 26 | * @param button_id the id of the button | ||
| 27 | * @param value indicates if the button is pressed or not | ||
| 28 | */ | ||
| 29 | void SetButtonState(std::size_t controller_number, int button_id, bool value); | ||
| 30 | |||
| 31 | /** | ||
| 32 | * Sets the status of a analog input to a specific player index | ||
| 33 | * @param controller_number the controller number that will take this action | ||
| 34 | * @param axis_id the id of the axis to move | ||
| 35 | * @param value the analog position of the axis | ||
| 36 | */ | ||
| 37 | void SetAxisState(std::size_t controller_number, int axis_id, float value); | ||
| 38 | |||
| 39 | /** | ||
| 40 | * Sets the status of the motion sensor to a specific player index | ||
| 41 | * @param controller_number the controller number that will take this action | ||
| 42 | * @param delta_timestamp time passed since last reading | ||
| 43 | * @param gyro_x,gyro_y,gyro_z the gyro sensor readings | ||
| 44 | * @param accel_x,accel_y,accel_z the accelerometer reading | ||
| 45 | */ | ||
| 46 | void SetMotionState(std::size_t controller_number, u64 delta_timestamp, float gyro_x, | ||
| 47 | float gyro_y, float gyro_z, float accel_x, float accel_y, float accel_z); | ||
| 48 | |||
| 49 | private: | ||
| 50 | /// Returns the correct identifier corresponding to the player index | ||
| 51 | PadIdentifier GetIdentifier(std::size_t controller_number) const; | ||
| 52 | }; | ||
| 53 | |||
| 54 | } // namespace InputCommon | ||
diff --git a/src/input_common/drivers/gc_adapter.cpp b/src/input_common/drivers/gc_adapter.cpp index 1ff296af5..f1184a5fa 100644 --- a/src/input_common/drivers/gc_adapter.cpp +++ b/src/input_common/drivers/gc_adapter.cpp | |||
| @@ -451,11 +451,11 @@ ButtonMapping GCAdapter::GetButtonMappingForDevice(const Common::ParamPackage& p | |||
| 451 | std::tuple{Settings::NativeButton::ZL, PadButton::TriggerL, PadAxes::TriggerLeft}, | 451 | std::tuple{Settings::NativeButton::ZL, PadButton::TriggerL, PadAxes::TriggerLeft}, |
| 452 | {Settings::NativeButton::ZR, PadButton::TriggerR, PadAxes::TriggerRight}, | 452 | {Settings::NativeButton::ZR, PadButton::TriggerR, PadAxes::TriggerRight}, |
| 453 | }; | 453 | }; |
| 454 | for (const auto& [switch_button, gcadapter_buton, gcadapter_axis] : switch_to_gcadapter_axis) { | 454 | for (const auto& [switch_button, gcadapter_button, gcadapter_axis] : switch_to_gcadapter_axis) { |
| 455 | Common::ParamPackage button_params{}; | 455 | Common::ParamPackage button_params{}; |
| 456 | button_params.Set("engine", GetEngineName()); | 456 | button_params.Set("engine", GetEngineName()); |
| 457 | button_params.Set("port", params.Get("port", 0)); | 457 | button_params.Set("port", params.Get("port", 0)); |
| 458 | button_params.Set("button", static_cast<s32>(gcadapter_buton)); | 458 | button_params.Set("button", static_cast<s32>(gcadapter_button)); |
| 459 | button_params.Set("axis", static_cast<s32>(gcadapter_axis)); | 459 | button_params.Set("axis", static_cast<s32>(gcadapter_axis)); |
| 460 | button_params.Set("threshold", 0.5f); | 460 | button_params.Set("threshold", 0.5f); |
| 461 | button_params.Set("range", 1.9f); | 461 | button_params.Set("range", 1.9f); |
diff --git a/src/input_common/helpers/joycon_protocol/irs.cpp b/src/input_common/helpers/joycon_protocol/irs.cpp index 68b0589e3..5bf72114d 100644 --- a/src/input_common/helpers/joycon_protocol/irs.cpp +++ b/src/input_common/helpers/joycon_protocol/irs.cpp | |||
| @@ -236,9 +236,9 @@ Common::Input::DriverResult IrsProtocol::WriteRegistersStep2() { | |||
| 236 | .number_of_registers = 0x8, | 236 | .number_of_registers = 0x8, |
| 237 | .registers = | 237 | .registers = |
| 238 | { | 238 | { |
| 239 | IrsRegister{IrRegistersAddress::LedIntensitiyMSB, | 239 | IrsRegister{IrRegistersAddress::LedIntensityMSB, |
| 240 | static_cast<u8>(led_intensity >> 8)}, | 240 | static_cast<u8>(led_intensity >> 8)}, |
| 241 | {IrRegistersAddress::LedIntensitiyLSB, static_cast<u8>(led_intensity & 0xff)}, | 241 | {IrRegistersAddress::LedIntensityLSB, static_cast<u8>(led_intensity & 0xff)}, |
| 242 | {IrRegistersAddress::ImageFlip, static_cast<u8>(image_flip)}, | 242 | {IrRegistersAddress::ImageFlip, static_cast<u8>(image_flip)}, |
| 243 | {IrRegistersAddress::DenoiseSmoothing, static_cast<u8>((denoise >> 16) & 0xff)}, | 243 | {IrRegistersAddress::DenoiseSmoothing, static_cast<u8>((denoise >> 16) & 0xff)}, |
| 244 | {IrRegistersAddress::DenoiseEdge, static_cast<u8>((denoise >> 8) & 0xff)}, | 244 | {IrRegistersAddress::DenoiseEdge, static_cast<u8>((denoise >> 8) & 0xff)}, |
diff --git a/src/input_common/helpers/joycon_protocol/joycon_types.h b/src/input_common/helpers/joycon_protocol/joycon_types.h index 77a43c67a..792f124e1 100644 --- a/src/input_common/helpers/joycon_protocol/joycon_types.h +++ b/src/input_common/helpers/joycon_protocol/joycon_types.h | |||
| @@ -282,7 +282,7 @@ enum class NFCCommand : u8 { | |||
| 282 | CancelAll = 0x00, | 282 | CancelAll = 0x00, |
| 283 | StartPolling = 0x01, | 283 | StartPolling = 0x01, |
| 284 | StopPolling = 0x02, | 284 | StopPolling = 0x02, |
| 285 | StartWaitingRecieve = 0x04, | 285 | StartWaitingReceive = 0x04, |
| 286 | ReadNtag = 0x06, | 286 | ReadNtag = 0x06, |
| 287 | WriteNtag = 0x08, | 287 | WriteNtag = 0x08, |
| 288 | Mifare = 0x0F, | 288 | Mifare = 0x0F, |
| @@ -382,8 +382,8 @@ enum class IrRegistersAddress : u16 { | |||
| 382 | FinalizeConfig = 0x0700, | 382 | FinalizeConfig = 0x0700, |
| 383 | LedFilter = 0x0e00, | 383 | LedFilter = 0x0e00, |
| 384 | Leds = 0x1000, | 384 | Leds = 0x1000, |
| 385 | LedIntensitiyMSB = 0x1100, | 385 | LedIntensityMSB = 0x1100, |
| 386 | LedIntensitiyLSB = 0x1200, | 386 | LedIntensityLSB = 0x1200, |
| 387 | ImageFlip = 0x2d00, | 387 | ImageFlip = 0x2d00, |
| 388 | Resolution = 0x2e00, | 388 | Resolution = 0x2e00, |
| 389 | DigitalGainLSB = 0x2e01, | 389 | DigitalGainLSB = 0x2e01, |
diff --git a/src/input_common/helpers/joycon_protocol/nfc.cpp b/src/input_common/helpers/joycon_protocol/nfc.cpp index 09953394b..db83f9ef4 100644 --- a/src/input_common/helpers/joycon_protocol/nfc.cpp +++ b/src/input_common/helpers/joycon_protocol/nfc.cpp | |||
| @@ -519,13 +519,13 @@ Common::Input::DriverResult NfcProtocol::GetMifareData( | |||
| 519 | } | 519 | } |
| 520 | 520 | ||
| 521 | if (output.mcu_report == MCUReport::NFCState && output.mcu_data[1] == 0x10) { | 521 | if (output.mcu_report == MCUReport::NFCState && output.mcu_data[1] == 0x10) { |
| 522 | constexpr std::size_t DATA_LENGHT = 0x10 + 1; | 522 | constexpr std::size_t DATA_LENGTH = 0x10 + 1; |
| 523 | constexpr std::size_t DATA_START = 11; | 523 | constexpr std::size_t DATA_START = 11; |
| 524 | const u8 number_of_elements = output.mcu_data[10]; | 524 | const u8 number_of_elements = output.mcu_data[10]; |
| 525 | for (std::size_t i = 0; i < number_of_elements; i++) { | 525 | for (std::size_t i = 0; i < number_of_elements; i++) { |
| 526 | out_data[i].sector = output.mcu_data[DATA_START + (i * DATA_LENGHT)]; | 526 | out_data[i].sector = output.mcu_data[DATA_START + (i * DATA_LENGTH)]; |
| 527 | memcpy(out_data[i].data.data(), | 527 | memcpy(out_data[i].data.data(), |
| 528 | output.mcu_data.data() + DATA_START + 1 + (i * DATA_LENGHT), | 528 | output.mcu_data.data() + DATA_START + 1 + (i * DATA_LENGTH), |
| 529 | sizeof(MifareReadData::data)); | 529 | sizeof(MifareReadData::data)); |
| 530 | } | 530 | } |
| 531 | package_index++; | 531 | package_index++; |
| @@ -659,7 +659,7 @@ Common::Input::DriverResult NfcProtocol::SendStopPollingRequest(MCUCommandRespon | |||
| 659 | Common::Input::DriverResult NfcProtocol::SendNextPackageRequest(MCUCommandResponse& output, | 659 | Common::Input::DriverResult NfcProtocol::SendNextPackageRequest(MCUCommandResponse& output, |
| 660 | u8 packet_id) { | 660 | u8 packet_id) { |
| 661 | NFCRequestState request{ | 661 | NFCRequestState request{ |
| 662 | .command_argument = NFCCommand::StartWaitingRecieve, | 662 | .command_argument = NFCCommand::StartWaitingReceive, |
| 663 | .block_id = {}, | 663 | .block_id = {}, |
| 664 | .packet_id = packet_id, | 664 | .packet_id = packet_id, |
| 665 | .packet_flag = MCUPacketFlag::LastCommandPacket, | 665 | .packet_flag = MCUPacketFlag::LastCommandPacket, |
diff --git a/src/input_common/helpers/joycon_protocol/rumble.cpp b/src/input_common/helpers/joycon_protocol/rumble.cpp index 7647f505e..9fd0b8470 100644 --- a/src/input_common/helpers/joycon_protocol/rumble.cpp +++ b/src/input_common/helpers/joycon_protocol/rumble.cpp | |||
| @@ -67,7 +67,7 @@ u8 RumbleProtocol::EncodeHighAmplitude(f32 amplitude) const { | |||
| 67 | // More information about these values can be found here: | 67 | // More information about these values can be found here: |
| 68 | // https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md | 68 | // https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md |
| 69 | 69 | ||
| 70 | static constexpr std::array<std::pair<f32, int>, 101> high_fequency_amplitude{ | 70 | static constexpr std::array<std::pair<f32, int>, 101> high_frequency_amplitude{ |
| 71 | std::pair<f32, int>{0.0f, 0x0}, | 71 | std::pair<f32, int>{0.0f, 0x0}, |
| 72 | {0.01f, 0x2}, | 72 | {0.01f, 0x2}, |
| 73 | {0.012f, 0x4}, | 73 | {0.012f, 0x4}, |
| @@ -171,20 +171,20 @@ u8 RumbleProtocol::EncodeHighAmplitude(f32 amplitude) const { | |||
| 171 | {1.003f, 0xc8}, | 171 | {1.003f, 0xc8}, |
| 172 | }; | 172 | }; |
| 173 | 173 | ||
| 174 | for (const auto& [amplitude_value, code] : high_fequency_amplitude) { | 174 | for (const auto& [amplitude_value, code] : high_frequency_amplitude) { |
| 175 | if (amplitude <= amplitude_value) { | 175 | if (amplitude <= amplitude_value) { |
| 176 | return static_cast<u8>(code); | 176 | return static_cast<u8>(code); |
| 177 | } | 177 | } |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | return static_cast<u8>(high_fequency_amplitude[high_fequency_amplitude.size() - 1].second); | 180 | return static_cast<u8>(high_frequency_amplitude[high_frequency_amplitude.size() - 1].second); |
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | u16 RumbleProtocol::EncodeLowAmplitude(f32 amplitude) const { | 183 | u16 RumbleProtocol::EncodeLowAmplitude(f32 amplitude) const { |
| 184 | // More information about these values can be found here: | 184 | // More information about these values can be found here: |
| 185 | // https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md | 185 | // https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md |
| 186 | 186 | ||
| 187 | static constexpr std::array<std::pair<f32, int>, 101> high_fequency_amplitude{ | 187 | static constexpr std::array<std::pair<f32, int>, 101> high_frequency_amplitude{ |
| 188 | std::pair<f32, int>{0.0f, 0x0040}, | 188 | std::pair<f32, int>{0.0f, 0x0040}, |
| 189 | {0.01f, 0x8040}, | 189 | {0.01f, 0x8040}, |
| 190 | {0.012f, 0x0041}, | 190 | {0.012f, 0x0041}, |
| @@ -288,13 +288,13 @@ u16 RumbleProtocol::EncodeLowAmplitude(f32 amplitude) const { | |||
| 288 | {1.003f, 0x0072}, | 288 | {1.003f, 0x0072}, |
| 289 | }; | 289 | }; |
| 290 | 290 | ||
| 291 | for (const auto& [amplitude_value, code] : high_fequency_amplitude) { | 291 | for (const auto& [amplitude_value, code] : high_frequency_amplitude) { |
| 292 | if (amplitude <= amplitude_value) { | 292 | if (amplitude <= amplitude_value) { |
| 293 | return static_cast<u16>(code); | 293 | return static_cast<u16>(code); |
| 294 | } | 294 | } |
| 295 | } | 295 | } |
| 296 | 296 | ||
| 297 | return static_cast<u16>(high_fequency_amplitude[high_fequency_amplitude.size() - 1].second); | 297 | return static_cast<u16>(high_frequency_amplitude[high_frequency_amplitude.size() - 1].second); |
| 298 | } | 298 | } |
| 299 | 299 | ||
| 300 | } // namespace InputCommon::Joycon | 300 | } // namespace InputCommon::Joycon |
diff --git a/src/input_common/helpers/udp_protocol.h b/src/input_common/helpers/udp_protocol.h index d9643ffe0..dba9f87d9 100644 --- a/src/input_common/helpers/udp_protocol.h +++ b/src/input_common/helpers/udp_protocol.h | |||
| @@ -78,7 +78,7 @@ namespace Request { | |||
| 78 | enum RegisterFlags : u8 { | 78 | enum RegisterFlags : u8 { |
| 79 | AllPads, | 79 | AllPads, |
| 80 | PadID, | 80 | PadID, |
| 81 | PadMACAdddress, | 81 | PadMACAddress, |
| 82 | }; | 82 | }; |
| 83 | 83 | ||
| 84 | struct Version {}; | 84 | struct Version {}; |
diff --git a/src/input_common/input_mapping.cpp b/src/input_common/input_mapping.cpp index 8c2ee4eb3..f1a1d7398 100644 --- a/src/input_common/input_mapping.cpp +++ b/src/input_common/input_mapping.cpp | |||
| @@ -210,6 +210,9 @@ bool MappingFactory::IsDriverValid(const MappingData& data) const { | |||
| 210 | if (data.engine == "analog_from_button") { | 210 | if (data.engine == "analog_from_button") { |
| 211 | return false; | 211 | return false; |
| 212 | } | 212 | } |
| 213 | if (data.engine == "virtual_gamepad") { | ||
| 214 | return false; | ||
| 215 | } | ||
| 213 | return true; | 216 | return true; |
| 214 | } | 217 | } |
| 215 | 218 | ||
diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp index c77fc04ee..f8749ebbf 100644 --- a/src/input_common/main.cpp +++ b/src/input_common/main.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <memory> | 4 | #include <memory> |
| 5 | #include "common/input.h" | 5 | #include "common/input.h" |
| 6 | #include "common/param_package.h" | 6 | #include "common/param_package.h" |
| 7 | #include "input_common/drivers/android.h" | ||
| 7 | #include "input_common/drivers/camera.h" | 8 | #include "input_common/drivers/camera.h" |
| 8 | #include "input_common/drivers/keyboard.h" | 9 | #include "input_common/drivers/keyboard.h" |
| 9 | #include "input_common/drivers/mouse.h" | 10 | #include "input_common/drivers/mouse.h" |
| @@ -78,6 +79,7 @@ struct InputSubsystem::Impl { | |||
| 78 | RegisterEngine("cemuhookudp", udp_client); | 79 | RegisterEngine("cemuhookudp", udp_client); |
| 79 | RegisterEngine("tas", tas_input); | 80 | RegisterEngine("tas", tas_input); |
| 80 | RegisterEngine("camera", camera); | 81 | RegisterEngine("camera", camera); |
| 82 | RegisterEngine("android", android); | ||
| 81 | RegisterEngine("virtual_amiibo", virtual_amiibo); | 83 | RegisterEngine("virtual_amiibo", virtual_amiibo); |
| 82 | RegisterEngine("virtual_gamepad", virtual_gamepad); | 84 | RegisterEngine("virtual_gamepad", virtual_gamepad); |
| 83 | #ifdef HAVE_SDL2 | 85 | #ifdef HAVE_SDL2 |
| @@ -109,6 +111,7 @@ struct InputSubsystem::Impl { | |||
| 109 | UnregisterEngine(udp_client); | 111 | UnregisterEngine(udp_client); |
| 110 | UnregisterEngine(tas_input); | 112 | UnregisterEngine(tas_input); |
| 111 | UnregisterEngine(camera); | 113 | UnregisterEngine(camera); |
| 114 | UnregisterEngine(android); | ||
| 112 | UnregisterEngine(virtual_amiibo); | 115 | UnregisterEngine(virtual_amiibo); |
| 113 | UnregisterEngine(virtual_gamepad); | 116 | UnregisterEngine(virtual_gamepad); |
| 114 | #ifdef HAVE_SDL2 | 117 | #ifdef HAVE_SDL2 |
| @@ -129,6 +132,8 @@ struct InputSubsystem::Impl { | |||
| 129 | devices.insert(devices.end(), keyboard_devices.begin(), keyboard_devices.end()); | 132 | devices.insert(devices.end(), keyboard_devices.begin(), keyboard_devices.end()); |
| 130 | auto mouse_devices = mouse->GetInputDevices(); | 133 | auto mouse_devices = mouse->GetInputDevices(); |
| 131 | devices.insert(devices.end(), mouse_devices.begin(), mouse_devices.end()); | 134 | devices.insert(devices.end(), mouse_devices.begin(), mouse_devices.end()); |
| 135 | auto android_devices = android->GetInputDevices(); | ||
| 136 | devices.insert(devices.end(), android_devices.begin(), android_devices.end()); | ||
| 132 | #ifdef HAVE_LIBUSB | 137 | #ifdef HAVE_LIBUSB |
| 133 | auto gcadapter_devices = gcadapter->GetInputDevices(); | 138 | auto gcadapter_devices = gcadapter->GetInputDevices(); |
| 134 | devices.insert(devices.end(), gcadapter_devices.begin(), gcadapter_devices.end()); | 139 | devices.insert(devices.end(), gcadapter_devices.begin(), gcadapter_devices.end()); |
| @@ -157,6 +162,9 @@ struct InputSubsystem::Impl { | |||
| 157 | if (engine == mouse->GetEngineName()) { | 162 | if (engine == mouse->GetEngineName()) { |
| 158 | return mouse; | 163 | return mouse; |
| 159 | } | 164 | } |
| 165 | if (engine == android->GetEngineName()) { | ||
| 166 | return android; | ||
| 167 | } | ||
| 160 | #ifdef HAVE_LIBUSB | 168 | #ifdef HAVE_LIBUSB |
| 161 | if (engine == gcadapter->GetEngineName()) { | 169 | if (engine == gcadapter->GetEngineName()) { |
| 162 | return gcadapter; | 170 | return gcadapter; |
| @@ -237,6 +245,9 @@ struct InputSubsystem::Impl { | |||
| 237 | if (engine == mouse->GetEngineName()) { | 245 | if (engine == mouse->GetEngineName()) { |
| 238 | return true; | 246 | return true; |
| 239 | } | 247 | } |
| 248 | if (engine == android->GetEngineName()) { | ||
| 249 | return true; | ||
| 250 | } | ||
| 240 | #ifdef HAVE_LIBUSB | 251 | #ifdef HAVE_LIBUSB |
| 241 | if (engine == gcadapter->GetEngineName()) { | 252 | if (engine == gcadapter->GetEngineName()) { |
| 242 | return true; | 253 | return true; |
| @@ -265,6 +276,7 @@ struct InputSubsystem::Impl { | |||
| 265 | void BeginConfiguration() { | 276 | void BeginConfiguration() { |
| 266 | keyboard->BeginConfiguration(); | 277 | keyboard->BeginConfiguration(); |
| 267 | mouse->BeginConfiguration(); | 278 | mouse->BeginConfiguration(); |
| 279 | android->BeginConfiguration(); | ||
| 268 | #ifdef HAVE_LIBUSB | 280 | #ifdef HAVE_LIBUSB |
| 269 | gcadapter->BeginConfiguration(); | 281 | gcadapter->BeginConfiguration(); |
| 270 | #endif | 282 | #endif |
| @@ -278,6 +290,7 @@ struct InputSubsystem::Impl { | |||
| 278 | void EndConfiguration() { | 290 | void EndConfiguration() { |
| 279 | keyboard->EndConfiguration(); | 291 | keyboard->EndConfiguration(); |
| 280 | mouse->EndConfiguration(); | 292 | mouse->EndConfiguration(); |
| 293 | android->EndConfiguration(); | ||
| 281 | #ifdef HAVE_LIBUSB | 294 | #ifdef HAVE_LIBUSB |
| 282 | gcadapter->EndConfiguration(); | 295 | gcadapter->EndConfiguration(); |
| 283 | #endif | 296 | #endif |
| @@ -308,6 +321,7 @@ struct InputSubsystem::Impl { | |||
| 308 | std::shared_ptr<TasInput::Tas> tas_input; | 321 | std::shared_ptr<TasInput::Tas> tas_input; |
| 309 | std::shared_ptr<CemuhookUDP::UDPClient> udp_client; | 322 | std::shared_ptr<CemuhookUDP::UDPClient> udp_client; |
| 310 | std::shared_ptr<Camera> camera; | 323 | std::shared_ptr<Camera> camera; |
| 324 | std::shared_ptr<Android> android; | ||
| 311 | std::shared_ptr<VirtualAmiibo> virtual_amiibo; | 325 | std::shared_ptr<VirtualAmiibo> virtual_amiibo; |
| 312 | std::shared_ptr<VirtualGamepad> virtual_gamepad; | 326 | std::shared_ptr<VirtualGamepad> virtual_gamepad; |
| 313 | 327 | ||
| @@ -373,6 +387,14 @@ const Camera* InputSubsystem::GetCamera() const { | |||
| 373 | return impl->camera.get(); | 387 | return impl->camera.get(); |
| 374 | } | 388 | } |
| 375 | 389 | ||
| 390 | Android* InputSubsystem::GetAndroid() { | ||
| 391 | return impl->android.get(); | ||
| 392 | } | ||
| 393 | |||
| 394 | const Android* InputSubsystem::GetAndroid() const { | ||
| 395 | return impl->android.get(); | ||
| 396 | } | ||
| 397 | |||
| 376 | VirtualAmiibo* InputSubsystem::GetVirtualAmiibo() { | 398 | VirtualAmiibo* InputSubsystem::GetVirtualAmiibo() { |
| 377 | return impl->virtual_amiibo.get(); | 399 | return impl->virtual_amiibo.get(); |
| 378 | } | 400 | } |
diff --git a/src/input_common/main.h b/src/input_common/main.h index d64a6cb4c..1d19019ee 100644 --- a/src/input_common/main.h +++ b/src/input_common/main.h | |||
| @@ -29,6 +29,7 @@ enum Values : int; | |||
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | namespace InputCommon { | 31 | namespace InputCommon { |
| 32 | class Android; | ||
| 32 | class Camera; | 33 | class Camera; |
| 33 | class Keyboard; | 34 | class Keyboard; |
| 34 | class Mouse; | 35 | class Mouse; |
| @@ -103,6 +104,12 @@ public: | |||
| 103 | /// Retrieves the underlying camera input device. | 104 | /// Retrieves the underlying camera input device. |
| 104 | [[nodiscard]] const Camera* GetCamera() const; | 105 | [[nodiscard]] const Camera* GetCamera() const; |
| 105 | 106 | ||
| 107 | /// Retrieves the underlying android input device. | ||
| 108 | [[nodiscard]] Android* GetAndroid(); | ||
| 109 | |||
| 110 | /// Retrieves the underlying android input device. | ||
| 111 | [[nodiscard]] const Android* GetAndroid() const; | ||
| 112 | |||
| 106 | /// Retrieves the underlying virtual amiibo input device. | 113 | /// Retrieves the underlying virtual amiibo input device. |
| 107 | [[nodiscard]] VirtualAmiibo* GetVirtualAmiibo(); | 114 | [[nodiscard]] VirtualAmiibo* GetVirtualAmiibo(); |
| 108 | 115 | ||
diff --git a/src/network/room_member.cpp b/src/network/room_member.cpp index b94cb24ad..a6845273c 100644 --- a/src/network/room_member.cpp +++ b/src/network/room_member.cpp | |||
| @@ -724,7 +724,7 @@ RoomMember::CallbackHandle<RoomInformation> RoomMember::BindOnRoomInformationCha | |||
| 724 | return room_member_impl->Bind(callback); | 724 | return room_member_impl->Bind(callback); |
| 725 | } | 725 | } |
| 726 | 726 | ||
| 727 | RoomMember::CallbackHandle<ChatEntry> RoomMember::BindOnChatMessageRecieved( | 727 | RoomMember::CallbackHandle<ChatEntry> RoomMember::BindOnChatMessageReceived( |
| 728 | std::function<void(const ChatEntry&)> callback) { | 728 | std::function<void(const ChatEntry&)> callback) { |
| 729 | return room_member_impl->Bind(callback); | 729 | return room_member_impl->Bind(callback); |
| 730 | } | 730 | } |
diff --git a/src/network/room_member.h b/src/network/room_member.h index 33ac18e72..37e9ea16a 100644 --- a/src/network/room_member.h +++ b/src/network/room_member.h | |||
| @@ -254,7 +254,7 @@ public: | |||
| 254 | * @param callback The function to call | 254 | * @param callback The function to call |
| 255 | * @return A handle used for removing the function from the registered list | 255 | * @return A handle used for removing the function from the registered list |
| 256 | */ | 256 | */ |
| 257 | CallbackHandle<ChatEntry> BindOnChatMessageRecieved( | 257 | CallbackHandle<ChatEntry> BindOnChatMessageReceived( |
| 258 | std::function<void(const ChatEntry&)> callback); | 258 | std::function<void(const ChatEntry&)> callback); |
| 259 | 259 | ||
| 260 | /** | 260 | /** |
diff --git a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp index b2ceeefc4..c5ac7b8f2 100644 --- a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp | |||
| @@ -608,8 +608,8 @@ std::string EmitContext::DefineGlobalMemoryFunctions() { | |||
| 608 | const auto aligned_low_addr{fmt::format("{}&{}", addr_xy[0], ssbo_align_mask)}; | 608 | const auto aligned_low_addr{fmt::format("{}&{}", addr_xy[0], ssbo_align_mask)}; |
| 609 | const auto aligned_addr{fmt::format("uvec2({},{})", aligned_low_addr, addr_xy[1])}; | 609 | const auto aligned_addr{fmt::format("uvec2({},{})", aligned_low_addr, addr_xy[1])}; |
| 610 | const auto addr_pack{fmt::format("packUint2x32({})", aligned_addr)}; | 610 | const auto addr_pack{fmt::format("packUint2x32({})", aligned_addr)}; |
| 611 | const auto addr_statment{fmt::format("uint64_t {}={};", ssbo_addr, addr_pack)}; | 611 | const auto addr_statement{fmt::format("uint64_t {}={};", ssbo_addr, addr_pack)}; |
| 612 | func += addr_statment; | 612 | func += addr_statement; |
| 613 | 613 | ||
| 614 | const auto size_vec{fmt::format("uvec2({},{})", size_xy[0], size_xy[1])}; | 614 | const auto size_vec{fmt::format("uvec2({},{})", size_xy[0], size_xy[1])}; |
| 615 | const auto comp_lhs{fmt::format("(addr>={})", ssbo_addr)}; | 615 | const auto comp_lhs{fmt::format("(addr>={})", ssbo_addr)}; |
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp index 800754554..64a4e0e55 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | |||
| @@ -12,6 +12,11 @@ namespace Shader::Backend::SPIRV { | |||
| 12 | namespace { | 12 | namespace { |
| 13 | class ImageOperands { | 13 | class ImageOperands { |
| 14 | public: | 14 | public: |
| 15 | [[maybe_unused]] static constexpr bool ImageSampleOffsetAllowed = false; | ||
| 16 | [[maybe_unused]] static constexpr bool ImageGatherOffsetAllowed = true; | ||
| 17 | [[maybe_unused]] static constexpr bool ImageFetchOffsetAllowed = false; | ||
| 18 | [[maybe_unused]] static constexpr bool ImageGradientOffsetAllowed = false; | ||
| 19 | |||
| 15 | explicit ImageOperands(EmitContext& ctx, bool has_bias, bool has_lod, bool has_lod_clamp, | 20 | explicit ImageOperands(EmitContext& ctx, bool has_bias, bool has_lod, bool has_lod_clamp, |
| 16 | Id lod, const IR::Value& offset) { | 21 | Id lod, const IR::Value& offset) { |
| 17 | if (has_bias) { | 22 | if (has_bias) { |
| @@ -22,7 +27,7 @@ public: | |||
| 22 | const Id lod_value{has_lod_clamp ? ctx.OpCompositeExtract(ctx.F32[1], lod, 0) : lod}; | 27 | const Id lod_value{has_lod_clamp ? ctx.OpCompositeExtract(ctx.F32[1], lod, 0) : lod}; |
| 23 | Add(spv::ImageOperandsMask::Lod, lod_value); | 28 | Add(spv::ImageOperandsMask::Lod, lod_value); |
| 24 | } | 29 | } |
| 25 | AddOffset(ctx, offset); | 30 | AddOffset(ctx, offset, ImageSampleOffsetAllowed); |
| 26 | if (has_lod_clamp) { | 31 | if (has_lod_clamp) { |
| 27 | const Id lod_clamp{has_bias ? ctx.OpCompositeExtract(ctx.F32[1], lod, 1) : lod}; | 32 | const Id lod_clamp{has_bias ? ctx.OpCompositeExtract(ctx.F32[1], lod, 1) : lod}; |
| 28 | Add(spv::ImageOperandsMask::MinLod, lod_clamp); | 33 | Add(spv::ImageOperandsMask::MinLod, lod_clamp); |
| @@ -55,20 +60,17 @@ public: | |||
| 55 | Add(spv::ImageOperandsMask::ConstOffsets, offsets); | 60 | Add(spv::ImageOperandsMask::ConstOffsets, offsets); |
| 56 | } | 61 | } |
| 57 | 62 | ||
| 58 | explicit ImageOperands(Id offset, Id lod, Id ms) { | 63 | explicit ImageOperands(Id lod, Id ms) { |
| 59 | if (Sirit::ValidId(lod)) { | 64 | if (Sirit::ValidId(lod)) { |
| 60 | Add(spv::ImageOperandsMask::Lod, lod); | 65 | Add(spv::ImageOperandsMask::Lod, lod); |
| 61 | } | 66 | } |
| 62 | if (Sirit::ValidId(offset)) { | ||
| 63 | Add(spv::ImageOperandsMask::Offset, offset); | ||
| 64 | } | ||
| 65 | if (Sirit::ValidId(ms)) { | 67 | if (Sirit::ValidId(ms)) { |
| 66 | Add(spv::ImageOperandsMask::Sample, ms); | 68 | Add(spv::ImageOperandsMask::Sample, ms); |
| 67 | } | 69 | } |
| 68 | } | 70 | } |
| 69 | 71 | ||
| 70 | explicit ImageOperands(EmitContext& ctx, bool has_lod_clamp, Id derivatives, | 72 | explicit ImageOperands(EmitContext& ctx, bool has_lod_clamp, Id derivatives, |
| 71 | u32 num_derivatives, Id offset, Id lod_clamp) { | 73 | u32 num_derivatives, const IR::Value& offset, Id lod_clamp) { |
| 72 | if (!Sirit::ValidId(derivatives)) { | 74 | if (!Sirit::ValidId(derivatives)) { |
| 73 | throw LogicError("Derivatives must be present"); | 75 | throw LogicError("Derivatives must be present"); |
| 74 | } | 76 | } |
| @@ -83,16 +85,14 @@ public: | |||
| 83 | const Id derivatives_Y{ctx.OpCompositeConstruct( | 85 | const Id derivatives_Y{ctx.OpCompositeConstruct( |
| 84 | ctx.F32[num_derivatives], std::span{deriv_y_accum.data(), deriv_y_accum.size()})}; | 86 | ctx.F32[num_derivatives], std::span{deriv_y_accum.data(), deriv_y_accum.size()})}; |
| 85 | Add(spv::ImageOperandsMask::Grad, derivatives_X, derivatives_Y); | 87 | Add(spv::ImageOperandsMask::Grad, derivatives_X, derivatives_Y); |
| 86 | if (Sirit::ValidId(offset)) { | 88 | AddOffset(ctx, offset, ImageGradientOffsetAllowed); |
| 87 | Add(spv::ImageOperandsMask::Offset, offset); | ||
| 88 | } | ||
| 89 | if (has_lod_clamp) { | 89 | if (has_lod_clamp) { |
| 90 | Add(spv::ImageOperandsMask::MinLod, lod_clamp); | 90 | Add(spv::ImageOperandsMask::MinLod, lod_clamp); |
| 91 | } | 91 | } |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | explicit ImageOperands(EmitContext& ctx, bool has_lod_clamp, Id derivatives_1, Id derivatives_2, | 94 | explicit ImageOperands(EmitContext& ctx, bool has_lod_clamp, Id derivatives_1, Id derivatives_2, |
| 95 | Id offset, Id lod_clamp) { | 95 | const IR::Value& offset, Id lod_clamp) { |
| 96 | if (!Sirit::ValidId(derivatives_1) || !Sirit::ValidId(derivatives_2)) { | 96 | if (!Sirit::ValidId(derivatives_1) || !Sirit::ValidId(derivatives_2)) { |
| 97 | throw LogicError("Derivatives must be present"); | 97 | throw LogicError("Derivatives must be present"); |
| 98 | } | 98 | } |
| @@ -111,9 +111,7 @@ public: | |||
| 111 | const Id derivatives_id2{ctx.OpCompositeConstruct( | 111 | const Id derivatives_id2{ctx.OpCompositeConstruct( |
| 112 | ctx.F32[3], std::span{deriv_2_accum.data(), deriv_2_accum.size()})}; | 112 | ctx.F32[3], std::span{deriv_2_accum.data(), deriv_2_accum.size()})}; |
| 113 | Add(spv::ImageOperandsMask::Grad, derivatives_id1, derivatives_id2); | 113 | Add(spv::ImageOperandsMask::Grad, derivatives_id1, derivatives_id2); |
| 114 | if (Sirit::ValidId(offset)) { | 114 | AddOffset(ctx, offset, ImageGradientOffsetAllowed); |
| 115 | Add(spv::ImageOperandsMask::Offset, offset); | ||
| 116 | } | ||
| 117 | if (has_lod_clamp) { | 115 | if (has_lod_clamp) { |
| 118 | Add(spv::ImageOperandsMask::MinLod, lod_clamp); | 116 | Add(spv::ImageOperandsMask::MinLod, lod_clamp); |
| 119 | } | 117 | } |
| @@ -132,7 +130,7 @@ public: | |||
| 132 | } | 130 | } |
| 133 | 131 | ||
| 134 | private: | 132 | private: |
| 135 | void AddOffset(EmitContext& ctx, const IR::Value& offset) { | 133 | void AddOffset(EmitContext& ctx, const IR::Value& offset, bool runtime_offset_allowed) { |
| 136 | if (offset.IsEmpty()) { | 134 | if (offset.IsEmpty()) { |
| 137 | return; | 135 | return; |
| 138 | } | 136 | } |
| @@ -165,7 +163,9 @@ private: | |||
| 165 | break; | 163 | break; |
| 166 | } | 164 | } |
| 167 | } | 165 | } |
| 168 | Add(spv::ImageOperandsMask::Offset, ctx.Def(offset)); | 166 | if (runtime_offset_allowed) { |
| 167 | Add(spv::ImageOperandsMask::Offset, ctx.Def(offset)); | ||
| 168 | } | ||
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | void Add(spv::ImageOperandsMask new_mask, Id value) { | 171 | void Add(spv::ImageOperandsMask new_mask, Id value) { |
| @@ -311,6 +311,37 @@ Id ImageGatherSubpixelOffset(EmitContext& ctx, const IR::TextureInstInfo& info, | |||
| 311 | return coords; | 311 | return coords; |
| 312 | } | 312 | } |
| 313 | } | 313 | } |
| 314 | |||
| 315 | void AddOffsetToCoordinates(EmitContext& ctx, const IR::TextureInstInfo& info, Id& coords, | ||
| 316 | Id offset) { | ||
| 317 | if (!Sirit::ValidId(offset)) { | ||
| 318 | return; | ||
| 319 | } | ||
| 320 | |||
| 321 | Id result_type{}; | ||
| 322 | switch (info.type) { | ||
| 323 | case TextureType::Buffer: | ||
| 324 | case TextureType::Color1D: | ||
| 325 | case TextureType::ColorArray1D: { | ||
| 326 | result_type = ctx.U32[1]; | ||
| 327 | break; | ||
| 328 | } | ||
| 329 | case TextureType::Color2D: | ||
| 330 | case TextureType::Color2DRect: | ||
| 331 | case TextureType::ColorArray2D: { | ||
| 332 | result_type = ctx.U32[2]; | ||
| 333 | break; | ||
| 334 | } | ||
| 335 | case TextureType::Color3D: { | ||
| 336 | result_type = ctx.U32[3]; | ||
| 337 | break; | ||
| 338 | } | ||
| 339 | case TextureType::ColorCube: | ||
| 340 | case TextureType::ColorArrayCube: | ||
| 341 | return; | ||
| 342 | } | ||
| 343 | coords = ctx.OpIAdd(result_type, coords, offset); | ||
| 344 | } | ||
| 314 | } // Anonymous namespace | 345 | } // Anonymous namespace |
| 315 | 346 | ||
| 316 | Id EmitBindlessImageSampleImplicitLod(EmitContext&) { | 347 | Id EmitBindlessImageSampleImplicitLod(EmitContext&) { |
| @@ -496,6 +527,7 @@ Id EmitImageGatherDref(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, | |||
| 496 | Id EmitImageFetch(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, Id offset, | 527 | Id EmitImageFetch(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, Id offset, |
| 497 | Id lod, Id ms) { | 528 | Id lod, Id ms) { |
| 498 | const auto info{inst->Flags<IR::TextureInstInfo>()}; | 529 | const auto info{inst->Flags<IR::TextureInstInfo>()}; |
| 530 | AddOffsetToCoordinates(ctx, info, coords, offset); | ||
| 499 | if (info.type == TextureType::Buffer) { | 531 | if (info.type == TextureType::Buffer) { |
| 500 | lod = Id{}; | 532 | lod = Id{}; |
| 501 | } | 533 | } |
| @@ -503,7 +535,7 @@ Id EmitImageFetch(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id c | |||
| 503 | // This image is multisampled, lod must be implicit | 535 | // This image is multisampled, lod must be implicit |
| 504 | lod = Id{}; | 536 | lod = Id{}; |
| 505 | } | 537 | } |
| 506 | const ImageOperands operands(offset, lod, ms); | 538 | const ImageOperands operands(lod, ms); |
| 507 | return Emit(&EmitContext::OpImageSparseFetch, &EmitContext::OpImageFetch, ctx, inst, ctx.F32[4], | 539 | return Emit(&EmitContext::OpImageSparseFetch, &EmitContext::OpImageFetch, ctx, inst, ctx.F32[4], |
| 508 | TextureImage(ctx, info, index), coords, operands.MaskOptional(), operands.Span()); | 540 | TextureImage(ctx, info, index), coords, operands.MaskOptional(), operands.Span()); |
| 509 | } | 541 | } |
| @@ -548,13 +580,13 @@ Id EmitImageQueryLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, I | |||
| 548 | } | 580 | } |
| 549 | 581 | ||
| 550 | Id EmitImageGradient(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, | 582 | Id EmitImageGradient(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, |
| 551 | Id derivatives, Id offset, Id lod_clamp) { | 583 | Id derivatives, const IR::Value& offset, Id lod_clamp) { |
| 552 | const auto info{inst->Flags<IR::TextureInstInfo>()}; | 584 | const auto info{inst->Flags<IR::TextureInstInfo>()}; |
| 553 | const auto operands = | 585 | const auto operands = info.num_derivatives == 3 |
| 554 | info.num_derivatives == 3 | 586 | ? ImageOperands(ctx, info.has_lod_clamp != 0, derivatives, |
| 555 | ? ImageOperands(ctx, info.has_lod_clamp != 0, derivatives, offset, {}, lod_clamp) | 587 | ctx.Def(offset), {}, lod_clamp) |
| 556 | : ImageOperands(ctx, info.has_lod_clamp != 0, derivatives, info.num_derivatives, offset, | 588 | : ImageOperands(ctx, info.has_lod_clamp != 0, derivatives, |
| 557 | lod_clamp); | 589 | info.num_derivatives, offset, lod_clamp); |
| 558 | return Emit(&EmitContext::OpImageSparseSampleExplicitLod, | 590 | return Emit(&EmitContext::OpImageSparseSampleExplicitLod, |
| 559 | &EmitContext::OpImageSampleExplicitLod, ctx, inst, ctx.F32[4], | 591 | &EmitContext::OpImageSampleExplicitLod, ctx, inst, ctx.F32[4], |
| 560 | Texture(ctx, info, index), coords, operands.Mask(), operands.Span()); | 592 | Texture(ctx, info, index), coords, operands.Mask(), operands.Span()); |
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h b/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h index 7d34575c8..5c01b1012 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h | |||
| @@ -543,7 +543,7 @@ Id EmitImageQueryDimensions(EmitContext& ctx, IR::Inst* inst, const IR::Value& i | |||
| 543 | const IR::Value& skip_mips); | 543 | const IR::Value& skip_mips); |
| 544 | Id EmitImageQueryLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords); | 544 | Id EmitImageQueryLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords); |
| 545 | Id EmitImageGradient(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, | 545 | Id EmitImageGradient(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, |
| 546 | Id derivatives, Id offset, Id lod_clamp); | 546 | Id derivatives, const IR::Value& offset, Id lod_clamp); |
| 547 | Id EmitImageRead(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords); | 547 | Id EmitImageRead(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords); |
| 548 | void EmitImageWrite(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, Id color); | 548 | void EmitImageWrite(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, Id color); |
| 549 | Id EmitIsTextureScaled(EmitContext& ctx, const IR::Value& index); | 549 | Id EmitIsTextureScaled(EmitContext& ctx, const IR::Value& index); |
diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index f8d8ca80a..51e7ab1e1 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h | |||
| @@ -55,7 +55,7 @@ public: | |||
| 55 | /// Requests to begin a renderpass. | 55 | /// Requests to begin a renderpass. |
| 56 | void RequestRenderpass(const Framebuffer* framebuffer); | 56 | void RequestRenderpass(const Framebuffer* framebuffer); |
| 57 | 57 | ||
| 58 | /// Requests the current executino context to be able to execute operations only allowed outside | 58 | /// Requests the current execution context to be able to execute operations only allowed outside |
| 59 | /// of a renderpass. | 59 | /// of a renderpass. |
| 60 | void RequestOutsideRenderPassOperationContext(); | 60 | void RequestOutsideRenderPassOperationContext(); |
| 61 | 61 | ||
diff --git a/src/yuzu/applets/qt_amiibo_settings.cpp b/src/yuzu/applets/qt_amiibo_settings.cpp index b457a736a..b91796dde 100644 --- a/src/yuzu/applets/qt_amiibo_settings.cpp +++ b/src/yuzu/applets/qt_amiibo_settings.cpp | |||
| @@ -36,7 +36,7 @@ QtAmiiboSettingsDialog::QtAmiiboSettingsDialog(QWidget* parent, | |||
| 36 | QtAmiiboSettingsDialog::~QtAmiiboSettingsDialog() = default; | 36 | QtAmiiboSettingsDialog::~QtAmiiboSettingsDialog() = default; |
| 37 | 37 | ||
| 38 | int QtAmiiboSettingsDialog::exec() { | 38 | int QtAmiiboSettingsDialog::exec() { |
| 39 | if (!is_initalized) { | 39 | if (!is_initialized) { |
| 40 | return QDialog::Rejected; | 40 | return QDialog::Rejected; |
| 41 | } | 41 | } |
| 42 | return QDialog::exec(); | 42 | return QDialog::exec(); |
| @@ -66,7 +66,7 @@ void QtAmiiboSettingsDialog::LoadInfo() { | |||
| 66 | QString::fromStdString(input_subsystem->GetVirtualAmiibo()->GetLastFilePath())); | 66 | QString::fromStdString(input_subsystem->GetVirtualAmiibo()->GetLastFilePath())); |
| 67 | 67 | ||
| 68 | SetSettingsDescription(); | 68 | SetSettingsDescription(); |
| 69 | is_initalized = true; | 69 | is_initialized = true; |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | void QtAmiiboSettingsDialog::LoadAmiiboInfo() { | 72 | void QtAmiiboSettingsDialog::LoadAmiiboInfo() { |
diff --git a/src/yuzu/applets/qt_amiibo_settings.h b/src/yuzu/applets/qt_amiibo_settings.h index ee66a0255..3833cf6f2 100644 --- a/src/yuzu/applets/qt_amiibo_settings.h +++ b/src/yuzu/applets/qt_amiibo_settings.h | |||
| @@ -58,7 +58,7 @@ private: | |||
| 58 | Core::Frontend::CabinetParameters parameters; | 58 | Core::Frontend::CabinetParameters parameters; |
| 59 | 59 | ||
| 60 | // If false amiibo settings failed to load | 60 | // If false amiibo settings failed to load |
| 61 | bool is_initalized{}; | 61 | bool is_initialized{}; |
| 62 | }; | 62 | }; |
| 63 | 63 | ||
| 64 | class QtAmiiboSettings final : public QObject, public Core::Frontend::CabinetApplet { | 64 | class QtAmiiboSettings final : public QObject, public Core::Frontend::CabinetApplet { |
diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h index 60edd464c..ae12b3481 100644 --- a/src/yuzu/bootmanager.h +++ b/src/yuzu/bootmanager.h | |||
| @@ -170,7 +170,7 @@ public: | |||
| 170 | 170 | ||
| 171 | void resizeEvent(QResizeEvent* event) override; | 171 | void resizeEvent(QResizeEvent* event) override; |
| 172 | 172 | ||
| 173 | /// Converts a Qt keybard key into NativeKeyboard key | 173 | /// Converts a Qt keyboard key into NativeKeyboard key |
| 174 | static int QtKeyToSwitchKey(Qt::Key qt_keys); | 174 | static int QtKeyToSwitchKey(Qt::Key qt_keys); |
| 175 | 175 | ||
| 176 | /// Converts a Qt modifier keys into NativeKeyboard modifier keys | 176 | /// Converts a Qt modifier keys into NativeKeyboard modifier keys |
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index 5dac9f1e7..400917f9d 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp | |||
| @@ -1650,9 +1650,21 @@ void ConfigureInputPlayer::SaveProfile() { | |||
| 1650 | void ConfigureInputPlayer::UpdateInputProfiles() { | 1650 | void ConfigureInputPlayer::UpdateInputProfiles() { |
| 1651 | ui->comboProfiles->clear(); | 1651 | ui->comboProfiles->clear(); |
| 1652 | 1652 | ||
| 1653 | for (const auto& profile_name : profiles->GetInputProfileNames()) { | 1653 | // Set current profile as empty by default |
| 1654 | int profile_index = -1; | ||
| 1655 | |||
| 1656 | // Add every available profile and search the player profile to set it as current one | ||
| 1657 | auto& current_profile = Settings::values.players.GetValue()[player_index].profile_name; | ||
| 1658 | std::vector<std::string> profile_names = profiles->GetInputProfileNames(); | ||
| 1659 | std::string profile_name; | ||
| 1660 | for (size_t i = 0; i < profile_names.size(); i++) { | ||
| 1661 | profile_name = profile_names[i]; | ||
| 1654 | ui->comboProfiles->addItem(QString::fromStdString(profile_name)); | 1662 | ui->comboProfiles->addItem(QString::fromStdString(profile_name)); |
| 1663 | if (current_profile == profile_name) { | ||
| 1664 | profile_index = (int)i; | ||
| 1665 | } | ||
| 1655 | } | 1666 | } |
| 1656 | 1667 | ||
| 1657 | ui->comboProfiles->setCurrentIndex(-1); | 1668 | LOG_DEBUG(Frontend, "Setting the current input profile to index {}", profile_index); |
| 1669 | ui->comboProfiles->setCurrentIndex(profile_index); | ||
| 1658 | } | 1670 | } |
diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp index 8f91f5e92..b3d9d8006 100644 --- a/src/yuzu/configuration/configure_input_player_widget.cpp +++ b/src/yuzu/configuration/configure_input_player_widget.cpp | |||
| @@ -845,12 +845,12 @@ void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center) | |||
| 845 | DrawSymbol(p, face_center + QPoint(-face_distance, 1), Symbol::Y, text_size); | 845 | DrawSymbol(p, face_center + QPoint(-face_distance, 1), Symbol::Y, text_size); |
| 846 | 846 | ||
| 847 | // D-pad buttons | 847 | // D-pad buttons |
| 848 | const QPointF dpad_postion = center + QPoint(-61, 0); | 848 | const QPointF dpad_position = center + QPoint(-61, 0); |
| 849 | DrawArrowButton(p, dpad_postion, Direction::Up, button_values[DUp]); | 849 | DrawArrowButton(p, dpad_position, Direction::Up, button_values[DUp]); |
| 850 | DrawArrowButton(p, dpad_postion, Direction::Left, button_values[DLeft]); | 850 | DrawArrowButton(p, dpad_position, Direction::Left, button_values[DLeft]); |
| 851 | DrawArrowButton(p, dpad_postion, Direction::Right, button_values[DRight]); | 851 | DrawArrowButton(p, dpad_position, Direction::Right, button_values[DRight]); |
| 852 | DrawArrowButton(p, dpad_postion, Direction::Down, button_values[DDown]); | 852 | DrawArrowButton(p, dpad_position, Direction::Down, button_values[DDown]); |
| 853 | DrawArrowButtonOutline(p, dpad_postion); | 853 | DrawArrowButtonOutline(p, dpad_position); |
| 854 | 854 | ||
| 855 | // ZL and ZR buttons | 855 | // ZL and ZR buttons |
| 856 | p.setPen(colors.outline); | 856 | p.setPen(colors.outline); |
| @@ -935,13 +935,13 @@ void PlayerControlPreview::DrawGCController(QPainter& p, const QPointF center) { | |||
| 935 | DrawSymbol(p, center + QPoint(100, -83), Symbol::Y, text_size); | 935 | DrawSymbol(p, center + QPoint(100, -83), Symbol::Y, text_size); |
| 936 | 936 | ||
| 937 | // D-pad buttons | 937 | // D-pad buttons |
| 938 | const QPointF dpad_postion = center + QPoint(-61, 37); | 938 | const QPointF dpad_position = center + QPoint(-61, 37); |
| 939 | const float dpad_size = 0.8f; | 939 | const float dpad_size = 0.8f; |
| 940 | DrawArrowButton(p, dpad_postion, Direction::Up, button_values[DUp], dpad_size); | 940 | DrawArrowButton(p, dpad_position, Direction::Up, button_values[DUp], dpad_size); |
| 941 | DrawArrowButton(p, dpad_postion, Direction::Left, button_values[DLeft], dpad_size); | 941 | DrawArrowButton(p, dpad_position, Direction::Left, button_values[DLeft], dpad_size); |
| 942 | DrawArrowButton(p, dpad_postion, Direction::Right, button_values[DRight], dpad_size); | 942 | DrawArrowButton(p, dpad_position, Direction::Right, button_values[DRight], dpad_size); |
| 943 | DrawArrowButton(p, dpad_postion, Direction::Down, button_values[DDown], dpad_size); | 943 | DrawArrowButton(p, dpad_position, Direction::Down, button_values[DDown], dpad_size); |
| 944 | DrawArrowButtonOutline(p, dpad_postion, dpad_size); | 944 | DrawArrowButtonOutline(p, dpad_position, dpad_size); |
| 945 | 945 | ||
| 946 | // Minus and Plus buttons | 946 | // Minus and Plus buttons |
| 947 | p.setPen(colors.outline); | 947 | p.setPen(colors.outline); |
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index 7cbf43775..b0b84f967 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp | |||
| @@ -121,7 +121,7 @@ void ConfigureSystem::Setup(const ConfigurationShared::Builder& builder) { | |||
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | if (setting->Id() == Settings::values.region_index.Id()) { | 123 | if (setting->Id() == Settings::values.region_index.Id()) { |
| 124 | // Keep track of the region_index (and langauge_index) combobox to validate the selected | 124 | // Keep track of the region_index (and language_index) combobox to validate the selected |
| 125 | // settings | 125 | // settings |
| 126 | combo_region = widget->combobox; | 126 | combo_region = widget->combobox; |
| 127 | } else if (setting->Id() == Settings::values.language_index.Id()) { | 127 | } else if (setting->Id() == Settings::values.language_index.Id()) { |
diff --git a/src/yuzu/configuration/input_profiles.cpp b/src/yuzu/configuration/input_profiles.cpp index 716efbccd..ebebadc94 100644 --- a/src/yuzu/configuration/input_profiles.cpp +++ b/src/yuzu/configuration/input_profiles.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #include "common/fs/fs.h" | 6 | #include "common/fs/fs.h" |
| 7 | #include "common/fs/path_util.h" | 7 | #include "common/fs/path_util.h" |
| 8 | #include "common/logging/log.h" | ||
| 8 | #include "frontend_common/config.h" | 9 | #include "frontend_common/config.h" |
| 9 | #include "yuzu/configuration/input_profiles.h" | 10 | #include "yuzu/configuration/input_profiles.h" |
| 10 | 11 | ||
| @@ -113,6 +114,8 @@ bool InputProfiles::LoadProfile(const std::string& profile_name, std::size_t pla | |||
| 113 | return false; | 114 | return false; |
| 114 | } | 115 | } |
| 115 | 116 | ||
| 117 | LOG_INFO(Config, "Loading input profile `{}`", profile_name); | ||
| 118 | |||
| 116 | map_profiles[profile_name]->ReadQtControlPlayerValues(player_index); | 119 | map_profiles[profile_name]->ReadQtControlPlayerValues(player_index); |
| 117 | return true; | 120 | return true; |
| 118 | } | 121 | } |
diff --git a/src/yuzu/configuration/qt_config.cpp b/src/yuzu/configuration/qt_config.cpp index 6aca71d7c..1051031f2 100644 --- a/src/yuzu/configuration/qt_config.cpp +++ b/src/yuzu/configuration/qt_config.cpp | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2023 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: 2023 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 "common/logging/log.h" | ||
| 4 | #include "input_common/main.h" | 5 | #include "input_common/main.h" |
| 5 | #include "qt_config.h" | 6 | #include "qt_config.h" |
| 6 | #include "uisettings.h" | 7 | #include "uisettings.h" |
| @@ -65,7 +66,7 @@ void QtConfig::ReloadAllValues() { | |||
| 65 | } | 66 | } |
| 66 | 67 | ||
| 67 | void QtConfig::SaveAllValues() { | 68 | void QtConfig::SaveAllValues() { |
| 68 | Save(); | 69 | SaveValues(); |
| 69 | SaveQtValues(); | 70 | SaveQtValues(); |
| 70 | } | 71 | } |
| 71 | 72 | ||
| @@ -327,7 +328,10 @@ void QtConfig::ReadMultiplayerValues() { | |||
| 327 | 328 | ||
| 328 | void QtConfig::SaveQtValues() { | 329 | void QtConfig::SaveQtValues() { |
| 329 | if (global) { | 330 | if (global) { |
| 331 | LOG_DEBUG(Config, "Saving global Qt configuration values"); | ||
| 330 | SaveUIValues(); | 332 | SaveUIValues(); |
| 333 | } else { | ||
| 334 | LOG_DEBUG(Config, "Saving Qt configuration values"); | ||
| 331 | } | 335 | } |
| 332 | SaveQtControlValues(); | 336 | SaveQtControlValues(); |
| 333 | 337 | ||
| @@ -545,6 +549,7 @@ void QtConfig::ReadQtControlPlayerValues(std::size_t player_index) { | |||
| 545 | void QtConfig::SaveQtControlPlayerValues(std::size_t player_index) { | 549 | void QtConfig::SaveQtControlPlayerValues(std::size_t player_index) { |
| 546 | BeginGroup(Settings::TranslateCategory(Settings::Category::Controls)); | 550 | BeginGroup(Settings::TranslateCategory(Settings::Category::Controls)); |
| 547 | 551 | ||
| 552 | LOG_DEBUG(Config, "Saving players control configuration values"); | ||
| 548 | SavePlayerValues(player_index); | 553 | SavePlayerValues(player_index); |
| 549 | SaveQtPlayerValues(player_index); | 554 | SaveQtPlayerValues(player_index); |
| 550 | 555 | ||
diff --git a/src/yuzu/configuration/shared_widget.cpp b/src/yuzu/configuration/shared_widget.cpp index 941683a43..85f4f7655 100644 --- a/src/yuzu/configuration/shared_widget.cpp +++ b/src/yuzu/configuration/shared_widget.cpp | |||
| @@ -750,12 +750,12 @@ Widget::Widget(Settings::BasicSetting* setting_, const TranslationMap& translati | |||
| 750 | } | 750 | } |
| 751 | 751 | ||
| 752 | apply_funcs.push_back([load_func, setting_](bool powered_on) { | 752 | apply_funcs.push_back([load_func, setting_](bool powered_on) { |
| 753 | if (setting_->RuntimeModfiable() || !powered_on) { | 753 | if (setting_->RuntimeModifiable() || !powered_on) { |
| 754 | load_func(); | 754 | load_func(); |
| 755 | } | 755 | } |
| 756 | }); | 756 | }); |
| 757 | 757 | ||
| 758 | bool enable = runtime_lock || setting.RuntimeModfiable(); | 758 | bool enable = runtime_lock || setting.RuntimeModifiable(); |
| 759 | if (setting.Switchable() && Settings::IsConfiguringGlobal() && !runtime_lock) { | 759 | if (setting.Switchable() && Settings::IsConfiguringGlobal() && !runtime_lock) { |
| 760 | enable &= setting.UsingGlobal(); | 760 | enable &= setting.UsingGlobal(); |
| 761 | } | 761 | } |
diff --git a/src/yuzu/multiplayer/chat_room.cpp b/src/yuzu/multiplayer/chat_room.cpp index dec9696c1..4463616b4 100644 --- a/src/yuzu/multiplayer/chat_room.cpp +++ b/src/yuzu/multiplayer/chat_room.cpp | |||
| @@ -206,7 +206,7 @@ void ChatRoom::Initialize(Network::RoomNetwork* room_network_) { | |||
| 206 | room_network = room_network_; | 206 | room_network = room_network_; |
| 207 | // setup the callbacks for network updates | 207 | // setup the callbacks for network updates |
| 208 | if (auto member = room_network->GetRoomMember().lock()) { | 208 | if (auto member = room_network->GetRoomMember().lock()) { |
| 209 | member->BindOnChatMessageRecieved( | 209 | member->BindOnChatMessageReceived( |
| 210 | [this](const Network::ChatEntry& chat) { emit ChatReceived(chat); }); | 210 | [this](const Network::ChatEntry& chat) { emit ChatReceived(chat); }); |
| 211 | member->BindOnStatusMessageReceived( | 211 | member->BindOnStatusMessageReceived( |
| 212 | [this](const Network::StatusMessageEntry& status_message) { | 212 | [this](const Network::StatusMessageEntry& status_message) { |
diff --git a/src/yuzu_cmd/sdl_config.cpp b/src/yuzu_cmd/sdl_config.cpp index e81bf5d45..995114510 100644 --- a/src/yuzu_cmd/sdl_config.cpp +++ b/src/yuzu_cmd/sdl_config.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #define SDL_MAIN_HANDLED | 5 | #define SDL_MAIN_HANDLED |
| 6 | #include <SDL.h> | 6 | #include <SDL.h> |
| 7 | 7 | ||
| 8 | #include "common/logging/log.h" | ||
| 8 | #include "input_common/main.h" | 9 | #include "input_common/main.h" |
| 9 | #include "sdl_config.h" | 10 | #include "sdl_config.h" |
| 10 | 11 | ||
| @@ -64,7 +65,7 @@ void SdlConfig::ReloadAllValues() { | |||
| 64 | } | 65 | } |
| 65 | 66 | ||
| 66 | void SdlConfig::SaveAllValues() { | 67 | void SdlConfig::SaveAllValues() { |
| 67 | Save(); | 68 | SaveValues(); |
| 68 | SaveSdlValues(); | 69 | SaveSdlValues(); |
| 69 | } | 70 | } |
| 70 | 71 | ||
| @@ -177,6 +178,7 @@ void SdlConfig::ReadHidbusValues() { | |||
| 177 | } | 178 | } |
| 178 | 179 | ||
| 179 | void SdlConfig::SaveSdlValues() { | 180 | void SdlConfig::SaveSdlValues() { |
| 181 | LOG_DEBUG(Config, "Saving SDL configuration values"); | ||
| 180 | SaveSdlControlValues(); | 182 | SaveSdlControlValues(); |
| 181 | 183 | ||
| 182 | WriteToIni(); | 184 | WriteToIni(); |
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index a81635fa4..c3cacf852 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp | |||
| @@ -401,7 +401,7 @@ int main(int argc, char** argv) { | |||
| 401 | 401 | ||
| 402 | if (use_multiplayer) { | 402 | if (use_multiplayer) { |
| 403 | if (auto member = system.GetRoomNetwork().GetRoomMember().lock()) { | 403 | if (auto member = system.GetRoomNetwork().GetRoomMember().lock()) { |
| 404 | member->BindOnChatMessageRecieved(OnMessageReceived); | 404 | member->BindOnChatMessageReceived(OnMessageReceived); |
| 405 | member->BindOnStatusMessageReceived(OnStatusMessageReceived); | 405 | member->BindOnStatusMessageReceived(OnStatusMessageReceived); |
| 406 | member->BindOnStateChanged(OnStateChanged); | 406 | member->BindOnStateChanged(OnStateChanged); |
| 407 | member->BindOnError(OnNetworkError); | 407 | member->BindOnError(OnNetworkError); |