yuzu-emu
/
yuzu
Archived
1
0
Fork 0

hle: service: ldn: IUserLocalCommunicationService: Indicate that LDN is disabled.

- Fixes crash on Pokemon Sword/Shield when pressing 'Y'.
This commit is contained in:
bunnei 2021-02-13 02:32:13 -08:00
parent d25011c92f
commit 51c13606d6
3 changed files with 19 additions and 3 deletions

View File

@ -400,6 +400,7 @@ add_library(core STATIC
hle/service/hid/controllers/xpad.h hle/service/hid/controllers/xpad.h
hle/service/lbl/lbl.cpp hle/service/lbl/lbl.cpp
hle/service/lbl/lbl.h hle/service/lbl/lbl.h
hle/service/ldn/errors.h
hle/service/ldn/ldn.cpp hle/service/ldn/ldn.cpp
hle/service/ldn/ldn.h hle/service/ldn/ldn.h
hle/service/ldr/ldr.cpp hle/service/ldr/ldr.cpp

View File

@ -0,0 +1,13 @@
// Copyright 2021 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "core/hle/result.h"
namespace Service::LDN {
constexpr ResultCode ERROR_DISABLED{ErrorModule::LDN, 22};
} // namespace Service::LDN

View File

@ -6,6 +6,7 @@
#include "core/hle/ipc_helpers.h" #include "core/hle/ipc_helpers.h"
#include "core/hle/result.h" #include "core/hle/result.h"
#include "core/hle/service/ldn/errors.h"
#include "core/hle/service/ldn/ldn.h" #include "core/hle/service/ldn/ldn.h"
#include "core/hle/service/sm/sm.h" #include "core/hle/service/sm/sm.h"
@ -140,10 +141,11 @@ public:
void Initialize2(Kernel::HLERequestContext& ctx) { void Initialize2(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_LDN, "(STUBBED) called"); LOG_WARNING(Service_LDN, "(STUBBED) called");
// Result success seem make this services start network and continue.
// If we just pass result error then it will stop and maybe try again and again. // Return the disabled error to indicate that LDN is currently unavailable, otherwise games
// will continue to try to make a connection.
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_UNKNOWN); rb.Push(ERROR_DISABLED);
} }
}; };