OSDN Git Service

[VM][STATE] Use namespace {VMNAME} to separate per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / phc25 / joystick.cpp
1 /*
2         SANYO PHC-25 Emulator 'ePHC-25'
3         SEIKO MAP-1010 Emulator 'eMAP-1010'
4
5         Author : Takeda.Toshiya
6         Date   : 2010.08.06-
7
8         [ joystick ]
9 */
10
11 #include "joystick.h"
12 #include "../ay_3_891x.h"
13
14 namespace PHC25 {
15
16 void JOYSTICK::initialize()
17 {
18         joy_stat = emu->get_joy_buffer();
19         
20         // register event to update the key status
21         register_frame_event(this);
22 }
23
24 void JOYSTICK::event_frame()
25 {
26         d_psg->write_signal(SIG_AY_3_891X_PORT_A, ~(joy_stat[0] & 0x1f), 0xff);
27         d_psg->write_signal(SIG_AY_3_891X_PORT_B, ~(joy_stat[1] & 0x1f), 0xff);
28 }
29
30 }