From bb39cc82364ea00324a054ba0970bdc07ecfdeec Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Sun, 23 Dec 2012 20:51:14 -0500 Subject: Correctly handle multi-part codes, for all cheat types (GG, PAR, GF). They are currently loaded as multiple codes, however. --- source/cheats2.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/cheats2.cpp') diff --git a/source/cheats2.cpp b/source/cheats2.cpp index 1423637..8d81d6d 100644 --- a/source/cheats2.cpp +++ b/source/cheats2.cpp @@ -105,17 +105,19 @@ void S9xInitCheatData () void S9xAddCheat (bool8 enable, bool8 save_current_value, uint32 address, uint8 byte) { - if (Cheat.num_cheats < sizeof (Cheat.c) / sizeof (Cheat. c [0])) + if (Cheat.num_cheats < sizeof (Cheat.c) / sizeof (Cheat.c [0])) { Cheat.c [Cheat.num_cheats].address = address; Cheat.c [Cheat.num_cheats].byte = byte; - Cheat.c [Cheat.num_cheats].enabled = TRUE; + Cheat.c [Cheat.num_cheats].enabled = enable; if (save_current_value) { Cheat.c [Cheat.num_cheats].saved_byte = S9xGetByte (address); Cheat.c [Cheat.num_cheats].saved = TRUE; } Cheat.num_cheats++; + if (enable) + S9xApplyCheat(Cheat.num_cheats - 1); } } -- cgit v1.2.3