OSDN Git Service

2e9f10cd8712dd777b441f8c6bb15f4b8388e3f0
[csp-qt/common_source_project-fm7.git] / source / src / vm / bubcom80 / rtc.h
1 /*
2         Systems Formulate BUBCOM80 Emulator 'eBUBCOM80'
3
4         Author : Takeda.Toshiya
5         Date   : 2018.05.11-
6
7         [ rtc ]
8 */
9
10 #ifndef _RTC_H_
11 #define _RTC_H_
12
13 #include "../vm.h"
14 #include "../../emu.h"
15 #include "../device.h"
16
17 class RTC : public DEVICE
18 {
19 private:
20         dll_cur_time_t cur_time;
21         dll_cur_time_t tmp_time;
22         uint8_t ctrl;
23         
24 public:
25         RTC(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
26         {
27                 set_device_name(_T("RTC"));
28         }
29         ~RTC() {}
30         
31         // common functions
32         void initialize();
33         void reset();
34         void write_io8(uint32_t addr, uint32_t data);
35         uint32_t read_io8(uint32_t addr);
36         void event_callback(int event_id, int err);
37         void decl_state();
38         void save_state(FILEIO* state_fio);
39         bool load_state(FILEIO* state_fio);
40 };
41
42 #endif
43