示例#1
0
CRSCylinder::~CRSCylinder(void)
{
	KillSystem();
}
示例#2
0
CPSSparks::~CPSSparks(void)
{
	KillSystem();
}
示例#3
0
int WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
#endif
{
int i,n,j;
u32 dd,nn;
dip_t *dip;

#if !defined(_DEBUG) && !defined(GEKKO) && !defined(LINUX)
int argc;
char **argv,*pstart,*pend,*str;
list_c argvlist;

pstart = lpCmdLine;
for(;;)
	{
	while(*pstart == ' ') //skip any spaces
		pstart++;
	if(strcmp(pstart,"") != 0) //is there another entry?
		{
		if(*pstart == '\"') //beginning quote, this is all one str
			pend = strchr(pstart,'\"');
		else if((pend = strchr(pstart,' ')) == 0)
			pend = lpCmdLine + strlen(lpCmdLine);
		str = new char[pend - pstart + 1];
		memset(str,0,pend - pstart + 1);
		strncpy(str,pstart,pend - pstart);
		pstart = pend;
		argvlist.add(str);
		}
	else
		break;
	}
argc = argvlist.num() + 1;
argv = new char*[argc];
argv[0] = new char[_MAX_PATH];
GetModuleFileName(GetModuleHandle(0),argv[0],_MAX_PATH);
for(i=1;i<argc;i++)
	argv[i] = (char*)argvlist.get(i - 1);
#endif

memset(RomSets,0,sizeof(CRomSet*) * MAX_ROMSETS);
AddRomSets();
ParameterInit_Arg(argv,argc);						//set our argument pointers
freq = 1000;
last = ticks = SDL_GetTicks();
frametime = freq / 60;
for(n=0;RomSets[n] != 0;n++)						//set default dip settings
	{
	for(nn=0,j=0;j<4;j++)
		{
		if((dip = RomSets[n]->GetDip(j)) == 0)
			break;
		for(dd=0,i=0;dip[i].Name;i++)
			dd |= dip[i].Default;
		nn |= dd << (j * 8);
		}
	settings.dip_default[n] = nn;
	}
settings.SetDefault();
if(CheckParameter("--setdefaults") == 0)			//user wants to reset settings, so dont load
	settings.Load();										//load settings
if(InitSystem(800,600,CheckParameter("--fullscreen")) != 0)
	{														//initialize system classes (vid/inp/snd)
	message("error initializing system\n");	//complain, hopefully the bad component explained
	return(1);											//return error
	}
if(CheckParameter("--rompath")) {
    strcpy(settings.romdir,GetParameterData("--rompath"));
}
if(CheckParameter("--romset"))									//if romset parameter specified
	{
	for(i=0;RomSets[i] != 0;i++)
		{
		if(strcmp(RomSets[i]->GetName(),GetParameterData("--romset")) == 0)
			{
			if(Init(RomSets[i]) != 0)								//try to create machine
				break;
			printf("trying to load %s\n",RomSet->GetName());
			video->SetSize(RomSet->ScreenW(),RomSet->ScreenH());
			if(Machine)
				{
				if(CheckParameter("--loadstate"))				//load save state
					{
					CState *s = new CState();						//create new state object

					if(s->Load(0,RomSet->GetName()) == 0)		//try to load state
						{
						Machine->LoadState(s);						//load state into machine
						s->Close();										//close state object
						}
					delete s;											//destroy state object
					}
				}
			break;
			}
		}
	}
if(CheckParameter("--stop") ||				//see if emulation should begin paused
	CheckParameter("--pause"))
	running = 0;									//clear running flag
if(CheckParameter("--run"))					//see if emulation should begin running (default)
	running = 1;									//set running flag
while(quit == 0)
	{
	nolock = 0;
//	if(GetAsyncKeyState('Q'))					//cheap fast forward hack
//		nolock = 1;
	nolock += ~settings.lockfps & 1;
	if(running && Machine)						//if running flag is set and a machine is loaded
		Machine->Frame();							//execute a machine frame
//	else
//		Sleep(100);								//else sleep for 0.1 seconds
	calcfps();									//show frames per second in title bar
	checkmessages();							//process messages
	}
Kill();												//destroy machine
KillSystem();							//destroy system classes
settings.Save();									//save settings
for(n=0;RomSets[n] != 0;n++)					//free romsets
	delete RomSets[n];
return(0);
}
示例#4
0
CPSSpawnEffect::~CPSSpawnEffect(void)
{
	KillSystem();
}
示例#5
0
文件: root.cpp 项目: mittorn/hlwe_src
C$$PREFIX$$$$Safe_root$$::~C$$PREFIX$$$$Safe_root$$(void)
{
	// TODO: clear private data here
	KillSystem();
}
示例#6
0
CPSDrips::~CPSDrips(void)
{
	KillSystem();
}
示例#7
0
CPSBlood::~CPSBlood(void)
{
	KillSystem();
}
示例#8
0
CPSBubbles::~CPSBubbles(void)
{
	KillSystem();
}