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,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue