Fix states loading issue of some games in big-endian platforms (#490)
* Fix states loading issue of some games in big-endian platforms * Typo Co-authored-by: negativeExponent <negativeExponent@users.noreply.github.com>
This commit is contained in:
@@ -999,7 +999,7 @@ int iNESLoad(const char *name, FCEUFILE *fp)
|
|||||||
FCEU_printf(" PRG+CHR CRC32: 0x%08X\n", iNESCart.CRC32);
|
FCEU_printf(" PRG+CHR CRC32: 0x%08X\n", iNESCart.CRC32);
|
||||||
FCEU_printf(" PRG+CHR MD5: 0x%s\n", md5_asciistr(iNESCart.MD5));
|
FCEU_printf(" PRG+CHR MD5: 0x%s\n", md5_asciistr(iNESCart.MD5));
|
||||||
FCEU_printf(" PRG-ROM: %6d KiB\n", iNESCart.PRGRomSize >> 10);
|
FCEU_printf(" PRG-ROM: %6d KiB\n", iNESCart.PRGRomSize >> 10);
|
||||||
FCEU_printf(" CHR-ROM: %36 KiB\n", iNESCart.CHRRomSize >> 10);
|
FCEU_printf(" CHR-ROM: %6d KiB\n", iNESCart.CHRRomSize >> 10);
|
||||||
FCEU_printf(" Mapper #: %3d\n", iNESCart.mapper);
|
FCEU_printf(" Mapper #: %3d\n", iNESCart.mapper);
|
||||||
FCEU_printf(" Mapper name: %s\n", mappername);
|
FCEU_printf(" Mapper name: %s\n", mappername);
|
||||||
FCEU_printf(" Mirroring: %s\n", iNESCart.mirror == 2 ? "None (Four-screen)" : iNESCart.mirror ? "Vertical" : "Horizontal");
|
FCEU_printf(" Mirroring: %s\n", iNESCart.mirror == 2 ? "None (Four-screen)" : iNESCart.mirror ? "Vertical" : "Horizontal");
|
||||||
|
|||||||
@@ -286,6 +286,7 @@ void FCEUSS_Load_Mem(void)
|
|||||||
|
|
||||||
uint8 header[16];
|
uint8 header[16];
|
||||||
int stateversion;
|
int stateversion;
|
||||||
|
int totalsize;
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
memstream_read(mem, header, 16);
|
memstream_read(mem, header, 16);
|
||||||
@@ -297,8 +298,10 @@ void FCEUSS_Load_Mem(void)
|
|||||||
stateversion = FCEU_de32lsb(header + 8);
|
stateversion = FCEU_de32lsb(header + 8);
|
||||||
else
|
else
|
||||||
stateversion = header[3] * 100;
|
stateversion = header[3] * 100;
|
||||||
|
|
||||||
|
totalsize = FCEU_de32lsb(header + 4);
|
||||||
|
|
||||||
x = ReadStateChunks(mem, *(uint32*)(header + 4));
|
x = ReadStateChunks(mem, totalsize);
|
||||||
|
|
||||||
if (stateversion < 9500)
|
if (stateversion < 9500)
|
||||||
X.IRQlow = 0;
|
X.IRQlow = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user