本文整理汇总了C++中EMUFILE_FILE::EnablePositionCache方法的典型用法代码示例。如果您正苦于以下问题:C++ EMUFILE_FILE::EnablePositionCache方法的具体用法?C++ EMUFILE_FILE::EnablePositionCache怎么用?C++ EMUFILE_FILE::EnablePositionCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EMUFILE_FILE
的用法示例。
在下文中一共展示了EMUFILE_FILE::EnablePositionCache方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: connect
virtual void connect()
{
Close();
romSize = 0;
sramSize = 0;
if (gameInfo.romsize == 0)
{
return;
}
if (GBACartridge_RomPath.empty())
{
return;
}
if (!strcasecmp(GBACartridge_RomPath.c_str(), "self"))
{
GBACartridge_RomPath = path.path;
GBACartridge_SRAMPath = Path::GetFileNameWithoutExt(GBACartridge_RomPath) + "." + GBA_SRAM_FILE_EXT;
}
printf("GBASlot opening ROM: %s\n", GBACartridge_RomPath.c_str());
EMUFILE_FILE *inf = new EMUFILE_FILE(GBACartridge_RomPath, "rb");
inf->EnablePositionCache();
fROM = inf;
if (fROM->fail())
{
printf(" - Failed\n");
Close();
return;
}
romSize = fROM->size();
printf(" - Success (%u bytes)\n", romSize);
// Load the GBA cartridge SRAM.
inf = new EMUFILE_FILE(GBACartridge_SRAMPath, "rb+");
fSRAM = inf;
if(fSRAM->fail())
{
delete fSRAM;
fSRAM = NULL;
printf("GBASlot did not load associated SRAM.\n");
}
else
{
inf->EnablePositionCache();
sramSize = fSRAM->size();
printf("Scanning GBA rom to ID save type\n");
saveType = scanSaveTypeGBA();
printf("\nGBASlot found SRAM (%s - %u bytes) at:\n%s\n", (saveType == 0xFF)?"Unknown":saveTypes[saveType], sramSize, GBACartridge_SRAMPath.c_str());
gbaFlash.size = sramSize;
if (gbaFlash.size <= (64 * 1024))
{
gbaFlash.idDevice = 0x1B;
gbaFlash.idManufacturer = 0x32;
}
else
{
gbaFlash.idDevice = 0x09;
gbaFlash.idManufacturer = 0xC2;
}
gbaFlash.state = 0;
}
}