OSDN Git Service

[VM][STATE] Use namespace {VMNAME} to separate per VMs.
[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 namespace PC8201 {
21
22 class KEYBOARD : public DEVICE
23 {
24 private:
25         const uint8_t* key_stat;
26         uint16_t column;
27         bool caps, kana;
28         
29 public:
30         KEYBOARD(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
31         {
32                 set_device_name(_T("Keyboard"));
33         }
34         ~KEYBOARD() {}
35         
36         // common functions
37         void initialize();
38         uint32_t read_io8(uint32_t addr);
39         void write_signal(int id, uint32_t data, uint32_t mask);
40         bool process_state(FILEIO* state_fio, bool loading);
41         
42         // unique functions
43         void key_down(int code);
44         bool get_caps_locked()
45         {
46                 return caps;
47         }
48         bool get_kana_locked()
49         {
50                 return kana;
51         }
52 };
53
54 }
55 #endif