mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-04 23:29:17 +00:00
CheatManager/ISOProperties: Refactor ActionReplay tabs as a class
Refactor Action Replay code into its own class like Gecko Codes.
This commit is contained in:
parent
def0b42fb7
commit
00a4404045
17 changed files with 706 additions and 487 deletions
|
@ -454,7 +454,7 @@ static int alphatobin(u32* dst, const std::vector<std::string>& alpha, int size)
|
|||
return ret;
|
||||
}
|
||||
|
||||
void DecryptARCode(std::vector<std::string> vCodes, std::vector<AREntry>& ops)
|
||||
void DecryptARCode(std::vector<std::string> vCodes, std::vector<AREntry>* ops)
|
||||
{
|
||||
// The almighty buildseeds() function!! without this, the crypto routines are useless
|
||||
buildseeds();
|
||||
|
@ -469,9 +469,9 @@ void DecryptARCode(std::vector<std::string> vCodes, std::vector<AREntry>& ops)
|
|||
|
||||
if ((ret = alphatobin(uCodes, vCodes, (int)vCodes.size())))
|
||||
{
|
||||
// Return value is index + 1, 0 being the success flag value.
|
||||
PanicAlertT("Action Replay Code Decryption Error:\nParity Check Failed\n\nCulprit Code:\n%s",
|
||||
vCodes[ret].c_str());
|
||||
batchdecrypt(uCodes, (u16)vCodes.size() << 1);
|
||||
vCodes[ret - 1].c_str());
|
||||
}
|
||||
else if (!batchdecrypt(uCodes, (u16)vCodes.size() << 1))
|
||||
{
|
||||
|
@ -481,10 +481,7 @@ void DecryptARCode(std::vector<std::string> vCodes, std::vector<AREntry>& ops)
|
|||
|
||||
for (size_t i = 0; i < (vCodes.size() << 1); i += 2)
|
||||
{
|
||||
AREntry op;
|
||||
op.cmd_addr = uCodes[i];
|
||||
op.value = uCodes[i + 1];
|
||||
ops.push_back(op);
|
||||
ops->emplace_back(uCodes[i], uCodes[i + 1]);
|
||||
// PanicAlert("Decrypted AR Code without verification code:\n%08X %08X", uCodes[i],
|
||||
// uCodes[i+1]);
|
||||
}
|
||||
|
@ -494,10 +491,7 @@ void DecryptARCode(std::vector<std::string> vCodes, std::vector<AREntry>& ops)
|
|||
// Skip passing the verification code back
|
||||
for (size_t i = 2; i < (vCodes.size() << 1); i += 2)
|
||||
{
|
||||
AREntry op;
|
||||
op.cmd_addr = uCodes[i];
|
||||
op.value = uCodes[i + 1];
|
||||
ops.push_back(op);
|
||||
ops->emplace_back(uCodes[i], uCodes[i + 1]);
|
||||
// PanicAlert("Decrypted AR Code:\n%08X %08X", uCodes[i], uCodes[i+1]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue