aboutsummaryrefslogtreecommitdiff
path: root/source/cheats2.c
diff options
context:
space:
mode:
authoraliaspider2014-10-29 06:47:46 +0100
committeraliaspider2014-10-29 06:47:46 +0100
commit761d752569b9bad6bdb755e91ca9e345cfb2788d (patch)
tree5eaa11c172c08039757d6bee1a3641e051462d3a /source/cheats2.c
parenta6dc7abc9b8cc3986eda5a84141da7dc9e4e8f1a (diff)
downloadsnes9x2005-761d752569b9bad6bdb755e91ca9e345cfb2788d.tar.gz
snes9x2005-761d752569b9bad6bdb755e91ca9e345cfb2788d.tar.bz2
snes9x2005-761d752569b9bad6bdb755e91ca9e345cfb2788d.zip
C++ cleanups. (in progress)
Diffstat (limited to 'source/cheats2.c')
-rw-r--r--source/cheats2.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/cheats2.c b/source/cheats2.c
index 59855b9..d45e229 100644
--- a/source/cheats2.c
+++ b/source/cheats2.c
@@ -98,7 +98,7 @@ extern SCheatData Cheat;
void S9xInitCheatData ()
{
Cheat.RAM = Memory.RAM;
- Cheat.SRAM = ::SRAM;
+ Cheat.SRAM = SRAM;
Cheat.FillRAM = Memory.FillRAM;
}
@@ -168,7 +168,7 @@ void S9xRemoveCheat (uint32 which1)
int block = (address >> MEMMAP_SHIFT) & MEMMAP_MASK;
uint8 *ptr = Memory.Map [block];
- if (ptr >= (uint8 *) CMemory::MAP_LAST)
+ if (ptr >= (uint8 *) MAP_LAST)
*(ptr + (address & 0xffff)) = Cheat.c [which1].saved_byte;
else
S9xSetByte (Cheat.c [which1].saved_byte, address);
@@ -187,7 +187,7 @@ void S9xApplyCheat (uint32 which1)
int block = (address >> MEMMAP_SHIFT) & MEMMAP_MASK;
uint8 *ptr = Memory.Map [block];
- if (ptr >= (uint8 *) CMemory::MAP_LAST)
+ if (ptr >= (uint8 *) MAP_LAST)
*(ptr + (address & 0xffff)) = Cheat.c [which1].byte;
else
S9xSetByte (Cheat.c [which1].byte, address);
@@ -196,9 +196,10 @@ void S9xApplyCheat (uint32 which1)
void S9xApplyCheats ()
{
+ uint32 i;
if (Settings.ApplyCheats)
{
- for (uint32 i = 0; i < Cheat.num_cheats; i++)
+ for (i = 0; i < Cheat.num_cheats; i++)
if (Cheat.c [i].enabled)
S9xApplyCheat (i);
}
@@ -206,9 +207,10 @@ void S9xApplyCheats ()
void S9xRemoveCheats ()
{
- for (uint32 i = 0; i < Cheat.num_cheats; i++)
- if (Cheat.c [i].enabled)
- S9xRemoveCheat (i);
+ uint32 i;
+ for (i = 0; i < Cheat.num_cheats; i++)
+ if (Cheat.c [i].enabled)
+ S9xRemoveCheat (i);
}
bool8 S9xLoadCheatFile (const char *filename)