- warn about CdSearchFile called doring CdlReadS

This commit is contained in:
Ilya Shurumov 2021-04-09 18:40:34 +06:00
parent 54ab7236f8
commit 8a9b42ee2c

View File

@ -51,6 +51,8 @@ int g_cdCurrentTrack = 1; // default
int g_cdNumFrames = 0;
int g_CD_com = 0;
bool g_cdReadDoneFlag = true;
char g_cdImageBinaryFileName[2048] = { 0 };
int g_UseCDImage = 0;
@ -156,6 +158,15 @@ CdlFILE* CdSearchFile(CdlFILE* fp, char* name)
return NULL;
}
assert(g_cdReadDoneFlag == true);
if (!g_cdReadDoneFlag)
{
// deny request
eprintwarn("CdSearchFile called while in 'CdlReadS'\n");
return NULL;
}
#ifdef _DEBUG
eprintf("CdSearchFile: %s\n", name);
#endif
@ -725,7 +736,6 @@ CdlCB g_readyCallback = NULL;
Sector g_cdSectorData;
bool g_isCdSectorDataRead = false;
bool g_cdReadDoneFlag = false;
SDL_Thread* g_cdSpoolerPCThread = NULL;
SDL_mutex* g_cdSpoolerMutex = NULL;