OSDN Git Service

c965c49dd1b8d1543739aec0b252c74b98d32651
[csp-qt/common_source_project-fm7.git] / source / src / vm / pc8201 / keyboard.h
1 /*
2         NEC PC-8201 Emulator 'ePC-8201'
3
4         Author : Takeda.Toshiya
5         Date   : 2009.03.31-
6
7         [ keyboard ]
8 */
9
10 #ifndef _KEYBOARD_H_
11 #define _KEYBOARD_H_
12
13 #include "../vm.h"
14 #include "../../emu.h"
15 #include "../device.h"
16
17 #define SIG_KEYBOARD_COLUMN_L   0
18 #define SIG_KEYBOARD_COLUMN_H   1
19
20 class KEYBOARD : public DEVICE
21 {
22 private:
23         const uint8_t* key_stat;
24         uint16_t column;
25         bool caps, kana;
26         
27 public:
28         KEYBOARD(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
29         {
30                 set_device_name(_T("Keyboard"));
31         }
32         ~KEYBOARD() {}
33         
34         // common functions
35         void initialize();
36         uint32_t read_io8(uint32_t addr);
37         void write_signal(int id, uint32_t data, uint32_t mask);
38         bool process_state(FILEIO* state_fio, bool loading);
39         
40         // unique functions
41         void key_down(int code);
42         bool get_caps_locked()
43         {
44                 return caps;
45         }
46         bool get_kana_locked()
47         {
48                 return kana;
49         }
50 };
51
52 #endif