trunk/src/emu/bus/vic20/4cga.c
| r26925 | r26926 | |
| 29 | 29 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_1) |
| 30 | 30 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_2) |
| 31 | 31 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_3) |
| 32 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_4) |
| 32 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_h) |
| 33 | 33 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 34 | 34 | |
| 35 | 35 | PORT_START("JOY4") |
| r26925 | r26926 | |
| 37 | 37 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_1) |
| 38 | 38 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_2) |
| 39 | 39 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_3) |
| 40 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_4) |
| 40 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_j) |
| 41 | 41 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 42 | 42 | INPUT_PORTS_END |
| 43 | 43 | |
| r26925 | r26926 | |
| 64 | 64 | c64_4cga_device::c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 65 | 65 | device_t(mconfig, C64_4CGA, "C64 Protovision 4 Player Interface", tag, owner, clock, "c64_4cga", __FILE__), |
| 66 | 66 | device_vic20_user_port_interface(mconfig, *this), |
| 67 | | m_port(0) |
| 67 | m_port(0), |
| 68 | m_joy3(0xf), |
| 69 | m_joy4(0xf) |
| 68 | 70 | { |
| 69 | 71 | } |
| 70 | 72 | |
| r26925 | r26926 | |
| 100 | 102 | output_d((data>>1)&1); |
| 101 | 103 | output_e((data>>2)&1); |
| 102 | 104 | output_f((data>>3)&1); |
| 103 | | output_h((data>>4)&1); |
| 104 | | output_j((data>>5)&1); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
trunk/src/emu/bus/vic20/4cga.h
| r26925 | r26926 | |
| 40 | 40 | DECLARE_WRITE_LINE_MEMBER(write_joy3_1) { if (state) m_joy3 |= 2; else m_joy3 &= ~2; update_output(); } |
| 41 | 41 | DECLARE_WRITE_LINE_MEMBER(write_joy3_2) { if (state) m_joy3 |= 4; else m_joy3 &= ~4; update_output(); } |
| 42 | 42 | DECLARE_WRITE_LINE_MEMBER(write_joy3_3) { if (state) m_joy3 |= 8; else m_joy3 &= ~8; update_output(); } |
| 43 | | DECLARE_WRITE_LINE_MEMBER(write_joy3_4) { if (state) m_joy3 |= 16; else m_joy3 &= ~16; update_output(); } |
| 44 | | DECLARE_WRITE_LINE_MEMBER(write_joy3_5) { if (state) m_joy3 |= 32; else m_joy3 &= ~32; update_output(); } |
| 45 | 43 | |
| 46 | 44 | DECLARE_WRITE_LINE_MEMBER(write_joy4_0) { if (state) m_joy4 |= 1; else m_joy4 &= ~1; update_output(); } |
| 47 | 45 | DECLARE_WRITE_LINE_MEMBER(write_joy4_1) { if (state) m_joy4 |= 2; else m_joy4 &= ~2; update_output(); } |
| 48 | 46 | DECLARE_WRITE_LINE_MEMBER(write_joy4_2) { if (state) m_joy4 |= 4; else m_joy4 &= ~4; update_output(); } |
| 49 | 47 | DECLARE_WRITE_LINE_MEMBER(write_joy4_3) { if (state) m_joy4 |= 8; else m_joy4 &= ~8; update_output(); } |
| 50 | | DECLARE_WRITE_LINE_MEMBER(write_joy4_4) { if (state) m_joy4 |= 16; else m_joy4 &= ~16; update_output(); } |
| 51 | | DECLARE_WRITE_LINE_MEMBER(write_joy4_5) { if (state) m_joy4 |= 32; else m_joy4 &= ~32; update_output(); } |
| 52 | 48 | |
| 53 | 49 | protected: |
| 54 | 50 | // device-level overrides |