本文整理汇总了C++中CartInfo::Close方法的典型用法代码示例。如果您正苦于以下问题:C++ CartInfo::Close方法的具体用法?C++ CartInfo::Close怎么用?C++ CartInfo::Close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CartInfo
的用法示例。
在下文中一共展示了CartInfo::Close方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UNIFGI
static void UNIFGI(GI h)
{
switch(h)
{
case GI_RESETSAVE:
FCEU_ClearGameSave(&UNIFCart);
break;
case GI_RESETM2:
if(UNIFCart.Reset)
UNIFCart.Reset();
break;
case GI_POWER:
if(UNIFCart.Power)
UNIFCart.Power();
if(UNIFchrrama) memset(UNIFchrrama,0,8192);
break;
case GI_CLOSE:
FCEU_SaveGameSave(&UNIFCart);
if(UNIFCart.Close)
UNIFCart.Close();
FreeUNIF();
break;
}
}
示例2: UNIFGI
static void UNIFGI(int h, void *param)
{
switch(h)
{
case GI_RESETM2:
if(UNIFCart.Reset)
UNIFCart.Reset();
break;
case GI_POWER:
if(UNIFCart.Power)
UNIFCart.Power();
if(UNIFchrrama) memset(UNIFchrrama,0,8192);
break;
case GI_CLOSE:
FCEU_SaveGameSave(&UNIFCart);
if(UNIFCart.Close)
UNIFCart.Close();
FreeUNIF();
ResetExState(0,0);
break;
case GI_INFOSTRING:
{
char board[24];
strncpy(board, sboardname, 20);
board[20] = 0;
sprintf(param, "UNIF, %s, %s%s", board, PAL?"PAL":"NTSC", UNIFCart.battery?", BB":"");
}
break;
}
}
示例3: UNIFLoad
void UNIFLoad(Stream *fp, NESGameType *gt)
{
try
{
uint8 magic[4];
if(fp->read(magic, 4, false) != 4 || memcmp(magic, "UNIF", 4))
throw MDFN_Error(0, _("Not a valid UNIF file."));
ResetCartMapping();
ResetUNIF();
memset(WantInput, 0, sizeof(WantInput));
unhead.info = fp->get_LE<uint32>();
fp->seek(0x20, SEEK_SET);
LoadUNIFChunks(fp);
{
md5_context md5;
md5.starts();
for(int x = 0; x < 32; x++)
{
if(malloced[x])
{
md5.update(malloced[x],mallocedsizes[x]);
}
}
md5.finish(UNIFCart.MD5);
MDFN_printf(_("ROM MD5: 0x%s\n"), md5_context::asciistr(UNIFCart.MD5, 0).c_str());
memcpy(MDFNGameInfo->MD5,UNIFCart.MD5,sizeof(UNIFCart.MD5));
MDFN_printf("\n");
}
InitializeBoard();
MDFN_LoadGameSave(&UNIFCart);
gt->Power = UNIF_Power;
gt->Reset = UNIF_Reset;
gt->SaveNV = UNIF_SaveNV;
gt->Kill = UNIF_Kill;
gt->StateAction = UNIF_StateAction;
if(UNIFCart.CartExpSound.HiFill)
GameExpSound.push_back(UNIFCart.CartExpSound);
MDFNGameInfo->DesiredInput.push_back(WantInput[0]);
MDFNGameInfo->DesiredInput.push_back(WantInput[1]);
MDFNGameInfo->DesiredInput.push_back("gamepad");
MDFNGameInfo->DesiredInput.push_back("gamepad");
MDFNGameInfo->DesiredInput.push_back(WantInput[2]);
}
catch(...)
{
if(UNIFCart.Close)
UNIFCart.Close();
FreeUNIF();
ResetUNIF();
throw;
}
}
示例4: UNIF_Kill
static void UNIF_Kill(void)
{
if(UNIFCart.Close)
UNIFCart.Close();
FreeUNIF();
}