本文整理汇总了C++中FILEIO::Fseek方法的典型用法代码示例。如果您正苦于以下问题:C++ FILEIO::Fseek方法的具体用法?C++ FILEIO::Fseek怎么用?C++ FILEIO::Fseek使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FILEIO
的用法示例。
在下文中一共展示了FILEIO::Fseek方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
void PC80S31K::initialize()
{
// init memory
memset(rom, 0xff, sizeof(rom));
memset(ram, 0, sizeof(ram));
memset(rdmy, 0xff, sizeof(rdmy));
// load rom image
FILEIO* fio = new FILEIO();
if(fio->Fopen(create_local_path(_T("PC88.ROM")), FILEIO_READ_BINARY)) {
fio->Fseek(0x14000, FILEIO_SEEK_CUR);
fio->Fread(rom, sizeof(rom), 1);
fio->Fclose();
} else if(fio->Fopen(create_local_path(_T("DISK.ROM")), FILEIO_READ_BINARY)) {
fio->Fread(rom, sizeof(rom), 1);
fio->Fclose();
} else {
// stop cpu
d_cpu->write_signal(SIG_CPU_BUSREQ, 1, 1);
}
delete fio;
// init memory map
SET_BANK(0x0000, 0x1fff, wdmy, rom);
SET_BANK(0x2000, 0x3fff, wdmy, rdmy);
SET_BANK(0x4000, 0x7fff, ram, ram);
SET_BANK(0x8000, 0xffff, wdmy, rdmy);
// XM8 version 1.20
// both drives always set force ready signal
d_fdc->write_signal(SIG_UPD765A_FREADY, 1, 1);
}
示例2: initialize
//
// initialize()
// initiailize
//
void DiskSub::initialize()
{
FILEIO *fio;
int high;
int low;
uint8 *ptr;
uint8 eor;
// clear rom & initialize (JR *)
memset(&memory[0x0000], 0xff, 0x2000);
memory[0x0000] = 0x18;
memory[0x0001] = 0xfe;
// clear higher memory
memset(&memory[0x8000], 0xff, 0x8000);
// inititlize 0x2000-0x7fff
ptr = &memory[0x2000];
for (high=0; high<0x60; high++) {
// get xor data
switch (init_table[high]) {
case 0:
eor = 0xf0;
break;
case 1:
eor = 0x0f;
break;
case 2:
eor = 0xff;
break;
default:
eor = 0x00;
break;
}
// fill memory
for (low=0; low<0x10; low++) {
memset(ptr, init_pattern[low] ^ eor, 0x10);
ptr += 0x10;
}
}
// read ROM (both PC88.ROM and DISK.ROM)
fio = new FILEIO;
if (fio->Fopen(emu->bios_path(_T("PC88.ROM")), FILEIO_READ_BINARY) == true) {
fio->Fseek(0x14000, FILEIO_SEEK_CUR);
fio->Fread(&memory[0], 1, 0x2000);
fio->Fclose();
}
if (fio->Fopen(emu->bios_path(_T("DISK.ROM")), FILEIO_READ_BINARY) == true) {
fio->Fread(&memory[0], 1, 0x2000);
fio->Fclose();
}
delete fio;
}
示例3: CheckSub
//
// CheckSub()
// check one rom file
//
bool Font::CheckSub(const char *rom, bool msgbox)
{
FILEIO fio;
Platform *platform;
EMU_SDL *wrapper;
_TCHAR *path;
Uint32 size;
// get EMU_SDL instance
wrapper = app->GetWrapper();
// get path
path = wrapper->get_bios_path((_TCHAR*)rom);
// try to open
if (fio.Fopen(path, FILEIO_READ_BINARY) == true) {
// seek and get size
fio.Fseek(0, FILEIO_SEEK_END);
size = (Uint32)fio.Ftell();
fio.Fseek(0, FILEIO_SEEK_SET);
// read
if (size <= sizeof(kanji_rom)) {
fio.Fread(kanji_rom, 1, (uint32)size);
}
// open ok
fio.Fclose();
return true;
}
// msgbox
if (msgbox == true) {
platform = app->GetPlatform();
sprintf(rom_message, "The ROM file is not found:\n");
strcat(rom_message, path);
platform->MsgBox(window, rom_message);
}
// not found
return false;
}