mirror of https://github.com/mgba-emu/mgba.git
Core: Fix some cheats API change fallout (fixes #2053)
This commit is contained in:
parent
c21f9e81bb
commit
4827daf5a6
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue