minor fix in cheat system
This commit is contained in:
parent
8a9103ed33
commit
92fb5e378f
|
@ -134,12 +134,13 @@ BOOL cheatsSave()
|
|||
for (int t = 0; t < cheats[i].num; t++)
|
||||
{
|
||||
char tmp_hex[6] = {0};
|
||||
wsprintf(tmp_hex, "%06X", cheats[i].hi[t]);
|
||||
|
||||
wsprintf(buf, "H%03i%04i", i, t);
|
||||
wsprintf(tmp_hex, "%06X", cheats[i].hi[t]);
|
||||
WritePrivateProfileString("Cheats", buf, tmp_hex, (char *)cheatFilename);
|
||||
wsprintf(buf, "L%03i%04i", i, t);
|
||||
WritePrivateProfileInt("Cheats", buf, cheats[i].lo[t], (char *)cheatFilename);
|
||||
wsprintf(tmp_hex, "%06X", cheats[i].lo[t]);
|
||||
WritePrivateProfileString("Cheats", buf, tmp_hex, (char *)cheatFilename);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -173,7 +174,8 @@ BOOL cheatsLoad()
|
|||
GetPrivateProfileString("Cheats", buf, "0", tmp_buf, 10, (char *)cheatFilename);
|
||||
sscanf_s(tmp_buf, "%x", &cheats[i].hi[t]);
|
||||
wsprintf(buf, "L%03i%04i", i, t);
|
||||
cheats[i].lo[t] = GetPrivateProfileInt("Cheats", buf, 0, (char *)cheatFilename);
|
||||
GetPrivateProfileString("Cheats", buf, "0", tmp_buf, 10, (char *)cheatFilename);
|
||||
sscanf_s(tmp_buf, "%x", &cheats[i].lo[t]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -227,7 +227,12 @@ BOOL CALLBACK CheatsAddProc(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam)
|
|||
if (cheatsAdd(atol(editBuf[3]), searchAddSize, tmp_addr, atol(editBuf[1]), editBuf[2], searchAddFreeze))
|
||||
{
|
||||
if (cheatsSave())
|
||||
{
|
||||
searchAddAddress = tmp_addr;
|
||||
searchAddValue = atol(editBuf[1]);
|
||||
|
||||
EndDialog(dialog, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -424,7 +429,7 @@ BOOL CALLBACK CheatsListBox_Proc(HWND dialog, UINT msg,WPARAM wparam,LPARAM lpar
|
|||
if (searchAddFreeze)
|
||||
lvi.pszText= "X";
|
||||
else
|
||||
lvi.pszText= "";
|
||||
lvi.pszText= " ";
|
||||
u32 row = ListView_InsertItem(cheatListView, &lvi);
|
||||
wsprintf(buf, "0x02%06X", searchAddAddress);
|
||||
ListView_SetItemText(cheatListView, row, 1, buf);
|
||||
|
|
Loading…
Reference in New Issue