mirror of
https://github.com/JesseTG/melonds-ds.git
synced 2024-11-24 06:59:40 +00:00
Update memory.cpp to reflect recent changes to ARCode
This commit is contained in:
parent
7c95e4c2d6
commit
87f710c16f
@ -155,17 +155,19 @@ PUBLIC_SYMBOL void retro_cheat_set(unsigned index, bool enabled, const char *cod
|
||||
ZoneScopedN("retro_cheat_set");
|
||||
if (!enabled)
|
||||
return;
|
||||
ARCode curcode;
|
||||
std::string str(code);
|
||||
char *pch = &*str.begin();
|
||||
ARCode curcode {
|
||||
.Name = code,
|
||||
.Enabled = true,
|
||||
.Code = {}
|
||||
};
|
||||
curcode.Name = code;
|
||||
curcode.Enabled = enabled;
|
||||
curcode.CodeLen = 0;
|
||||
pch = strtok(pch, " +");
|
||||
while (pch != nullptr) {
|
||||
curcode.Code[curcode.CodeLen] = (u32) strtol(pch, nullptr, 16);
|
||||
retro::log(RETRO_LOG_INFO, "Adding Code %s (%d) \n", pch, curcode.Code[curcode.CodeLen]);
|
||||
curcode.CodeLen++;
|
||||
curcode.Code.push_back((u32) strtol(pch, nullptr, 16));
|
||||
retro::log(RETRO_LOG_INFO, "Adding Code %s (%d) \n", pch, curcode.Code.back());
|
||||
pch = strtok(nullptr, " +");
|
||||
}
|
||||
AREngine::RunCheat(curcode);
|
||||
|
Loading…
Reference in New Issue
Block a user