OSDN Git Service

ddc00e270757ae80230270521845d5a8f4c157c1
[csp-qt/common_source_project-fm7.git] / source / src / vm / fmr30 / timer.h
1 /*
2         FUJITSU FMR-30 Emulator 'eFMR-30'
3
4         Author : Takeda.Toshiya
5         Date   : 2008.12.31 -
6
7         [ timer ]
8 */
9
10 #ifndef _TIMER_H_
11 #define _TIMER_H_
12
13 #include "../vm.h"
14 #include "../../emu.h"
15 #include "../device.h"
16
17 #define SIG_TIMER_CH0   0
18 #define SIG_TIMER_CH1   1
19
20 class TIMER : public DEVICE
21 {
22 private:
23         DEVICE *d_pic;
24         
25         uint8 ctrl, status;
26         void update_intr();
27         
28 public:
29         TIMER(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}
30         ~TIMER() {}
31         
32         // common functions
33         void initialize();
34         void write_io8(uint32 addr, uint32 data);
35         uint32 read_io8(uint32 addr);
36         void write_signal(int id, uint32 data, uint32 mask);
37         void save_state(FILEIO* state_fio);
38         bool load_state(FILEIO* state_fio);
39         
40         // unique function
41         void set_context_pic(DEVICE* device)
42         {
43                 d_pic = device;
44         }
45 };
46
47 #endif
48