mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-06 22:25:41 +12:00
[Memory] Add read16 (how did I never notice this was missing?)
This commit is contained in:
parent
2088b59f10
commit
5bcdf4d063
1 changed files with 10 additions and 1 deletions
|
@ -63,7 +63,16 @@ u8 Memory::read8(u32 vaddr) {
|
|||
}
|
||||
|
||||
u16 Memory::read16(u32 vaddr) {
|
||||
Helpers::panic("Unimplemented 16-bit read, addr: %08X", vaddr);
|
||||
const u32 page = vaddr >> pageShift;
|
||||
const u32 offset = vaddr & pageMask;
|
||||
|
||||
uintptr_t pointer = readTable[page];
|
||||
if (pointer != 0) [[likely]] {
|
||||
return *(u16*)(pointer + offset);
|
||||
}
|
||||
else {
|
||||
Helpers::panic("Unimplemented 16-bit read, addr: %08X", vaddr);
|
||||
}
|
||||
}
|
||||
|
||||
u32 Memory::read32(u32 vaddr) {
|
||||
|
|
Loading…
Add table
Reference in a new issue