diff --git a/src/core/hle/service/nwm/nwm_uds.cpp b/src/core/hle/service/nwm/nwm_uds.cpp index 439764f22..3fb9326c5 100644 --- a/src/core/hle/service/nwm/nwm_uds.cpp +++ b/src/core/hle/service/nwm/nwm_uds.cpp @@ -664,6 +664,22 @@ void NWM_UDS::InitializeWithVersion(Kernel::HLERequestContext& ctx) { version); } +void NWM_UDS::InitializeDeprecated(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp(ctx, 0x01, 11, 2); + u32 sharedmem_size = rp.Pop(); + auto node = rp.PopRaw(); + auto sharedmem = rp.PopObject(); + + // The deprecated version uses fixed 0x100 as the version + auto result = Initialize(sharedmem_size, node, 0x100, std::move(sharedmem)); + + IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); + rb.Push(result.Code()); + rb.PushCopyObjects(result.ValueOr(nullptr)); + + LOG_DEBUG(Service_NWM, "called sharedmem_size=0x{:08X}", sharedmem_size); +} + void NWM_UDS::GetConnectionStatus(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0xB, 0, 0); IPC::RequestBuilder rb = rp.MakeBuilder(13, 0); @@ -1272,7 +1288,7 @@ void NWM_UDS::BeaconBroadcastCallback(u64 userdata, s64 cycles_late) { NWM_UDS::NWM_UDS(Core::System& system) : ServiceFramework("nwm::UDS"), system(system) { static const FunctionInfo functions[] = { - {0x000102C2, nullptr, "Initialize (deprecated)"}, + {0x000102C2, &NWM_UDS::InitializeDeprecated, "Initialize (deprecated)"}, {0x00020000, nullptr, "Scrap"}, {0x00030000, &NWM_UDS::Shutdown, "Shutdown"}, {0x00040402, nullptr, "CreateNetwork (deprecated)"}, diff --git a/src/core/hle/service/nwm/nwm_uds.h b/src/core/hle/service/nwm/nwm_uds.h index 400875355..0b59abd55 100644 --- a/src/core/hle/service/nwm/nwm_uds.h +++ b/src/core/hle/service/nwm/nwm_uds.h @@ -320,6 +320,21 @@ private: */ void InitializeWithVersion(Kernel::HLERequestContext& ctx); + /** + * NWM_UDS::InitializeDeprecated service function + * Inputs: + * 1 : Shared memory size + * 2-11 : Input NodeInfo Structure + * 13 : Value 0 + * 14 : Shared memory handle + * Outputs: + * 0 : Return header + * 1 : Result of function, 0 on success, otherwise error code + * 2 : Value 0 + * 3 : Output event handle + */ + void InitializeDeprecated(Kernel::HLERequestContext& ctx); + /** * NWM_UDS::BeginHostingNetwork service function. * Creates a network and starts broadcasting its presence.