mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-14 06:50:29 +02:00
Merge pull request #9654 from LunaMoo/CWC0x6_0x1
Fix "copy type" pointer cwc
This commit is contained in:
commit
dbd8085c3e
1 file changed
+3
-3
+3
-3
@@ -439,7 +439,7 @@ void CWCheatEngine::Run() {
|
||||
int count = arg2 & 0xFFFF;
|
||||
int type = (arg2 >> 16) & 0xF;
|
||||
for (int i = 1; i < count; i ++ ) {
|
||||
if (i+1 < count) {
|
||||
if (i < count) {
|
||||
code = GetNextCode();
|
||||
if (code.size() < 2) {
|
||||
// User provided incomplete cheat. Should warn but would be very spammy...
|
||||
@@ -452,8 +452,8 @@ void CWCheatEngine::Run() {
|
||||
case 0x1: // type copy byte
|
||||
{
|
||||
int srcAddr = Memory::Read_U32(addr) + offset;
|
||||
int dstAddr = Memory::Read_U16(addr + baseOffset) + (arg3 & 0x0FFFFFFF);
|
||||
if (Memory::IsValidAddress(dstAddr) && Memory::IsValidAddress(srcAddr)) {
|
||||
int dstAddr = Memory::Read_U32(addr + baseOffset) + (arg3 & 0x0FFFFFFF);
|
||||
if (Memory::IsValidAddress(dstAddr) && Memory::IsValidAddress(srcAddr) && Memory::IsValidAddress(srcAddr + arg) && Memory::IsValidAddress(dstAddr + arg)) {
|
||||
Memory::MemcpyUnchecked(dstAddr, srcAddr, arg);
|
||||
}
|
||||
type = -1; //Done
|
||||
|
||||
Reference in new issue
Block a user