mirror of https://github.com/PCSX2/pcsx2.git
pcsx2: Remove special case from pointer patch command parsing (#3135)
Removes the special case in type 6 (pointer) code parsing when the data value is 0. This matches Codebreaker behaviour.
This commit is contained in:
parent
b34338a500
commit
e7d1a58a5a
|
@ -84,75 +84,34 @@ void handle_extended_t(IniPatch *p)
|
|||
break;
|
||||
|
||||
case 0x6000: // 000Xnnnn iiiiiiii
|
||||
if (IterationIncrement == 0x0)
|
||||
{
|
||||
//LastType = ((u32)p->addr & 0x000F0000) >> 16;
|
||||
u32 mem = memRead32(PrevCheatAddr);
|
||||
if ((u32)p->addr < 0x100)
|
||||
{
|
||||
LastType = 0x0;
|
||||
PrevCheatAddr = mem + ((u32)p->addr);
|
||||
}
|
||||
else if ((u32)p->addr < 0x1000)
|
||||
{
|
||||
LastType = 0x1;
|
||||
PrevCheatAddr = mem + ((u32)p->addr * 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
LastType = 0x2;
|
||||
PrevCheatAddr = mem + ((u32)p->addr * 4);
|
||||
}
|
||||
{
|
||||
// Get Number of pointers
|
||||
if (((u32)p->addr & 0x0000FFFF) == 0)
|
||||
IterationCount = 1;
|
||||
else
|
||||
IterationCount = (u32)p->addr & 0x0000FFFF;
|
||||
|
||||
// Check if needed to read another pointer
|
||||
// Read first pointer
|
||||
LastType = ((u32)p->addr & 0x000F0000) >> 16;
|
||||
u32 mem = memRead32(PrevCheatAddr);
|
||||
|
||||
PrevCheatAddr = mem + (u32)p->data;
|
||||
IterationCount--;
|
||||
|
||||
// Check if needed to read another pointer
|
||||
if (IterationCount == 0)
|
||||
{
|
||||
PrevCheatType = 0;
|
||||
if (((mem & 0x0FFFFFFF) & 0x3FFFFFFC) != 0)
|
||||
{
|
||||
switch (LastType)
|
||||
{
|
||||
case 0x0:
|
||||
memWrite8(PrevCheatAddr, (u8)p->data & 0xFF);
|
||||
break;
|
||||
case 0x1:
|
||||
memWrite16(PrevCheatAddr, (u16)p->data & 0x0FFFF);
|
||||
break;
|
||||
case 0x2:
|
||||
memWrite32(PrevCheatAddr, (u32)p->data);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (((mem & 0x0FFFFFFF) & 0x3FFFFFFC) != 0) writeCheat();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get Number of pointers
|
||||
if (((u32)p->addr & 0x0000FFFF) == 0)
|
||||
IterationCount = 1;
|
||||
else
|
||||
IterationCount = (u32)p->addr & 0x0000FFFF;
|
||||
|
||||
// Read first pointer
|
||||
LastType = ((u32)p->addr & 0x000F0000) >> 16;
|
||||
u32 mem = memRead32(PrevCheatAddr);
|
||||
|
||||
PrevCheatAddr = mem + (u32)p->data;
|
||||
IterationCount--;
|
||||
|
||||
// Check if needed to read another pointer
|
||||
if (IterationCount == 0)
|
||||
{
|
||||
if (((mem & 0x0FFFFFFF) & 0x3FFFFFFC) == 0)
|
||||
PrevCheatType = 0;
|
||||
if (((mem & 0x0FFFFFFF) & 0x3FFFFFFC) != 0) writeCheat();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((mem & 0x0FFFFFFF) & 0x3FFFFFFC) == 0)
|
||||
PrevCheatType = 0;
|
||||
else
|
||||
PrevCheatType = 0x6001;
|
||||
}
|
||||
PrevCheatType = 0x6001;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x6001: // 000Xnnnn iiiiiiii
|
||||
|
|
Loading…
Reference in New Issue