OSDN Git Service

[VM][STATE][MZ2500][MZ700][MZ80K] Apply new state framework to some VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / mz700 / keyboard.h
1 /*
2         SHARP MZ-700 Emulator 'EmuZ-700'
3         SHARP MZ-800 Emulator 'EmuZ-800'
4         SHARP MZ-1500 Emulator 'EmuZ-1500'
5
6         Author : Takeda.Toshiya
7         Date   : 2008.06.05 -
8
9         [ keyboard ]
10 */
11
12 #ifndef _KEYBOARD_H_
13 #define _KEYBOARD_H_
14
15 #include "../vm.h"
16 #include "../../emu.h"
17 #include "../device.h"
18
19 #define SIG_KEYBOARD_COLUMN     0
20
21 class KEYBOARD : public DEVICE
22 {
23 private:
24         DEVICE *d_pio;
25         
26         const uint8_t* key_stat;
27         uint8_t column;
28         void update_key();
29         
30 public:
31         KEYBOARD(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
32         {
33                 set_device_name(_T("Keyboard"));
34         }
35         ~KEYBOARD() {}
36         
37         // common functions
38         void initialize();
39         void write_signal(int id, uint32_t data, uint32_t mask);
40         void event_frame();
41         void decl_state();
42         void save_state(FILEIO* state_fio);
43         bool load_state(FILEIO* state_fio);
44         
45         // unique function
46         void set_context_pio(DEVICE* device)
47         {
48                 d_pio = device;
49         }
50 };
51
52 #endif