1
0
Fork 0

added support for Warninglevel

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@317
This commit is contained in:
Peter Veenstra 2002-10-16 14:07:52 +00:00
parent 602882eb78
commit 56faf852a6
5 changed files with 113 additions and 23 deletions

View file

@ -40,7 +40,7 @@
/* NEEDS A CLEANUP */
char dosbox_basedir[CROSS_LEN];
Config * control;
Bitu errorlevel=1; //during startup display reason for Exits
//The whole load of startups for all the subfunctions
void MSG_Init(Section_prop *);
@ -132,7 +132,8 @@ void DOSBOX_RunMachine(void){
static void DOSBOX_RealInit(Section * sec) {
Section_prop * section=static_cast<Section_prop *>(sec);
/* Initialize some dosbox internals */
LastTicks=GetTicks();
errorlevel=section->Get_int("WARNINGS");
LastTicks=GetTicks();
DOSBOX_SetLoop(&Normal_Loop);
MSG_Init(section);
}

View file

@ -499,8 +499,8 @@ int main(int argc, char* argv[]) {
control->StartUp();
/* Shutdown everything */
} catch (char * error) {
LOG_ERROR("Exit to error %s",error);
LOG_ERROR("Exit to error: %s",error);
}
GFX_Stop();
return 0;
};
};

View file

@ -214,18 +214,21 @@ void S_Warn(char * format,...) {
GFX_ShowMsg(buf);
#endif
}
char buf[1024]; //global as else it doesn't always gets thrown right (linux/gcc2.95)
void E_Exit(char * format,...) {
char buf[1024];
// char buf[1024]; //see above
if(errorlevel>=1){
va_list msg;
strcpy(buf,"EXIT:");
va_start(msg,format);
vsprintf(buf+strlen(buf),format,msg);
vsprintf(buf,format,msg);
va_end(msg);
strcat(buf,"\n");
printf(buf);
} else {
strcpy(buf,"an unsupported feature\n");
}
throw(buf);
};
};