2 ASCII MSX1 Emulator 'yaMSX1'
3 ASCII MSX2 Emulator 'yaMSX2'
4 Pioneer PX-7 Emulator 'ePX-7'
9 modified by Takeda.Toshiya
16 #include "../ym2203.h"
18 void JOYSTICK::initialize()
20 joy_stat = emu->get_joy_buffer();
23 // register event to update the key status
24 register_frame_event(this);
27 void JOYSTICK::event_frame()
29 d_psg->write_signal(SIG_YM2203_PORT_A, ~(joy_stat[select] & 0x3f), 0x7f);
32 void JOYSTICK::write_signal(int id, uint32_t data, uint32_t mask)
34 if(id == SIG_JOYSTICK_SEL) {
35 if(select != ((data & mask) != 0)) {
36 select = ((data & mask) != 0);
37 d_psg->write_signal(SIG_YM2203_PORT_A, ~(joy_stat[select] & 0x3f), 0x7f);
42 #define STATE_VERSION 1
44 void JOYSTICK::save_state(FILEIO* state_fio)
46 state_fio->FputUint32(STATE_VERSION);
47 state_fio->FputInt32(this_device_id);
49 state_fio->FputInt32(select);
52 bool JOYSTICK::load_state(FILEIO* state_fio)
54 if(state_fio->FgetUint32() != STATE_VERSION) {
57 if(state_fio->FgetInt32() != this_device_id) {
60 select = state_fio->FgetInt32();