mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-11 05:26:24 +02:00
Core: Correct ValidSize outside scratchpad.
And simplify all the scratchpad valid checks.
This commit is contained in:
1 parent
bbdb4f76c8
commit
744d17e13c
3 files changed
+13
-8
No files matched your search
@@ -35,7 +35,7 @@ u8 *GetPointer(const u32 address) {
|
||||
} else if ((address & 0x3F800000) == 0x04000000) {
|
||||
// VRAM
|
||||
return GetPointerUnchecked(address);
|
||||
} else if ((address & 0xBFFF0000) == 0x00010000 && (address & 0x0000FFFF) < SCRATCHPAD_SIZE) {
|
||||
} else if ((address & 0xBFFFC000) == 0x00010000) {
|
||||
// Scratchpad
|
||||
return GetPointerUnchecked(address);
|
||||
} else if ((address & 0x3F000000) >= 0x08000000 && (address & 0x3F000000) < 0x08000000 + g_MemorySize) {
|
||||
@@ -61,7 +61,7 @@ inline void ReadFromHardware(T &var, const u32 address) {
|
||||
} else if ((address & 0x3F800000) == 0x04000000) {
|
||||
// VRAM
|
||||
var = *((const T*)GetPointerUnchecked(address));
|
||||
} else if ((address & 0xBFFF0000) == 0x00010000 && (address & 0x0000FFFF) < SCRATCHPAD_SIZE) {
|
||||
} else if ((address & 0xBFFFC000) == 0x00010000) {
|
||||
// Scratchpad
|
||||
var = *((const T*)GetPointerUnchecked(address));
|
||||
} else if ((address & 0x3F000000) >= 0x08000000 && (address & 0x3F000000) < 0x08000000 + g_MemorySize) {
|
||||
@@ -86,7 +86,7 @@ inline void WriteToHardware(u32 address, const T data) {
|
||||
} else if ((address & 0x3F800000) == 0x04000000) {
|
||||
// VRAM
|
||||
*(T*)GetPointerUnchecked(address) = data;
|
||||
} else if ((address & 0xBFFF0000) == 0x00010000 && (address & 0x0000FFFF) < SCRATCHPAD_SIZE) {
|
||||
} else if ((address & 0xBFFFC000) == 0x00010000) {
|
||||
// Scratchpad
|
||||
*(T*)GetPointerUnchecked(address) = data;
|
||||
} else if ((address & 0x3F000000) >= 0x08000000 && (address & 0x3F000000) < 0x08000000 + g_MemorySize) {
|
||||
@@ -113,7 +113,7 @@ bool IsRAMAddress(const u32 address) {
|
||||
}
|
||||
|
||||
bool IsScratchpadAddress(const u32 address) {
|
||||
return (address & 0xBFFF0000) == 0x00010000 && (address & 0x0000FFFF) < SCRATCHPAD_SIZE;
|
||||
return (address & 0xBFFFC000) == 0x00010000;
|
||||
}
|
||||
|
||||
u8 Read_U8(const u32 address) {
|
||||
|
||||
Reference in new issue
Block a user