Always savestate expansion pak regardless of settings.

All the disable expansion pak setting actually does is tell the game the expansion pak is not available.
However, not all games actually abide by this, some will use the expansion pak area anyways.
Video plugins also end up just using a "segfault test" to determine if the expansion pak is present or not
So video plugins may use the expansion pak area too
This ends up causing savestates sometimes just crashing the game if the expansion pak ends up used

Resolves #3092, other state issues might be solved with this (I suspect #3328 is caused by this)
This commit is contained in:
CasualPokePlayer 2022-09-17 13:11:31 -07:00
parent de38781081
commit 5e34dc6166
3 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@ -487,7 +487,7 @@ EXPORT int CALL savestates_load_bkm(char * curr)
char *queue;
hasExpansion = !(ConfigGetParamInt(g_CoreConfig, "DisableExtraMem"));
hasExpansion = 1;// !(ConfigGetParamInt(g_CoreConfig, "DisableExtraMem"));
savestateSize = hasExpansion ? 16788288 : 12593984;
queue = curr + savestateSize;
@ -1457,7 +1457,7 @@ EXPORT int CALL savestates_save_bkm(char *curr)
queuelength = save_eventqueue_infos(queue);
hasExpansion = !(ConfigGetParamInt(g_CoreConfig, "DisableExtraMem"));
hasExpansion = 1;// !(ConfigGetParamInt(g_CoreConfig, "DisableExtraMem"));
// Allocate memory for the save state data
if (hasExpansion)

View File

@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
public void LoadStateBinary(BinaryReader reader)
{
int length = reader.ReadInt32();
if ((_disableExpansionSlot && length >= 16788288) || (!_disableExpansionSlot && length < 16788288))
if (length < 16788288)
{
throw new SavestateSizeMismatchException("Wrong N64 savestate size");
}