本文整理汇总了C++中FILEIO类的典型用法代码示例。如果您正苦于以下问题:C++ FILEIO类的具体用法?C++ FILEIO怎么用?C++ FILEIO使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FILEIO类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: memset
void MEMORY::initialize()
{
memset(rom, 0xff, sizeof(rom));
memset(rdmy, 0xff, sizeof(rdmy));
// load rom image
FILEIO* fio = new FILEIO();
if(fio->Fopen(emu->bios_path(_T("BASIC.ROM")), FILEIO_READ_BINARY)) {
fio->Fread(rom, sizeof(rom), 1);
fio->Fclose();
}
delete fio;
// set memory map
#ifdef _MAP1010
SET_BANK(0x0000, 0x5fff, wdmy, rom );
SET_BANK(0x6000, 0x77ff, vram, vram);
SET_BANK(0x7800, 0x7fff, wdmy, rdmy);
SET_BANK(0x8000, 0xffff, ram, ram );
#else
SET_BANK(0x0000, 0x5fff, wdmy, rom );
SET_BANK(0x6000, 0x77ff, vram, vram);
SET_BANK(0x7800, 0xbfff, wdmy, rdmy);
SET_BANK(0xc000, 0xffff, ram, ram );
#endif
}
示例2: DEVICE
KANJIROM::KANJIROM(VM *parent_vm, EMU* parent_emu, bool type_2std): DEVICE(parent_vm, parent_emu)
{
FILEIO *fio;
read_ok = false;
fio = new FILEIO();
memset(data_table, 0xff, 0x20000);
// read_table[0].memory = data_table;
if(type_2std) {
class2 = true;
if(fio->Fopen(create_local_path(_T("KANJI2.ROM")), FILEIO_READ_BINARY)) {
fio->Fread(data_table, 0x20000, 1);
fio->Fclose();
read_ok = true;
}
} else {
class2 = false;
if(fio->Fopen(create_local_path(_T("KANJI1.ROM")), FILEIO_READ_BINARY)) {
fio->Fread(data_table, 0x20000, 1);
fio->Fclose();
read_ok = true;
} else if(fio->Fopen(create_local_path(_T("KANJI.ROM")), FILEIO_READ_BINARY)) {
fio->Fread(data_table, 0x20000, 1);
fio->Fclose();
read_ok = true;
}
}
kanjiaddr.d = 0;
delete fio;
return;
}
示例3: FILEIO
void CMOS::release()
{
FILEIO* fio = new FILEIO();
if(fio->Fopen(emu->bios_path(_T("CMOS.BIN")), FILEIO_WRITE_BINARY)) {
fio->Fwrite(cmos, sizeof(cmos), 1);
fio->Fclose();
}
delete fio;
}
示例4: emu
VM::VM(EMU* parent_emu) : emu(parent_emu)
{
// create devices
first_device = last_device = NULL;
dummy = new DEVICE(this, emu); // must be 1st device
event = new EVENT(this, emu); // must be 2nd device
drec = new DATAREC(this, emu);
cpu = new I8080(this, emu); // i8085
memory = new MEMORY(this, emu);
rtc = new RP5C01(this, emu);
io = new IO(this, emu);
// set contexts
event->set_context_cpu(cpu);
event->set_context_sound(drec);
drec->set_context_ear(io, SIG_IO_CMT, 1);
cpu->set_context_sod(io, SIG_IO_SOD, 1);
io->set_context_cpu(cpu);
io->set_context_drec(drec);
io->set_context_rtc(rtc);
// cpu bus
cpu->set_context_mem(memory);
cpu->set_context_io(io);
cpu->set_context_intr(io);
#ifdef USE_DEBUGGER
cpu->set_context_debugger(new DEBUGGER(this, emu));
#endif
// memory bus
memset(rom, 0xff, sizeof(rom));
memset(ram, 0, sizeof(ram));
memory->read_bios(_T("BIOS.ROM"), rom, sizeof(rom));
FILEIO* fio = new FILEIO();
if(fio->Fopen(create_local_path(_T("RAM.BIN")), FILEIO_READ_BINARY)) {
fio->Fread(ram, sizeof(ram), 1);
fio->Fclose();
}
delete fio;
memory->set_memory_r(0x0000, 0x7fff, rom);
memory->set_memory_rw(0x8000, 0xffff, ram);
memory->set_wait_rw(0x0000, 0xffff, 1);
// initialize all devices
for(DEVICE* device = first_device; device; device = device->next_device) {
device->initialize();
}
}
示例5: FILEIO
void KANJIPAC2::initialize(int id)
{
FILEIO* fio = new FILEIO();
if(fio->Fopen(emu->bios_path(_T("KANJI.ROM")), FILEIO_READ_BINARY)) {
fio->Fread(rom, sizeof(rom), 1);
fio->Fclose();
}
delete fio;
ptr = 0;
}
示例6: memset
void ROMPACK::initialize()
{
memset(rom, 0xff, sizeof(rom));
FILEIO* fio = new FILEIO();
if(fio->Fopen(emu->bios_path(_T("ROMPACK.ROM")), FILEIO_READ_BINARY)) {
fio->Fread(rom, sizeof(rom), 1);
fio->Fclose();
}
delete fio;
}
示例7: FILEIO
void RAMPAC2::release()
{
// save modified data
if(opened && modified) {
FILEIO* fio = new FILEIO();
if(fio->Fopen(path, FILEIO_WRITE_BINARY)) {
fio->Fwrite(ram, sizeof(ram), 1);
fio->Fclose();
}
delete fio;
}
}
示例8: memset
void CMOS::initialize()
{
// load cmos image
memset(cmos, 0, sizeof(cmos));
FILEIO* fio = new FILEIO();
if(fio->Fopen(emu->bios_path(_T("CMOS.BIN")), FILEIO_READ_BINARY)) {
fio->Fread(cmos, sizeof(cmos), 1);
fio->Fclose();
}
delete fio;
}
示例9: FILEIO
void RP5C01::release()
{
#ifndef HAS_RP5C15
// save ram image
FILEIO* fio = new FILEIO();
if(fio->Fopen(emu->bios_path(_T("RP5C01.BIN")), FILEIO_WRITE_BINARY)) {
fio->Fwrite(ram, sizeof(ram), 1);
fio->Fclose();
}
delete fio;
#endif
}
示例10: memset
void MAIN::initialize()
{
memset(rom, 0xff, sizeof(rom));
memset(rdmy, 0xff, sizeof(rdmy));
FILEIO* fio = new FILEIO();
if(fio->Fopen(emu->bios_path(_T("BASIC.ROM")), FILEIO_READ_BINARY)) {
fio->Fread(rom, sizeof(rom), 1);
fio->Fclose();
}
delete fio;
SET_BANK(0x0000, 0xffff, ram, ram);
}
示例11: memset
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);
}
示例12: memset
void EXTROM::initialize()
{
// init image
memset(rom, 0, sizeof(rom));
// load rom image
FILEIO* fio = new FILEIO();
if(fio->Fopen(emu->bios_path(_T("EXT.ROM")), FILEIO_READ_BINARY)) {
fio->Fread(rom, sizeof(rom), 1);
fio->Fclose();
}
delete fio;
ptr = 0;
}
示例13: TO_BCD
void RTC::release()
{
// set power off time
regs[POFMI] = TO_BCD(cur_time.minute);
regs[POFH] = TO_BCD(cur_time.hour);
regs[POFD] = TO_BCD(cur_time.day);
// save rtc regs image
FILEIO* fio = new FILEIO();
if(fio->Fopen(create_local_path(_T("RTC.BIN")), FILEIO_WRITE_BINARY)) {
fio->Fwrite(regs + 8, 32, 1);
fio->Fclose();
}
delete fio;
}
示例14: FILEIO
void MEMORY::open_cart(_TCHAR* file_path)
{
FILEIO* fio = new FILEIO();
if(fio->Fopen(file_path, FILEIO_READ_BINARY)) {
memset(cart, 0xff, sizeof(cart));
fio->Fread(cart, sizeof(cart), 1);
fio->Fclose();
}
delete fio;
// set memory map
SET_BANK(0x0000, 0x7fff, wdmy, cart);
SET_BANK(0x8000, 0xffff, ram + 0x8000, ram + 0x8000);
}
示例15: memset
void KANJI::initialize()
{
// init image
memset(kanji, 0xff, sizeof(kanji));
// load kanji image
FILEIO* fio = new FILEIO();
if(fio->Fopen(create_local_path(_T("KANJI.ROM")), FILEIO_READ_BINARY)) {
fio->Fread(kanji, sizeof(kanji), 1);
fio->Fclose();
}
delete fio;
ptr = 0;
strobe = false;
}