diff options
| author | 2021-02-13 02:32:13 -0800 | |
|---|---|---|
| committer | 2021-02-13 20:11:26 -0800 | |
| commit | 51c13606d6b9a25a93bd008db53a2553b16126e5 (patch) | |
| tree | f0eca4717b30a37215e2715fef80d5b66cd7553d /src | |
| parent | hle: service: am: IStorageAccessor: Fix out of bounds error handling. (diff) | |
| download | yuzu-51c13606d6b9a25a93bd008db53a2553b16126e5.tar.gz yuzu-51c13606d6b9a25a93bd008db53a2553b16126e5.tar.xz yuzu-51c13606d6b9a25a93bd008db53a2553b16126e5.zip | |
hle: service: ldn: IUserLocalCommunicationService: Indicate that LDN is disabled.
- Fixes crash on Pokemon Sword/Shield when pressing 'Y'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/core/hle/service/ldn/errors.h | 13 | ||||
| -rw-r--r-- | src/core/hle/service/ldn/ldn.cpp | 8 |
3 files changed, 19 insertions, 3 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 1662ec63d..e74e6a668 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -400,6 +400,7 @@ add_library(core STATIC | |||
| 400 | hle/service/hid/controllers/xpad.h | 400 | hle/service/hid/controllers/xpad.h |
| 401 | hle/service/lbl/lbl.cpp | 401 | hle/service/lbl/lbl.cpp |
| 402 | hle/service/lbl/lbl.h | 402 | hle/service/lbl/lbl.h |
| 403 | hle/service/ldn/errors.h | ||
| 403 | hle/service/ldn/ldn.cpp | 404 | hle/service/ldn/ldn.cpp |
| 404 | hle/service/ldn/ldn.h | 405 | hle/service/ldn/ldn.h |
| 405 | hle/service/ldr/ldr.cpp | 406 | hle/service/ldr/ldr.cpp |
diff --git a/src/core/hle/service/ldn/errors.h b/src/core/hle/service/ldn/errors.h new file mode 100644 index 000000000..a718c5c66 --- /dev/null +++ b/src/core/hle/service/ldn/errors.h | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | // Copyright 2021 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/result.h" | ||
| 8 | |||
| 9 | namespace Service::LDN { | ||
| 10 | |||
| 11 | constexpr ResultCode ERROR_DISABLED{ErrorModule::LDN, 22}; | ||
| 12 | |||
| 13 | } // namespace Service::LDN | ||
diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp index ee908f399..1c46609ae 100644 --- a/src/core/hle/service/ldn/ldn.cpp +++ b/src/core/hle/service/ldn/ldn.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include "core/hle/ipc_helpers.h" | 7 | #include "core/hle/ipc_helpers.h" |
| 8 | #include "core/hle/result.h" | 8 | #include "core/hle/result.h" |
| 9 | #include "core/hle/service/ldn/errors.h" | ||
| 9 | #include "core/hle/service/ldn/ldn.h" | 10 | #include "core/hle/service/ldn/ldn.h" |
| 10 | #include "core/hle/service/sm/sm.h" | 11 | #include "core/hle/service/sm/sm.h" |
| 11 | 12 | ||
| @@ -140,10 +141,11 @@ public: | |||
| 140 | 141 | ||
| 141 | void Initialize2(Kernel::HLERequestContext& ctx) { | 142 | void Initialize2(Kernel::HLERequestContext& ctx) { |
| 142 | LOG_WARNING(Service_LDN, "(STUBBED) called"); | 143 | LOG_WARNING(Service_LDN, "(STUBBED) called"); |
| 143 | // Result success seem make this services start network and continue. | 144 | |
| 144 | // If we just pass result error then it will stop and maybe try again and again. | 145 | // Return the disabled error to indicate that LDN is currently unavailable, otherwise games |
| 146 | // will continue to try to make a connection. | ||
| 145 | IPC::ResponseBuilder rb{ctx, 2}; | 147 | IPC::ResponseBuilder rb{ctx, 2}; |
| 146 | rb.Push(RESULT_UNKNOWN); | 148 | rb.Push(ERROR_DISABLED); |
| 147 | } | 149 | } |
| 148 | }; | 150 | }; |
| 149 | 151 | ||