Replace global variable with mutator accessor methods for wri state saving

This commit is contained in:
U-DESKTOP-7SFAKTP\Ron 2026-01-26 17:40:51 -08:00
parent 5d39ebe83b
commit e5d3ebabb9
5 changed files with 16 additions and 2 deletions

View File

@ -413,6 +413,7 @@ System::ResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::st
apt->GetAppletManager()->SetSysMenuArg(restore_sys_menu_arg.value());
restore_sys_menu_arg.reset();
}
apt->SetWirelessRebootInfoBuffer(restore_wireless_reboot_info);
}
if (restore_plugin_context.has_value()) {
@ -737,6 +738,7 @@ void System::Reset() {
if (auto apt = Service::APT::GetModule(*this)) {
restore_deliver_arg = apt->GetAppletManager()->ReceiveDeliverArg();
restore_sys_menu_arg = apt->GetAppletManager()->GetSysMenuArg();
restore_wireless_reboot_info = apt->GetWirelessRebootInfoBuffer();
}
if (auto plg_ldr = Service::PLGLDR::GetService(*this)) {
restore_plugin_context = plg_ldr->GetPluginLoaderContext();

View File

@ -489,6 +489,7 @@ private:
boost::optional<Service::APT::SysMenuArg> restore_sys_menu_arg;
boost::optional<Service::PLGLDR::PLG_LDR::PluginLoaderContext> restore_plugin_context;
std::unique_ptr<IPCDebugger::Recorder> restore_ipc_recorder;
std::vector<u8> restore_wireless_reboot_info;
std::vector<u64> lle_modules;

View File

@ -1493,6 +1493,14 @@ std::shared_ptr<AppletManager> Module::GetAppletManager() const {
return applet_manager;
}
std::vector<u8> Module::GetWirelessRebootInfoBuffer() const {
return wireless_reboot_info;
}
void Module::SetWirelessRebootInfoBuffer(std::vector<u8> info_buf) {
wireless_reboot_info = info_buf;
}
std::shared_ptr<Module> GetModule(Core::System& system) {
auto apt = system.ServiceManager().GetService<Service::APT::Module::APTInterface>("APT:A");
if (!apt)

View File

@ -51,6 +51,9 @@ public:
std::shared_ptr<AppletManager> GetAppletManager() const;
std::vector<u8> GetWirelessRebootInfoBuffer() const;
void SetWirelessRebootInfoBuffer(std::vector<u8> info_buf);
class NSInterface : public ServiceFramework<NSInterface> {
public:
NSInterface(std::shared_ptr<Module> apt, const char* name, u32 max_session);
@ -1093,7 +1096,7 @@ private:
std::shared_ptr<AppletManager> applet_manager;
static inline std::vector<u8> wireless_reboot_info;
std::vector<u8> wireless_reboot_info;
template <class Archive>
void serialize(Archive& ar, const unsigned int);

View File

@ -1271,7 +1271,7 @@ void NWM_UDS::RecvBeaconBroadcastData(Kernel::HLERequestContext& ctx) {
static constexpr std::chrono::nanoseconds UDSBeaconScanInterval{300000000};
ctx.SleepClientThread("uds::RecvBeaconBroadcastData", UDSBeaconScanInterval,
std::make_shared<ThreadCallback>(0xF));
std::make_shared<ThreadCallback>(0xF));
// Retrieve all beacon frames that were received from the desired mac address.
auto beacons = GetReceivedBeacons(mac_address);