diff options
| author | iCatButler <i.am.catbutler@gmail.com> | 2016-05-15 16:24:55 +0100 |
|---|---|---|
| committer | iCatButler <i.am.catbutler@gmail.com> | 2016-05-15 16:24:55 +0100 |
| commit | fed51208575d3b67789ded126a38c7da3b23cef0 (patch) | |
| tree | c69684980d7787064ee7b24e79827ee2b7905410 /libpcsxcore | |
| parent | 6a9f87865f525a4b368330ebb28e6936493e0e72 (diff) | |
| download | pcsxr-fed51208575d3b67789ded126a38c7da3b23cef0.tar.gz | |
Track memory read and writes with constant addresses
Diffstat (limited to 'libpcsxcore')
| -rwxr-xr-x | libpcsxcore/ix86/iR3000A.c | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/libpcsxcore/ix86/iR3000A.c b/libpcsxcore/ix86/iR3000A.c index 3d662537..f835db37 100755 --- a/libpcsxcore/ix86/iR3000A.c +++ b/libpcsxcore/ix86/iR3000A.c @@ -1511,6 +1511,13 @@ static void recLW() { MOV32MtoR(EAX, (u32)&psxH[addr & 0xfff]); MOV32RtoM((u32)&psxRegs.GPR.r[_Rt_], EAX); + + // iCB: PGXP hook + PUSH32I(psxRegs.code); // iCB: Needed to extract reg and opcode + PUSH32I(addr); + CALLFunc((u32)PGXP_psxMemRead32Trace); + resp += 8; + // iCB: PGXP /hook return; } if (t == 0x1f80) { @@ -1529,6 +1536,13 @@ static void recLW() { MOV32MtoR(EAX, (u32)&psxH[addr & 0xffff]); MOV32RtoM((u32)&psxRegs.GPR.r[_Rt_], EAX); + + // iCB: PGXP hook + PUSH32I(psxRegs.code); // iCB: Needed to extract reg and opcode + PUSH32I(addr); + CALLFunc((u32)PGXP_psxMemRead32Trace); + resp += 8; + // iCB: PGXP /hook return; case 0x1f801810: @@ -1597,6 +1611,13 @@ void recLWL() { iRegs[_Rt_].state = ST_UNK; MOV32RtoM((u32)&psxRegs.GPR.r[_Rt_], EAX); + + // iCB: PGXP hook + PUSH32I(psxRegs.code); // iCB: Needed to extract reg and opcode + PUSH32I(addr); + CALLFunc((u32)PGXP_psxMemRead32Trace); + resp += 8; + // iCB: PGXP /hook return; } } @@ -1752,6 +1773,13 @@ void recLWR() { iRegs[_Rt_].state = ST_UNK; MOV32RtoM((u32)&psxRegs.GPR.r[_Rt_], EAX); + + // iCB: PGXP hook + PUSH32I(psxRegs.code); // iCB: Needed to extract reg and opcode + PUSH32I(addr); + CALLFunc((u32)PGXP_psxMemRead32Trace); + resp += 8; + // iCB: PGXP /hook return; } } @@ -1939,6 +1967,19 @@ static void recSW() { MOV32MtoR(EAX, (u32)&psxRegs.GPR.r[_Rt_]); MOV32RtoM((u32)&psxH[addr & 0xfff], EAX); } + + // iCB: PGXP hook + PUSH32I(psxRegs.code); // iCB: Needed to extract reg and opcode + if (IsConst(_Rt_)) { + PUSH32I(iRegs[_Rt_].k); + } + else { + PUSH32M((u32)&psxRegs.GPR.r[_Rt_]); + } + PUSH32I(addr); + CALLFunc((u32)PGXP_psxMemWrite32Trace); + resp += 12; + // iCB: PGXP /hook return; } if (t == 0x1f80) { @@ -1958,6 +1999,19 @@ static void recSW() { MOV32MtoR(EAX, (u32)&psxRegs.GPR.r[_Rt_]); MOV32RtoM((u32)&psxH[addr & 0xffff], EAX); } + + // iCB: PGXP hook + PUSH32I(psxRegs.code); // iCB: Needed to extract reg and opcode + if (IsConst(_Rt_)) { + PUSH32I(iRegs[_Rt_].k); + } + else { + PUSH32M((u32)&psxRegs.GPR.r[_Rt_]); + } + PUSH32I(addr); + CALLFunc((u32)PGXP_psxMemWrite32Trace); + resp += 12; + // iCB: PGXP /hook return; case 0x1f801810: @@ -2104,6 +2158,19 @@ void recSWL() { MOV32MtoR(EAX, (u32)&psxH[addr & 0xffc]); iSWLk(addr & 3); MOV32RtoM((u32)&psxH[addr & 0xffc], EAX); + + // iCB: PGXP hook + PUSH32I(psxRegs.code); // iCB: Needed to extract reg and opcode + if (IsConst(_Rt_)) { + PUSH32I(iRegs[_Rt_].k); + } + else { + PUSH32M((u32)&psxRegs.GPR.r[_Rt_]); + } + PUSH32I(addr); + CALLFunc((u32)PGXP_psxMemWrite32Trace); + resp += 12; + // iCB: PGXP /hook return; } } @@ -2189,6 +2256,19 @@ void recSWR() { MOV32MtoR(EAX, (u32)&psxH[addr & 0xffc]); iSWRk(addr & 3); MOV32RtoM((u32)&psxH[addr & 0xffc], EAX); + + // iCB: PGXP hook + PUSH32I(psxRegs.code); // iCB: Needed to extract reg and opcode + if (IsConst(_Rt_)) { + PUSH32I(iRegs[_Rt_].k); + } + else { + PUSH32M((u32)&psxRegs.GPR.r[_Rt_]); + } + PUSH32I(addr); + CALLFunc((u32)PGXP_psxMemWrite32Trace); + resp += 12; + // iCB: PGXP /hook return; } } |
