2 TOSHIBA PASOPIA Emulator 'EmuPIA'
3 TOSHIBA PASOPIA 7 Emulator 'EmuPIA7'
5 Author : Takeda.Toshiya
11 #include "kanjipac2.h"
13 void KANJIPAC2::initialize(int id)
15 FILEIO* fio = new FILEIO();
16 if(fio->Fopen(create_local_path(_T("KANJI.ROM")), FILEIO_READ_BINARY)) {
17 fio->Fread(rom, sizeof(rom), 1);
25 void KANJIPAC2::write_io8(uint32_t addr, uint32_t data)
29 ptr = (ptr & 0x1ff00) | data;
32 ptr = (ptr & 0x100ff) | (data << 8);
35 ptr = (ptr & 0x0ffff) | ((data & 0x01) << 16);
40 uint32_t KANJIPAC2::read_io8(uint32_t addr)
42 return rom[ptr & 0x1ffff];
45 #define STATE_VERSION 1
47 #include "../../statesub.h"
49 void KANJIPAC2::decl_state()
51 state_entry = new csp_state_utils(STATE_VERSION, 0, (const _TCHAR *)_T("PAC2SLOT::KANJIPAC2"), NULL);
53 DECL_STATE_ENTRY_UINT32(ptr);
58 void KANJIPAC2::save_state(FILEIO* state_fio)
60 if(state_entry != NULL) {
61 state_entry->save_state(state_fio);
63 // state_fio->FputUint32(STATE_VERSION);
65 // state_fio->FputUint32(ptr);
68 bool KANJIPAC2::load_state(FILEIO* state_fio)
71 if(state_entry != NULL) {
72 mb = state_entry->load_state(state_fio);
75 // if(state_fio->FgetUint32() != STATE_VERSION) {
78 // ptr = state_fio->FgetUint32();
82 bool KANJIPAC2::process_state(FILEIO* state_fio, bool loading)
84 if(!state_fio->StateCheckUint32(STATE_VERSION)) {
87 state_fio->StateUint32(ptr);