GBA: Make some codes work without master codes

This commit is contained in:
Jeffrey Pfau 2015-02-10 00:25:52 -08:00
parent 5015975e4c
commit 7d36331dc4
2 changed files with 16 additions and 2 deletions

View File

@ -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;

View File

@ -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;