Core: Fix some cheats API change fallout (fixes #2053)

This commit is contained in:
Vicki Pfau 2021-02-23 22:36:23 -08:00
parent c21f9e81bb
commit 4827daf5a6
2 changed files with 9 additions and 3 deletions

View File

@ -775,7 +775,9 @@ void mCheatDeviceInit(void* cpu, struct mCPUComponent* component) {
size_t i;
for (i = 0; i < mCheatSetsSize(&device->cheats); ++i) {
struct mCheatSet* cheats = *mCheatSetsGetPointer(&device->cheats, i);
cheats->add(cheats, device);
if (cheats->add) {
cheats->add(cheats, device);
}
}
}
@ -784,6 +786,8 @@ void mCheatDeviceDeinit(struct mCPUComponent* component) {
size_t i;
for (i = mCheatSetsSize(&device->cheats); i--;) {
struct mCheatSet* cheats = *mCheatSetsGetPointer(&device->cheats, i);
cheats->remove(cheats, device);
if (cheats->remove) {
cheats->remove(cheats, device);
}
}
}

View File

@ -165,6 +165,8 @@ void CheatsView::enterCheat(int codeType) {
mCheatAddLine(set, string.toUtf8().constData(), codeType);
m_model.endAppendRow();
}
set->refresh(set, m_controller->cheatDevice());
if (set->refresh) {
set->refresh(set, m_controller->cheatDevice());
}
m_ui.codeEntry->clear();
}