OSDN Git Service

[VM][STATE] Use namespace {VMNAME} to separate per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / pc9801 / keyboard.h
1 /*
2         NEC PC-9801 Emulator 'ePC-9801'
3         NEC PC-9801E/F/M Emulator 'ePC-9801E'
4         NEC PC-9801U Emulator 'ePC-9801U'
5         NEC PC-9801VF Emulator 'ePC-9801VF'
6         NEC PC-9801VM Emulator 'ePC-9801VM'
7         NEC PC-9801VX Emulator 'ePC-9801VX'
8         NEC PC-9801RA Emulator 'ePC-9801RA'
9         NEC PC-98XA Emulator 'ePC-98XA'
10         NEC PC-98XL Emulator 'ePC-98XL'
11         NEC PC-98RL Emulator 'ePC-98RL'
12         NEC PC-98DO Emulator 'ePC-98DO'
13
14         Author : Takeda.Toshiya
15         Date   : 2010.09.16-
16
17         [ keyboard ]
18 */
19
20 #ifndef _KEYBOARD_H_
21 #define _KEYBOARD_H_
22
23 #include "../vm.h"
24 #include "../../emu.h"
25 #include "../device.h"
26
27 #define SIG_KEYBOARD_RECV       0
28
29 namespace PC9801 {
30
31 class KEYBOARD : public DEVICE
32 {
33 private:
34         DEVICE *d_sio;
35         
36         bool kana, caps;
37         uint8_t flag[256];
38         
39 public:
40         KEYBOARD(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
41         {
42                 set_device_name(_T("Keyboard"));
43         }
44         ~KEYBOARD() {}
45         
46         // common functions
47         void initialize();
48         void reset();
49         bool process_state(FILEIO* state_fio, bool loading);
50         
51         // unique functions
52         void set_context_sio(DEVICE* device)
53         {
54                 d_sio = device;
55         }
56         void key_down(int code, bool repeat);
57         void key_up(int code);
58         bool get_caps_locked()
59         {
60                 return caps;
61         }
62         bool get_kana_locked()
63         {
64                 return kana;
65         }
66 };
67
68 }
69 #endif