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,9 +635,11 @@ bool GBACheatParseFile(struct GBACheatDevice* device, struct VFile* vf) {
|
||||||
GBACheatAddSet(device, set);
|
GBACheatAddSet(device, set);
|
||||||
newSet->gsaVersion = set->gsaVersion;
|
newSet->gsaVersion = set->gsaVersion;
|
||||||
memcpy(newSet->gsaSeeds, set->gsaSeeds, sizeof(newSet->gsaSeeds));
|
memcpy(newSet->gsaSeeds, set->gsaSeeds, sizeof(newSet->gsaSeeds));
|
||||||
|
if (set->hook) {
|
||||||
newSet->hook = set->hook;
|
newSet->hook = set->hook;
|
||||||
++newSet->hook->refs;
|
++newSet->hook->refs;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
set = newSet;
|
set = newSet;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -715,6 +715,18 @@ void GBAFrameEnded(struct GBA* gba) {
|
||||||
GBARRNextFrame(gba->rr);
|
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();
|
struct GBAThread* thread = GBAThreadGetContext();
|
||||||
if (!thread) {
|
if (!thread) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue