mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-26 23:10:38 +00:00
parent
233b0a87c1
commit
bab9581901
@ -313,13 +313,13 @@ inline bool IsValidAddress(const u32 address) {
|
||||
inline u32 ValidSize(const u32 address, const u32 requested_size) {
|
||||
u32 max_size;
|
||||
if ((address & 0x3E000000) == 0x08000000) {
|
||||
max_size = 0x08000000 + g_MemorySize - (address & 0x3E000000);
|
||||
max_size = 0x08000000 + g_MemorySize - (address & 0x3FFFFFFF);
|
||||
} else if ((address & 0x3F800000) == 0x04000000) {
|
||||
max_size = 0x04800000 - (address & 0x3F800000);
|
||||
max_size = 0x04800000 - (address & 0x3FFFFFFF);
|
||||
} else if ((address & 0xBFFF0000) == 0x00010000) {
|
||||
max_size = 0x00014000 - (address & 0xBFFF0000);
|
||||
max_size = 0x00014000 - (address & 0xBFFFFFFF);
|
||||
} else if ((address & 0x3F000000) >= 0x08000000 && (address & 0x3F000000) < 0x08000000 + g_MemorySize) {
|
||||
max_size = 0x08000000 + g_MemorySize - (address & 0x3F000000);
|
||||
max_size = 0x08000000 + g_MemorySize - (address & 0x3FFFFFFF);
|
||||
} else {
|
||||
max_size = 0;
|
||||
}
|
||||
|
@ -567,6 +567,8 @@ static bool TestMemMap() {
|
||||
EXPECT_EQ_HEX(Memory::ValidSize(base, 0x40000001), range.size);
|
||||
EXPECT_EQ_HEX(Memory::ValidSize(base, 0x20000001), range.size);
|
||||
EXPECT_EQ_HEX(Memory::ValidSize(base, 0x10000001), range.size);
|
||||
|
||||
EXPECT_EQ_HEX(Memory::ValidSize(base + range.size - 0x10, 0x20000001), 0x10);
|
||||
}
|
||||
}
|
||||
|
||||
@ -607,6 +609,7 @@ TestItem availableTests[] = {
|
||||
TEST_ITEM(ParseLBN),
|
||||
TEST_ITEM(QuickTexHash),
|
||||
TEST_ITEM(CLZ),
|
||||
TEST_ITEM(MemMap),
|
||||
TEST_ITEM(ShaderGenerators),
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user