Made Soft IPS patching follow old patch offsetting method
This commit is contained in:
@@ -25,6 +25,7 @@ extern int NumofBytes;
|
|||||||
extern int NumofBanks;
|
extern int NumofBanks;
|
||||||
extern unsigned int *romdata;
|
extern unsigned int *romdata;
|
||||||
extern unsigned char IPSPatched;
|
extern unsigned char IPSPatched;
|
||||||
|
extern unsigned char Header512;
|
||||||
|
|
||||||
char *patchfile;
|
char *patchfile;
|
||||||
|
|
||||||
@@ -32,6 +33,7 @@ void PatchUsingIPS()
|
|||||||
{
|
{
|
||||||
unsigned char *ROM = (unsigned char *)romdata;
|
unsigned char *ROM = (unsigned char *)romdata;
|
||||||
int location = 0, length = 0;
|
int location = 0, length = 0;
|
||||||
|
int sub = Header512 ? 512 : 0;
|
||||||
|
|
||||||
FILE *fp = 0;
|
FILE *fp = 0;
|
||||||
fp = fopen(patchfile, "rb");
|
fp = fopen(patchfile, "rb");
|
||||||
@@ -57,8 +59,8 @@ void PatchUsingIPS()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//We assume all IPS files are for ROMs with headers
|
//Offset by size of ROM header
|
||||||
location = inloc - 512;
|
location = inloc - sub;
|
||||||
|
|
||||||
//Length is a 2 byte value (max 64KB)
|
//Length is a 2 byte value (max 64KB)
|
||||||
length = (fgetc(fp) << 8) | fgetc(fp);
|
length = (fgetc(fp) << 8) | fgetc(fp);
|
||||||
|
|||||||
Reference in New Issue
Block a user