mirror of https://github.com/mgba-emu/mgba.git
GBA: Make some codes work without master codes
This commit is contained in:
parent
5015975e4c
commit
7d36331dc4
|
@ -635,8 +635,10 @@ bool GBACheatParseFile(struct GBACheatDevice* device, struct VFile* vf) {
|
|||
GBACheatAddSet(device, set);
|
||||
newSet->gsaVersion = set->gsaVersion;
|
||||
memcpy(newSet->gsaSeeds, set->gsaSeeds, sizeof(newSet->gsaSeeds));
|
||||
newSet->hook = set->hook;
|
||||
++newSet->hook->refs;
|
||||
if (set->hook) {
|
||||
newSet->hook = set->hook;
|
||||
++newSet->hook->refs;
|
||||
}
|
||||
}
|
||||
set = newSet;
|
||||
break;
|
||||
|
|
|
@ -715,6 +715,18 @@ void GBAFrameEnded(struct GBA* gba) {
|
|||
GBARRNextFrame(gba->rr);
|
||||
}
|
||||
|
||||
if (gba->cpu->components[GBA_COMPONENT_CHEAT_DEVICE]) {
|
||||
struct GBACheatDevice* device = (struct GBACheatDevice*) gba->cpu->components[GBA_COMPONENT_CHEAT_DEVICE];
|
||||
size_t i;
|
||||
for (i = 0; i < GBACheatSetsSize(&device->cheats); ++i) {
|
||||
struct GBACheatSet* cheats = *GBACheatSetsGetPointer(&device->cheats, i);
|
||||
if (!cheats->hook) {
|
||||
GBACheatRefresh(device, cheats);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct GBAThread* thread = GBAThreadGetContext();
|
||||
if (!thread) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue