Example #1
0
void S9xRemoveCheat (uint32 which1)
{
	if (Cheat.c[which1].saved)
	{
		uint32	address = Cheat.c[which1].address;

		int		block = (address & 0xffffff) >> MEMMAP_SHIFT;
		uint8	*ptr = Memory.Map[block];

		if (ptr >= (uint8 *) CMemory::MAP_LAST)
			*(ptr + (address & 0xffff)) = Cheat.c[which1].saved_byte;
		else
			S9xSetByteFree(Cheat.c[which1].saved_byte, address);
	}
Example #2
0
void S9xRemoveCheat (uint32 which1)
{
	std::vector<SCheat>::iterator iter = Cheat.c[which1].c.begin();
	while (iter != Cheat.c[which1].c.end())
	{
		SCheat& c = *iter;
		if (c.saved)
		{
			uint32	address = c.address;

			int		block = (address & 0xffffff) >> MEMMAP_SHIFT;
			uint8	*ptr = Memory.Map[block];

			if (ptr >= (uint8 *) CMemory::MAP_LAST)
				*(ptr + (address & 0xffff)) = c.saved_byte;
			else
				S9xSetByteFree(c.saved_byte, address);
		}
		iter++;
	}