2 TOSHIBA PASOPIA Emulator 'EmuPIA'
4 Author : Takeda.Toshiya
13 #include "kanjipac2.h"
16 void PAC2::initialize()
18 rampac2 = new RAMPAC2(vm, emu);
19 kanji = new KANJIPAC2(vm, emu);
20 joy = new JOYPAC2(vm, emu);
21 dummy = new PAC2DEV(vm, emu);
23 rampac2->initialize(1);
40 device_type = config.device_type;
41 get_device()->reset();
44 void PAC2::write_io8(uint32 addr, uint32 data)
51 get_device()->write_io8(addr, data);
56 uint32 PAC2::read_io8(uint32 addr)
58 return get_device()->read_io8(addr);
61 PAC2DEV* PAC2::get_device()
66 case DEVICE_KANJI_ROM:
74 void PAC2::open_rampac2(_TCHAR* file_path)
76 rampac2->open_file(file_path);
79 #define STATE_VERSION 1
81 void PAC2::save_state(FILEIO* state_fio)
83 state_fio->FputUint32(STATE_VERSION);
84 state_fio->FputInt32(this_device_id);
86 state_fio->FputInt32(device_type);
87 get_device()->save_state(state_fio);
90 bool PAC2::load_state(FILEIO* state_fio)
92 if(state_fio->FgetUint32() != STATE_VERSION) {
95 if(state_fio->FgetInt32() != this_device_id) {
98 device_type = state_fio->FgetInt32();
99 if(!get_device()->load_state(state_fio)) {