OSDN Git Service

[VM] Add vm_template.h . This class, VM_TEMPLATE:: must be mother of VM:: .See fm7...
[csp-qt/common_source_project-fm7.git] / source / src / vm / upd4991a.h
1 /*
2         Skelton for retropc emulator
3
4         Author : Takeda.Toshiya
5         Date   : 2008.06.10-
6
7         [ uPD4991A ]
8 */
9
10 #ifndef _UPD4991A_H_
11 #define _UPD4991A_H_
12
13 //#include "vm.h"
14 //#include "../emu.h"
15 #include "device.h"
16
17 class VM;
18 class EMU;
19 class UPD4991A : public DEVICE
20 {
21 private:
22         dll_cur_time_t cur_time;
23         int register_id;
24         
25         uint8_t regs[3][13];
26         uint8_t ctrl1, ctrl2, mode;
27         
28         void read_from_cur_time();
29         void write_to_cur_time();
30         
31 public:
32         UPD4991A(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {
33                 set_device_name(_T("uPD4991A RTC"));
34         }
35         ~UPD4991A() {}
36         
37         // common functions
38         void initialize();
39         void write_io8(uint32_t addr, uint32_t data);
40         uint32_t read_io8(uint32_t addr);
41         void event_callback(int event_id, int err);
42         void decl_state();
43         void save_state(FILEIO* state_fio);
44         bool load_state(FILEIO* state_fio);
45 };
46
47 #endif
48