mirror of
https://github.com/izzy2lost/ppsspp.git
synced 2026-03-10 12:43:04 -07:00
Split GetPointer into two versions, to help with const correctness
This commit is contained in:
@@ -28,19 +28,19 @@
|
||||
|
||||
namespace Memory {
|
||||
|
||||
u8 *GetPointer(const u32 address) {
|
||||
u8 *GetPointerWrite(const u32 address) {
|
||||
if ((address & 0x3E000000) == 0x08000000) {
|
||||
// RAM
|
||||
return GetPointerUnchecked(address);
|
||||
return GetPointerWriteUnchecked(address);
|
||||
} else if ((address & 0x3F800000) == 0x04000000) {
|
||||
// VRAM
|
||||
return GetPointerUnchecked(address);
|
||||
return GetPointerWriteUnchecked(address);
|
||||
} else if ((address & 0xBFFFC000) == 0x00010000) {
|
||||
// Scratchpad
|
||||
return GetPointerUnchecked(address);
|
||||
return GetPointerWriteUnchecked(address);
|
||||
} else if ((address & 0x3F000000) >= 0x08000000 && (address & 0x3F000000) < 0x08000000 + g_MemorySize) {
|
||||
// More RAM (remasters, etc.)
|
||||
return GetPointerUnchecked(address);
|
||||
return GetPointerWriteUnchecked(address);
|
||||
} else {
|
||||
static bool reported = false;
|
||||
if (!reported) {
|
||||
@@ -52,6 +52,10 @@ u8 *GetPointer(const u32 address) {
|
||||
}
|
||||
}
|
||||
|
||||
const u8 *GetPointer(const u32 address) {
|
||||
return (const u8 *)GetPointerWrite(address);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void ReadFromHardware(T &var, const u32 address) {
|
||||
// TODO: Figure out the fastest order of tests for both read and write (they are probably different).
|
||||
|
||||
Reference in New Issue
Block a user