Merge pull request #107 from caldog20/wifimac-configmem

Stub reads for WIFI MAC address in ConfigMem
This commit is contained in:
wheremyfoodat 2023-07-11 23:56:31 +03:00 committed by GitHub
commit e00f5d21df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View file

@ -104,7 +104,10 @@ u16 Memory::read16(u32 vaddr) {
if (pointer != 0) [[likely]] {
return *(u16*)(pointer + offset);
} else {
Helpers::panic("Unimplemented 16-bit read, addr: %08X", vaddr);
switch (vaddr) {
case ConfigMem::WifiMac + 4: return 0xEEFF; // Wifi MAC: Last 2 bytes of MAC Address
default: Helpers::panic("Unimplemented 16-bit read, addr: %08X", vaddr);
}
}
}
@ -130,7 +133,8 @@ u32 Memory::read32(u32 vaddr) {
case ConfigMem::AppMemAlloc: return appResourceLimits.maxCommit;
case ConfigMem::SyscoreVer: return 2;
case 0x1FF81000: return 0; // TODO: Figure out what this config mem address does
case 0x1FF81000: return 0; // TODO: Figure out what this config mem address does
case ConfigMem::WifiMac: return 0xFF07F440; // Wifi MAC: First 4 bytes of MAC Address
default:
if (vaddr >= VirtualAddrs::VramStart && vaddr < VirtualAddrs::VramStart + VirtualAddrs::VramSize) {
Helpers::warn("VRAM read!\n");
@ -454,4 +458,4 @@ u64 Memory::timeSince3DSEpoch() {
constexpr u64 offset = 2208988800ull;
milliseconds ms = duration_cast<milliseconds>(seconds(rawTime + timezoneDifference + offset));
return ms.count();
}
}