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,15 +775,19 @@ 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);
if (cheats->add) {
cheats->add(cheats, device);
}
}
}
void mCheatDeviceDeinit(struct mCPUComponent* component) {
struct mCheatDevice* device = (struct mCheatDevice*) component;
size_t i;
for (i = mCheatSetsSize(&device->cheats); i--;) {
struct mCheatSet* cheats = *mCheatSetsGetPointer(&device->cheats, i);
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();
}
if (set->refresh) {
set->refresh(set, m_controller->cheatDevice());
}
m_ui.codeEntry->clear();
}