- add clear data for paths variables;
This commit is contained in:
parent
8b80838fb8
commit
f9acd10d94
|
@ -47,7 +47,7 @@ static BOOL LidClosed = FALSE;
|
||||||
static u8 countLid = 0;
|
static u8 countLid = 0;
|
||||||
char pathToROM[MAX_PATH];
|
char pathToROM[MAX_PATH];
|
||||||
char pathFilenameToROMwithoutExt[MAX_PATH];
|
char pathFilenameToROMwithoutExt[MAX_PATH];
|
||||||
char gameSerial[19];
|
char ROMserial[19];
|
||||||
|
|
||||||
/* the count of bytes copied from the firmware into memory */
|
/* the count of bytes copied from the firmware into memory */
|
||||||
#define NDS_FW_USER_SETTINGS_MEM_BYTE_COUNT 0x70
|
#define NDS_FW_USER_SETTINGS_MEM_BYTE_COUNT 0x70
|
||||||
|
@ -358,6 +358,9 @@ int NDS_LoadROM( const char *filename, int bmtype, u32 bmsize,
|
||||||
if (filename == NULL)
|
if (filename == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
memset(pathToROM, 0, MAX_PATH);
|
||||||
|
memset(pathFilenameToROMwithoutExt, 0, MAX_PATH);
|
||||||
|
memset(ROMserial, 0, sizeof(ROMserial));
|
||||||
memset(extROM, 0, MAX_PATH);
|
memset(extROM, 0, MAX_PATH);
|
||||||
memset(extROM2, 0, 5);
|
memset(extROM2, 0, 5);
|
||||||
|
|
||||||
|
@ -450,12 +453,14 @@ int NDS_LoadROM( const char *filename, int bmtype, u32 bmsize,
|
||||||
#endif
|
#endif
|
||||||
delete [] noext;
|
delete [] noext;
|
||||||
|
|
||||||
|
memset(buf, 0, MAX_PATH);
|
||||||
strcpy(buf, pathFilenameToROMwithoutExt);
|
strcpy(buf, pathFilenameToROMwithoutExt);
|
||||||
strcat(buf, ".sav"); // DeSmuME memory card :)
|
strcat(buf, ".sav"); // DeSmuME memory card :)
|
||||||
|
|
||||||
mc_realloc(&MMU.bupmem, bmtype, bmsize);
|
mc_realloc(&MMU.bupmem, bmtype, bmsize);
|
||||||
mc_load_file(&MMU.bupmem, buf);
|
mc_load_file(&MMU.bupmem, buf);
|
||||||
|
|
||||||
|
memset(buf, 0, MAX_PATH);
|
||||||
strcpy(buf, pathFilenameToROMwithoutExt);
|
strcpy(buf, pathFilenameToROMwithoutExt);
|
||||||
strcat(buf, ".dct"); // DeSmuME cheat :)
|
strcat(buf, ".dct"); // DeSmuME cheat :)
|
||||||
cheatsInit(buf);
|
cheatsInit(buf);
|
||||||
|
@ -494,8 +499,8 @@ int NDS_LoadROM( const char *filename, int bmtype, u32 bmsize,
|
||||||
memcpy(buf+strlen(buf), header->gameCode, 4);
|
memcpy(buf+strlen(buf), header->gameCode, 4);
|
||||||
memcpy(buf+strlen(buf), &header->makerCode, 2);
|
memcpy(buf+strlen(buf), &header->makerCode, 2);
|
||||||
}
|
}
|
||||||
INFO("\nGame serial: %s\n\n", buf);
|
INFO("\nROM serial: %s\n\n", buf);
|
||||||
strcpy(gameSerial, buf);
|
strcpy(ROMserial, buf);
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue