src/mess/machine/c64_4ksa.c
| r0 | r14771 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Kingsoft 4-Player Adapter emulation |
| 4 | |
| 5 | http://hitmen.c02.at/html/hardware.html |
| 6 | |
| 7 | Copyright MESS Team. |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | |
| 10 | **********************************************************************/ |
| 11 | |
| 12 | #include "c64_4ksa.h" |
| 13 | |
| 14 | |
| 15 | |
| 16 | //************************************************************************** |
| 17 | // DEVICE DEFINITIONS |
| 18 | //************************************************************************** |
| 19 | |
| 20 | const device_type C64_4KSA = &device_creator<c64_4ksa_device>; |
| 21 | |
| 22 | |
| 23 | INPUT_CHANGED_MEMBER( c64_4ksa_device::fire4 ) |
| 24 | { |
| 25 | m_slot->sp2_w(newval); |
| 26 | } |
| 27 | |
| 28 | static INPUT_PORTS_START( c64_4player ) |
| 29 | PORT_START("SP2") |
| 30 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_4ksa_device, fire4, 0) |
| 31 | |
| 32 | PORT_START("PB") |
| 33 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) |
| 34 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) |
| 35 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) |
| 36 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) |
| 37 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) |
| 38 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) |
| 39 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) |
| 40 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) |
| 41 | |
| 42 | PORT_START("PA2") |
| 43 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) |
| 44 | INPUT_PORTS_END |
| 45 | |
| 46 | |
| 47 | //------------------------------------------------- |
| 48 | // input_ports - device-specific input ports |
| 49 | //------------------------------------------------- |
| 50 | |
| 51 | ioport_constructor c64_4ksa_device::device_input_ports() const |
| 52 | { |
| 53 | return INPUT_PORTS_NAME( c64_4player ); |
| 54 | } |
| 55 | |
| 56 | |
| 57 | |
| 58 | //************************************************************************** |
| 59 | // LIVE DEVICE |
| 60 | //************************************************************************** |
| 61 | |
| 62 | //------------------------------------------------- |
| 63 | // c64_4ksa_device - constructor |
| 64 | //------------------------------------------------- |
| 65 | |
| 66 | c64_4ksa_device::c64_4ksa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 67 | device_t(mconfig, C64_4KSA, "C64 Kingsoft 4-Player Adapter", tag, owner, clock), |
| 68 | device_c64_user_port_interface(mconfig, *this) |
| 69 | { |
| 70 | } |
| 71 | |
| 72 | |
| 73 | //------------------------------------------------- |
| 74 | // device_start - device-specific startup |
| 75 | //------------------------------------------------- |
| 76 | |
| 77 | void c64_4ksa_device::device_start() |
| 78 | { |
| 79 | } |
| 80 | |
| 81 | |
| 82 | //------------------------------------------------- |
| 83 | // c64_pb_r - port B read |
| 84 | //------------------------------------------------- |
| 85 | |
| 86 | UINT8 c64_4ksa_device::c64_pb_r(address_space &space, offs_t offset) |
| 87 | { |
| 88 | return input_port_read(*this, "PB"); |
| 89 | } |
| 90 | |
| 91 | |
| 92 | //------------------------------------------------- |
| 93 | // c64_pb_w - port B write |
| 94 | //------------------------------------------------- |
| 95 | |
| 96 | int c64_4ksa_device::c64_pa2_r() |
| 97 | { |
| 98 | return BIT(input_port_read(*this, "PA2"), 0); |
| 99 | } |
| 100 | |
| 101 | |
| 102 | //------------------------------------------------- |
| 103 | // c64_cnt1_w - CNT 1 write |
| 104 | //------------------------------------------------- |
| 105 | |
| 106 | void c64_4ksa_device::c64_cnt1_w(int level) |
| 107 | { |
| 108 | m_slot->cnt2_w(level); |
| 109 | } |
src/mess/machine/c64_4ksa.h
| r0 | r14771 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Kingsoft 4-Player Adapter emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #pragma once |
| 11 | |
| 12 | #ifndef __C64_4KSA__ |
| 13 | #define __C64_4KSA__ |
| 14 | |
| 15 | #define ADDRESS_MAP_MODERN |
| 16 | |
| 17 | #include "emu.h" |
| 18 | #include "machine/c64user.h" |
| 19 | |
| 20 | |
| 21 | |
| 22 | //************************************************************************** |
| 23 | // TYPE DEFINITIONS |
| 24 | //************************************************************************** |
| 25 | |
| 26 | // ======================> c64_4ksa_device |
| 27 | |
| 28 | class c64_4ksa_device : public device_t, |
| 29 | public device_c64_user_port_interface |
| 30 | { |
| 31 | public: |
| 32 | // construction/destruction |
| 33 | c64_4ksa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 34 | |
| 35 | // optional information overrides |
| 36 | virtual ioport_constructor device_input_ports() const; |
| 37 | |
| 38 | INPUT_CHANGED_MEMBER( fire4 ); |
| 39 | |
| 40 | protected: |
| 41 | // device-level overrides |
| 42 | virtual void device_start(); |
| 43 | virtual void device_config_complete() { m_shortname = "c64_4ksa"; } |
| 44 | |
| 45 | // device_c64_user_port_interface overrides |
| 46 | virtual UINT8 c64_pb_r(address_space &space, offs_t offset); |
| 47 | virtual int c64_pa2_r(); |
| 48 | virtual void c64_cnt1_w(int level); |
| 49 | }; |
| 50 | |
| 51 | |
| 52 | // device type definition |
| 53 | extern const device_type C64_4KSA; |
| 54 | |
| 55 | |
| 56 | #endif |
src/mess/machine/cbmipt.c
| r14770 | r14771 | |
| 1160 | 1160 | SLOT_INTERFACE("epyxfastload", C64_EPYX_FAST_LOAD) |
| 1161 | 1161 | SLOT_INTERFACE("exos", C64_EXOS) |
| 1162 | 1162 | SLOT_INTERFACE("final", C64_FINAL) |
| 1163 | SLOT_INTERFACE("final3", C64_FINAL3) |
| 1163 | 1164 | SLOT_INTERFACE("fun_play", C64_FUN_PLAY) |
| 1164 | 1165 | SLOT_INTERFACE("kingsoft", C64_KINGSOFT) |
| 1165 | 1166 | SLOT_INTERFACE("mach5", C64_MACH5) |
| r14770 | r14771 | |
| 1188 | 1189 | |
| 1189 | 1190 | SLOT_INTERFACE_START( c64_user_port_cards ) |
| 1190 | 1191 | SLOT_INTERFACE("4cga", C64_4CGA) |
| 1192 | SLOT_INTERFACE("4dxh", C64_4DXH) |
| 1193 | SLOT_INTERFACE("4ksa", C64_4KSA) |
| 1194 | SLOT_INTERFACE("4tba", C64_4TBA) |
| 1191 | 1195 | SLOT_INTERFACE_END |
src/mess/machine/c64_4dxh.c
| r0 | r14771 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | The Digital Excess & Hitmen 4-Player Joystick adapter emulation |
| 4 | |
| 5 | http://hitmen.c02.at/html/hardware.html |
| 6 | |
| 7 | Copyright MESS Team. |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | |
| 10 | **********************************************************************/ |
| 11 | |
| 12 | #include "c64_4dxh.h" |
| 13 | |
| 14 | |
| 15 | |
| 16 | //************************************************************************** |
| 17 | // DEVICE DEFINITIONS |
| 18 | //************************************************************************** |
| 19 | |
| 20 | const device_type C64_4DXH = &device_creator<c64_4dxh_device>; |
| 21 | |
| 22 | |
| 23 | INPUT_CHANGED_MEMBER( c64_4dxh_device::fire4 ) |
| 24 | { |
| 25 | m_slot->sp2_w(newval); |
| 26 | } |
| 27 | |
| 28 | static INPUT_PORTS_START( c64_4player ) |
| 29 | PORT_START("SP2") |
| 30 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_4dxh_device, fire4, 0) |
| 31 | |
| 32 | PORT_START("PB") |
| 33 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) |
| 34 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) |
| 35 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) |
| 36 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) |
| 37 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) |
| 38 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) |
| 39 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) |
| 40 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) |
| 41 | |
| 42 | PORT_START("PA2") |
| 43 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) |
| 44 | INPUT_PORTS_END |
| 45 | |
| 46 | |
| 47 | //------------------------------------------------- |
| 48 | // input_ports - device-specific input ports |
| 49 | //------------------------------------------------- |
| 50 | |
| 51 | ioport_constructor c64_4dxh_device::device_input_ports() const |
| 52 | { |
| 53 | return INPUT_PORTS_NAME( c64_4player ); |
| 54 | } |
| 55 | |
| 56 | |
| 57 | |
| 58 | //************************************************************************** |
| 59 | // LIVE DEVICE |
| 60 | //************************************************************************** |
| 61 | |
| 62 | //------------------------------------------------- |
| 63 | // c64_4dxh_device - constructor |
| 64 | //------------------------------------------------- |
| 65 | |
| 66 | c64_4dxh_device::c64_4dxh_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 67 | device_t(mconfig, C64_4DXH, "C64 DXH 4-Player Adapter", tag, owner, clock), |
| 68 | device_c64_user_port_interface(mconfig, *this) |
| 69 | { |
| 70 | } |
| 71 | |
| 72 | |
| 73 | //------------------------------------------------- |
| 74 | // device_start - device-specific startup |
| 75 | //------------------------------------------------- |
| 76 | |
| 77 | void c64_4dxh_device::device_start() |
| 78 | { |
| 79 | } |
| 80 | |
| 81 | |
| 82 | //------------------------------------------------- |
| 83 | // c64_pb_r - port B read |
| 84 | //------------------------------------------------- |
| 85 | |
| 86 | UINT8 c64_4dxh_device::c64_pb_r(address_space &space, offs_t offset) |
| 87 | { |
| 88 | return input_port_read(*this, "PB"); |
| 89 | } |
| 90 | |
| 91 | |
| 92 | //------------------------------------------------- |
| 93 | // c64_pb_w - port B write |
| 94 | //------------------------------------------------- |
| 95 | |
| 96 | int c64_4dxh_device::c64_pa2_r() |
| 97 | { |
| 98 | return BIT(input_port_read(*this, "PA2"), 0); |
| 99 | } |
| 100 | |
| 101 | |
| 102 | //------------------------------------------------- |
| 103 | // c64_cnt1_w - CNT 1 write |
| 104 | //------------------------------------------------- |
| 105 | |
| 106 | void c64_4dxh_device::c64_cnt1_w(int level) |
| 107 | { |
| 108 | m_slot->cnt2_w(level); |
| 109 | } |
src/mess/machine/c64_4dxh.h
| r0 | r14771 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | The Digital Excess & Hitmen 4-Player Joystick adapter emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #pragma once |
| 11 | |
| 12 | #ifndef __C64_4DXH__ |
| 13 | #define __C64_4DXH__ |
| 14 | |
| 15 | #define ADDRESS_MAP_MODERN |
| 16 | |
| 17 | #include "emu.h" |
| 18 | #include "machine/c64user.h" |
| 19 | |
| 20 | |
| 21 | |
| 22 | //************************************************************************** |
| 23 | // TYPE DEFINITIONS |
| 24 | //************************************************************************** |
| 25 | |
| 26 | // ======================> c64_4dxh_device |
| 27 | |
| 28 | class c64_4dxh_device : public device_t, |
| 29 | public device_c64_user_port_interface |
| 30 | { |
| 31 | public: |
| 32 | // construction/destruction |
| 33 | c64_4dxh_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 34 | |
| 35 | // optional information overrides |
| 36 | virtual ioport_constructor device_input_ports() const; |
| 37 | |
| 38 | INPUT_CHANGED_MEMBER( fire4 ); |
| 39 | |
| 40 | protected: |
| 41 | // device-level overrides |
| 42 | virtual void device_start(); |
| 43 | virtual void device_config_complete() { m_shortname = "c64_4dxh"; } |
| 44 | |
| 45 | // device_c64_user_port_interface overrides |
| 46 | virtual UINT8 c64_pb_r(address_space &space, offs_t offset); |
| 47 | virtual int c64_pa2_r(); |
| 48 | virtual void c64_cnt1_w(int level); |
| 49 | }; |
| 50 | |
| 51 | |
| 52 | // device type definition |
| 53 | extern const device_type C64_4DXH; |
| 54 | |
| 55 | |
| 56 | #endif |
src/mess/machine/c64_final3.c
| r0 | r14771 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Final Cartridge III emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #include "c64_final3.h" |
| 11 | |
| 12 | |
| 13 | |
| 14 | //************************************************************************** |
| 15 | // DEVICE DEFINITIONS |
| 16 | //************************************************************************** |
| 17 | |
| 18 | const device_type C64_FINAL3 = &device_creator<c64_final3_cartridge_device>; |
| 19 | |
| 20 | |
| 21 | INPUT_CHANGED_MEMBER( c64_final3_cartridge_device::freeze ) |
| 22 | { |
| 23 | if (!newval) |
| 24 | { |
| 25 | m_game = 0; |
| 26 | } |
| 27 | |
| 28 | m_slot->nmi_w(newval ? CLEAR_LINE : ASSERT_LINE); |
| 29 | } |
| 30 | |
| 31 | static INPUT_PORTS_START( c64_final3 ) |
| 32 | PORT_START("FREEZE") |
| 33 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Freeze") PORT_CODE(KEYCODE_F12) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_final3_cartridge_device, freeze, 0) |
| 34 | INPUT_PORTS_END |
| 35 | |
| 36 | |
| 37 | //------------------------------------------------- |
| 38 | // input_ports - device-specific input ports |
| 39 | //------------------------------------------------- |
| 40 | |
| 41 | ioport_constructor c64_final3_cartridge_device::device_input_ports() const |
| 42 | { |
| 43 | return INPUT_PORTS_NAME( c64_final3 ); |
| 44 | } |
| 45 | |
| 46 | |
| 47 | |
| 48 | //************************************************************************** |
| 49 | // LIVE DEVICE |
| 50 | //************************************************************************** |
| 51 | |
| 52 | //------------------------------------------------- |
| 53 | // c64_final3_cartridge_device - constructor |
| 54 | //------------------------------------------------- |
| 55 | |
| 56 | c64_final3_cartridge_device::c64_final3_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 57 | device_t(mconfig, C64_FINAL3, "C64 Final Cartridge III", tag, owner, clock), |
| 58 | device_c64_expansion_card_interface(mconfig, *this) |
| 59 | { |
| 60 | } |
| 61 | |
| 62 | |
| 63 | //------------------------------------------------- |
| 64 | // device_start - device-specific startup |
| 65 | //------------------------------------------------- |
| 66 | |
| 67 | void c64_final3_cartridge_device::device_start() |
| 68 | { |
| 69 | // state saving |
| 70 | save_item(NAME(m_bank)); |
| 71 | save_item(NAME(m_hidden)); |
| 72 | } |
| 73 | |
| 74 | |
| 75 | //------------------------------------------------- |
| 76 | // device_reset - device-specific reset |
| 77 | //------------------------------------------------- |
| 78 | |
| 79 | void c64_final3_cartridge_device::device_reset() |
| 80 | { |
| 81 | m_bank = 0; |
| 82 | |
| 83 | m_exrom = 0; |
| 84 | m_game = 0; |
| 85 | |
| 86 | m_slot->nmi_w(CLEAR_LINE); |
| 87 | |
| 88 | m_hidden = 0; |
| 89 | } |
| 90 | |
| 91 | |
| 92 | //------------------------------------------------- |
| 93 | // c64_cd_r - cartridge data read |
| 94 | //------------------------------------------------- |
| 95 | |
| 96 | UINT8 c64_final3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2) |
| 97 | { |
| 98 | UINT8 data = 0; |
| 99 | |
| 100 | if (!roml || !romh || !io1 || !io2) |
| 101 | { |
| 102 | offs_t addr = (m_bank << 14) | (offset & 0x3fff); |
| 103 | data = m_roml[addr]; |
| 104 | } |
| 105 | |
| 106 | return data; |
| 107 | } |
| 108 | |
| 109 | |
| 110 | //------------------------------------------------- |
| 111 | // c64_cd_w - cartridge data write |
| 112 | //------------------------------------------------- |
| 113 | |
| 114 | void c64_final3_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2) |
| 115 | { |
| 116 | if (!m_hidden && !io2 && ((offset & 0xff) == 0xff)) |
| 117 | { |
| 118 | /* |
| 119 | |
| 120 | bit description |
| 121 | |
| 122 | 0 A14 |
| 123 | 1 A15 |
| 124 | 2 |
| 125 | 3 |
| 126 | 4 EXROM |
| 127 | 5 GAME |
| 128 | 6 NMI |
| 129 | 7 hide register |
| 130 | |
| 131 | */ |
| 132 | |
| 133 | m_bank = data & 0x03; |
| 134 | |
| 135 | m_exrom = BIT(data, 4); |
| 136 | m_game = BIT(data, 5); |
| 137 | |
| 138 | m_slot->nmi_w(BIT(data, 6) ? CLEAR_LINE : ASSERT_LINE); |
| 139 | |
| 140 | m_hidden = BIT(data, 7); |
| 141 | } |
| 142 | } |
src/mess/machine/c64_final3.h
| r0 | r14771 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Final Cartridge III emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #pragma once |
| 11 | |
| 12 | #ifndef __FINAL3__ |
| 13 | #define __FINAL3__ |
| 14 | |
| 15 | #define ADDRESS_MAP_MODERN |
| 16 | |
| 17 | #include "emu.h" |
| 18 | #include "machine/c64exp.h" |
| 19 | |
| 20 | |
| 21 | |
| 22 | //************************************************************************** |
| 23 | // TYPE DEFINITIONS |
| 24 | //************************************************************************** |
| 25 | |
| 26 | // ======================> c64_final3_cartridge_device |
| 27 | |
| 28 | class c64_final3_cartridge_device : public device_t, |
| 29 | public device_c64_expansion_card_interface |
| 30 | { |
| 31 | public: |
| 32 | // construction/destruction |
| 33 | c64_final3_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 34 | |
| 35 | // optional information overrides |
| 36 | virtual ioport_constructor device_input_ports() const; |
| 37 | |
| 38 | INPUT_CHANGED_MEMBER( freeze ); |
| 39 | |
| 40 | protected: |
| 41 | // device-level overrides |
| 42 | virtual void device_start(); |
| 43 | virtual void device_reset(); |
| 44 | virtual void device_config_complete() { m_shortname = "c64_final3"; } |
| 45 | |
| 46 | // device_c64_expansion_card_interface overrides |
| 47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2); |
| 48 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2); |
| 49 | |
| 50 | private: |
| 51 | UINT8 m_bank; |
| 52 | int m_hidden; |
| 53 | }; |
| 54 | |
| 55 | |
| 56 | // device type definition |
| 57 | extern const device_type C64_FINAL3; |
| 58 | |
| 59 | |
| 60 | #endif |
src/mess/machine/c64_4tba.c
| r0 | r14771 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Starbyte Software Tie Break Adaptor emulation |
| 4 | |
| 5 | http://hitmen.c02.at/html/hardware.html |
| 6 | |
| 7 | Copyright MESS Team. |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | |
| 10 | **********************************************************************/ |
| 11 | |
| 12 | #include "c64_4tba.h" |
| 13 | |
| 14 | |
| 15 | |
| 16 | //************************************************************************** |
| 17 | // DEVICE DEFINITIONS |
| 18 | //************************************************************************** |
| 19 | |
| 20 | const device_type C64_4TBA = &device_creator<c64_4tba_device>; |
| 21 | |
| 22 | |
| 23 | INPUT_CHANGED_MEMBER( c64_4tba_device::fire3 ) |
| 24 | { |
| 25 | m_slot->sp2_w(newval); |
| 26 | } |
| 27 | |
| 28 | static INPUT_PORTS_START( c64_4player ) |
| 29 | PORT_START("SP2") |
| 30 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_4tba_device, fire3, 0) |
| 31 | |
| 32 | PORT_START("PB") |
| 33 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) |
| 34 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) |
| 35 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) |
| 36 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) |
| 37 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) |
| 38 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) |
| 39 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) |
| 40 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) |
| 41 | |
| 42 | PORT_START("PA2") |
| 43 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) |
| 44 | INPUT_PORTS_END |
| 45 | |
| 46 | |
| 47 | //------------------------------------------------- |
| 48 | // input_ports - device-specific input ports |
| 49 | //------------------------------------------------- |
| 50 | |
| 51 | ioport_constructor c64_4tba_device::device_input_ports() const |
| 52 | { |
| 53 | return INPUT_PORTS_NAME( c64_4player ); |
| 54 | } |
| 55 | |
| 56 | |
| 57 | |
| 58 | //************************************************************************** |
| 59 | // LIVE DEVICE |
| 60 | //************************************************************************** |
| 61 | |
| 62 | //------------------------------------------------- |
| 63 | // c64_4tba_device - constructor |
| 64 | //------------------------------------------------- |
| 65 | |
| 66 | c64_4tba_device::c64_4tba_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 67 | device_t(mconfig, C64_4TBA, "C64 Tie Break Adapter", tag, owner, clock), |
| 68 | device_c64_user_port_interface(mconfig, *this) |
| 69 | { |
| 70 | } |
| 71 | |
| 72 | |
| 73 | //------------------------------------------------- |
| 74 | // device_start - device-specific startup |
| 75 | //------------------------------------------------- |
| 76 | |
| 77 | void c64_4tba_device::device_start() |
| 78 | { |
| 79 | } |
| 80 | |
| 81 | |
| 82 | //------------------------------------------------- |
| 83 | // c64_pb_r - port B read |
| 84 | //------------------------------------------------- |
| 85 | |
| 86 | UINT8 c64_4tba_device::c64_pb_r(address_space &space, offs_t offset) |
| 87 | { |
| 88 | return input_port_read(*this, "PB"); |
| 89 | } |
| 90 | |
| 91 | |
| 92 | //------------------------------------------------- |
| 93 | // c64_pb_w - port B write |
| 94 | //------------------------------------------------- |
| 95 | |
| 96 | int c64_4tba_device::c64_pa2_r() |
| 97 | { |
| 98 | return BIT(input_port_read(*this, "PA2"), 0); |
| 99 | } |
| 100 | |
| 101 | |
| 102 | //------------------------------------------------- |
| 103 | // c64_cnt1_w - CNT 1 write |
| 104 | //------------------------------------------------- |
| 105 | |
| 106 | void c64_4tba_device::c64_cnt1_w(int level) |
| 107 | { |
| 108 | m_slot->cnt2_w(level); |
| 109 | } |
src/mess/machine/c64_4tba.h
| r0 | r14771 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Starbyte Software Tie Break Adaptor emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #pragma once |
| 11 | |
| 12 | #ifndef __C64_4TBA__ |
| 13 | #define __C64_4TBA__ |
| 14 | |
| 15 | #define ADDRESS_MAP_MODERN |
| 16 | |
| 17 | #include "emu.h" |
| 18 | #include "machine/c64user.h" |
| 19 | |
| 20 | |
| 21 | |
| 22 | //************************************************************************** |
| 23 | // TYPE DEFINITIONS |
| 24 | //************************************************************************** |
| 25 | |
| 26 | // ======================> c64_4tba_device |
| 27 | |
| 28 | class c64_4tba_device : public device_t, |
| 29 | public device_c64_user_port_interface |
| 30 | { |
| 31 | public: |
| 32 | // construction/destruction |
| 33 | c64_4tba_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 34 | |
| 35 | // optional information overrides |
| 36 | virtual ioport_constructor device_input_ports() const; |
| 37 | |
| 38 | INPUT_CHANGED_MEMBER( fire3 ); |
| 39 | |
| 40 | protected: |
| 41 | // device-level overrides |
| 42 | virtual void device_start(); |
| 43 | virtual void device_config_complete() { m_shortname = "c64_4tba"; } |
| 44 | |
| 45 | // device_c64_user_port_interface overrides |
| 46 | virtual UINT8 c64_pb_r(address_space &space, offs_t offset); |
| 47 | virtual int c64_pa2_r(); |
| 48 | virtual void c64_cnt1_w(int level); |
| 49 | }; |
| 50 | |
| 51 | |
| 52 | // device type definition |
| 53 | extern const device_type C64_4TBA; |
| 54 | |
| 55 | |
| 56 | #endif |
src/mess/mess.mak
| r14770 | r14771 | |
| 772 | 772 | $(MESS_MACHINE)/c64exp.o \ |
| 773 | 773 | $(MESS_MACHINE)/c64user.o \ |
| 774 | 774 | $(MESS_MACHINE)/c64_4cga.o \ |
| 775 | $(MESS_MACHINE)/c64_4dxh.o \ |
| 776 | $(MESS_MACHINE)/c64_4ksa.o \ |
| 777 | $(MESS_MACHINE)/c64_4tba.o \ |
| 775 | 778 | $(MESS_MACHINE)/c64_comal80.o \ |
| 776 | 779 | $(MESS_MACHINE)/c64_dela_ep256.o \ |
| 777 | 780 | $(MESS_MACHINE)/c64_dela_ep64.o \ |
| r14770 | r14771 | |
| 783 | 786 | $(MESS_MACHINE)/c64_epyx_fast_load.o \ |
| 784 | 787 | $(MESS_MACHINE)/c64_exos.o \ |
| 785 | 788 | $(MESS_MACHINE)/c64_final.o \ |
| 789 | $(MESS_MACHINE)/c64_final3.o \ |
| 786 | 790 | $(MESS_MACHINE)/c64_fun_play.o \ |
| 787 | 791 | $(MESS_MACHINE)/c64_georam.o \ |
| 788 | 792 | $(MESS_MACHINE)/c64_ieee488.o \ |