本文整理汇总了C++中CState::Load方法的典型用法代码示例。如果您正苦于以下问题:C++ CState::Load方法的具体用法?C++ CState::Load怎么用?C++ CState::Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CState
的用法示例。
在下文中一共展示了CState::Load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WinMain
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
//.........这里部分代码省略.........