trunk/src/emu/bus/vic20/4cga.c
| r0 | r26920 | |
| 1 | // license:BSD-3-Clause |
| 2 | // copyright-holders:Curt Coder |
| 3 | /********************************************************************** |
| 4 | |
| 5 | Classical Games/Protovision 4 Player Interface emulation |
| 6 | |
| 7 | http://www.protovision-online.com/hardw/4_player.htm |
| 8 | http://hitmen.c02.at/html/hardware.html |
| 9 | |
| 10 | Copyright MESS Team. |
| 11 | Visit http://mamedev.org for licensing and usage restrictions. |
| 12 | |
| 13 | **********************************************************************/ |
| 14 | |
| 15 | #include "4cga.h" |
| 16 | |
| 17 | |
| 18 | |
| 19 | //************************************************************************** |
| 20 | // DEVICE DEFINITIONS |
| 21 | //************************************************************************** |
| 22 | |
| 23 | const device_type C64_4CGA = &device_creator<c64_4cga_device>; |
| 24 | |
| 25 | |
| 26 | static INPUT_PORTS_START( c64_4player ) |
| 27 | PORT_START("JOY3") |
| 28 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_0) |
| 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 | 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 | 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) |
| 33 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 34 | |
| 35 | PORT_START("JOY4") |
| 36 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_0) |
| 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 | 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 | 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) |
| 41 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 42 | INPUT_PORTS_END |
| 43 | |
| 44 | |
| 45 | //------------------------------------------------- |
| 46 | // input_ports - device-specific input ports |
| 47 | //------------------------------------------------- |
| 48 | |
| 49 | ioport_constructor c64_4cga_device::device_input_ports() const |
| 50 | { |
| 51 | return INPUT_PORTS_NAME( c64_4player ); |
| 52 | } |
| 53 | |
| 54 | |
| 55 | |
| 56 | //************************************************************************** |
| 57 | // LIVE DEVICE |
| 58 | //************************************************************************** |
| 59 | |
| 60 | //------------------------------------------------- |
| 61 | // c64_4cga_device - constructor |
| 62 | //------------------------------------------------- |
| 63 | |
| 64 | c64_4cga_device::c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 65 | device_t(mconfig, C64_4CGA, "C64 Protovision 4 Player Interface", tag, owner, clock, "c64_4cga", __FILE__), |
| 66 | device_vic20_user_port_interface(mconfig, *this), |
| 67 | m_port(0) |
| 68 | { |
| 69 | } |
| 70 | |
| 71 | |
| 72 | //------------------------------------------------- |
| 73 | // device_start - device-specific startup |
| 74 | //------------------------------------------------- |
| 75 | |
| 76 | void c64_4cga_device::device_start() |
| 77 | { |
| 78 | // state saving |
| 79 | save_item(NAME(m_port)); |
| 80 | } |
| 81 | |
| 82 | //------------------------------------------------- |
| 83 | // update_output |
| 84 | //------------------------------------------------- |
| 85 | |
| 86 | void c64_4cga_device::update_output() |
| 87 | { |
| 88 | UINT8 data; |
| 89 | |
| 90 | if (m_port) |
| 91 | { |
| 92 | data = m_joy3; |
| 93 | } |
| 94 | else |
| 95 | { |
| 96 | data = m_joy4; |
| 97 | } |
| 98 | |
| 99 | output_c((data>>0)&1); |
| 100 | output_d((data>>1)&1); |
| 101 | output_e((data>>2)&1); |
| 102 | output_f((data>>3)&1); |
| 103 | output_h((data>>4)&1); |
| 104 | output_j((data>>5)&1); |
| 105 | } |
| 106 | |
| 107 | |
| 108 | //------------------------------------------------- |
| 109 | // c64_pb_w - port B write |
| 110 | //------------------------------------------------- |
| 111 | |
| 112 | WRITE_LINE_MEMBER( c64_4cga_device::input_l ) |
| 113 | { |
| 114 | m_port = state; |
| 115 | update_output(); |
| 116 | } |
trunk/src/emu/bus/c64/4cga.c
| r26919 | r26920 | |
| 1 | | // license:BSD-3-Clause |
| 2 | | // copyright-holders:Curt Coder |
| 3 | | /********************************************************************** |
| 4 | | |
| 5 | | Classical Games/Protovision 4 Player Interface emulation |
| 6 | | |
| 7 | | http://www.protovision-online.com/hardw/4_player.htm |
| 8 | | http://hitmen.c02.at/html/hardware.html |
| 9 | | |
| 10 | | Copyright MESS Team. |
| 11 | | Visit http://mamedev.org for licensing and usage restrictions. |
| 12 | | |
| 13 | | **********************************************************************/ |
| 14 | | |
| 15 | | #include "4cga.h" |
| 16 | | |
| 17 | | |
| 18 | | |
| 19 | | //************************************************************************** |
| 20 | | // DEVICE DEFINITIONS |
| 21 | | //************************************************************************** |
| 22 | | |
| 23 | | const device_type C64_4CGA = &device_creator<c64_4cga_device>; |
| 24 | | |
| 25 | | |
| 26 | | static INPUT_PORTS_START( c64_4player ) |
| 27 | | PORT_START("JOY3") |
| 28 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 29 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 30 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 31 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 32 | | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 33 | | |
| 34 | | PORT_START("JOY4") |
| 35 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 36 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 37 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 38 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 39 | | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 40 | | |
| 41 | | PORT_START("FIRE") |
| 42 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 43 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 44 | | PORT_BIT( 0xcf, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 45 | | INPUT_PORTS_END |
| 46 | | |
| 47 | | |
| 48 | | //------------------------------------------------- |
| 49 | | // input_ports - device-specific input ports |
| 50 | | //------------------------------------------------- |
| 51 | | |
| 52 | | ioport_constructor c64_4cga_device::device_input_ports() const |
| 53 | | { |
| 54 | | return INPUT_PORTS_NAME( c64_4player ); |
| 55 | | } |
| 56 | | |
| 57 | | |
| 58 | | |
| 59 | | //************************************************************************** |
| 60 | | // LIVE DEVICE |
| 61 | | //************************************************************************** |
| 62 | | |
| 63 | | //------------------------------------------------- |
| 64 | | // c64_4cga_device - constructor |
| 65 | | //------------------------------------------------- |
| 66 | | |
| 67 | | c64_4cga_device::c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 68 | | device_t(mconfig, C64_4CGA, "C64 Protovision 4 Player Interface", tag, owner, clock, "c64_4cga", __FILE__), |
| 69 | | device_c64_user_port_interface(mconfig, *this), |
| 70 | | m_fire(*this, "FIRE"), |
| 71 | | m_joy3(*this, "JOY3"), |
| 72 | | m_joy4(*this, "JOY4"), |
| 73 | | m_port(0) |
| 74 | | { |
| 75 | | } |
| 76 | | |
| 77 | | |
| 78 | | //------------------------------------------------- |
| 79 | | // device_start - device-specific startup |
| 80 | | //------------------------------------------------- |
| 81 | | |
| 82 | | void c64_4cga_device::device_start() |
| 83 | | { |
| 84 | | // state saving |
| 85 | | save_item(NAME(m_port)); |
| 86 | | } |
| 87 | | |
| 88 | | |
| 89 | | //------------------------------------------------- |
| 90 | | // c64_pb_r - port B read |
| 91 | | //------------------------------------------------- |
| 92 | | |
| 93 | | UINT8 c64_4cga_device::c64_pb_r(address_space &space, offs_t offset) |
| 94 | | { |
| 95 | | UINT8 data = m_fire->read(); |
| 96 | | |
| 97 | | if (m_port) |
| 98 | | { |
| 99 | | data &= m_joy3->read(); |
| 100 | | } |
| 101 | | else |
| 102 | | { |
| 103 | | data &= m_joy4->read(); |
| 104 | | } |
| 105 | | |
| 106 | | return data; |
| 107 | | } |
| 108 | | |
| 109 | | |
| 110 | | //------------------------------------------------- |
| 111 | | // c64_pb_w - port B write |
| 112 | | //------------------------------------------------- |
| 113 | | |
| 114 | | void c64_4cga_device::c64_pb_w(address_space &space, offs_t offset, UINT8 data) |
| 115 | | { |
| 116 | | m_port = BIT(data, 7); |
| 117 | | } |
trunk/src/emu/bus/c64/user.c
| r26919 | r26920 | |
| 11 | 11 | |
| 12 | 12 | #include "user.h" |
| 13 | 13 | |
| 14 | | |
| 15 | | |
| 16 | | //************************************************************************** |
| 17 | | // GLOBAL VARIABLES |
| 18 | | //************************************************************************** |
| 19 | | |
| 20 | | const device_type C64_USER_PORT = &device_creator<c64_user_port_device>; |
| 21 | | |
| 22 | | |
| 23 | | |
| 24 | | //************************************************************************** |
| 25 | | // CARD INTERFACE |
| 26 | | //************************************************************************** |
| 27 | | |
| 28 | 14 | //------------------------------------------------- |
| 29 | | // device_c64_user_port_interface - constructor |
| 30 | | //------------------------------------------------- |
| 31 | | |
| 32 | | device_c64_user_port_interface::device_c64_user_port_interface(const machine_config &mconfig, device_t &device) |
| 33 | | : device_slot_card_interface(mconfig,device) |
| 34 | | { |
| 35 | | m_slot = dynamic_cast<c64_user_port_device *>(device.owner()); |
| 36 | | } |
| 37 | | |
| 38 | | |
| 39 | | //------------------------------------------------- |
| 40 | | // ~device_c64_user_port_interface - destructor |
| 41 | | //------------------------------------------------- |
| 42 | | |
| 43 | | device_c64_user_port_interface::~device_c64_user_port_interface() |
| 44 | | { |
| 45 | | } |
| 46 | | |
| 47 | | |
| 48 | | |
| 49 | | //************************************************************************** |
| 50 | | // LIVE DEVICE |
| 51 | | //************************************************************************** |
| 52 | | |
| 53 | | //------------------------------------------------- |
| 54 | | // c64_user_port_device - constructor |
| 55 | | //------------------------------------------------- |
| 56 | | |
| 57 | | c64_user_port_device::c64_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 58 | | device_t(mconfig, C64_USER_PORT, "C64 user port", tag, owner, clock, "c64_user_port", __FILE__), |
| 59 | | device_slot_interface(mconfig, *this), |
| 60 | | m_write_cnt1(*this), |
| 61 | | m_write_sp1(*this), |
| 62 | | m_write_cnt2(*this), |
| 63 | | m_write_sp2(*this), |
| 64 | | m_write_flag2(*this), |
| 65 | | m_write_reset(*this) |
| 66 | | { |
| 67 | | } |
| 68 | | |
| 69 | | |
| 70 | | //------------------------------------------------- |
| 71 | | // device_start - device-specific startup |
| 72 | | //------------------------------------------------- |
| 73 | | |
| 74 | | void c64_user_port_device::device_start() |
| 75 | | { |
| 76 | | m_card = dynamic_cast<device_c64_user_port_interface *>(get_card_device()); |
| 77 | | |
| 78 | | // resolve callbacks |
| 79 | | m_write_cnt1.resolve_safe(); |
| 80 | | m_write_sp1.resolve_safe(); |
| 81 | | m_write_cnt2.resolve_safe(); |
| 82 | | m_write_sp2.resolve_safe(); |
| 83 | | m_write_flag2.resolve_safe(); |
| 84 | | m_write_reset.resolve_safe(); |
| 85 | | } |
| 86 | | |
| 87 | | |
| 88 | | //------------------------------------------------- |
| 89 | | // device_reset - device-specific reset |
| 90 | | //------------------------------------------------- |
| 91 | | |
| 92 | | void c64_user_port_device::device_reset() |
| 93 | | { |
| 94 | | if (get_card_device()) |
| 95 | | { |
| 96 | | get_card_device()->reset(); |
| 97 | | } |
| 98 | | } |
| 99 | | |
| 100 | | |
| 101 | | READ8_MEMBER( c64_user_port_device::pb_r ) { UINT8 data = 0xff; if (m_card != NULL) data = m_card->c64_pb_r(space, offset); return data; } |
| 102 | | WRITE8_MEMBER( c64_user_port_device::pb_w ) { if (m_card != NULL) m_card->c64_pb_w(space, offset, data); } |
| 103 | | READ_LINE_MEMBER( c64_user_port_device::pa2_r ) { int state = 1; if (m_card != NULL) state = m_card->c64_pa2_r(); return state; } |
| 104 | | WRITE_LINE_MEMBER( c64_user_port_device::pa2_w ) { if (m_card != NULL) m_card->c64_pa2_w(state); } |
| 105 | | WRITE_LINE_MEMBER( c64_user_port_device::pc2_w ) { if (m_card != NULL) m_card->c64_pc2_w(state); } |
| 106 | | WRITE_LINE_MEMBER( c64_user_port_device::atn_w ) { if (m_card != NULL) m_card->c64_atn_w(state); } |
| 107 | | WRITE_LINE_MEMBER( c64_user_port_device::cnt1_w ) { if (m_card != NULL) m_card->c64_cnt1_w(state); } |
| 108 | | WRITE_LINE_MEMBER( c64_user_port_device::sp1_w ) { if (m_card != NULL) m_card->c64_sp1_w(state); } |
| 109 | | WRITE_LINE_MEMBER( c64_user_port_device::cnt2_w ) { if (m_card != NULL) m_card->c64_cnt2_w(state); } |
| 110 | | WRITE_LINE_MEMBER( c64_user_port_device::sp2_w ) { if (m_card != NULL) m_card->c64_sp2_w(state); } |
| 111 | | |
| 112 | | |
| 113 | | //------------------------------------------------- |
| 114 | 15 | // SLOT_INTERFACE( c64_user_port_cards ) |
| 115 | 16 | //------------------------------------------------- |
| 116 | 17 | |
| 18 | // slot devices |
| 19 | #include "bus/vic20/4cga.h" |
| 20 | #include "4dxh.h" |
| 21 | #include "4ksa.h" |
| 22 | #include "4tba.h" |
| 23 | #include "bn1541.h" |
| 24 | #include "geocable.h" |
| 25 | #include "bus/vic20/vic1011.h" |
| 26 | |
| 117 | 27 | SLOT_INTERFACE_START( c64_user_port_cards ) |
| 118 | 28 | SLOT_INTERFACE("4cga", C64_4CGA) |
| 119 | 29 | SLOT_INTERFACE("4dxh", C64_4DXH) |
| r26919 | r26920 | |
| 121 | 31 | SLOT_INTERFACE("4tba", C64_4TBA) |
| 122 | 32 | SLOT_INTERFACE("bn1541", C64_BN1541) |
| 123 | 33 | SLOT_INTERFACE("geocable", C64_GEOCABLE) |
| 124 | | SLOT_INTERFACE("rs232", C64_VIC1011) |
| 34 | SLOT_INTERFACE("rs232", VIC1011) |
| 125 | 35 | SLOT_INTERFACE_END |
trunk/src/emu/bus/c64/user.h
| r26919 | r26920 | |
| 29 | 29 | #ifndef __C64_USER_PORT__ |
| 30 | 30 | #define __C64_USER_PORT__ |
| 31 | 31 | |
| 32 | | #include "emu.h" |
| 32 | #include "bus/vic20/user.h" |
| 33 | 33 | |
| 34 | | |
| 35 | | |
| 36 | | //************************************************************************** |
| 37 | | // CONSTANTS |
| 38 | | //************************************************************************** |
| 39 | | |
| 40 | | #define C64_USER_PORT_TAG "user" |
| 41 | | |
| 42 | | |
| 43 | | |
| 44 | | //************************************************************************** |
| 45 | | // INTERFACE CONFIGURATION MACROS |
| 46 | | //************************************************************************** |
| 47 | | |
| 48 | | #define MCFG_C64_USER_PORT_ADD(_tag, _slot_intf, _def_slot, _reset) \ |
| 49 | | MCFG_DEVICE_ADD(_tag, C64_USER_PORT, 0) \ |
| 50 | | downcast<c64_user_port_device *>(device)->set_reset_callback(DEVCB2_##_reset); \ |
| 51 | | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) |
| 52 | | |
| 53 | | |
| 54 | | #define MCFG_C64_USER_PORT_CIA1_CALLBACKS(_cnt, _sp) \ |
| 55 | | downcast<c64_user_port_device *>(device)->set_cia1_callbacks(DEVCB2_##_cnt, DEVCB2_##_sp); |
| 56 | | |
| 57 | | #define MCFG_C64_USER_PORT_CIA2_CALLBACKS(_cnt, _sp, _flag) \ |
| 58 | | downcast<c64_user_port_device *>(device)->set_cia2_callbacks(DEVCB2_##_cnt, DEVCB2_##_sp, DEVCB2_##_flag); |
| 59 | | |
| 60 | | |
| 61 | | |
| 62 | | //************************************************************************** |
| 63 | | // TYPE DEFINITIONS |
| 64 | | //************************************************************************** |
| 65 | | |
| 66 | | // ======================> c64_user_port_device |
| 67 | | |
| 68 | | class device_c64_user_port_interface; |
| 69 | | |
| 70 | | class c64_user_port_device : public device_t, |
| 71 | | public device_slot_interface |
| 72 | | { |
| 73 | | public: |
| 74 | | // construction/destruction |
| 75 | | c64_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 76 | | |
| 77 | | template<class _reset> void set_reset_callback(_reset reset) { m_write_reset.set_callback(reset); } |
| 78 | | |
| 79 | | template<class _cnt, class _sp> void set_cia1_callbacks(_cnt cnt, _sp sp) { |
| 80 | | m_write_cnt1.set_callback(cnt); |
| 81 | | m_write_sp1.set_callback(sp); |
| 82 | | } |
| 83 | | |
| 84 | | template<class _cnt, class _sp, class _flag> void set_cia2_callbacks(_cnt cnt, _sp sp, _flag flag) { |
| 85 | | m_write_cnt2.set_callback(cnt); |
| 86 | | m_write_sp2.set_callback(sp); |
| 87 | | m_write_flag2.set_callback(flag); |
| 88 | | } |
| 89 | | |
| 90 | | // computer interface |
| 91 | | DECLARE_READ8_MEMBER( pb_r ); |
| 92 | | DECLARE_WRITE8_MEMBER( pb_w ); |
| 93 | | DECLARE_READ_LINE_MEMBER( pa2_r ); |
| 94 | | DECLARE_WRITE_LINE_MEMBER( pa2_w ); |
| 95 | | DECLARE_WRITE_LINE_MEMBER( pc2_w ); |
| 96 | | DECLARE_WRITE_LINE_MEMBER( atn_w ); |
| 97 | | DECLARE_WRITE_LINE_MEMBER( cnt1_w ); |
| 98 | | DECLARE_WRITE_LINE_MEMBER( sp1_w ); |
| 99 | | DECLARE_WRITE_LINE_MEMBER( cnt2_w ); |
| 100 | | DECLARE_WRITE_LINE_MEMBER( sp2_w ); |
| 101 | | |
| 102 | | // cartridge interface |
| 103 | | DECLARE_WRITE_LINE_MEMBER( cia_cnt1_w ) { m_write_cnt1(state); } |
| 104 | | DECLARE_WRITE_LINE_MEMBER( cia_sp1_w ) { m_write_sp1(state); } |
| 105 | | DECLARE_WRITE_LINE_MEMBER( cia_cnt2_w ) { m_write_cnt2(state); } |
| 106 | | DECLARE_WRITE_LINE_MEMBER( cia_sp2_w ) { m_write_sp2(state); } |
| 107 | | DECLARE_WRITE_LINE_MEMBER( cia_flag2_w ) { m_write_flag2(state); } |
| 108 | | DECLARE_WRITE_LINE_MEMBER( reset_w ) { m_write_reset(state); } |
| 109 | | |
| 110 | | protected: |
| 111 | | // device-level overrides |
| 112 | | virtual void device_start(); |
| 113 | | virtual void device_reset(); |
| 114 | | |
| 115 | | devcb2_write_line m_write_cnt1; |
| 116 | | devcb2_write_line m_write_sp1; |
| 117 | | devcb2_write_line m_write_cnt2; |
| 118 | | devcb2_write_line m_write_sp2; |
| 119 | | devcb2_write_line m_write_flag2; |
| 120 | | devcb2_write_line m_write_reset; |
| 121 | | |
| 122 | | device_c64_user_port_interface *m_card; |
| 123 | | }; |
| 124 | | |
| 125 | | |
| 126 | | // ======================> device_c64_user_port_interface |
| 127 | | |
| 128 | | // class representing interface-specific live c64_expansion card |
| 129 | | class device_c64_user_port_interface : public device_slot_card_interface |
| 130 | | { |
| 131 | | public: |
| 132 | | // construction/destruction |
| 133 | | device_c64_user_port_interface(const machine_config &mconfig, device_t &device); |
| 134 | | virtual ~device_c64_user_port_interface(); |
| 135 | | |
| 136 | | virtual UINT8 c64_pb_r(address_space &space, offs_t offset) { return 0xff; }; |
| 137 | | virtual void c64_pb_w(address_space &space, offs_t offset, UINT8 data) { }; |
| 138 | | |
| 139 | | virtual int c64_pa2_r() { return 1; }; |
| 140 | | virtual void c64_pa2_w(int state) { }; |
| 141 | | virtual void c64_cnt1_w(int state) { }; |
| 142 | | virtual void c64_sp1_w(int state) { }; |
| 143 | | virtual void c64_pc2_w(int state) { }; |
| 144 | | virtual void c64_cnt2_w(int state) { }; |
| 145 | | virtual void c64_sp2_w(int state) { }; |
| 146 | | virtual void c64_atn_w(int state) { }; |
| 147 | | |
| 148 | | protected: |
| 149 | | c64_user_port_device *m_slot; |
| 150 | | }; |
| 151 | | |
| 152 | | |
| 153 | | // device type definition |
| 154 | | extern const device_type C64_USER_PORT; |
| 155 | | |
| 156 | | |
| 157 | | // slot devices |
| 158 | | #include "4cga.h" |
| 159 | | #include "4dxh.h" |
| 160 | | #include "4ksa.h" |
| 161 | | #include "4tba.h" |
| 162 | | #include "bn1541.h" |
| 163 | | #include "geocable.h" |
| 164 | | #include "vic1011.h" |
| 165 | | |
| 166 | 34 | SLOT_INTERFACE_EXTERN( c64_user_port_cards ); |
| 167 | 35 | |
| 168 | | |
| 169 | | |
| 170 | 36 | #endif |
trunk/src/emu/bus/c64/4ksa.c
| r26919 | r26920 | |
| 28 | 28 | |
| 29 | 29 | static INPUT_PORTS_START( c64_4ksa ) |
| 30 | 30 | PORT_START("SP2") |
| 31 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_user_port_device, cia_sp2_w) |
| 31 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_7) |
| 32 | 32 | |
| 33 | 33 | PORT_START("PB") |
| 34 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 35 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 36 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 37 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 38 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 39 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 40 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 41 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 34 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_c) |
| 35 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_d) |
| 36 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_e) |
| 37 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_f) |
| 38 | 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) |
| 39 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_j) |
| 40 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_k) |
| 41 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_l) |
| 42 | 42 | |
| 43 | 43 | PORT_START("PA2") |
| 44 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 44 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_m) |
| 45 | 45 | INPUT_PORTS_END |
| 46 | 46 | |
| 47 | 47 | |
| r26919 | r26920 | |
| 66 | 66 | |
| 67 | 67 | c64_4ksa_device::c64_4ksa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 68 | 68 | device_t(mconfig, C64_4KSA, "C64 Kingsoft 4-Player Adapter", tag, owner, clock, "c64_4ksa", __FILE__), |
| 69 | | device_c64_user_port_interface(mconfig, *this), |
| 70 | | m_pb(*this, "PB"), |
| 71 | | m_pa2(*this, "PA2") |
| 69 | device_vic20_user_port_interface(mconfig, *this) |
| 72 | 70 | { |
| 73 | 71 | } |
| 74 | 72 | |
| r26919 | r26920 | |
| 80 | 78 | void c64_4ksa_device::device_start() |
| 81 | 79 | { |
| 82 | 80 | } |
| 83 | | |
| 84 | | |
| 85 | | //------------------------------------------------- |
| 86 | | // c64_pb_r - port B read |
| 87 | | //------------------------------------------------- |
| 88 | | |
| 89 | | UINT8 c64_4ksa_device::c64_pb_r(address_space &space, offs_t offset) |
| 90 | | { |
| 91 | | return m_pb->read(); |
| 92 | | } |
| 93 | | |
| 94 | | |
| 95 | | //------------------------------------------------- |
| 96 | | // c64_pb_w - port B write |
| 97 | | //------------------------------------------------- |
| 98 | | |
| 99 | | int c64_4ksa_device::c64_pa2_r() |
| 100 | | { |
| 101 | | return BIT(m_pa2->read(), 0); |
| 102 | | } |
| 103 | | |
| 104 | | |
| 105 | | //------------------------------------------------- |
| 106 | | // c64_cnt1_w - CNT 1 write |
| 107 | | //------------------------------------------------- |
| 108 | | |
| 109 | | void c64_4ksa_device::c64_cnt1_w(int level) |
| 110 | | { |
| 111 | | m_slot->cia_cnt2_w(level); |
| 112 | | } |
trunk/src/emu/bus/c64/4tba.c
| r26919 | r26920 | |
| 28 | 28 | |
| 29 | 29 | static INPUT_PORTS_START( c64_4tba ) |
| 30 | 30 | PORT_START("SP2") |
| 31 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_user_port_device, cia_sp2_w) |
| 31 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_7) |
| 32 | 32 | |
| 33 | 33 | PORT_START("PB") |
| 34 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 35 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 36 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 37 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 38 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 39 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 40 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 41 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 34 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_c) |
| 35 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_d) |
| 36 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_e) |
| 37 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_f) |
| 38 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_h) |
| 39 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_j) |
| 40 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_k) |
| 41 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_l) |
| 42 | 42 | |
| 43 | 43 | PORT_START("PA2") |
| 44 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 44 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_m) |
| 45 | 45 | INPUT_PORTS_END |
| 46 | 46 | |
| 47 | 47 | |
| r26919 | r26920 | |
| 66 | 66 | |
| 67 | 67 | c64_4tba_device::c64_4tba_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 68 | 68 | device_t(mconfig, C64_4TBA, "C64 Tie Break Adapter", tag, owner, clock, "c64_4tba", __FILE__), |
| 69 | | device_c64_user_port_interface(mconfig, *this), |
| 70 | | m_pb(*this, "PB"), |
| 71 | | m_pa2(*this, "PA2") |
| 69 | device_vic20_user_port_interface(mconfig, *this) |
| 72 | 70 | { |
| 73 | 71 | } |
| 74 | 72 | |
| r26919 | r26920 | |
| 80 | 78 | void c64_4tba_device::device_start() |
| 81 | 79 | { |
| 82 | 80 | } |
| 83 | | |
| 84 | | |
| 85 | | //------------------------------------------------- |
| 86 | | // c64_pb_r - port B read |
| 87 | | //------------------------------------------------- |
| 88 | | |
| 89 | | UINT8 c64_4tba_device::c64_pb_r(address_space &space, offs_t offset) |
| 90 | | { |
| 91 | | return m_pb->read(); |
| 92 | | } |
| 93 | | |
| 94 | | |
| 95 | | //------------------------------------------------- |
| 96 | | // c64_pb_w - port B write |
| 97 | | //------------------------------------------------- |
| 98 | | |
| 99 | | int c64_4tba_device::c64_pa2_r() |
| 100 | | { |
| 101 | | return BIT(m_pa2->read(), 0); |
| 102 | | } |
| 103 | | |
| 104 | | |
| 105 | | //------------------------------------------------- |
| 106 | | // c64_cnt1_w - CNT 1 write |
| 107 | | //------------------------------------------------- |
| 108 | | |
| 109 | | void c64_4tba_device::c64_cnt1_w(int level) |
| 110 | | { |
| 111 | | m_slot->cia_cnt2_w(level); |
| 112 | | } |
trunk/src/emu/bus/c64/4dxh.c
| r26919 | r26920 | |
| 28 | 28 | |
| 29 | 29 | static INPUT_PORTS_START( c64_4dxh ) |
| 30 | 30 | PORT_START("SP2") |
| 31 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_user_port_device, cia_sp2_w) |
| 31 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_7) |
| 32 | 32 | |
| 33 | 33 | PORT_START("PB") |
| 34 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 35 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 36 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 37 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 38 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 39 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 40 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 41 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 34 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_c) |
| 35 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_d) |
| 36 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_e) |
| 37 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_f) |
| 38 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_h) |
| 39 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_j) |
| 40 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_k) |
| 41 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_l) |
| 42 | 42 | |
| 43 | 43 | PORT_START("PA2") |
| 44 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 44 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_m) |
| 45 | 45 | INPUT_PORTS_END |
| 46 | 46 | |
| 47 | 47 | |
| r26919 | r26920 | |
| 66 | 66 | |
| 67 | 67 | c64_4dxh_device::c64_4dxh_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 68 | 68 | device_t(mconfig, C64_4DXH, "C64 DXH 4-Player Adapter", tag, owner, clock, "c64_4dxh", __FILE__), |
| 69 | | device_c64_user_port_interface(mconfig, *this), |
| 70 | | m_pb(*this, "PB"), |
| 71 | | m_pa2(*this, "PA2") |
| 69 | device_vic20_user_port_interface(mconfig, *this) |
| 72 | 70 | { |
| 73 | 71 | } |
| 74 | 72 | |
| r26919 | r26920 | |
| 80 | 78 | void c64_4dxh_device::device_start() |
| 81 | 79 | { |
| 82 | 80 | } |
| 83 | | |
| 84 | | |
| 85 | | //------------------------------------------------- |
| 86 | | // c64_pb_r - port B read |
| 87 | | //------------------------------------------------- |
| 88 | | |
| 89 | | UINT8 c64_4dxh_device::c64_pb_r(address_space &space, offs_t offset) |
| 90 | | { |
| 91 | | return m_pb->read(); |
| 92 | | } |
| 93 | | |
| 94 | | |
| 95 | | //------------------------------------------------- |
| 96 | | // c64_pb_w - port B write |
| 97 | | //------------------------------------------------- |
| 98 | | |
| 99 | | int c64_4dxh_device::c64_pa2_r() |
| 100 | | { |
| 101 | | return BIT(m_pa2->read(), 0); |
| 102 | | } |
| 103 | | |
| 104 | | |
| 105 | | //------------------------------------------------- |
| 106 | | // c64_cnt1_w - CNT 1 write |
| 107 | | //------------------------------------------------- |
| 108 | | |
| 109 | | void c64_4dxh_device::c64_cnt1_w(int level) |
| 110 | | { |
| 111 | | m_slot->cia_cnt2_w(level); |
| 112 | | } |
trunk/src/mess/drivers/c128.c
| r26919 | r26920 | |
| 1096 | 1096 | WRITE_LINE_MEMBER( c128_state::cia1_cnt_w ) |
| 1097 | 1097 | { |
| 1098 | 1098 | m_cnt1 = state; |
| 1099 | m_user->write_4(state); |
| 1099 | 1100 | |
| 1100 | 1101 | update_iec(); |
| 1101 | 1102 | } |
| r26919 | r26920 | |
| 1103 | 1104 | WRITE_LINE_MEMBER( c128_state::cia1_sp_w ) |
| 1104 | 1105 | { |
| 1105 | 1106 | m_sp1 = state; |
| 1107 | m_user->write_5(state); |
| 1106 | 1108 | |
| 1107 | 1109 | update_iec(); |
| 1108 | 1110 | } |
| r26919 | r26920 | |
| 1139 | 1141 | UINT8 data = 0; |
| 1140 | 1142 | |
| 1141 | 1143 | // user port |
| 1142 | | data |= m_user->pa2_r() << 2; |
| 1144 | data |= m_user_pa2 << 2; |
| 1143 | 1145 | |
| 1144 | 1146 | // IEC bus |
| 1145 | 1147 | data |= m_iec->clk_r() << 6; |
| r26919 | r26920 | |
| 1170 | 1172 | m_va15 = BIT(data, 1); |
| 1171 | 1173 | |
| 1172 | 1174 | // user port |
| 1173 | | m_user->pa2_w(BIT(data, 2)); |
| 1175 | m_user->write_m(BIT(data, 2)); |
| 1174 | 1176 | |
| 1175 | 1177 | // IEC bus |
| 1176 | 1178 | m_iec->atn_w(!BIT(data, 3)); |
| r26919 | r26920 | |
| 1180 | 1182 | update_iec(); |
| 1181 | 1183 | } |
| 1182 | 1184 | |
| 1185 | READ8_MEMBER( c128_state::cia2_pb_r ) |
| 1186 | { |
| 1187 | return m_user_pb; |
| 1188 | } |
| 1183 | 1189 | |
| 1190 | WRITE8_MEMBER( c128_state::cia2_pb_w ) |
| 1191 | { |
| 1192 | m_user->write_c((data>>0)&1); |
| 1193 | m_user->write_d((data>>1)&1); |
| 1194 | m_user->write_e((data>>2)&1); |
| 1195 | m_user->write_f((data>>3)&1); |
| 1196 | m_user->write_h((data>>4)&1); |
| 1197 | m_user->write_j((data>>5)&1); |
| 1198 | m_user->write_k((data>>6)&1); |
| 1199 | m_user->write_l((data>>7)&1); |
| 1200 | } |
| 1201 | |
| 1184 | 1202 | //------------------------------------------------- |
| 1185 | 1203 | // M6510_INTERFACE( cpu_intf ) |
| 1186 | 1204 | //------------------------------------------------- |
| r26919 | r26920 | |
| 1463 | 1481 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia1_pa_r), NULL) |
| 1464 | 1482 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia1_pb_r), WRITE8(c128_state, cia1_pb_w), NULL) |
| 1465 | 1483 | MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c128_state, cia2_irq_w)) |
| 1466 | | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w)) |
| 1484 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_6), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_7)) |
| 1467 | 1485 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia2_pa_r), WRITE8(c128_state, cia2_pa_w)) |
| 1468 | | MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w)) |
| 1486 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia2_pb_r), WRITE8(c128_state, cia2_pb_w), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_8)) |
| 1469 | 1487 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1470 | 1488 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL) |
| 1471 | 1489 | MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS8564_TAG, mos8564_device, lp_w)) |
| r26919 | r26920 | |
| 1473 | 1491 | MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6567_CLOCK, c64_expansion_cards, NULL) |
| 1474 | 1492 | MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c128_state, exp_irq_w), WRITELINE(c128_state, exp_nmi_w), WRITELINE(c128_state, exp_reset_w)) |
| 1475 | 1493 | MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c128_state, exp_dma_cd_r), WRITE8(c128_state, exp_dma_cd_w), WRITELINE(c128_state, exp_dma_w)) |
| 1476 | | MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, WRITELINE(c128_state, exp_reset_w)) |
| 1477 | | MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w)) |
| 1478 | | MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1494 | |
| 1495 | MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, c64_user_port_cards, NULL) |
| 1496 | MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(c128_state, exp_reset_w)) |
| 1497 | MCFG_VIC20_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w)) |
| 1498 | MCFG_VIC20_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w)) |
| 1499 | MCFG_VIC20_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w)) |
| 1500 | MCFG_VIC20_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w)) |
| 1501 | MCFG_VIC20_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w)) |
| 1502 | MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1503 | MCFG_VIC20_USER_PORT_C_HANDLER(WRITELINE(c128_state, write_user_pb0)) |
| 1504 | MCFG_VIC20_USER_PORT_D_HANDLER(WRITELINE(c128_state, write_user_pb1)) |
| 1505 | MCFG_VIC20_USER_PORT_E_HANDLER(WRITELINE(c128_state, write_user_pb2)) |
| 1506 | MCFG_VIC20_USER_PORT_F_HANDLER(WRITELINE(c128_state, write_user_pb3)) |
| 1507 | MCFG_VIC20_USER_PORT_H_HANDLER(WRITELINE(c128_state, write_user_pb4)) |
| 1508 | MCFG_VIC20_USER_PORT_J_HANDLER(WRITELINE(c128_state, write_user_pb5)) |
| 1509 | MCFG_VIC20_USER_PORT_K_HANDLER(WRITELINE(c128_state, write_user_pb6)) |
| 1510 | MCFG_VIC20_USER_PORT_L_HANDLER(WRITELINE(c128_state, write_user_pb7)) |
| 1511 | MCFG_VIC20_USER_PORT_M_HANDLER(WRITELINE(c128_state, write_user_pa2)) |
| 1512 | |
| 1479 | 1513 | MCFG_QUICKLOAD_ADD("quickload", c128_state, cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) |
| 1480 | 1514 | |
| 1481 | 1515 | // software list |
| r26919 | r26920 | |
| 1578 | 1612 | MCFG_MOS6526_SERIAL_CALLBACKS(WRITELINE(c128_state, cia1_cnt_w), WRITELINE(c128_state, cia1_sp_w)) |
| 1579 | 1613 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia1_pa_r), NULL) |
| 1580 | 1614 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia1_pb_r), WRITE8(c128_state, cia1_pb_w), NULL) |
| 1581 | | MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, WRITELINE(c128_state, cia2_irq_w)) |
| 1582 | | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w)) |
| 1615 | MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c128_state, cia2_irq_w)) |
| 1616 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_6), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_7)) |
| 1583 | 1617 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia2_pa_r), WRITE8(c128_state, cia2_pa_w)) |
| 1584 | | MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w)) |
| 1618 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia2_pb_r), WRITE8(c128_state, cia2_pb_w), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_8)) |
| 1585 | 1619 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1586 | 1620 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL) |
| 1587 | 1621 | MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS8566_TAG, mos8566_device, lp_w)) |
| r26919 | r26920 | |
| 1589 | 1623 | MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, c64_expansion_cards, NULL) |
| 1590 | 1624 | MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c128_state, exp_irq_w), WRITELINE(c128_state, exp_nmi_w), WRITELINE(c128_state, exp_reset_w)) |
| 1591 | 1625 | MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c128_state, exp_dma_cd_r), WRITE8(c128_state, exp_dma_cd_w), WRITELINE(c128_state, exp_dma_w)) |
| 1592 | | MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, WRITELINE(c128_state, exp_reset_w)) |
| 1593 | | MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w)) |
| 1594 | | MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1626 | |
| 1627 | MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, c64_user_port_cards, NULL) |
| 1628 | MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(c128_state, exp_reset_w)) |
| 1629 | MCFG_VIC20_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w)) |
| 1630 | MCFG_VIC20_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w)) |
| 1631 | MCFG_VIC20_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w)) |
| 1632 | MCFG_VIC20_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w)) |
| 1633 | MCFG_VIC20_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w)) |
| 1634 | MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1635 | MCFG_VIC20_USER_PORT_C_HANDLER(WRITELINE(c128_state, write_user_pb0)) |
| 1636 | MCFG_VIC20_USER_PORT_D_HANDLER(WRITELINE(c128_state, write_user_pb1)) |
| 1637 | MCFG_VIC20_USER_PORT_E_HANDLER(WRITELINE(c128_state, write_user_pb2)) |
| 1638 | MCFG_VIC20_USER_PORT_F_HANDLER(WRITELINE(c128_state, write_user_pb3)) |
| 1639 | MCFG_VIC20_USER_PORT_H_HANDLER(WRITELINE(c128_state, write_user_pb4)) |
| 1640 | MCFG_VIC20_USER_PORT_J_HANDLER(WRITELINE(c128_state, write_user_pb5)) |
| 1641 | MCFG_VIC20_USER_PORT_K_HANDLER(WRITELINE(c128_state, write_user_pb6)) |
| 1642 | MCFG_VIC20_USER_PORT_L_HANDLER(WRITELINE(c128_state, write_user_pb7)) |
| 1643 | MCFG_VIC20_USER_PORT_M_HANDLER(WRITELINE(c128_state, write_user_pa2)) |
| 1644 | |
| 1595 | 1645 | MCFG_QUICKLOAD_ADD("quickload", c128_state, cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) |
| 1596 | 1646 | |
| 1597 | 1647 | // software list |
trunk/src/mess/drivers/c64.c
| r26919 | r26920 | |
| 769 | 769 | UINT8 data = 0; |
| 770 | 770 | |
| 771 | 771 | // user port |
| 772 | | data |= m_user->pa2_r() << 2; |
| 772 | data |= m_user_pa2 << 2; |
| 773 | 773 | |
| 774 | 774 | // IEC bus |
| 775 | 775 | data |= m_iec->clk_r() << 6; |
| r26919 | r26920 | |
| 800 | 800 | m_va15 = BIT(data, 1); |
| 801 | 801 | |
| 802 | 802 | // user port |
| 803 | | m_user->pa2_w(BIT(data, 2)); |
| 803 | m_user->write_m(BIT(data, 2)); |
| 804 | 804 | |
| 805 | 805 | // IEC bus |
| 806 | 806 | m_iec->atn_w(!BIT(data, 3)); |
| r26919 | r26920 | |
| 808 | 808 | m_iec->data_w(!BIT(data, 5)); |
| 809 | 809 | } |
| 810 | 810 | |
| 811 | READ8_MEMBER( c64_state::cia2_pb_r ) |
| 812 | { |
| 813 | return m_user_pb; |
| 814 | } |
| 811 | 815 | |
| 816 | WRITE8_MEMBER( c64_state::cia2_pb_w ) |
| 817 | { |
| 818 | m_user->write_c((data>>0)&1); |
| 819 | m_user->write_d((data>>1)&1); |
| 820 | m_user->write_e((data>>2)&1); |
| 821 | m_user->write_f((data>>3)&1); |
| 822 | m_user->write_h((data>>4)&1); |
| 823 | m_user->write_j((data>>5)&1); |
| 824 | m_user->write_k((data>>6)&1); |
| 825 | m_user->write_l((data>>7)&1); |
| 826 | } |
| 827 | |
| 812 | 828 | //------------------------------------------------- |
| 813 | 829 | // M6510_INTERFACE( cpu_intf ) |
| 814 | 830 | //------------------------------------------------- |
| r26919 | r26920 | |
| 1032 | 1048 | save_item(NAME(m_exp_irq)); |
| 1033 | 1049 | save_item(NAME(m_exp_nmi)); |
| 1034 | 1050 | save_item(NAME(m_exp_dma)); |
| 1051 | save_item(NAME(m_user_pb)); |
| 1052 | save_item(NAME(m_user_pa2)); |
| 1035 | 1053 | } |
| 1036 | 1054 | |
| 1037 | 1055 | |
| r26919 | r26920 | |
| 1079 | 1097 | // devices |
| 1080 | 1098 | MCFG_PLS100_ADD(PLA_TAG) |
| 1081 | 1099 | MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6567_CLOCK, 60, WRITELINE(c64_state, cia1_irq_w)) |
| 1082 | | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt1_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp1_w)) |
| 1100 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_4), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_5)) |
| 1083 | 1101 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL) |
| 1084 | 1102 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL) |
| 1085 | 1103 | MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c64_state, cia2_irq_w)) |
| 1086 | | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w)) |
| 1104 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_6), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_7)) |
| 1087 | 1105 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia2_pa_r), WRITE8(c64_state, cia2_pa_w)) |
| 1088 | | MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w)) |
| 1106 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia2_pb_r), WRITE8(c64_state, cia2_pb_w), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_8)) |
| 1089 | 1107 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w)) |
| 1090 | 1108 | MCFG_CBM_IEC_ADD("c1541") |
| 1091 | 1109 | MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w)) |
| 1092 | | MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, atn_w)) |
| 1110 | MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_9)) |
| 1093 | 1111 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL) |
| 1094 | 1112 | MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6567_TAG, mos6567_device, lp_w)) |
| 1095 | 1113 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy") |
| 1096 | 1114 | MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6567_CLOCK, c64_expansion_cards, NULL) |
| 1097 | 1115 | MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c64_state, exp_irq_w), WRITELINE(c64_state, exp_nmi_w), WRITELINE(c64_state, exp_reset_w)) |
| 1098 | 1116 | MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w)) |
| 1099 | | MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, WRITELINE(c64_state, exp_reset_w)) |
| 1100 | | MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w)) |
| 1101 | | MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1117 | |
| 1118 | MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, c64_user_port_cards, NULL) |
| 1119 | MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(c64_state, exp_reset_w)) |
| 1120 | MCFG_VIC20_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w)) |
| 1121 | MCFG_VIC20_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w)) |
| 1122 | MCFG_VIC20_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w)) |
| 1123 | MCFG_VIC20_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w)) |
| 1124 | MCFG_VIC20_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w)) |
| 1125 | MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1126 | MCFG_VIC20_USER_PORT_C_HANDLER(WRITELINE(c64_state, write_user_pb0)) |
| 1127 | MCFG_VIC20_USER_PORT_D_HANDLER(WRITELINE(c64_state, write_user_pb1)) |
| 1128 | MCFG_VIC20_USER_PORT_E_HANDLER(WRITELINE(c64_state, write_user_pb2)) |
| 1129 | MCFG_VIC20_USER_PORT_F_HANDLER(WRITELINE(c64_state, write_user_pb3)) |
| 1130 | MCFG_VIC20_USER_PORT_H_HANDLER(WRITELINE(c64_state, write_user_pb4)) |
| 1131 | MCFG_VIC20_USER_PORT_J_HANDLER(WRITELINE(c64_state, write_user_pb5)) |
| 1132 | MCFG_VIC20_USER_PORT_K_HANDLER(WRITELINE(c64_state, write_user_pb6)) |
| 1133 | MCFG_VIC20_USER_PORT_L_HANDLER(WRITELINE(c64_state, write_user_pb7)) |
| 1134 | MCFG_VIC20_USER_PORT_M_HANDLER(WRITELINE(c64_state, write_user_pa2)) |
| 1135 | |
| 1102 | 1136 | MCFG_QUICKLOAD_ADD("quickload", c64_state, cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS) |
| 1103 | 1137 | |
| 1104 | 1138 | // software list |
| r26919 | r26920 | |
| 1192 | 1226 | // devices |
| 1193 | 1227 | MCFG_PLS100_ADD(PLA_TAG) |
| 1194 | 1228 | MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, WRITELINE(c64_state, cia1_irq_w)) |
| 1195 | | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt1_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp1_w)) |
| 1229 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_4), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_5)) |
| 1196 | 1230 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL) |
| 1197 | 1231 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL) |
| 1198 | | MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, WRITELINE(c64_state, cia2_irq_w)) |
| 1199 | | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w)) |
| 1232 | MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c64_state, cia2_irq_w)) |
| 1233 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_6), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_7)) |
| 1200 | 1234 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia2_pa_r), WRITE8(c64_state, cia2_pa_w)) |
| 1201 | | MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w)) |
| 1235 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia2_pb_r), WRITE8(c64_state, cia2_pb_w), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_8)) |
| 1202 | 1236 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w)) |
| 1203 | 1237 | MCFG_CBM_IEC_ADD("c1541") |
| 1204 | 1238 | MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w)) |
| 1205 | | MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, atn_w)) |
| 1239 | MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_9)) |
| 1206 | 1240 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL) |
| 1207 | 1241 | MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w)) |
| 1208 | 1242 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy") |
| 1209 | 1243 | MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, c64_expansion_cards, NULL) |
| 1210 | 1244 | MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c64_state, exp_irq_w), WRITELINE(c64_state, exp_nmi_w), WRITELINE(c64_state, exp_reset_w)) |
| 1211 | 1245 | MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w)) |
| 1212 | | MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, WRITELINE(c64_state, exp_reset_w)) |
| 1213 | | MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w)) |
| 1214 | | MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1246 | |
| 1247 | MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, c64_user_port_cards, NULL) |
| 1248 | MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(c64_state, exp_reset_w)) |
| 1249 | MCFG_VIC20_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w)) |
| 1250 | MCFG_VIC20_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w)) |
| 1251 | MCFG_VIC20_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w)) |
| 1252 | MCFG_VIC20_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w)) |
| 1253 | MCFG_VIC20_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w)) |
| 1254 | MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1255 | MCFG_VIC20_USER_PORT_C_HANDLER(WRITELINE(c64_state, write_user_pb0)) |
| 1256 | MCFG_VIC20_USER_PORT_D_HANDLER(WRITELINE(c64_state, write_user_pb1)) |
| 1257 | MCFG_VIC20_USER_PORT_E_HANDLER(WRITELINE(c64_state, write_user_pb2)) |
| 1258 | MCFG_VIC20_USER_PORT_F_HANDLER(WRITELINE(c64_state, write_user_pb3)) |
| 1259 | MCFG_VIC20_USER_PORT_H_HANDLER(WRITELINE(c64_state, write_user_pb4)) |
| 1260 | MCFG_VIC20_USER_PORT_J_HANDLER(WRITELINE(c64_state, write_user_pb5)) |
| 1261 | MCFG_VIC20_USER_PORT_K_HANDLER(WRITELINE(c64_state, write_user_pb6)) |
| 1262 | MCFG_VIC20_USER_PORT_L_HANDLER(WRITELINE(c64_state, write_user_pb7)) |
| 1263 | MCFG_VIC20_USER_PORT_M_HANDLER(WRITELINE(c64_state, write_user_pa2)) |
| 1264 | |
| 1215 | 1265 | MCFG_QUICKLOAD_ADD("quickload", c64_state, cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS) |
| 1216 | 1266 | |
| 1217 | 1267 | // software list |
| r26919 | r26920 | |
| 1283 | 1333 | // devices |
| 1284 | 1334 | MCFG_PLS100_ADD(PLA_TAG) |
| 1285 | 1335 | MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, WRITELINE(c64_state, cia1_irq_w)) |
| 1286 | | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt1_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp1_w)) |
| 1287 | | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64gs_state, cia1_pa_r), NULL) |
| 1288 | | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64gs_state, cia1_pb_r), NULL, NULL) |
| 1289 | | MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, WRITELINE(c64_state, cia2_irq_w)) |
| 1290 | | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w)) |
| 1336 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_4), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_5)) |
| 1337 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL) |
| 1338 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL) |
| 1339 | MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c64_state, cia2_irq_w)) |
| 1340 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_6), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_7)) |
| 1291 | 1341 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia2_pa_r), WRITE8(c64_state, cia2_pa_w)) |
| 1292 | | MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w)) |
| 1342 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia2_pb_r), WRITE8(c64_state, cia2_pb_w), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_8)) |
| 1293 | 1343 | MCFG_CBM_IEC_ADD(NULL) |
| 1294 | 1344 | MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w)) |
| 1295 | | MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, atn_w)) |
| 1296 | | |
| 1345 | MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_9)) |
| 1297 | 1346 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL) |
| 1298 | 1347 | MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w)) |
| 1299 | 1348 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy") |
| 1300 | 1349 | MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, c64_expansion_cards, NULL) |
| 1301 | 1350 | MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c64_state, exp_irq_w), WRITELINE(c64_state, exp_nmi_w), WRITELINE(c64_state, exp_reset_w)) |
| 1302 | 1351 | MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w)) |
| 1303 | | MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, WRITELINE(c64_state, exp_reset_w)) |
| 1304 | | MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w)) |
| 1305 | | MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1352 | |
| 1353 | MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, c64_user_port_cards, NULL) |
| 1354 | MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(c64_state, exp_reset_w)) |
| 1355 | MCFG_VIC20_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w)) |
| 1356 | MCFG_VIC20_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w)) |
| 1357 | MCFG_VIC20_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w)) |
| 1358 | MCFG_VIC20_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w)) |
| 1359 | MCFG_VIC20_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w)) |
| 1360 | MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1361 | MCFG_VIC20_USER_PORT_C_HANDLER(WRITELINE(c64_state, write_user_pb0)) |
| 1362 | MCFG_VIC20_USER_PORT_D_HANDLER(WRITELINE(c64_state, write_user_pb1)) |
| 1363 | MCFG_VIC20_USER_PORT_E_HANDLER(WRITELINE(c64_state, write_user_pb2)) |
| 1364 | MCFG_VIC20_USER_PORT_F_HANDLER(WRITELINE(c64_state, write_user_pb3)) |
| 1365 | MCFG_VIC20_USER_PORT_H_HANDLER(WRITELINE(c64_state, write_user_pb4)) |
| 1366 | MCFG_VIC20_USER_PORT_J_HANDLER(WRITELINE(c64_state, write_user_pb5)) |
| 1367 | MCFG_VIC20_USER_PORT_K_HANDLER(WRITELINE(c64_state, write_user_pb6)) |
| 1368 | MCFG_VIC20_USER_PORT_L_HANDLER(WRITELINE(c64_state, write_user_pb7)) |
| 1369 | MCFG_VIC20_USER_PORT_M_HANDLER(WRITELINE(c64_state, write_user_pa2)) |
| 1370 | |
| 1306 | 1371 | MCFG_QUICKLOAD_ADD("quickload", c64_state, cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS) |
| 1307 | 1372 | |
| 1308 | 1373 | // software list |