UDS: Add non zero mac address to the shared page

Apparently several games check the shared page mac address and wifi
link level values, and will refuse to start UDS if they are not correct.
This change gives a default value (in case you aren't connected to a
network) and will read the value from Room if you are connected.
This commit is contained in:
James Rowe 2018-02-16 18:38:28 -07:00
parent e2eab46535
commit ffe94421b2
3 changed files with 33 additions and 0 deletions

View file

@ -83,6 +83,17 @@ void Init() {
update_time_event =
CoreTiming::RegisterEvent("SharedPage::UpdateTimeCallback", UpdateTimeCallback);
CoreTiming::ScheduleEvent(0, update_time_event);
SetWifiLinkLevel(WifiLinkLevel::POOR);
SetMacAddress(DefaultMac);
}
void SetMacAddress(const MacAddress& addr) {
std::memcpy(shared_page.wifi_macaddr, addr.data(), sizeof(MacAddress));
}
void SetWifiLinkLevel(WifiLinkLevel level) {
shared_page.wifi_link_level = static_cast<u8>(level);
}
} // namespace