From f580bee32ca2d57facfe6565852a17840f430d4a Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 28 Feb 2021 17:25:53 +0300 Subject: [PATCH] Rewrite cellNetCtlNetStartDialogLoadAsync hack --- rpcs3/Emu/Cell/Modules/cellNetCtl.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp b/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp index cb3e313042..112319cc8c 100644 --- a/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp +++ b/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp @@ -223,6 +223,19 @@ error_code cellNetCtlGetInfo(s32 code, vm::ptr info) return CELL_OK; } +struct netstart_hack +{ + static constexpr std::string_view thread_name = "NetStart Hack"; + + void operator()(int) + { + thread_ctrl::wait_for(500'000); + + sysutil_send_system_cmd(CELL_SYSUTIL_NET_CTL_NETSTART_LOADED, 0); + sysutil_send_system_cmd(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0); + } +}; + error_code cellNetCtlNetStartDialogLoadAsync(vm::cptr param) { cellNetCtl.error("cellNetCtlNetStartDialogLoadAsync(param=*0x%x)", param); @@ -250,16 +263,7 @@ error_code cellNetCtlNetStartDialogLoadAsync(vm::cptrinit("Delayed cellNetCtlNetStartDialogLoadAsync messages", []() - { - lv2_obj::wait_timeout(500000, nullptr); - - if (thread_ctrl::state() != thread_state::aborting) - { - sysutil_send_system_cmd(CELL_SYSUTIL_NET_CTL_NETSTART_LOADED, 0); - sysutil_send_system_cmd(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0); - } - }); + g_fxo->get>()->operator()(0); return CELL_OK; }