2 FUJITSU FMR-30 Emulator 'eFMR-30'
4 Author : Takeda.Toshiya
12 void CMOS::initialize()
15 memset(cmos, 0xff, sizeof(cmos));
18 FILEIO* fio = new FILEIO();
19 if(fio->Fopen(create_local_path(_T("CMOS.BIN")), FILEIO_READ_BINARY)) {
20 fio->Fread(cmos, sizeof(cmos), 1);
29 FILEIO* fio = new FILEIO();
30 if(fio->Fopen(create_local_path(_T("CMOS.BIN")), FILEIO_WRITE_BINARY)) {
31 fio->Fwrite(cmos, sizeof(cmos), 1);
38 void CMOS::write_io8(uint32_t addr, uint32_t data)
40 if(cmos[addr & 0x1fff] != data) {
41 cmos[addr & 0x1fff] = data;
46 uint32_t CMOS::read_io8(uint32_t addr)
48 return cmos[addr & 0x1fff];
51 #define STATE_VERSION 1
53 #include "../../statesub.h"
55 void CMOS::decl_state()
57 enter_decl_state(STATE_VERSION);
59 DECL_STATE_ENTRY_1D_ARRAY(cmos, sizeof(cmos));
60 DECL_STATE_ENTRY_BOOL(modified);
65 void CMOS::save_state(FILEIO* state_fio)
67 if(state_entry != NULL) {
68 state_entry->save_state(state_fio);
71 // state_fio->FputUint32(STATE_VERSION);
72 // state_fio->FputInt32(this_device_id);
74 // state_fio->Fwrite(cmos, sizeof(cmos), 1);
75 // state_fio->FputBool(modified);
78 bool CMOS::load_state(FILEIO* state_fio)
81 if(state_entry != NULL) {
82 mb = state_entry->load_state(state_fio);
88 // if(state_fio->FgetUint32() != STATE_VERSION) {
91 // if(state_fio->FgetInt32() != this_device_id) {
94 // state_fio->Fread(cmos, sizeof(cmos), 1);
95 // modified = state_fio->FgetBool();