fix for that sporadic crash w/Megadrive reset

This commit is contained in:
dinkc64 2015-12-18 23:43:40 +00:00
parent acd64aab09
commit cb87dd43cb
1 changed files with 9 additions and 1 deletions

View File

@ -116,6 +116,7 @@ static bool bVidRecalcPalette;
static UINT8* pVidTransImage = NULL;
static UINT32* pVidTransPalette = NULL;
static INT32 bSkipNextFrame = 0;
static UINT32 __cdecl HighCol15(INT32 r, INT32 g, INT32 b, INT32 /* i */)
{
@ -307,6 +308,12 @@ static INT32 VidDoFrame(bool bRedraw)
nRet = pVidOut[nVidActive]->Frame(bRedraw);
if (bSkipNextFrame) {
// if ReInitialise(); is called from the machine's reset function, it will crash below. This prevents that from happening. (Megadrive)
bSkipNextFrame = 0;
return 0;
}
pBurnDraw = NULL;
nBurnPitch = 0;
@ -351,7 +358,8 @@ INT32 VidReInitialise()
pVidTransImage = NULL;
}
pVidTransImage = (UINT8*)malloc(nVidImageWidth * nVidImageHeight * sizeof(INT16));
bSkipNextFrame = 1;
return 0;
}