- fixed search lists (and 3 byte size work correct now);
- fixed search after load savestate;
(will next step - add Action Replay parser)
This commit is contained in:
mtabachenko 2009-04-17 11:13:59 +00:00
parent df99182300
commit 2684c683a8
4 changed files with 17 additions and 7 deletions

View File

@ -854,7 +854,7 @@ void NDS_FreeROM(void)
MMU.bupmem.fp = NULL;
}
void NDS_Reset( void)
void NDS_Reset(BOOL resetBySavestate)
{
unsigned int i;
u32 src;
@ -1034,7 +1034,8 @@ void NDS_Reset( void)
gfx3d_reset();
gpu3D->NDS_3D_Reset();
SPU_Reset();
cheatsSearchClose();
if (!resetBySavestate)
cheatsSearchClose();
#ifdef EXPERIMENTAL_WIFI
WIFI_Init(&wifiMac);

View File

@ -274,7 +274,7 @@ int NDS_LoadROM(const char *filename, int bmtype, u32 bmsize,
const char *cflash_disk_image_file);
#endif
void NDS_FreeROM(void);
void NDS_Reset(void);
void NDS_Reset(BOOL resetBySaveState = FALSE);
int NDS_ImportSave(const char *filename);
int NDS_WriteBMP(const char *filename);

View File

@ -566,14 +566,23 @@ u32 cheatSearchNumber()
BOOL cheatSearchGetList(u32 *address, u32 *curVal)
{
for (u32 i = searchLastRecord; i < (4 * 1024 * 1024); i++)
u8 step = (searchSize+1);
u8 stepMem = 1;
switch (searchSize)
{
case 1: stepMem = 0x3; break;
case 2: stepMem = 0x7; break;
case 3: stepMem = 0xF; break;
}
for (u32 i = searchLastRecord; i < (4 * 1024 * 1024); i+=step)
{
u32 addr = (i >> 3);
u32 offs = (i % 8);
if (searchStatMem[addr] & (1<<offs))
if (searchStatMem[addr] & (stepMem<<offs))
{
*address = i;
searchLastRecord = i+1;
searchLastRecord = i+step;
switch (searchSize)
{

View File

@ -828,7 +828,7 @@ static bool savestate_load(std::istream* is)
//while the series of resets below should work,
//we are testing the robustness of the savestate system with this full reset.
//the full reset wipes more things, so we can make sure that they are being restored correctly
NDS_Reset();
NDS_Reset(TRUE);
//reset some options to their old defaults which werent saved
nds.debugConsole = FALSE;