Merge pull request #5138 from sum2012/cw-cheat

cwcheat 0x0 auto detect bit
This commit is contained in:
Henrik Rydgård 2014-01-19 05:43:17 -08:00
commit 5508e62ed6

View File

@ -264,9 +264,14 @@ void CWCheatEngine::Run() {
int addr = GetAddress(comm & 0x0FFFFFFF);
switch (comm >> 28) {
case 0: // 8-bit write.
case 0: // 8-bit write.But need more check
if (Memory::IsValidAddress(addr)){
Memory::Write_U8((u8) arg, addr);
if (arg < 0x00000100) // 8-bit
Memory::Write_U8((u8) arg, addr);
else if (arg < 0x00010000) // 16-bit
Memory::Write_U16((u16) arg, addr);
else // 32-bit
Memory::Write_U32((u32) arg, addr);
}
break;
case 0x1: // 16-bit write