OSDN Git Service

22a9e38998850541a69da40e6a3fa9e6efca2f49
[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 class JOYSTICK : public DEVICE
30 {
31 private:
32         DEVICE *d_opn;
33         
34         const uint32_t *joy_status;
35         uint8_t select;
36         
37 public:
38         JOYSTICK(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
39         {
40                 set_device_name(_T("Joystick I/F"));
41         }
42         ~JOYSTICK() {}
43         
44         // common functions
45         void initialize();
46         void write_signal(int id, uint32_t data, uint32_t mask);
47         void event_frame();
48         bool process_state(FILEIO* state_fio, bool loading);
49         
50         // unique function
51         void set_context_opn(DEVICE* device)
52         {
53                 d_opn = device;
54         }
55 };
56
57 #endif