diff options
author | Nebuleon Fumika | 2012-12-23 20:51:14 -0500 |
---|---|---|
committer | Nebuleon Fumika | 2012-12-23 20:51:14 -0500 |
commit | bb39cc82364ea00324a054ba0970bdc07ecfdeec (patch) | |
tree | b221c90bf1c23195f08b69de6dd8cdb3f1b9df75 /source/cheats2.cpp | |
parent | a194b850037c03f5fb3ac1ecc9f7a99f73b84104 (diff) | |
download | snes9x2005-bb39cc82364ea00324a054ba0970bdc07ecfdeec.tar.gz snes9x2005-bb39cc82364ea00324a054ba0970bdc07ecfdeec.tar.bz2 snes9x2005-bb39cc82364ea00324a054ba0970bdc07ecfdeec.zip |
Correctly handle multi-part codes, for all cheat types (GG, PAR, GF).
They are currently loaded as multiple codes, however.
Diffstat (limited to 'source/cheats2.cpp')
-rw-r--r-- | source/cheats2.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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); } } |