mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-08 23:25:40 +12:00
Add WIFI MAC to ConfigMem and stub reads
This commit is contained in:
parent
27cf8d75ca
commit
7f4746139d
2 changed files with 11 additions and 11 deletions
|
@ -11,20 +11,16 @@ namespace ConfigMem {
|
||||||
AppMemAlloc = 0x1FF80040,
|
AppMemAlloc = 0x1FF80040,
|
||||||
HardwareType = 0x1FF81004,
|
HardwareType = 0x1FF81004,
|
||||||
Datetime0 = 0x1FF81020,
|
Datetime0 = 0x1FF81020,
|
||||||
|
WifiMac = 0x1FF81060,
|
||||||
NetworkState = 0x1FF81067,
|
NetworkState = 0x1FF81067,
|
||||||
LedState3D = 0x1FF81084,
|
LedState3D = 0x1FF81084,
|
||||||
BatteryState = 0x1FF81085,
|
BatteryState = 0x1FF81085,
|
||||||
Unknown1086 = 0x1FF81086,
|
Unknown1086 = 0x1FF81086,
|
||||||
HeadphonesConnectedMaybe = 0x1FF810C0 // TODO: What is actually stored here?
|
HeadphonesConnectedMaybe = 0x1FF810C0 // TODO: What is actually stored here?
|
||||||
};
|
};
|
||||||
|
|
||||||
// Shows what type of hardware we're running on
|
// Shows what type of hardware we're running on
|
||||||
namespace HardwareCodes {
|
namespace HardwareCodes {
|
||||||
enum : u8 {
|
enum : u8 { Product = 1, Devboard = 2, Debugger = 3, Capture = 4 };
|
||||||
Product = 1,
|
|
||||||
Devboard = 2,
|
|
||||||
Debugger = 3,
|
|
||||||
Capture = 4
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
} // namespace ConfigMem
|
||||||
|
|
|
@ -104,7 +104,10 @@ u16 Memory::read16(u32 vaddr) {
|
||||||
if (pointer != 0) [[likely]] {
|
if (pointer != 0) [[likely]] {
|
||||||
return *(u16*)(pointer + offset);
|
return *(u16*)(pointer + offset);
|
||||||
} else {
|
} 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::AppMemAlloc: return appResourceLimits.maxCommit;
|
||||||
case ConfigMem::SyscoreVer: return 2;
|
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:
|
default:
|
||||||
if (vaddr >= VirtualAddrs::VramStart && vaddr < VirtualAddrs::VramStart + VirtualAddrs::VramSize) {
|
if (vaddr >= VirtualAddrs::VramStart && vaddr < VirtualAddrs::VramStart + VirtualAddrs::VramSize) {
|
||||||
Helpers::warn("VRAM read!\n");
|
Helpers::warn("VRAM read!\n");
|
||||||
|
@ -454,4 +458,4 @@ u64 Memory::timeSince3DSEpoch() {
|
||||||
constexpr u64 offset = 2208988800ull;
|
constexpr u64 offset = 2208988800ull;
|
||||||
milliseconds ms = duration_cast<milliseconds>(seconds(rawTime + timezoneDifference + offset));
|
milliseconds ms = duration_cast<milliseconds>(seconds(rawTime + timezoneDifference + offset));
|
||||||
return ms.count();
|
return ms.count();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue