2 MITSUBISHI Electric MULTI8 Emulator 'EmuLTI8'
4 Author : Takeda.Toshiya
13 void KANJI::initialize()
16 FILEIO* fio = new FILEIO();
17 if(fio->Fopen(create_local_path(_T("KANJI.ROM")), FILEIO_READ_BINARY)) {
18 fio->Fread(rom, sizeof(rom), 1);
21 // 8255 Port A, bit6 = 0 (kanji rom exists)
22 d_pio->write_signal(SIG_I8255_PORT_A, 0, 0x40);
24 // 8255 Port A, bit6 = 1 (kanji rom does not exist)
25 d_pio->write_signal(SIG_I8255_PORT_A, 0x40, 0x40);
35 void KANJI::write_io8(uint32_t addr, uint32_t data)
39 ptr = (ptr & 0xff00) | data;
42 ptr = (ptr & 0x00ff) | (data << 8);
47 uint32_t KANJI::read_io8(uint32_t addr)
51 return rom[(ptr << 1) | 0];
53 return rom[(ptr << 1) | 1];
58 #define STATE_VERSION 1
60 #include "../../statesub.h"
62 void KANJI::decl_state()
64 enter_decl_state(STATE_VERSION);
66 DECL_STATE_ENTRY_UINT32(ptr);
71 void KANJI::save_state(FILEIO* state_fio)
73 if(state_entry != NULL) {
74 state_entry->save_state(state_fio);
76 // state_fio->FputUint32(STATE_VERSION);
78 // state_fio->FputUint32(ptr);
81 bool KANJI::load_state(FILEIO* state_fio)
84 if(state_entry != NULL) {
85 mb = state_entry->load_state(state_fio);
90 // if(state_fio->FgetUint32() != STATE_VERSION) {
93 // ptr = state_fio->FgetUint32();
97 bool KANJI::process_state(FILEIO* state_fio, bool loading)
99 if(!state_fio->StateCheckUint32(STATE_VERSION)) {
102 if(!state_fio->StateCheckInt32(this_device_id)) {
105 state_fio->StateUint32(ptr);