there was a very old bug in the emulator which didnt matter due to luck but which caused unexciting mappers not to store their (empty) state correctly in the savestate. WriteStateChunk() returned 0 when there was an error in SubWrite(), even though it shouldve written a 5 to account for the overhead
This commit is contained in:
parent
03ad29922f
commit
7489c70b3d
|
@ -143,7 +143,7 @@ static int WriteStateChunk(FILE *st, int type, SFORMAT *sf)
|
||||||
|
|
||||||
if(!SubWrite(st,sf))
|
if(!SubWrite(st,sf))
|
||||||
{
|
{
|
||||||
return(0);
|
return 5;
|
||||||
}
|
}
|
||||||
return (bsize+5);
|
return (bsize+5);
|
||||||
}
|
}
|
||||||
|
@ -358,7 +358,7 @@ bool FCEUSS_SaveFP(FILE *st)
|
||||||
|
|
||||||
//compress it
|
//compress it
|
||||||
uint8* cbuf = new uint8[len*2]; //worst case compression, lets say twice the input buffer size
|
uint8* cbuf = new uint8[len*2]; //worst case compression, lets say twice the input buffer size
|
||||||
uLongf comprlen;
|
uLongf comprlen = len*2;
|
||||||
int error = compress2(cbuf,&comprlen,&buf[0],len,Z_BEST_COMPRESSION);
|
int error = compress2(cbuf,&comprlen,&buf[0],len,Z_BEST_COMPRESSION);
|
||||||
|
|
||||||
//dump the header
|
//dump the header
|
||||||
|
|
Loading…
Reference in New Issue