OSDN Git Service

[VM][STATE] Use namespace {VMNAME} to separate per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / pc9801 / joystick.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   : 2011.03.28-
16
17         [ joystick ]
18 */
19
20 #ifndef _JOYSTICK_H_
21 #define _JOYSTICK_H_
22
23 #include "../vm.h"
24 #include "../../emu.h"
25 #include "../device.h"
26
27 #define SIG_JOYSTICK_SELECT     0
28
29 namespace PC9801 {
30
31 class JOYSTICK : public DEVICE
32 {
33 private:
34         DEVICE *d_opn;
35         
36         const uint32_t *joy_status;
37         uint8_t select;
38         
39 public:
40         JOYSTICK(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
41         {
42                 set_device_name(_T("Joystick I/F"));
43         }
44         ~JOYSTICK() {}
45         
46         // common functions
47         void initialize();
48         void write_signal(int id, uint32_t data, uint32_t mask);
49         void event_frame();
50         bool process_state(FILEIO* state_fio, bool loading);
51         
52         // unique function
53         void set_context_opn(DEVICE* device)
54         {
55                 d_opn = device;
56         }
57 };
58
59 }
60 #endif