2 NEC PC-98LT Emulator 'ePC-98LT'
3 NEC PC-98HA Emulator 'eHANDY98'
5 Author : Takeda.Toshiya
14 void NOTE::initialize()
17 memset(regs, 0, sizeof(regs));
20 void NOTE::write_io8(uint32_t addr, uint32_t data)
22 switch(addr & 0xffff) {
24 regs[ch & 0x0f] = data;
42 // bit0 = 1: power off
43 // d_pic->write_signal(SIG_I8259_IR5, data, 2);
51 uint32_t NOTE::read_io8(uint32_t addr)
53 switch(addr & 0xffff) {
55 return regs[ch & 0x0f];
60 return 0xe; // 4 if no memcard
63 return 0x46; // 0x40 if no memcard
65 // bit7 = 1: docking station
66 // bit6 = 1: ac power supply
69 // bit2 = 1: li.battery low
70 // bit1 = 1: battery low
71 // bit0 = 1: power off
72 #ifdef DOCKING_STATION
81 #define STATE_VERSION 1
83 #include "../../statesub.h"
85 void NOTE::decl_state()
87 enter_decl_state(STATE_VERSION);
89 DECL_STATE_ENTRY_UINT8(ch);
90 DECL_STATE_ENTRY_1D_ARRAY(regs, sizeof(regs));
95 void NOTE::save_state(FILEIO* state_fio)
97 if(state_entry != NULL) {
98 state_entry->save_state(state_fio);
100 // state_fio->FputUint32(STATE_VERSION);
101 // state_fio->FputInt32(this_device_id);
103 // state_fio->FputUint8(ch);
104 // state_fio->Fwrite(regs, sizeof(regs), 1);
107 bool NOTE::load_state(FILEIO* state_fio)
110 if(state_entry != NULL) {
111 mb = state_entry->load_state(state_fio);
116 // if(state_fio->FgetUint32() != STATE_VERSION) {
119 // if(state_fio->FgetInt32() != this_device_id) {
122 // ch = state_fio->FgetUint8();
123 // state_fio->Fread(regs, sizeof(regs), 1);
127 bool NOTE::process_state(FILEIO* state_fio, bool loading)
129 if(!state_fio->StateCheckUint32(STATE_VERSION)) {
132 if(!state_fio->StateCheckInt32(this_device_id)) {
135 state_fio->StateUint8(ch);
136 state_fio->StateBuffer(regs, sizeof(regs), 1);