trunk/src/emu/bus/vic20/user.c
| r26928 | r26929 | |
| 1 | 1 | // license:BSD-3-Clause |
| 2 | | // copyright-holders:Curt Coder |
| 2 | // copyright-holders:smf |
| 3 | 3 | /********************************************************************** |
| 4 | 4 | |
| 5 | 5 | Commodore VIC-20 User Port emulation |
| r26928 | r26929 | |
| 11 | 11 | |
| 12 | 12 | #include "user.h" |
| 13 | 13 | |
| 14 | | |
| 15 | | |
| 16 | | //************************************************************************** |
| 17 | | // GLOBAL VARIABLES |
| 18 | | //************************************************************************** |
| 19 | | |
| 20 | | const device_type VIC20_USER_PORT = &device_creator<vic20_user_port_device>; |
| 21 | | |
| 22 | | |
| 23 | | |
| 24 | | //************************************************************************** |
| 25 | | // CARD INTERFACE |
| 26 | | //************************************************************************** |
| 27 | | |
| 28 | 14 | //------------------------------------------------- |
| 29 | | // device_vic20_user_port_interface - constructor |
| 30 | | //------------------------------------------------- |
| 31 | | |
| 32 | | device_vic20_user_port_interface::device_vic20_user_port_interface(const machine_config &mconfig, device_t &device) |
| 33 | | : device_slot_card_interface(mconfig,device) |
| 34 | | { |
| 35 | | m_slot = dynamic_cast<vic20_user_port_device *>(device.owner()); |
| 36 | | } |
| 37 | | |
| 38 | | |
| 39 | | //------------------------------------------------- |
| 40 | | // ~device_vic20_user_port_interface - destructor |
| 41 | | //------------------------------------------------- |
| 42 | | |
| 43 | | device_vic20_user_port_interface::~device_vic20_user_port_interface() |
| 44 | | { |
| 45 | | } |
| 46 | | |
| 47 | | |
| 48 | | |
| 49 | | //************************************************************************** |
| 50 | | // LIVE DEVICE |
| 51 | | //************************************************************************** |
| 52 | | |
| 53 | | //------------------------------------------------- |
| 54 | | // vic20_user_port_device - constructor |
| 55 | | //------------------------------------------------- |
| 56 | | |
| 57 | | vic20_user_port_device::vic20_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 58 | | device_t(mconfig, VIC20_USER_PORT, "VIC-20 user port", tag, owner, clock, "vic20_user_port", __FILE__), |
| 59 | | device_slot_interface(mconfig, *this), |
| 60 | | m_3_handler(*this), |
| 61 | | m_4_handler(*this), |
| 62 | | m_5_handler(*this), |
| 63 | | m_6_handler(*this), |
| 64 | | m_7_handler(*this), |
| 65 | | m_8_handler(*this), |
| 66 | | m_9_handler(*this), |
| 67 | | m_b_handler(*this), |
| 68 | | m_c_handler(*this), |
| 69 | | m_d_handler(*this), |
| 70 | | m_e_handler(*this), |
| 71 | | m_f_handler(*this), |
| 72 | | m_h_handler(*this), |
| 73 | | m_j_handler(*this), |
| 74 | | m_k_handler(*this), |
| 75 | | m_l_handler(*this), |
| 76 | | m_m_handler(*this) |
| 77 | | { |
| 78 | | } |
| 79 | | |
| 80 | | |
| 81 | | //------------------------------------------------- |
| 82 | | // device_start - device-specific startup |
| 83 | | //------------------------------------------------- |
| 84 | | |
| 85 | | void vic20_user_port_device::device_start() |
| 86 | | { |
| 87 | | m_card = dynamic_cast<device_vic20_user_port_interface *>(get_card_device()); |
| 88 | | |
| 89 | | // resolve callbacks |
| 90 | | m_3_handler.resolve_safe(); |
| 91 | | m_4_handler.resolve_safe(); |
| 92 | | m_5_handler.resolve_safe(); |
| 93 | | m_6_handler.resolve_safe(); |
| 94 | | m_7_handler.resolve_safe(); |
| 95 | | m_8_handler.resolve_safe(); |
| 96 | | m_9_handler.resolve_safe(); |
| 97 | | m_b_handler.resolve_safe(); |
| 98 | | m_c_handler.resolve_safe(); |
| 99 | | m_d_handler.resolve_safe(); |
| 100 | | m_e_handler.resolve_safe(); |
| 101 | | m_f_handler.resolve_safe(); |
| 102 | | m_h_handler.resolve_safe(); |
| 103 | | m_j_handler.resolve_safe(); |
| 104 | | m_k_handler.resolve_safe(); |
| 105 | | m_l_handler.resolve_safe(); |
| 106 | | m_m_handler.resolve_safe(); |
| 107 | | |
| 108 | | // pull up |
| 109 | | m_3_handler(1); |
| 110 | | m_4_handler(1); |
| 111 | | m_5_handler(1); |
| 112 | | m_6_handler(1); |
| 113 | | m_7_handler(1); |
| 114 | | m_8_handler(1); |
| 115 | | m_9_handler(1); |
| 116 | | m_b_handler(1); |
| 117 | | m_c_handler(1); |
| 118 | | m_d_handler(1); |
| 119 | | m_e_handler(1); |
| 120 | | m_f_handler(1); |
| 121 | | m_h_handler(1); |
| 122 | | m_j_handler(1); |
| 123 | | m_k_handler(1); |
| 124 | | m_l_handler(1); |
| 125 | | m_m_handler(1); |
| 126 | | } |
| 127 | | |
| 128 | | |
| 129 | | //------------------------------------------------- |
| 130 | | // device_reset - device-specific reset |
| 131 | | //------------------------------------------------- |
| 132 | | |
| 133 | | void vic20_user_port_device::device_reset() |
| 134 | | { |
| 135 | | if (get_card_device()) |
| 136 | | { |
| 137 | | get_card_device()->reset(); |
| 138 | | } |
| 139 | | } |
| 140 | | |
| 141 | | |
| 142 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_3 ) { if (m_card != NULL) m_card->input_3(state); } |
| 143 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_4 ) { if (m_card != NULL) m_card->input_4(state); } |
| 144 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_5 ) { if (m_card != NULL) m_card->input_5(state); } |
| 145 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_6 ) { if (m_card != NULL) m_card->input_6(state); } |
| 146 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_7 ) { if (m_card != NULL) m_card->input_7(state); } |
| 147 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_8 ) { if (m_card != NULL) m_card->input_8(state); } |
| 148 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_9 ) { if (m_card != NULL) m_card->input_9(state); } |
| 149 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_b ) { if (m_card != NULL) m_card->input_b(state); } |
| 150 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_c ) { if (m_card != NULL) m_card->input_c(state); } |
| 151 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_d ) { if (m_card != NULL) m_card->input_d(state); } |
| 152 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_e ) { if (m_card != NULL) m_card->input_e(state); } |
| 153 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_f ) { if (m_card != NULL) m_card->input_f(state); } |
| 154 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_h ) { if (m_card != NULL) m_card->input_h(state); } |
| 155 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_j ) { if (m_card != NULL) m_card->input_j(state); } |
| 156 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_k ) { if (m_card != NULL) m_card->input_k(state); } |
| 157 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_l ) { if (m_card != NULL) m_card->input_l(state); } |
| 158 | | WRITE_LINE_MEMBER( vic20_user_port_device::write_m ) { if (m_card != NULL) m_card->input_m(state); } |
| 159 | | |
| 160 | | |
| 161 | | |
| 162 | | //------------------------------------------------- |
| 163 | 15 | // SLOT_INTERFACE( vic20_user_port_cards ) |
| 164 | 16 | //------------------------------------------------- |
| 165 | 17 | |
trunk/src/emu/bus/vic20/user.h
| r26928 | r26929 | |
| 1 | 1 | // license:BSD-3-Clause |
| 2 | | // copyright-holders:Curt Coder |
| 2 | // copyright-holders:smf |
| 3 | 3 | /********************************************************************** |
| 4 | 4 | |
| 5 | 5 | Commodore VIC-20 User Port emulation |
| r26928 | r26929 | |
| 29 | 29 | #ifndef __VIC20_USER_PORT__ |
| 30 | 30 | #define __VIC20_USER_PORT__ |
| 31 | 31 | |
| 32 | | #include "emu.h" |
| 32 | #include "bus/pet/user.h" |
| 33 | 33 | |
| 34 | | |
| 35 | | |
| 36 | | //************************************************************************** |
| 37 | | // INTERFACE CONFIGURATION MACROS |
| 38 | | //************************************************************************** |
| 39 | | |
| 40 | | #define MCFG_VIC20_USER_PORT_ADD(_tag, _slot_intf, _def_slot) \ |
| 41 | | MCFG_DEVICE_ADD(_tag, VIC20_USER_PORT, 0) \ |
| 42 | | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) |
| 43 | | |
| 44 | | #define MCFG_VIC20_USER_PORT_3_HANDLER(_devcb) \ |
| 45 | | devcb = &vic20_user_port_device::set_3_handler(*device, DEVCB2_##_devcb); |
| 46 | | |
| 47 | | #define MCFG_VIC20_USER_PORT_4_HANDLER(_devcb) \ |
| 48 | | devcb = &vic20_user_port_device::set_4_handler(*device, DEVCB2_##_devcb); |
| 49 | | |
| 50 | | #define MCFG_VIC20_USER_PORT_5_HANDLER(_devcb) \ |
| 51 | | devcb = &vic20_user_port_device::set_5_handler(*device, DEVCB2_##_devcb); |
| 52 | | |
| 53 | | #define MCFG_VIC20_USER_PORT_6_HANDLER(_devcb) \ |
| 54 | | devcb = &vic20_user_port_device::set_6_handler(*device, DEVCB2_##_devcb); |
| 55 | | |
| 56 | | #define MCFG_VIC20_USER_PORT_7_HANDLER(_devcb) \ |
| 57 | | devcb = &vic20_user_port_device::set_7_handler(*device, DEVCB2_##_devcb); |
| 58 | | |
| 59 | | #define MCFG_VIC20_USER_PORT_8_HANDLER(_devcb) \ |
| 60 | | devcb = &vic20_user_port_device::set_8_handler(*device, DEVCB2_##_devcb); |
| 61 | | |
| 62 | | #define MCFG_VIC20_USER_PORT_9_HANDLER(_devcb) \ |
| 63 | | devcb = &vic20_user_port_device::set_9_handler(*device, DEVCB2_##_devcb); |
| 64 | | |
| 65 | | #define MCFG_VIC20_USER_PORT_B_HANDLER(_devcb) \ |
| 66 | | devcb = &vic20_user_port_device::set_b_handler(*device, DEVCB2_##_devcb); |
| 67 | | |
| 68 | | #define MCFG_VIC20_USER_PORT_C_HANDLER(_devcb) \ |
| 69 | | devcb = &vic20_user_port_device::set_c_handler(*device, DEVCB2_##_devcb); |
| 70 | | |
| 71 | | #define MCFG_VIC20_USER_PORT_D_HANDLER(_devcb) \ |
| 72 | | devcb = &vic20_user_port_device::set_d_handler(*device, DEVCB2_##_devcb); |
| 73 | | |
| 74 | | #define MCFG_VIC20_USER_PORT_E_HANDLER(_devcb) \ |
| 75 | | devcb = &vic20_user_port_device::set_e_handler(*device, DEVCB2_##_devcb); |
| 76 | | |
| 77 | | #define MCFG_VIC20_USER_PORT_F_HANDLER(_devcb) \ |
| 78 | | devcb = &vic20_user_port_device::set_f_handler(*device, DEVCB2_##_devcb); |
| 79 | | |
| 80 | | #define MCFG_VIC20_USER_PORT_H_HANDLER(_devcb) \ |
| 81 | | devcb = &vic20_user_port_device::set_h_handler(*device, DEVCB2_##_devcb); |
| 82 | | |
| 83 | | #define MCFG_VIC20_USER_PORT_J_HANDLER(_devcb) \ |
| 84 | | devcb = &vic20_user_port_device::set_j_handler(*device, DEVCB2_##_devcb); |
| 85 | | |
| 86 | | #define MCFG_VIC20_USER_PORT_K_HANDLER(_devcb) \ |
| 87 | | devcb = &vic20_user_port_device::set_k_handler(*device, DEVCB2_##_devcb); |
| 88 | | |
| 89 | | #define MCFG_VIC20_USER_PORT_L_HANDLER(_devcb) \ |
| 90 | | devcb = &vic20_user_port_device::set_l_handler(*device, DEVCB2_##_devcb); |
| 91 | | |
| 92 | | #define MCFG_VIC20_USER_PORT_M_HANDLER(_devcb) \ |
| 93 | | devcb = &vic20_user_port_device::set_m_handler(*device, DEVCB2_##_devcb); |
| 94 | | |
| 95 | | |
| 96 | | //************************************************************************** |
| 97 | | // TYPE DEFINITIONS |
| 98 | | //************************************************************************** |
| 99 | | |
| 100 | | // ======================> vic20_user_port_device |
| 101 | | |
| 102 | | class device_vic20_user_port_interface; |
| 103 | | |
| 104 | | class vic20_user_port_device : public device_t, |
| 105 | | public device_slot_interface |
| 106 | | { |
| 107 | | public: |
| 108 | | // construction/destruction |
| 109 | | vic20_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 110 | | |
| 111 | | template<class _Object> static devcb2_base &set_3_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_3_handler.set_callback(object); } |
| 112 | | template<class _Object> static devcb2_base &set_4_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_4_handler.set_callback(object); } |
| 113 | | template<class _Object> static devcb2_base &set_5_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_5_handler.set_callback(object); } |
| 114 | | template<class _Object> static devcb2_base &set_6_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_6_handler.set_callback(object); } |
| 115 | | template<class _Object> static devcb2_base &set_7_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_7_handler.set_callback(object); } |
| 116 | | template<class _Object> static devcb2_base &set_8_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_8_handler.set_callback(object); } |
| 117 | | template<class _Object> static devcb2_base &set_9_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_9_handler.set_callback(object); } |
| 118 | | template<class _Object> static devcb2_base &set_b_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_b_handler.set_callback(object); } |
| 119 | | template<class _Object> static devcb2_base &set_c_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_c_handler.set_callback(object); } |
| 120 | | template<class _Object> static devcb2_base &set_d_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_d_handler.set_callback(object); } |
| 121 | | template<class _Object> static devcb2_base &set_e_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_e_handler.set_callback(object); } |
| 122 | | template<class _Object> static devcb2_base &set_f_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_f_handler.set_callback(object); } |
| 123 | | template<class _Object> static devcb2_base &set_h_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_h_handler.set_callback(object); } |
| 124 | | template<class _Object> static devcb2_base &set_j_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_j_handler.set_callback(object); } |
| 125 | | template<class _Object> static devcb2_base &set_k_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_k_handler.set_callback(object); } |
| 126 | | template<class _Object> static devcb2_base &set_l_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_l_handler.set_callback(object); } |
| 127 | | template<class _Object> static devcb2_base &set_m_handler(device_t &device, _Object object) { return downcast<vic20_user_port_device &>(device).m_m_handler.set_callback(object); } |
| 128 | | |
| 129 | | // computer interface |
| 130 | | DECLARE_WRITE_LINE_MEMBER( write_3 ); |
| 131 | | DECLARE_WRITE_LINE_MEMBER( write_4 ); |
| 132 | | DECLARE_WRITE_LINE_MEMBER( write_5 ); |
| 133 | | DECLARE_WRITE_LINE_MEMBER( write_6 ); |
| 134 | | DECLARE_WRITE_LINE_MEMBER( write_7 ); |
| 135 | | DECLARE_WRITE_LINE_MEMBER( write_8 ); |
| 136 | | DECLARE_WRITE_LINE_MEMBER( write_9 ); |
| 137 | | DECLARE_WRITE_LINE_MEMBER( write_b ); |
| 138 | | DECLARE_WRITE_LINE_MEMBER( write_c ); |
| 139 | | DECLARE_WRITE_LINE_MEMBER( write_d ); |
| 140 | | DECLARE_WRITE_LINE_MEMBER( write_e ); |
| 141 | | DECLARE_WRITE_LINE_MEMBER( write_f ); |
| 142 | | DECLARE_WRITE_LINE_MEMBER( write_h ); |
| 143 | | DECLARE_WRITE_LINE_MEMBER( write_j ); |
| 144 | | DECLARE_WRITE_LINE_MEMBER( write_k ); |
| 145 | | DECLARE_WRITE_LINE_MEMBER( write_l ); |
| 146 | | DECLARE_WRITE_LINE_MEMBER( write_m ); |
| 147 | | |
| 148 | | // device interface |
| 149 | | devcb2_write_line m_3_handler; |
| 150 | | devcb2_write_line m_4_handler; |
| 151 | | devcb2_write_line m_5_handler; |
| 152 | | devcb2_write_line m_6_handler; |
| 153 | | devcb2_write_line m_7_handler; |
| 154 | | devcb2_write_line m_8_handler; |
| 155 | | devcb2_write_line m_9_handler; |
| 156 | | devcb2_write_line m_b_handler; |
| 157 | | devcb2_write_line m_c_handler; |
| 158 | | devcb2_write_line m_d_handler; |
| 159 | | devcb2_write_line m_e_handler; |
| 160 | | devcb2_write_line m_f_handler; |
| 161 | | devcb2_write_line m_h_handler; |
| 162 | | devcb2_write_line m_j_handler; |
| 163 | | devcb2_write_line m_k_handler; |
| 164 | | devcb2_write_line m_l_handler; |
| 165 | | devcb2_write_line m_m_handler; |
| 166 | | |
| 167 | | protected: |
| 168 | | // device-level overrides |
| 169 | | virtual void device_start(); |
| 170 | | virtual void device_reset(); |
| 171 | | |
| 172 | | device_vic20_user_port_interface *m_card; |
| 173 | | }; |
| 174 | | |
| 175 | | |
| 176 | | // ======================> device_vic20_user_port_interface |
| 177 | | |
| 178 | | // class representing interface-specific vic20_expansion card |
| 179 | | class device_vic20_user_port_interface : public device_slot_card_interface |
| 180 | | { |
| 181 | | public: |
| 182 | | device_vic20_user_port_interface(const machine_config &mconfig, device_t &device); |
| 183 | | virtual ~device_vic20_user_port_interface(); |
| 184 | | |
| 185 | | virtual DECLARE_WRITE_LINE_MEMBER( input_3 ) {} |
| 186 | | virtual DECLARE_WRITE_LINE_MEMBER( input_4 ) {} |
| 187 | | virtual DECLARE_WRITE_LINE_MEMBER( input_5 ) {} |
| 188 | | virtual DECLARE_WRITE_LINE_MEMBER( input_6 ) {} |
| 189 | | virtual DECLARE_WRITE_LINE_MEMBER( input_7 ) {} |
| 190 | | virtual DECLARE_WRITE_LINE_MEMBER( input_8 ) {} |
| 191 | | virtual DECLARE_WRITE_LINE_MEMBER( input_9 ) {} |
| 192 | | virtual DECLARE_WRITE_LINE_MEMBER( input_b ) {} |
| 193 | | virtual DECLARE_WRITE_LINE_MEMBER( input_c ) {} |
| 194 | | virtual DECLARE_WRITE_LINE_MEMBER( input_d ) {} |
| 195 | | virtual DECLARE_WRITE_LINE_MEMBER( input_e ) {} |
| 196 | | virtual DECLARE_WRITE_LINE_MEMBER( input_f ) {} |
| 197 | | virtual DECLARE_WRITE_LINE_MEMBER( input_h ) {} |
| 198 | | virtual DECLARE_WRITE_LINE_MEMBER( input_j ) {} |
| 199 | | virtual DECLARE_WRITE_LINE_MEMBER( input_k ) {} |
| 200 | | virtual DECLARE_WRITE_LINE_MEMBER( input_l ) {} |
| 201 | | virtual DECLARE_WRITE_LINE_MEMBER( input_m ) {} |
| 202 | | |
| 203 | | DECLARE_WRITE_LINE_MEMBER( output_3 ) { m_slot->m_3_handler(state); } |
| 204 | | DECLARE_WRITE_LINE_MEMBER( output_4 ) { m_slot->m_4_handler(state); } |
| 205 | | DECLARE_WRITE_LINE_MEMBER( output_5 ) { m_slot->m_5_handler(state); } |
| 206 | | DECLARE_WRITE_LINE_MEMBER( output_6 ) { m_slot->m_6_handler(state); } |
| 207 | | DECLARE_WRITE_LINE_MEMBER( output_7 ) { m_slot->m_7_handler(state); } |
| 208 | | DECLARE_WRITE_LINE_MEMBER( output_8 ) { m_slot->m_8_handler(state); } |
| 209 | | DECLARE_WRITE_LINE_MEMBER( output_9 ) { m_slot->m_9_handler(state); } |
| 210 | | DECLARE_WRITE_LINE_MEMBER( output_b ) { m_slot->m_b_handler(state); } |
| 211 | | DECLARE_WRITE_LINE_MEMBER( output_c ) { m_slot->m_c_handler(state); } |
| 212 | | DECLARE_WRITE_LINE_MEMBER( output_d ) { m_slot->m_d_handler(state); } |
| 213 | | DECLARE_WRITE_LINE_MEMBER( output_e ) { m_slot->m_e_handler(state); } |
| 214 | | DECLARE_WRITE_LINE_MEMBER( output_f ) { m_slot->m_f_handler(state); } |
| 215 | | DECLARE_WRITE_LINE_MEMBER( output_h ) { m_slot->m_h_handler(state); } |
| 216 | | DECLARE_WRITE_LINE_MEMBER( output_j ) { m_slot->m_j_handler(state); } |
| 217 | | DECLARE_WRITE_LINE_MEMBER( output_k ) { m_slot->m_k_handler(state); } |
| 218 | | DECLARE_WRITE_LINE_MEMBER( output_l ) { m_slot->m_l_handler(state); } |
| 219 | | DECLARE_WRITE_LINE_MEMBER( output_m ) { m_slot->m_m_handler(state); } |
| 220 | | |
| 221 | | protected: |
| 222 | | vic20_user_port_device *m_slot; |
| 223 | | }; |
| 224 | | |
| 225 | | |
| 226 | | // device type definition |
| 227 | | extern const device_type VIC20_USER_PORT; |
| 228 | | |
| 229 | 34 | SLOT_INTERFACE_EXTERN( vic20_user_port_cards ); |
| 230 | 35 | |
| 231 | 36 | #endif |
trunk/src/emu/bus/pet/user.h
| r26928 | r26929 | |
| 1 | 1 | // license:BSD-3-Clause |
| 2 | | // copyright-holders:Curt Coder |
| 2 | // copyright-holders:smf |
| 3 | 3 | /********************************************************************** |
| 4 | 4 | |
| 5 | 5 | Commodore PET User Port emulation |
| r26928 | r26929 | |
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | //************************************************************************** |
| 37 | | // CONSTANTS |
| 37 | // INTERFACE CONFIGURATION MACROS |
| 38 | 38 | //************************************************************************** |
| 39 | 39 | |
| 40 | | #define PET_USER_PORT_TAG "user" |
| 40 | #define MCFG_PET_USER_PORT_ADD(_tag, _slot_intf, _def_slot) \ |
| 41 | MCFG_DEVICE_ADD(_tag, PET_USER_PORT, 0) \ |
| 42 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) |
| 41 | 43 | |
| 44 | #define MCFG_PET_USER_PORT_3_HANDLER(_devcb) \ |
| 45 | devcb = &pet_user_port_device::set_3_handler(*device, DEVCB2_##_devcb); |
| 42 | 46 | |
| 47 | #define MCFG_PET_USER_PORT_4_HANDLER(_devcb) \ |
| 48 | devcb = &pet_user_port_device::set_4_handler(*device, DEVCB2_##_devcb); |
| 43 | 49 | |
| 44 | | //************************************************************************** |
| 45 | | // INTERFACE CONFIGURATION MACROS |
| 46 | | //************************************************************************** |
| 50 | #define MCFG_PET_USER_PORT_5_HANDLER(_devcb) \ |
| 51 | devcb = &pet_user_port_device::set_5_handler(*device, DEVCB2_##_devcb); |
| 47 | 52 | |
| 48 | | #define PET_USER_PORT_INTERFACE(_name) \ |
| 49 | | const pet_user_port_interface (_name) = |
| 53 | #define MCFG_PET_USER_PORT_6_HANDLER(_devcb) \ |
| 54 | devcb = &pet_user_port_device::set_6_handler(*device, DEVCB2_##_devcb); |
| 50 | 55 | |
| 56 | #define MCFG_PET_USER_PORT_7_HANDLER(_devcb) \ |
| 57 | devcb = &pet_user_port_device::set_7_handler(*device, DEVCB2_##_devcb); |
| 51 | 58 | |
| 52 | | #define MCFG_PET_USER_PORT_ADD(_tag, _config, _slot_intf, _def_slot) \ |
| 53 | | MCFG_DEVICE_ADD(_tag, PET_USER_PORT, 0) \ |
| 54 | | MCFG_DEVICE_CONFIG(_config) \ |
| 55 | | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) |
| 59 | #define MCFG_PET_USER_PORT_8_HANDLER(_devcb) \ |
| 60 | devcb = &pet_user_port_device::set_8_handler(*device, DEVCB2_##_devcb); |
| 56 | 61 | |
| 62 | #define MCFG_PET_USER_PORT_9_HANDLER(_devcb) \ |
| 63 | devcb = &pet_user_port_device::set_9_handler(*device, DEVCB2_##_devcb); |
| 57 | 64 | |
| 65 | #define MCFG_PET_USER_PORT_B_HANDLER(_devcb) \ |
| 66 | devcb = &pet_user_port_device::set_b_handler(*device, DEVCB2_##_devcb); |
| 58 | 67 | |
| 68 | #define MCFG_PET_USER_PORT_C_HANDLER(_devcb) \ |
| 69 | devcb = &pet_user_port_device::set_c_handler(*device, DEVCB2_##_devcb); |
| 70 | |
| 71 | #define MCFG_PET_USER_PORT_D_HANDLER(_devcb) \ |
| 72 | devcb = &pet_user_port_device::set_d_handler(*device, DEVCB2_##_devcb); |
| 73 | |
| 74 | #define MCFG_PET_USER_PORT_E_HANDLER(_devcb) \ |
| 75 | devcb = &pet_user_port_device::set_e_handler(*device, DEVCB2_##_devcb); |
| 76 | |
| 77 | #define MCFG_PET_USER_PORT_F_HANDLER(_devcb) \ |
| 78 | devcb = &pet_user_port_device::set_f_handler(*device, DEVCB2_##_devcb); |
| 79 | |
| 80 | #define MCFG_PET_USER_PORT_H_HANDLER(_devcb) \ |
| 81 | devcb = &pet_user_port_device::set_h_handler(*device, DEVCB2_##_devcb); |
| 82 | |
| 83 | #define MCFG_PET_USER_PORT_J_HANDLER(_devcb) \ |
| 84 | devcb = &pet_user_port_device::set_j_handler(*device, DEVCB2_##_devcb); |
| 85 | |
| 86 | #define MCFG_PET_USER_PORT_K_HANDLER(_devcb) \ |
| 87 | devcb = &pet_user_port_device::set_k_handler(*device, DEVCB2_##_devcb); |
| 88 | |
| 89 | #define MCFG_PET_USER_PORT_L_HANDLER(_devcb) \ |
| 90 | devcb = &pet_user_port_device::set_l_handler(*device, DEVCB2_##_devcb); |
| 91 | |
| 92 | #define MCFG_PET_USER_PORT_M_HANDLER(_devcb) \ |
| 93 | devcb = &pet_user_port_device::set_m_handler(*device, DEVCB2_##_devcb); |
| 94 | |
| 95 | |
| 59 | 96 | //************************************************************************** |
| 60 | 97 | // TYPE DEFINITIONS |
| 61 | 98 | //************************************************************************** |
| 62 | 99 | |
| 63 | | // ======================> pet_user_port_interface |
| 64 | | |
| 65 | | struct pet_user_port_interface |
| 66 | | { |
| 67 | | devcb_write_line m_out_ca1_cb; |
| 68 | | devcb_write_line m_out_cb2_cb; |
| 69 | | }; |
| 70 | | |
| 71 | | |
| 72 | 100 | // ======================> pet_user_port_device |
| 73 | 101 | |
| 74 | 102 | class device_pet_user_port_interface; |
| 75 | 103 | |
| 76 | 104 | class pet_user_port_device : public device_t, |
| 77 | | public pet_user_port_interface, |
| 78 | | public device_slot_interface |
| 105 | public device_slot_interface |
| 79 | 106 | { |
| 80 | 107 | public: |
| 81 | 108 | // construction/destruction |
| 82 | 109 | pet_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 83 | 110 | |
| 111 | template<class _Object> static devcb2_base &set_3_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_3_handler.set_callback(object); } |
| 112 | template<class _Object> static devcb2_base &set_4_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_4_handler.set_callback(object); } |
| 113 | template<class _Object> static devcb2_base &set_5_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_5_handler.set_callback(object); } |
| 114 | template<class _Object> static devcb2_base &set_6_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_6_handler.set_callback(object); } |
| 115 | template<class _Object> static devcb2_base &set_7_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_7_handler.set_callback(object); } |
| 116 | template<class _Object> static devcb2_base &set_8_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_8_handler.set_callback(object); } |
| 117 | template<class _Object> static devcb2_base &set_9_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_9_handler.set_callback(object); } |
| 118 | template<class _Object> static devcb2_base &set_b_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_b_handler.set_callback(object); } |
| 119 | template<class _Object> static devcb2_base &set_c_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_c_handler.set_callback(object); } |
| 120 | template<class _Object> static devcb2_base &set_d_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_d_handler.set_callback(object); } |
| 121 | template<class _Object> static devcb2_base &set_e_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_e_handler.set_callback(object); } |
| 122 | template<class _Object> static devcb2_base &set_f_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_f_handler.set_callback(object); } |
| 123 | template<class _Object> static devcb2_base &set_h_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_h_handler.set_callback(object); } |
| 124 | template<class _Object> static devcb2_base &set_j_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_j_handler.set_callback(object); } |
| 125 | template<class _Object> static devcb2_base &set_k_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_k_handler.set_callback(object); } |
| 126 | template<class _Object> static devcb2_base &set_l_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_l_handler.set_callback(object); } |
| 127 | template<class _Object> static devcb2_base &set_m_handler(device_t &device, _Object object) { return downcast<pet_user_port_device &>(device).m_m_handler.set_callback(object); } |
| 128 | |
| 84 | 129 | // computer interface |
| 85 | | DECLARE_READ8_MEMBER( pa_r ); |
| 86 | | DECLARE_WRITE8_MEMBER( pa_w ); |
| 87 | | DECLARE_READ_LINE_MEMBER( ca1_r ); |
| 88 | | DECLARE_WRITE_LINE_MEMBER( ca1_w ); |
| 89 | | DECLARE_READ_LINE_MEMBER( cb2_r ); |
| 90 | | DECLARE_WRITE_LINE_MEMBER( cb2_w ); |
| 130 | DECLARE_WRITE_LINE_MEMBER( write_3 ); |
| 131 | DECLARE_WRITE_LINE_MEMBER( write_4 ); |
| 132 | DECLARE_WRITE_LINE_MEMBER( write_5 ); |
| 133 | DECLARE_WRITE_LINE_MEMBER( write_6 ); |
| 134 | DECLARE_WRITE_LINE_MEMBER( write_7 ); |
| 135 | DECLARE_WRITE_LINE_MEMBER( write_8 ); |
| 136 | DECLARE_WRITE_LINE_MEMBER( write_9 ); |
| 137 | DECLARE_WRITE_LINE_MEMBER( write_b ); |
| 138 | DECLARE_WRITE_LINE_MEMBER( write_c ); |
| 139 | DECLARE_WRITE_LINE_MEMBER( write_d ); |
| 140 | DECLARE_WRITE_LINE_MEMBER( write_e ); |
| 141 | DECLARE_WRITE_LINE_MEMBER( write_f ); |
| 142 | DECLARE_WRITE_LINE_MEMBER( write_h ); |
| 143 | DECLARE_WRITE_LINE_MEMBER( write_j ); |
| 144 | DECLARE_WRITE_LINE_MEMBER( write_k ); |
| 145 | DECLARE_WRITE_LINE_MEMBER( write_l ); |
| 146 | DECLARE_WRITE_LINE_MEMBER( write_m ); |
| 91 | 147 | |
| 92 | | // cartridge interface |
| 93 | | DECLARE_WRITE_LINE_MEMBER( via_ca1_w ) { m_out_ca1_func(state); } |
| 94 | | DECLARE_WRITE_LINE_MEMBER( via_cb2_w ) { m_out_cb2_func(state); } |
| 148 | // device interface |
| 149 | devcb2_write_line m_3_handler; |
| 150 | devcb2_write_line m_4_handler; |
| 151 | devcb2_write_line m_5_handler; |
| 152 | devcb2_write_line m_6_handler; |
| 153 | devcb2_write_line m_7_handler; |
| 154 | devcb2_write_line m_8_handler; |
| 155 | devcb2_write_line m_9_handler; |
| 156 | devcb2_write_line m_b_handler; |
| 157 | devcb2_write_line m_c_handler; |
| 158 | devcb2_write_line m_d_handler; |
| 159 | devcb2_write_line m_e_handler; |
| 160 | devcb2_write_line m_f_handler; |
| 161 | devcb2_write_line m_h_handler; |
| 162 | devcb2_write_line m_j_handler; |
| 163 | devcb2_write_line m_k_handler; |
| 164 | devcb2_write_line m_l_handler; |
| 165 | devcb2_write_line m_m_handler; |
| 95 | 166 | |
| 96 | 167 | protected: |
| 97 | 168 | // device-level overrides |
| 98 | | virtual void device_config_complete(); |
| 99 | 169 | virtual void device_start(); |
| 100 | 170 | virtual void device_reset(); |
| 101 | 171 | |
| 102 | | devcb_resolved_write_line m_out_ca1_func; |
| 103 | | devcb_resolved_write_line m_out_cb2_func; |
| 104 | | |
| 105 | 172 | device_pet_user_port_interface *m_card; |
| 106 | 173 | }; |
| 107 | 174 | |
| 108 | 175 | |
| 109 | 176 | // ======================> device_pet_user_port_interface |
| 110 | 177 | |
| 111 | | // class representing interface-specific live pet_expansion card |
| 178 | // class representing interface-specific pet_expansion card |
| 112 | 179 | class device_pet_user_port_interface : public device_slot_card_interface |
| 113 | 180 | { |
| 114 | 181 | public: |
| 115 | | // construction/destruction |
| 116 | 182 | device_pet_user_port_interface(const machine_config &mconfig, device_t &device); |
| 117 | 183 | virtual ~device_pet_user_port_interface(); |
| 118 | 184 | |
| 119 | | virtual UINT8 pet_pa_r(address_space &space, offs_t offset) { return 0xff; }; |
| 120 | | virtual void pet_pa_w(address_space &space, offs_t offset, UINT8 data) { }; |
| 185 | virtual DECLARE_WRITE_LINE_MEMBER( input_3 ) {} |
| 186 | virtual DECLARE_WRITE_LINE_MEMBER( input_4 ) {} |
| 187 | virtual DECLARE_WRITE_LINE_MEMBER( input_5 ) {} |
| 188 | virtual DECLARE_WRITE_LINE_MEMBER( input_6 ) {} |
| 189 | virtual DECLARE_WRITE_LINE_MEMBER( input_7 ) {} |
| 190 | virtual DECLARE_WRITE_LINE_MEMBER( input_8 ) {} |
| 191 | virtual DECLARE_WRITE_LINE_MEMBER( input_9 ) {} |
| 192 | virtual DECLARE_WRITE_LINE_MEMBER( input_b ) {} |
| 193 | virtual DECLARE_WRITE_LINE_MEMBER( input_c ) {} |
| 194 | virtual DECLARE_WRITE_LINE_MEMBER( input_d ) {} |
| 195 | virtual DECLARE_WRITE_LINE_MEMBER( input_e ) {} |
| 196 | virtual DECLARE_WRITE_LINE_MEMBER( input_f ) {} |
| 197 | virtual DECLARE_WRITE_LINE_MEMBER( input_h ) {} |
| 198 | virtual DECLARE_WRITE_LINE_MEMBER( input_j ) {} |
| 199 | virtual DECLARE_WRITE_LINE_MEMBER( input_k ) {} |
| 200 | virtual DECLARE_WRITE_LINE_MEMBER( input_l ) {} |
| 201 | virtual DECLARE_WRITE_LINE_MEMBER( input_m ) {} |
| 121 | 202 | |
| 122 | | virtual int pet_ca1_r() { return 1; }; |
| 123 | | virtual void pet_ca1_w(int state) { }; |
| 124 | | virtual int pet_cb2_r() { return 1; }; |
| 125 | | virtual void pet_cb2_w(int state) { }; |
| 203 | DECLARE_WRITE_LINE_MEMBER( output_3 ) { m_slot->m_3_handler(state); } |
| 204 | DECLARE_WRITE_LINE_MEMBER( output_4 ) { m_slot->m_4_handler(state); } |
| 205 | DECLARE_WRITE_LINE_MEMBER( output_5 ) { m_slot->m_5_handler(state); } |
| 206 | DECLARE_WRITE_LINE_MEMBER( output_6 ) { m_slot->m_6_handler(state); } |
| 207 | DECLARE_WRITE_LINE_MEMBER( output_7 ) { m_slot->m_7_handler(state); } |
| 208 | DECLARE_WRITE_LINE_MEMBER( output_8 ) { m_slot->m_8_handler(state); } |
| 209 | DECLARE_WRITE_LINE_MEMBER( output_9 ) { m_slot->m_9_handler(state); } |
| 210 | DECLARE_WRITE_LINE_MEMBER( output_b ) { m_slot->m_b_handler(state); } |
| 211 | DECLARE_WRITE_LINE_MEMBER( output_c ) { m_slot->m_c_handler(state); } |
| 212 | DECLARE_WRITE_LINE_MEMBER( output_d ) { m_slot->m_d_handler(state); } |
| 213 | DECLARE_WRITE_LINE_MEMBER( output_e ) { m_slot->m_e_handler(state); } |
| 214 | DECLARE_WRITE_LINE_MEMBER( output_f ) { m_slot->m_f_handler(state); } |
| 215 | DECLARE_WRITE_LINE_MEMBER( output_h ) { m_slot->m_h_handler(state); } |
| 216 | DECLARE_WRITE_LINE_MEMBER( output_j ) { m_slot->m_j_handler(state); } |
| 217 | DECLARE_WRITE_LINE_MEMBER( output_k ) { m_slot->m_k_handler(state); } |
| 218 | DECLARE_WRITE_LINE_MEMBER( output_l ) { m_slot->m_l_handler(state); } |
| 219 | DECLARE_WRITE_LINE_MEMBER( output_m ) { m_slot->m_m_handler(state); } |
| 126 | 220 | |
| 127 | 221 | protected: |
| 128 | 222 | pet_user_port_device *m_slot; |
| r26928 | r26929 | |
| 136 | 230 | // slot devices |
| 137 | 231 | SLOT_INTERFACE_EXTERN( pet_user_port_cards ); |
| 138 | 232 | |
| 139 | | |
| 140 | | |
| 141 | 233 | #endif |
trunk/src/emu/bus/pet/user.c
| r26928 | r26929 | |
| 1 | 1 | // license:BSD-3-Clause |
| 2 | | // copyright-holders:Curt Coder |
| 2 | // copyright-holders:smf |
| 3 | 3 | /********************************************************************** |
| 4 | 4 | |
| 5 | 5 | Commodore PET User Port emulation |
| r26928 | r26929 | |
| 55 | 55 | //------------------------------------------------- |
| 56 | 56 | |
| 57 | 57 | pet_user_port_device::pet_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 58 | | device_t(mconfig, PET_USER_PORT, "PET user port", tag, owner, clock, "pet_user_port", __FILE__), |
| 59 | | device_slot_interface(mconfig, *this) |
| 58 | device_t(mconfig, PET_USER_PORT, "VIC-20 user port", tag, owner, clock, "pet_user_port", __FILE__), |
| 59 | device_slot_interface(mconfig, *this), |
| 60 | m_3_handler(*this), |
| 61 | m_4_handler(*this), |
| 62 | m_5_handler(*this), |
| 63 | m_6_handler(*this), |
| 64 | m_7_handler(*this), |
| 65 | m_8_handler(*this), |
| 66 | m_9_handler(*this), |
| 67 | m_b_handler(*this), |
| 68 | m_c_handler(*this), |
| 69 | m_d_handler(*this), |
| 70 | m_e_handler(*this), |
| 71 | m_f_handler(*this), |
| 72 | m_h_handler(*this), |
| 73 | m_j_handler(*this), |
| 74 | m_k_handler(*this), |
| 75 | m_l_handler(*this), |
| 76 | m_m_handler(*this) |
| 60 | 77 | { |
| 61 | 78 | } |
| 62 | 79 | |
| 63 | 80 | |
| 64 | 81 | //------------------------------------------------- |
| 65 | | // device_config_complete - perform any |
| 66 | | // operations now that the configuration is |
| 67 | | // complete |
| 68 | | //------------------------------------------------- |
| 69 | | |
| 70 | | void pet_user_port_device::device_config_complete() |
| 71 | | { |
| 72 | | // inherit a copy of the static data |
| 73 | | const pet_user_port_interface *intf = reinterpret_cast<const pet_user_port_interface *>(static_config()); |
| 74 | | if (intf != NULL) |
| 75 | | { |
| 76 | | *static_cast<pet_user_port_interface *>(this) = *intf; |
| 77 | | } |
| 78 | | |
| 79 | | // or initialize to defaults if none provided |
| 80 | | else |
| 81 | | { |
| 82 | | memset(&m_out_ca1_cb, 0, sizeof(m_out_ca1_cb)); |
| 83 | | memset(&m_out_cb2_cb, 0, sizeof(m_out_cb2_cb)); |
| 84 | | } |
| 85 | | } |
| 86 | | |
| 87 | | |
| 88 | | //------------------------------------------------- |
| 89 | 82 | // device_start - device-specific startup |
| 90 | 83 | //------------------------------------------------- |
| 91 | 84 | |
| r26928 | r26929 | |
| 94 | 87 | m_card = dynamic_cast<device_pet_user_port_interface *>(get_card_device()); |
| 95 | 88 | |
| 96 | 89 | // resolve callbacks |
| 97 | | m_out_ca1_func.resolve(m_out_ca1_cb, *this); |
| 98 | | m_out_cb2_func.resolve(m_out_cb2_cb, *this); |
| 90 | m_3_handler.resolve_safe(); |
| 91 | m_4_handler.resolve_safe(); |
| 92 | m_5_handler.resolve_safe(); |
| 93 | m_6_handler.resolve_safe(); |
| 94 | m_7_handler.resolve_safe(); |
| 95 | m_8_handler.resolve_safe(); |
| 96 | m_9_handler.resolve_safe(); |
| 97 | m_b_handler.resolve_safe(); |
| 98 | m_c_handler.resolve_safe(); |
| 99 | m_d_handler.resolve_safe(); |
| 100 | m_e_handler.resolve_safe(); |
| 101 | m_f_handler.resolve_safe(); |
| 102 | m_h_handler.resolve_safe(); |
| 103 | m_j_handler.resolve_safe(); |
| 104 | m_k_handler.resolve_safe(); |
| 105 | m_l_handler.resolve_safe(); |
| 106 | m_m_handler.resolve_safe(); |
| 107 | |
| 108 | // pull up |
| 109 | m_3_handler(1); |
| 110 | m_4_handler(1); |
| 111 | m_5_handler(1); |
| 112 | m_6_handler(1); |
| 113 | m_7_handler(1); |
| 114 | m_8_handler(1); |
| 115 | m_9_handler(1); |
| 116 | m_b_handler(1); |
| 117 | m_c_handler(1); |
| 118 | m_d_handler(1); |
| 119 | m_e_handler(1); |
| 120 | m_f_handler(1); |
| 121 | m_h_handler(1); |
| 122 | m_j_handler(1); |
| 123 | m_k_handler(1); |
| 124 | m_l_handler(1); |
| 125 | m_m_handler(1); |
| 99 | 126 | } |
| 100 | 127 | |
| 101 | 128 | |
| r26928 | r26929 | |
| 105 | 132 | |
| 106 | 133 | void pet_user_port_device::device_reset() |
| 107 | 134 | { |
| 135 | if (get_card_device()) |
| 136 | { |
| 137 | get_card_device()->reset(); |
| 138 | } |
| 108 | 139 | } |
| 109 | 140 | |
| 110 | 141 | |
| 111 | | READ8_MEMBER( pet_user_port_device::pa_r ) { UINT8 data = 0xff; if (m_card != NULL) data = m_card->pet_pa_r(space, offset); return data; } |
| 112 | | WRITE8_MEMBER( pet_user_port_device::pa_w ) { if (m_card != NULL) m_card->pet_pa_w(space, offset, data); } |
| 113 | | READ_LINE_MEMBER( pet_user_port_device::ca1_r ) { int state = 1; if (m_card != NULL) state = m_card->pet_ca1_r(); return state; } |
| 114 | | WRITE_LINE_MEMBER( pet_user_port_device::ca1_w ) { if (m_card != NULL) m_card->pet_ca1_w(state); } |
| 115 | | READ_LINE_MEMBER( pet_user_port_device::cb2_r ) { int state = 1; if (m_card != NULL) state = m_card->pet_cb2_r(); return state; } |
| 116 | | WRITE_LINE_MEMBER( pet_user_port_device::cb2_w ) { if (m_card != NULL) m_card->pet_cb2_w(state); } |
| 142 | WRITE_LINE_MEMBER( pet_user_port_device::write_3 ) { if (m_card != NULL) m_card->input_3(state); } |
| 143 | WRITE_LINE_MEMBER( pet_user_port_device::write_4 ) { if (m_card != NULL) m_card->input_4(state); } |
| 144 | WRITE_LINE_MEMBER( pet_user_port_device::write_5 ) { if (m_card != NULL) m_card->input_5(state); } |
| 145 | WRITE_LINE_MEMBER( pet_user_port_device::write_6 ) { if (m_card != NULL) m_card->input_6(state); } |
| 146 | WRITE_LINE_MEMBER( pet_user_port_device::write_7 ) { if (m_card != NULL) m_card->input_7(state); } |
| 147 | WRITE_LINE_MEMBER( pet_user_port_device::write_8 ) { if (m_card != NULL) m_card->input_8(state); } |
| 148 | WRITE_LINE_MEMBER( pet_user_port_device::write_9 ) { if (m_card != NULL) m_card->input_9(state); } |
| 149 | WRITE_LINE_MEMBER( pet_user_port_device::write_b ) { if (m_card != NULL) m_card->input_b(state); } |
| 150 | WRITE_LINE_MEMBER( pet_user_port_device::write_c ) { if (m_card != NULL) m_card->input_c(state); } |
| 151 | WRITE_LINE_MEMBER( pet_user_port_device::write_d ) { if (m_card != NULL) m_card->input_d(state); } |
| 152 | WRITE_LINE_MEMBER( pet_user_port_device::write_e ) { if (m_card != NULL) m_card->input_e(state); } |
| 153 | WRITE_LINE_MEMBER( pet_user_port_device::write_f ) { if (m_card != NULL) m_card->input_f(state); } |
| 154 | WRITE_LINE_MEMBER( pet_user_port_device::write_h ) { if (m_card != NULL) m_card->input_h(state); } |
| 155 | WRITE_LINE_MEMBER( pet_user_port_device::write_j ) { if (m_card != NULL) m_card->input_j(state); } |
| 156 | WRITE_LINE_MEMBER( pet_user_port_device::write_k ) { if (m_card != NULL) m_card->input_k(state); } |
| 157 | WRITE_LINE_MEMBER( pet_user_port_device::write_l ) { if (m_card != NULL) m_card->input_l(state); } |
| 158 | WRITE_LINE_MEMBER( pet_user_port_device::write_m ) { if (m_card != NULL) m_card->input_m(state); } |
| 117 | 159 | |
| 118 | 160 | |
| 161 | |
| 162 | |
| 163 | |
| 119 | 164 | //------------------------------------------------- |
| 120 | 165 | // SLOT_INTERFACE( pet_user_port_cards ) |
| 121 | 166 | //------------------------------------------------- |
trunk/src/emu/bus/c64/4ksa.c
| r26928 | r26929 | |
| 1 | 1 | // license:BSD-3-Clause |
| 2 | | // copyright-holders:Curt Coder |
| 2 | // copyright-holders:smf |
| 3 | 3 | /********************************************************************** |
| 4 | 4 | |
| 5 | 5 | Kingsoft 4-Player Adapter emulation |
| r26928 | r26929 | |
| 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, device_vic20_user_port_interface, output_7) |
| 31 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_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) 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) |
| 34 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_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_pet_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_pet_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_pet_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_pet_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_pet_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_pet_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_pet_user_port_interface, output_l) |
| 42 | 42 | |
| 43 | 43 | PORT_START("PA2") |
| 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) |
| 44 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_user_port_interface, output_m) |
| 45 | 45 | INPUT_PORTS_END |
| 46 | 46 | |
| 47 | 47 | |
| r26928 | r26929 | |
| 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_vic20_user_port_interface(mconfig, *this) |
| 69 | device_pet_user_port_interface(mconfig, *this) |
| 70 | 70 | { |
| 71 | 71 | } |
| 72 | 72 | |
trunk/src/emu/bus/c64/4tba.c
| r26928 | r26929 | |
| 1 | 1 | // license:BSD-3-Clause |
| 2 | | // copyright-holders:Curt Coder |
| 2 | // copyright-holders:smf |
| 3 | 3 | /********************************************************************** |
| 4 | 4 | |
| 5 | 5 | Starbyte Software Tie Break Adaptor emulation |
| r26928 | r26929 | |
| 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, device_vic20_user_port_interface, output_7) |
| 31 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_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) 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) |
| 34 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_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_pet_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_pet_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_pet_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_pet_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_pet_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_pet_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_pet_user_port_interface, output_l) |
| 42 | 42 | |
| 43 | 43 | PORT_START("PA2") |
| 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) |
| 44 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_user_port_interface, output_m) |
| 45 | 45 | INPUT_PORTS_END |
| 46 | 46 | |
| 47 | 47 | |
| r26928 | r26929 | |
| 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_vic20_user_port_interface(mconfig, *this) |
| 69 | device_pet_user_port_interface(mconfig, *this) |
| 70 | 70 | { |
| 71 | 71 | } |
| 72 | 72 | |
trunk/src/emu/bus/c64/4dxh.c
| r26928 | r26929 | |
| 1 | 1 | // license:BSD-3-Clause |
| 2 | | // copyright-holders:Curt Coder |
| 2 | // copyright-holders:smf |
| 3 | 3 | /********************************************************************** |
| 4 | 4 | |
| 5 | 5 | The Digital Excess & Hitmen 4-Player Joystick adapter emulation |
| r26928 | r26929 | |
| 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, device_vic20_user_port_interface, output_7) |
| 31 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_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) 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) |
| 34 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_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_pet_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_pet_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_pet_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_pet_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_pet_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_pet_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_pet_user_port_interface, output_l) |
| 42 | 42 | |
| 43 | 43 | PORT_START("PA2") |
| 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) |
| 44 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_user_port_interface, output_m) |
| 45 | 45 | INPUT_PORTS_END |
| 46 | 46 | |
| 47 | 47 | |
| r26928 | r26929 | |
| 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_vic20_user_port_interface(mconfig, *this) |
| 69 | device_pet_user_port_interface(mconfig, *this) |
| 70 | 70 | { |
| 71 | 71 | } |
| 72 | 72 | |
trunk/src/emu/bus/plus4/user.c
| r26928 | r26929 | |
| 1 | | |
| 2 | | |
| 1 | // license:BSD-3-Clause |
| 2 | // copyright-holders:smf |
| 3 | 3 | /********************************************************************** |
| 4 | 4 | |
| 5 | 5 | Commodore Plus/4 User Port emulation |
| r26928 | r26929 | |
| 11 | 11 | |
| 12 | 12 | #include "user.h" |
| 13 | 13 | |
| 14 | | |
| 15 | | |
| 16 | | //************************************************************************** |
| 17 | | // GLOBAL VARIABLES |
| 18 | | //************************************************************************** |
| 19 | | |
| 20 | | const device_type PLUS4_USER_PORT = &device_creator<plus4_user_port_device>; |
| 21 | | |
| 22 | | |
| 23 | | |
| 24 | | //************************************************************************** |
| 25 | | // CARD INTERFACE |
| 26 | | //************************************************************************** |
| 27 | | |
| 28 | 14 | //------------------------------------------------- |
| 29 | | // device_plus4_user_port_interface - constructor |
| 30 | | //------------------------------------------------- |
| 31 | | |
| 32 | | device_plus4_user_port_interface::device_plus4_user_port_interface(const machine_config &mconfig, device_t &device) |
| 33 | | : device_slot_card_interface(mconfig,device) |
| 34 | | { |
| 35 | | m_slot = dynamic_cast<plus4_user_port_device *>(device.owner()); |
| 36 | | } |
| 37 | | |
| 38 | | |
| 39 | | //------------------------------------------------- |
| 40 | | // ~device_plus4_user_port_interface - destructor |
| 41 | | //------------------------------------------------- |
| 42 | | |
| 43 | | device_plus4_user_port_interface::~device_plus4_user_port_interface() |
| 44 | | { |
| 45 | | } |
| 46 | | |
| 47 | | |
| 48 | | |
| 49 | | //************************************************************************** |
| 50 | | // LIVE DEVICE |
| 51 | | //************************************************************************** |
| 52 | | |
| 53 | | //------------------------------------------------- |
| 54 | | // plus4_user_port_device - constructor |
| 55 | | //------------------------------------------------- |
| 56 | | |
| 57 | | plus4_user_port_device::plus4_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 58 | | device_t(mconfig, PLUS4_USER_PORT, "User Port", tag, owner, clock, "plus4_user_port", __FILE__), |
| 59 | | device_slot_interface(mconfig, *this), |
| 60 | | m_4_handler(*this), |
| 61 | | m_5_handler(*this), |
| 62 | | m_6_handler(*this), |
| 63 | | m_7_handler(*this), |
| 64 | | m_8_handler(*this), |
| 65 | | m_b_handler(*this), |
| 66 | | m_c_handler(*this), |
| 67 | | m_f_handler(*this), |
| 68 | | m_h_handler(*this), |
| 69 | | m_j_handler(*this), |
| 70 | | m_k_handler(*this), |
| 71 | | m_l_handler(*this) |
| 72 | | { |
| 73 | | } |
| 74 | | |
| 75 | | |
| 76 | | //------------------------------------------------- |
| 77 | | // device_start - device-specific startup |
| 78 | | //------------------------------------------------- |
| 79 | | |
| 80 | | void plus4_user_port_device::device_start() |
| 81 | | { |
| 82 | | m_cart = dynamic_cast<device_plus4_user_port_interface *>(get_card_device()); |
| 83 | | |
| 84 | | // resolve callbacks |
| 85 | | m_4_handler.resolve_safe(); |
| 86 | | m_5_handler.resolve_safe(); |
| 87 | | m_6_handler.resolve_safe(); |
| 88 | | m_7_handler.resolve_safe(); |
| 89 | | m_8_handler.resolve_safe(); |
| 90 | | m_b_handler.resolve_safe(); |
| 91 | | m_c_handler.resolve_safe(); |
| 92 | | m_f_handler.resolve_safe(); |
| 93 | | m_h_handler.resolve_safe(); |
| 94 | | m_j_handler.resolve_safe(); |
| 95 | | m_k_handler.resolve_safe(); |
| 96 | | m_l_handler.resolve_safe(); |
| 97 | | |
| 98 | | // pull up |
| 99 | | m_4_handler(1); |
| 100 | | m_5_handler(1); |
| 101 | | m_6_handler(1); |
| 102 | | m_7_handler(1); |
| 103 | | m_8_handler(1); |
| 104 | | m_b_handler(1); |
| 105 | | m_c_handler(1); |
| 106 | | m_f_handler(1); |
| 107 | | m_h_handler(1); |
| 108 | | m_j_handler(1); |
| 109 | | m_k_handler(1); |
| 110 | | m_l_handler(1); |
| 111 | | } |
| 112 | | |
| 113 | | |
| 114 | | //------------------------------------------------- |
| 115 | | // device_reset - device-specific reset |
| 116 | | //------------------------------------------------- |
| 117 | | |
| 118 | | void plus4_user_port_device::device_reset() |
| 119 | | { |
| 120 | | if (get_card_device()) |
| 121 | | { |
| 122 | | get_card_device()->reset(); |
| 123 | | } |
| 124 | | } |
| 125 | | |
| 126 | | |
| 127 | | WRITE_LINE_MEMBER( plus4_user_port_device::write_4 ) { if (m_cart != NULL) m_cart->write_4(state); } |
| 128 | | WRITE_LINE_MEMBER( plus4_user_port_device::write_5 ) { if (m_cart != NULL) m_cart->write_5(state); } |
| 129 | | WRITE_LINE_MEMBER( plus4_user_port_device::write_6 ) { if (m_cart != NULL) m_cart->write_6(state); } |
| 130 | | WRITE_LINE_MEMBER( plus4_user_port_device::write_7 ) { if (m_cart != NULL) m_cart->write_7(state); } |
| 131 | | WRITE_LINE_MEMBER( plus4_user_port_device::write_8 ) { if (m_cart != NULL) m_cart->write_8(state); } |
| 132 | | WRITE_LINE_MEMBER( plus4_user_port_device::write_9 ) { if (m_cart != NULL) m_cart->write_9(state); } |
| 133 | | WRITE_LINE_MEMBER( plus4_user_port_device::write_b ) { if (m_cart != NULL) m_cart->write_b(state); } |
| 134 | | WRITE_LINE_MEMBER( plus4_user_port_device::write_d ) { if (m_cart != NULL) m_cart->write_d(state); } |
| 135 | | WRITE_LINE_MEMBER( plus4_user_port_device::write_e ) { if (m_cart != NULL) m_cart->write_e(state); } |
| 136 | | WRITE_LINE_MEMBER( plus4_user_port_device::write_f ) { if (m_cart != NULL) m_cart->write_f(state); } |
| 137 | | WRITE_LINE_MEMBER( plus4_user_port_device::write_j ) { if (m_cart != NULL) m_cart->write_j(state); } |
| 138 | | WRITE_LINE_MEMBER( plus4_user_port_device::write_k ) { if (m_cart != NULL) m_cart->write_k(state); } |
| 139 | | WRITE_LINE_MEMBER( plus4_user_port_device::write_m ) { if (m_cart != NULL) m_cart->write_m(state); } |
| 140 | | |
| 141 | | |
| 142 | | |
| 143 | | //------------------------------------------------- |
| 144 | 15 | // SLOT_INTERFACE( plus4_user_port_cards ) |
| 145 | 16 | //------------------------------------------------- |
| 146 | 17 | |
| 147 | 18 | // slot devices |
| 148 | 19 | #include "diag264_lb_user.h" |
| 20 | #include "bus/vic20/vic1011.h" |
| 149 | 21 | |
| 150 | 22 | SLOT_INTERFACE_START( plus4_user_port_cards ) |
| 151 | 23 | SLOT_INTERFACE("diag264", DIAG264_USER_PORT_LOOPBACK) |
| 24 | SLOT_INTERFACE("rs232", VIC1011) |
| 152 | 25 | SLOT_INTERFACE_END |
trunk/src/emu/bus/plus4/user.h
| r26928 | r26929 | |
| 1 | 1 | // license:BSD-3-Clause |
| 2 | | // copyright-holders:Curt Coder |
| 2 | // copyright-holders:smf |
| 3 | 3 | /********************************************************************** |
| 4 | 4 | |
| 5 | 5 | Commodore Plus/4 User Port emulation |
| r26928 | r26929 | |
| 29 | 29 | #ifndef __PLUS4_USER_PORT__ |
| 30 | 30 | #define __PLUS4_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 PLUS4_USER_PORT_TAG "user" |
| 41 | | |
| 42 | | |
| 43 | | |
| 44 | | //************************************************************************** |
| 45 | | // INTERFACE CONFIGURATION MACROS |
| 46 | | //************************************************************************** |
| 47 | | |
| 48 | | #define MCFG_PLUS4_USER_PORT_ADD(_tag, _slot_intf, _def_slot) \ |
| 49 | | MCFG_DEVICE_ADD(_tag, PLUS4_USER_PORT, 0) \ |
| 50 | | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) |
| 51 | | |
| 52 | | #define MCFG_PLUS4_USER_PORT_4_HANDLER(_devcb) \ |
| 53 | | devcb = &plus4_user_port_device::set_4_handler(*device, DEVCB2_##_devcb); |
| 54 | | |
| 55 | | #define MCFG_PLUS4_USER_PORT_5_HANDLER(_devcb) \ |
| 56 | | devcb = &plus4_user_port_device::set_5_handler(*device, DEVCB2_##_devcb); |
| 57 | | |
| 58 | | #define MCFG_PLUS4_USER_PORT_6_HANDLER(_devcb) \ |
| 59 | | devcb = &plus4_user_port_device::set_6_handler(*device, DEVCB2_##_devcb); |
| 60 | | |
| 61 | | #define MCFG_PLUS4_USER_PORT_7_HANDLER(_devcb) \ |
| 62 | | devcb = &plus4_user_port_device::set_7_handler(*device, DEVCB2_##_devcb); |
| 63 | | |
| 64 | | #define MCFG_PLUS4_USER_PORT_8_HANDLER(_devcb) \ |
| 65 | | devcb = &plus4_user_port_device::set_8_handler(*device, DEVCB2_##_devcb); |
| 66 | | |
| 67 | | #define MCFG_PLUS4_USER_PORT_B_HANDLER(_devcb) \ |
| 68 | | devcb = &plus4_user_port_device::set_b_handler(*device, DEVCB2_##_devcb); |
| 69 | | |
| 70 | | #define MCFG_PLUS4_USER_PORT_C_HANDLER(_devcb) \ |
| 71 | | devcb = &plus4_user_port_device::set_c_handler(*device, DEVCB2_##_devcb); |
| 72 | | |
| 73 | | #define MCFG_PLUS4_USER_PORT_F_HANDLER(_devcb) \ |
| 74 | | devcb = &plus4_user_port_device::set_f_handler(*device, DEVCB2_##_devcb); |
| 75 | | |
| 76 | | #define MCFG_PLUS4_USER_PORT_H_HANDLER(_devcb) \ |
| 77 | | devcb = &plus4_user_port_device::set_h_handler(*device, DEVCB2_##_devcb); |
| 78 | | |
| 79 | | #define MCFG_PLUS4_USER_PORT_J_HANDLER(_devcb) \ |
| 80 | | devcb = &plus4_user_port_device::set_j_handler(*device, DEVCB2_##_devcb); |
| 81 | | |
| 82 | | #define MCFG_PLUS4_USER_PORT_K_HANDLER(_devcb) \ |
| 83 | | devcb = &plus4_user_port_device::set_k_handler(*device, DEVCB2_##_devcb); |
| 84 | | |
| 85 | | #define MCFG_PLUS4_USER_PORT_L_HANDLER(_devcb) \ |
| 86 | | devcb = &plus4_user_port_device::set_l_handler(*device, DEVCB2_##_devcb); |
| 87 | | |
| 88 | | //************************************************************************** |
| 89 | | // TYPE DEFINITIONS |
| 90 | | //************************************************************************** |
| 91 | | |
| 92 | | // ======================> plus4_user_port_device |
| 93 | | |
| 94 | | class device_plus4_user_port_interface; |
| 95 | | |
| 96 | | class plus4_user_port_device : public device_t, |
| 97 | | public device_slot_interface |
| 98 | | { |
| 99 | | public: |
| 100 | | // construction/destruction |
| 101 | | plus4_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 102 | | |
| 103 | | template<class _Object> static devcb2_base &set_4_handler(device_t &device, _Object object) { return downcast<plus4_user_port_device &>(device).m_4_handler.set_callback(object); } |
| 104 | | template<class _Object> static devcb2_base &set_5_handler(device_t &device, _Object object) { return downcast<plus4_user_port_device &>(device).m_5_handler.set_callback(object); } |
| 105 | | template<class _Object> static devcb2_base &set_6_handler(device_t &device, _Object object) { return downcast<plus4_user_port_device &>(device).m_6_handler.set_callback(object); } |
| 106 | | template<class _Object> static devcb2_base &set_7_handler(device_t &device, _Object object) { return downcast<plus4_user_port_device &>(device).m_7_handler.set_callback(object); } |
| 107 | | template<class _Object> static devcb2_base &set_8_handler(device_t &device, _Object object) { return downcast<plus4_user_port_device &>(device).m_8_handler.set_callback(object); } |
| 108 | | template<class _Object> static devcb2_base &set_b_handler(device_t &device, _Object object) { return downcast<plus4_user_port_device &>(device).m_b_handler.set_callback(object); } |
| 109 | | template<class _Object> static devcb2_base &set_c_handler(device_t &device, _Object object) { return downcast<plus4_user_port_device &>(device).m_c_handler.set_callback(object); } |
| 110 | | template<class _Object> static devcb2_base &set_f_handler(device_t &device, _Object object) { return downcast<plus4_user_port_device &>(device).m_f_handler.set_callback(object); } |
| 111 | | template<class _Object> static devcb2_base &set_h_handler(device_t &device, _Object object) { return downcast<plus4_user_port_device &>(device).m_h_handler.set_callback(object); } |
| 112 | | template<class _Object> static devcb2_base &set_j_handler(device_t &device, _Object object) { return downcast<plus4_user_port_device &>(device).m_j_handler.set_callback(object); } |
| 113 | | template<class _Object> static devcb2_base &set_k_handler(device_t &device, _Object object) { return downcast<plus4_user_port_device &>(device).m_k_handler.set_callback(object); } |
| 114 | | template<class _Object> static devcb2_base &set_l_handler(device_t &device, _Object object) { return downcast<plus4_user_port_device &>(device).m_l_handler.set_callback(object); } |
| 115 | | |
| 116 | | // computer interface |
| 117 | | DECLARE_WRITE_LINE_MEMBER( write_4 ); |
| 118 | | DECLARE_WRITE_LINE_MEMBER( write_5 ); |
| 119 | | DECLARE_WRITE_LINE_MEMBER( write_6 ); |
| 120 | | DECLARE_WRITE_LINE_MEMBER( write_7 ); |
| 121 | | DECLARE_WRITE_LINE_MEMBER( write_8 ); |
| 122 | | DECLARE_WRITE_LINE_MEMBER( write_9 ); |
| 123 | | DECLARE_WRITE_LINE_MEMBER( write_b ); |
| 124 | | DECLARE_WRITE_LINE_MEMBER( write_d ); |
| 125 | | DECLARE_WRITE_LINE_MEMBER( write_e ); |
| 126 | | DECLARE_WRITE_LINE_MEMBER( write_f ); |
| 127 | | DECLARE_WRITE_LINE_MEMBER( write_j ); |
| 128 | | DECLARE_WRITE_LINE_MEMBER( write_k ); |
| 129 | | DECLARE_WRITE_LINE_MEMBER( write_m ); |
| 130 | | |
| 131 | | // device interface |
| 132 | | devcb2_write_line m_4_handler; |
| 133 | | devcb2_write_line m_5_handler; |
| 134 | | devcb2_write_line m_6_handler; |
| 135 | | devcb2_write_line m_7_handler; |
| 136 | | devcb2_write_line m_8_handler; |
| 137 | | devcb2_write_line m_b_handler; |
| 138 | | devcb2_write_line m_c_handler; |
| 139 | | devcb2_write_line m_f_handler; |
| 140 | | devcb2_write_line m_h_handler; |
| 141 | | devcb2_write_line m_j_handler; |
| 142 | | devcb2_write_line m_k_handler; |
| 143 | | devcb2_write_line m_l_handler; |
| 144 | | |
| 145 | | protected: |
| 146 | | // device-level overrides |
| 147 | | virtual void device_start(); |
| 148 | | virtual void device_reset(); |
| 149 | | |
| 150 | | device_plus4_user_port_interface *m_cart; |
| 151 | | }; |
| 152 | | |
| 153 | | |
| 154 | | // ======================> device_plus4_user_port_interface |
| 155 | | |
| 156 | | // class representing interface-specific live plus4_expansion card |
| 157 | | class device_plus4_user_port_interface : public device_slot_card_interface |
| 158 | | { |
| 159 | | public: |
| 160 | | // construction/destruction |
| 161 | | device_plus4_user_port_interface(const machine_config &mconfig, device_t &device); |
| 162 | | virtual ~device_plus4_user_port_interface(); |
| 163 | | |
| 164 | | DECLARE_WRITE_LINE_MEMBER( write_4 ) {} |
| 165 | | DECLARE_WRITE_LINE_MEMBER( write_5 ) {} |
| 166 | | DECLARE_WRITE_LINE_MEMBER( write_6 ) {} |
| 167 | | DECLARE_WRITE_LINE_MEMBER( write_7 ) {} |
| 168 | | DECLARE_WRITE_LINE_MEMBER( write_8 ) {} |
| 169 | | DECLARE_WRITE_LINE_MEMBER( write_9 ) {} |
| 170 | | DECLARE_WRITE_LINE_MEMBER( write_b ) {} |
| 171 | | DECLARE_WRITE_LINE_MEMBER( write_d ) {} |
| 172 | | DECLARE_WRITE_LINE_MEMBER( write_e ) {} |
| 173 | | DECLARE_WRITE_LINE_MEMBER( write_f ) {} |
| 174 | | DECLARE_WRITE_LINE_MEMBER( write_j ) {} |
| 175 | | DECLARE_WRITE_LINE_MEMBER( write_k ) {} |
| 176 | | DECLARE_WRITE_LINE_MEMBER( write_m ) {} |
| 177 | | |
| 178 | | protected: |
| 179 | | plus4_user_port_device *m_slot; |
| 180 | | }; |
| 181 | | |
| 182 | | |
| 183 | | // device type definition |
| 184 | | extern const device_type PLUS4_USER_PORT; |
| 185 | | |
| 186 | | |
| 187 | 34 | SLOT_INTERFACE_EXTERN( plus4_user_port_cards ); |
| 188 | 35 | |
| 189 | 36 | #endif |
trunk/src/mess/drivers/vic20.c
| r26928 | r26929 | |
| 659 | 659 | MCFG_VIA6522_READPA_HANDLER(READ8(vic20_state, via1_pa_r)) |
| 660 | 660 | MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(vic20_state, via1_pa_w)) |
| 661 | 661 | MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(vic20_state, via1_pb_w)) |
| 662 | | MCFG_VIA6522_CB1_HANDLER(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_b)) |
| 662 | MCFG_VIA6522_CB1_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_b)) |
| 663 | 663 | MCFG_VIA6522_CA2_HANDLER(DEVWRITELINE(PET_DATASSETTE_PORT_TAG, pet_datassette_port_device, motor_w)) |
| 664 | | MCFG_VIA6522_CB2_HANDLER(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_m)) |
| 664 | MCFG_VIA6522_CB2_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_m)) |
| 665 | 665 | MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE(M6502_TAG, m6502_device, nmi_line)) |
| 666 | 666 | |
| 667 | 667 | MCFG_DEVICE_ADD(M6522_2_TAG, VIA6522, 0) |
| r26928 | r26929 | |
| 680 | 680 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy") |
| 681 | 681 | MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(WRITELINE(vic20_state, write_light_pen)) |
| 682 | 682 | |
| 683 | | MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, vic20_user_port_cards, NULL) |
| 684 | | MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(vic20_state, exp_reset_w)) |
| 685 | | MCFG_VIC20_USER_PORT_4_HANDLER(WRITELINE(vic20_state, write_user_joy0)) |
| 686 | | MCFG_VIC20_USER_PORT_5_HANDLER(WRITELINE(vic20_state, write_user_joy1)) |
| 687 | | MCFG_VIC20_USER_PORT_6_HANDLER(WRITELINE(vic20_state, write_user_joy2)) |
| 688 | | MCFG_VIC20_USER_PORT_7_HANDLER(WRITELINE(vic20_state, write_user_light_pen)) |
| 689 | | MCFG_VIC20_USER_PORT_8_HANDLER(WRITELINE(vic20_state, write_user_cassette_switch)) |
| 690 | | MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_cb1)) |
| 691 | | MCFG_VIC20_USER_PORT_C_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb0)) |
| 692 | | MCFG_VIC20_USER_PORT_D_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb1)) |
| 693 | | MCFG_VIC20_USER_PORT_E_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb2)) |
| 694 | | MCFG_VIC20_USER_PORT_F_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb3)) |
| 695 | | MCFG_VIC20_USER_PORT_H_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb4)) |
| 696 | | MCFG_VIC20_USER_PORT_J_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb5)) |
| 697 | | MCFG_VIC20_USER_PORT_K_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb6)) |
| 698 | | MCFG_VIC20_USER_PORT_L_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb7)) |
| 699 | | MCFG_VIC20_USER_PORT_M_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_cb2)) |
| 683 | MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, vic20_user_port_cards, NULL) |
| 684 | MCFG_PET_USER_PORT_3_HANDLER(WRITELINE(vic20_state, exp_reset_w)) |
| 685 | MCFG_PET_USER_PORT_4_HANDLER(WRITELINE(vic20_state, write_user_joy0)) |
| 686 | MCFG_PET_USER_PORT_5_HANDLER(WRITELINE(vic20_state, write_user_joy1)) |
| 687 | MCFG_PET_USER_PORT_6_HANDLER(WRITELINE(vic20_state, write_user_joy2)) |
| 688 | MCFG_PET_USER_PORT_7_HANDLER(WRITELINE(vic20_state, write_user_light_pen)) |
| 689 | MCFG_PET_USER_PORT_8_HANDLER(WRITELINE(vic20_state, write_user_cassette_switch)) |
| 690 | MCFG_PET_USER_PORT_B_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_cb1)) |
| 691 | MCFG_PET_USER_PORT_C_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb0)) |
| 692 | MCFG_PET_USER_PORT_D_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb1)) |
| 693 | MCFG_PET_USER_PORT_E_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb2)) |
| 694 | MCFG_PET_USER_PORT_F_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb3)) |
| 695 | MCFG_PET_USER_PORT_H_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb4)) |
| 696 | MCFG_PET_USER_PORT_J_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb5)) |
| 697 | MCFG_PET_USER_PORT_K_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb6)) |
| 698 | MCFG_PET_USER_PORT_L_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb7)) |
| 699 | MCFG_PET_USER_PORT_M_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_cb2)) |
| 700 | 700 | |
| 701 | 701 | MCFG_QUICKLOAD_ADD("quickload", vic20_state, cbm_vc20, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) |
| 702 | 702 | |
trunk/src/mess/drivers/plus4.c
| r26928 | r26929 | |
| 745 | 745 | MCFG_PLS100_ADD(PLA_TAG) |
| 746 | 746 | |
| 747 | 747 | MCFG_DEVICE_ADD(MOS6551_TAG, MOS6551, XTAL_1_8432MHz) |
| 748 | | MCFG_MOS6551_RTS_HANDLER(DEVWRITELINE(PLUS4_USER_PORT_TAG, plus4_user_port_device, write_d)) |
| 749 | | MCFG_MOS6551_DTR_HANDLER(DEVWRITELINE(PLUS4_USER_PORT_TAG, plus4_user_port_device, write_e)) |
| 750 | | MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE(PLUS4_USER_PORT_TAG, plus4_user_port_device, write_m)) |
| 748 | MCFG_MOS6551_RTS_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_d)) |
| 749 | MCFG_MOS6551_DTR_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_e)) |
| 750 | MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_m)) |
| 751 | 751 | MCFG_MOS6551_IRQ_HANDLER(WRITELINE(plus4_state, acia_irq_w)) |
| 752 | 752 | |
| 753 | 753 | MCFG_DEVICE_ADD(MOS6529_USER_TAG, MOS6529, 0) |
| 754 | | MCFG_MOS6529_P0_HANDLER(DEVWRITELINE(PLUS4_USER_PORT_TAG, plus4_user_port_device, write_b)) |
| 755 | | MCFG_MOS6529_P1_HANDLER(DEVWRITELINE(PLUS4_USER_PORT_TAG, plus4_user_port_device, write_k)) |
| 756 | | MCFG_MOS6529_P2_HANDLER(DEVWRITELINE(PLUS4_USER_PORT_TAG, plus4_user_port_device, write_4)) |
| 757 | | MCFG_MOS6529_P3_HANDLER(DEVWRITELINE(PLUS4_USER_PORT_TAG, plus4_user_port_device, write_5)) |
| 758 | | MCFG_MOS6529_P4_HANDLER(DEVWRITELINE(PLUS4_USER_PORT_TAG, plus4_user_port_device, write_6)) |
| 759 | | MCFG_MOS6529_P5_HANDLER(DEVWRITELINE(PLUS4_USER_PORT_TAG, plus4_user_port_device, write_7)) |
| 760 | | MCFG_MOS6529_P6_HANDLER(DEVWRITELINE(PLUS4_USER_PORT_TAG, plus4_user_port_device, write_j)) |
| 761 | | MCFG_MOS6529_P7_HANDLER(DEVWRITELINE(PLUS4_USER_PORT_TAG, plus4_user_port_device, write_f)) |
| 754 | MCFG_MOS6529_P0_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_b)) |
| 755 | MCFG_MOS6529_P1_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_k)) |
| 756 | MCFG_MOS6529_P2_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_4)) |
| 757 | MCFG_MOS6529_P3_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_5)) |
| 758 | MCFG_MOS6529_P4_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6)) |
| 759 | MCFG_MOS6529_P5_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) |
| 760 | MCFG_MOS6529_P6_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_j)) |
| 761 | MCFG_MOS6529_P7_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_f)) |
| 762 | 762 | |
| 763 | 763 | MCFG_DEVICE_ADD(MOS6529_KB_TAG, MOS6529, 0) |
| 764 | 764 | MCFG_MOS6529_P0_HANDLER(WRITELINE(plus4_state, write_kb0)) |
| r26928 | r26929 | |
| 773 | 773 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, plus4_datassette_devices, "c1531", NULL) |
| 774 | 774 | |
| 775 | 775 | MCFG_CBM_IEC_ADD(NULL) |
| 776 | | MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(PLUS4_USER_PORT_TAG, plus4_user_port_device, write_9)) |
| 776 | MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_9)) |
| 777 | 777 | |
| 778 | 778 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL) |
| 779 | 779 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy") |
| 780 | 780 | MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, XTAL_14_31818MHz/16, plus4_expansion_cards, "c1551", WRITELINE(plus4_state, exp_irq_w)) |
| 781 | 781 | MCFG_PLUS4_EXPANSION_SLOT_DMA_CALLBACKS(READ8(plus4_state, read), WRITE8(plus4_state, write), INPUTLINE(MOS7501_TAG, INPUT_LINE_HALT)) |
| 782 | 782 | |
| 783 | | MCFG_PLUS4_USER_PORT_ADD(PLUS4_USER_PORT_TAG, plus4_user_port_cards, NULL) |
| 784 | | MCFG_PLUS4_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p2)) // cassette sense |
| 785 | | MCFG_PLUS4_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p3)) |
| 786 | | MCFG_PLUS4_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p4)) |
| 787 | | MCFG_PLUS4_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p5)) |
| 788 | | MCFG_PLUS4_USER_PORT_8_HANDLER(DEVWRITELINE(MOS6551_TAG, mos6551_device, rxc_w)) |
| 789 | | MCFG_PLUS4_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p0)) |
| 790 | | MCFG_PLUS4_USER_PORT_C_HANDLER(DEVWRITELINE(MOS6551_TAG, mos6551_device, rxd_w)) |
| 791 | | MCFG_PLUS4_USER_PORT_F_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p7)) |
| 792 | | MCFG_PLUS4_USER_PORT_H_HANDLER(DEVWRITELINE(MOS6551_TAG, mos6551_device, dcd_w)) |
| 793 | | MCFG_PLUS4_USER_PORT_J_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p6)) |
| 794 | | MCFG_PLUS4_USER_PORT_K_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p1)) |
| 795 | | MCFG_PLUS4_USER_PORT_L_HANDLER(DEVWRITELINE(MOS6551_TAG, mos6551_device, dsr_w)) |
| 783 | MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, plus4_user_port_cards, NULL) |
| 784 | MCFG_PET_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p2)) // cassette sense |
| 785 | MCFG_PET_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p3)) |
| 786 | MCFG_PET_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p4)) |
| 787 | MCFG_PET_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p5)) |
| 788 | MCFG_PET_USER_PORT_8_HANDLER(DEVWRITELINE(MOS6551_TAG, mos6551_device, rxc_w)) |
| 789 | MCFG_PET_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p0)) |
| 790 | MCFG_PET_USER_PORT_C_HANDLER(DEVWRITELINE(MOS6551_TAG, mos6551_device, rxd_w)) |
| 791 | MCFG_PET_USER_PORT_F_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p7)) |
| 792 | MCFG_PET_USER_PORT_H_HANDLER(DEVWRITELINE(MOS6551_TAG, mos6551_device, dcd_w)) |
| 793 | MCFG_PET_USER_PORT_J_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p6)) |
| 794 | MCFG_PET_USER_PORT_K_HANDLER(DEVWRITELINE(MOS6529_USER_TAG, mos6529_device, write_p1)) |
| 795 | MCFG_PET_USER_PORT_L_HANDLER(DEVWRITELINE(MOS6551_TAG, mos6551_device, dsr_w)) |
| 796 | 796 | |
| 797 | 797 | MCFG_QUICKLOAD_ADD("quickload", plus4_state, cbm_c16, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) |
| 798 | 798 | |
| r26928 | r26929 | |
| 853 | 853 | |
| 854 | 854 | MCFG_DEVICE_REMOVE(MOS6551_TAG) |
| 855 | 855 | MCFG_DEVICE_REMOVE(MOS6529_USER_TAG) |
| 856 | | MCFG_DEVICE_REMOVE(PLUS4_USER_PORT_TAG) |
| 856 | MCFG_DEVICE_REMOVE(PET_USER_PORT_TAG) |
| 857 | 857 | |
| 858 | 858 | MCFG_DEVICE_MODIFY(CBM_IEC_TAG) |
| 859 | 859 | MCFG_CBM_IEC_BUS_ATN_CALLBACK(NULL) |
| r26928 | r26929 | |
| 875 | 875 | |
| 876 | 876 | MCFG_DEVICE_REMOVE(MOS6551_TAG) |
| 877 | 877 | MCFG_DEVICE_REMOVE(MOS6529_USER_TAG) |
| 878 | | MCFG_DEVICE_REMOVE(PLUS4_USER_PORT_TAG) |
| 878 | MCFG_DEVICE_REMOVE(PET_USER_PORT_TAG) |
| 879 | 879 | |
| 880 | 880 | MCFG_DEVICE_MODIFY(CBM_IEC_TAG) |
| 881 | 881 | MCFG_CBM_IEC_BUS_ATN_CALLBACK(NULL) |
trunk/src/mess/drivers/c64.c
| r26928 | r26929 | |
| 1097 | 1097 | // devices |
| 1098 | 1098 | MCFG_PLS100_ADD(PLA_TAG) |
| 1099 | 1099 | MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6567_CLOCK, 60, WRITELINE(c64_state, cia1_irq_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)) |
| 1100 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_4), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_5)) |
| 1101 | 1101 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL) |
| 1102 | 1102 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL) |
| 1103 | 1103 | MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c64_state, cia2_irq_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)) |
| 1104 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) |
| 1105 | 1105 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia2_pa_r), WRITE8(c64_state, cia2_pa_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)) |
| 1106 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia2_pb_r), WRITE8(c64_state, cia2_pb_w), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_8)) |
| 1107 | 1107 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w)) |
| 1108 | 1108 | MCFG_CBM_IEC_ADD("c1541") |
| 1109 | 1109 | MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w)) |
| 1110 | | MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_9)) |
| 1110 | MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_9)) |
| 1111 | 1111 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL) |
| 1112 | 1112 | MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6567_TAG, mos6567_device, lp_w)) |
| 1113 | 1113 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy") |
| r26928 | r26929 | |
| 1115 | 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)) |
| 1116 | 1116 | MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w)) |
| 1117 | 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)) |
| 1118 | MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, c64_user_port_cards, NULL) |
| 1119 | MCFG_PET_USER_PORT_3_HANDLER(WRITELINE(c64_state, exp_reset_w)) |
| 1120 | MCFG_PET_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w)) |
| 1121 | MCFG_PET_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w)) |
| 1122 | MCFG_PET_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w)) |
| 1123 | MCFG_PET_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w)) |
| 1124 | MCFG_PET_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w)) |
| 1125 | MCFG_PET_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1126 | MCFG_PET_USER_PORT_C_HANDLER(WRITELINE(c64_state, write_user_pb0)) |
| 1127 | MCFG_PET_USER_PORT_D_HANDLER(WRITELINE(c64_state, write_user_pb1)) |
| 1128 | MCFG_PET_USER_PORT_E_HANDLER(WRITELINE(c64_state, write_user_pb2)) |
| 1129 | MCFG_PET_USER_PORT_F_HANDLER(WRITELINE(c64_state, write_user_pb3)) |
| 1130 | MCFG_PET_USER_PORT_H_HANDLER(WRITELINE(c64_state, write_user_pb4)) |
| 1131 | MCFG_PET_USER_PORT_J_HANDLER(WRITELINE(c64_state, write_user_pb5)) |
| 1132 | MCFG_PET_USER_PORT_K_HANDLER(WRITELINE(c64_state, write_user_pb6)) |
| 1133 | MCFG_PET_USER_PORT_L_HANDLER(WRITELINE(c64_state, write_user_pb7)) |
| 1134 | MCFG_PET_USER_PORT_M_HANDLER(WRITELINE(c64_state, write_user_pa2)) |
| 1135 | 1135 | |
| 1136 | 1136 | MCFG_QUICKLOAD_ADD("quickload", c64_state, cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS) |
| 1137 | 1137 | |
| r26928 | r26929 | |
| 1226 | 1226 | // devices |
| 1227 | 1227 | MCFG_PLS100_ADD(PLA_TAG) |
| 1228 | 1228 | MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, WRITELINE(c64_state, cia1_irq_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)) |
| 1229 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_4), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_5)) |
| 1230 | 1230 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL) |
| 1231 | 1231 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL) |
| 1232 | 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)) |
| 1233 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) |
| 1234 | 1234 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia2_pa_r), WRITE8(c64_state, cia2_pa_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)) |
| 1235 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia2_pb_r), WRITE8(c64_state, cia2_pb_w), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_8)) |
| 1236 | 1236 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w)) |
| 1237 | 1237 | MCFG_CBM_IEC_ADD("c1541") |
| 1238 | 1238 | MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w)) |
| 1239 | | MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_9)) |
| 1239 | MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_9)) |
| 1240 | 1240 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL) |
| 1241 | 1241 | MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w)) |
| 1242 | 1242 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy") |
| r26928 | r26929 | |
| 1244 | 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)) |
| 1245 | 1245 | MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w)) |
| 1246 | 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)) |
| 1247 | MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, c64_user_port_cards, NULL) |
| 1248 | MCFG_PET_USER_PORT_3_HANDLER(WRITELINE(c64_state, exp_reset_w)) |
| 1249 | MCFG_PET_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w)) |
| 1250 | MCFG_PET_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w)) |
| 1251 | MCFG_PET_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w)) |
| 1252 | MCFG_PET_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w)) |
| 1253 | MCFG_PET_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w)) |
| 1254 | MCFG_PET_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1255 | MCFG_PET_USER_PORT_C_HANDLER(WRITELINE(c64_state, write_user_pb0)) |
| 1256 | MCFG_PET_USER_PORT_D_HANDLER(WRITELINE(c64_state, write_user_pb1)) |
| 1257 | MCFG_PET_USER_PORT_E_HANDLER(WRITELINE(c64_state, write_user_pb2)) |
| 1258 | MCFG_PET_USER_PORT_F_HANDLER(WRITELINE(c64_state, write_user_pb3)) |
| 1259 | MCFG_PET_USER_PORT_H_HANDLER(WRITELINE(c64_state, write_user_pb4)) |
| 1260 | MCFG_PET_USER_PORT_J_HANDLER(WRITELINE(c64_state, write_user_pb5)) |
| 1261 | MCFG_PET_USER_PORT_K_HANDLER(WRITELINE(c64_state, write_user_pb6)) |
| 1262 | MCFG_PET_USER_PORT_L_HANDLER(WRITELINE(c64_state, write_user_pb7)) |
| 1263 | MCFG_PET_USER_PORT_M_HANDLER(WRITELINE(c64_state, write_user_pa2)) |
| 1264 | 1264 | |
| 1265 | 1265 | MCFG_QUICKLOAD_ADD("quickload", c64_state, cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS) |
| 1266 | 1266 | |
| r26928 | r26929 | |
| 1333 | 1333 | // devices |
| 1334 | 1334 | MCFG_PLS100_ADD(PLA_TAG) |
| 1335 | 1335 | MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, WRITELINE(c64_state, cia1_irq_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)) |
| 1336 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_4), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_5)) |
| 1337 | 1337 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL) |
| 1338 | 1338 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL) |
| 1339 | 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)) |
| 1340 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) |
| 1341 | 1341 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia2_pa_r), WRITE8(c64_state, cia2_pa_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)) |
| 1342 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia2_pb_r), WRITE8(c64_state, cia2_pb_w), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_8)) |
| 1343 | 1343 | MCFG_CBM_IEC_ADD(NULL) |
| 1344 | 1344 | MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w)) |
| 1345 | | MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_9)) |
| 1345 | MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_9)) |
| 1346 | 1346 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL) |
| 1347 | 1347 | MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w)) |
| 1348 | 1348 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy") |
| r26928 | r26929 | |
| 1350 | 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)) |
| 1351 | 1351 | MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w)) |
| 1352 | 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)) |
| 1353 | MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, c64_user_port_cards, NULL) |
| 1354 | MCFG_PET_USER_PORT_3_HANDLER(WRITELINE(c64_state, exp_reset_w)) |
| 1355 | MCFG_PET_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w)) |
| 1356 | MCFG_PET_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w)) |
| 1357 | MCFG_PET_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w)) |
| 1358 | MCFG_PET_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w)) |
| 1359 | MCFG_PET_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w)) |
| 1360 | MCFG_PET_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1361 | MCFG_PET_USER_PORT_C_HANDLER(WRITELINE(c64_state, write_user_pb0)) |
| 1362 | MCFG_PET_USER_PORT_D_HANDLER(WRITELINE(c64_state, write_user_pb1)) |
| 1363 | MCFG_PET_USER_PORT_E_HANDLER(WRITELINE(c64_state, write_user_pb2)) |
| 1364 | MCFG_PET_USER_PORT_F_HANDLER(WRITELINE(c64_state, write_user_pb3)) |
| 1365 | MCFG_PET_USER_PORT_H_HANDLER(WRITELINE(c64_state, write_user_pb4)) |
| 1366 | MCFG_PET_USER_PORT_J_HANDLER(WRITELINE(c64_state, write_user_pb5)) |
| 1367 | MCFG_PET_USER_PORT_K_HANDLER(WRITELINE(c64_state, write_user_pb6)) |
| 1368 | MCFG_PET_USER_PORT_L_HANDLER(WRITELINE(c64_state, write_user_pb7)) |
| 1369 | MCFG_PET_USER_PORT_M_HANDLER(WRITELINE(c64_state, write_user_pa2)) |
| 1370 | 1370 | |
| 1371 | 1371 | MCFG_QUICKLOAD_ADD("quickload", c64_state, cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS) |
| 1372 | 1372 | |
trunk/src/mess/drivers/c128.c
| r26928 | r26929 | |
| 1481 | 1481 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia1_pa_r), NULL) |
| 1482 | 1482 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia1_pb_r), WRITE8(c128_state, cia1_pb_w), NULL) |
| 1483 | 1483 | MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c128_state, cia2_irq_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)) |
| 1484 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) |
| 1485 | 1485 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia2_pa_r), WRITE8(c128_state, cia2_pa_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)) |
| 1486 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia2_pb_r), WRITE8(c128_state, cia2_pb_w), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_8)) |
| 1487 | 1487 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1488 | 1488 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL) |
| 1489 | 1489 | MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS8564_TAG, mos8564_device, lp_w)) |
| r26928 | r26929 | |
| 1492 | 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)) |
| 1493 | 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)) |
| 1494 | 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)) |
| 1495 | MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, c64_user_port_cards, NULL) |
| 1496 | MCFG_PET_USER_PORT_3_HANDLER(WRITELINE(c128_state, exp_reset_w)) |
| 1497 | MCFG_PET_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w)) |
| 1498 | MCFG_PET_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w)) |
| 1499 | MCFG_PET_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w)) |
| 1500 | MCFG_PET_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w)) |
| 1501 | MCFG_PET_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w)) |
| 1502 | MCFG_PET_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1503 | MCFG_PET_USER_PORT_C_HANDLER(WRITELINE(c128_state, write_user_pb0)) |
| 1504 | MCFG_PET_USER_PORT_D_HANDLER(WRITELINE(c128_state, write_user_pb1)) |
| 1505 | MCFG_PET_USER_PORT_E_HANDLER(WRITELINE(c128_state, write_user_pb2)) |
| 1506 | MCFG_PET_USER_PORT_F_HANDLER(WRITELINE(c128_state, write_user_pb3)) |
| 1507 | MCFG_PET_USER_PORT_H_HANDLER(WRITELINE(c128_state, write_user_pb4)) |
| 1508 | MCFG_PET_USER_PORT_J_HANDLER(WRITELINE(c128_state, write_user_pb5)) |
| 1509 | MCFG_PET_USER_PORT_K_HANDLER(WRITELINE(c128_state, write_user_pb6)) |
| 1510 | MCFG_PET_USER_PORT_L_HANDLER(WRITELINE(c128_state, write_user_pb7)) |
| 1511 | MCFG_PET_USER_PORT_M_HANDLER(WRITELINE(c128_state, write_user_pa2)) |
| 1512 | 1512 | |
| 1513 | 1513 | MCFG_QUICKLOAD_ADD("quickload", c128_state, cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) |
| 1514 | 1514 | |
| r26928 | r26929 | |
| 1613 | 1613 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia1_pa_r), NULL) |
| 1614 | 1614 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia1_pb_r), WRITE8(c128_state, cia1_pb_w), NULL) |
| 1615 | 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)) |
| 1616 | MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_6), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_7)) |
| 1617 | 1617 | MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia2_pa_r), WRITE8(c128_state, cia2_pa_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)) |
| 1618 | MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia2_pb_r), WRITE8(c128_state, cia2_pb_w), DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_8)) |
| 1619 | 1619 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1620 | 1620 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL) |
| 1621 | 1621 | MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS8566_TAG, mos8566_device, lp_w)) |
| r26928 | r26929 | |
| 1624 | 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)) |
| 1625 | 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)) |
| 1626 | 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)) |
| 1627 | MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, c64_user_port_cards, NULL) |
| 1628 | MCFG_PET_USER_PORT_3_HANDLER(WRITELINE(c128_state, exp_reset_w)) |
| 1629 | MCFG_PET_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w)) |
| 1630 | MCFG_PET_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w)) |
| 1631 | MCFG_PET_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w)) |
| 1632 | MCFG_PET_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w)) |
| 1633 | MCFG_PET_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w)) |
| 1634 | MCFG_PET_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w)) |
| 1635 | MCFG_PET_USER_PORT_C_HANDLER(WRITELINE(c128_state, write_user_pb0)) |
| 1636 | MCFG_PET_USER_PORT_D_HANDLER(WRITELINE(c128_state, write_user_pb1)) |
| 1637 | MCFG_PET_USER_PORT_E_HANDLER(WRITELINE(c128_state, write_user_pb2)) |
| 1638 | MCFG_PET_USER_PORT_F_HANDLER(WRITELINE(c128_state, write_user_pb3)) |
| 1639 | MCFG_PET_USER_PORT_H_HANDLER(WRITELINE(c128_state, write_user_pb4)) |
| 1640 | MCFG_PET_USER_PORT_J_HANDLER(WRITELINE(c128_state, write_user_pb5)) |
| 1641 | MCFG_PET_USER_PORT_K_HANDLER(WRITELINE(c128_state, write_user_pb6)) |
| 1642 | MCFG_PET_USER_PORT_L_HANDLER(WRITELINE(c128_state, write_user_pb7)) |
| 1643 | MCFG_PET_USER_PORT_M_HANDLER(WRITELINE(c128_state, write_user_pa2)) |
| 1644 | 1644 | |
| 1645 | 1645 | MCFG_QUICKLOAD_ADD("quickload", c128_state, cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) |
| 1646 | 1646 | |
trunk/src/mess/drivers/pet.c
| r26928 | r26929 | |
| 795 | 795 | |
| 796 | 796 | WRITE8_MEMBER( pet_state::via_pa_w ) |
| 797 | 797 | { |
| 798 | | m_user->pa_w(space, 0, data); |
| 798 | m_user->write_c((data>>0)&1); |
| 799 | m_user->write_d((data>>1)&1); |
| 800 | m_user->write_e((data>>2)&1); |
| 801 | m_user->write_f((data>>3)&1); |
| 802 | m_user->write_h((data>>4)&1); |
| 803 | m_user->write_j((data>>5)&1); |
| 804 | m_user->write_k((data>>6)&1); |
| 805 | m_user->write_l((data>>7)&1); |
| 799 | 806 | |
| 800 | 807 | m_via_pa = data; |
| 801 | 808 | } |
| r26928 | r26929 | |
| 867 | 874 | m_via_cb2 = state; |
| 868 | 875 | update_speaker(); |
| 869 | 876 | |
| 870 | | m_user->cb2_w(state); |
| 877 | m_user->write_m(state); |
| 871 | 878 | } |
| 872 | 879 | |
| 873 | 880 | |
| r26928 | r26929 | |
| 1071 | 1078 | }; |
| 1072 | 1079 | |
| 1073 | 1080 | |
| 1074 | | //------------------------------------------------- |
| 1075 | | // PET_USER_PORT_INTERFACE( user_intf ) |
| 1076 | | //------------------------------------------------- |
| 1077 | | |
| 1078 | | static PET_USER_PORT_INTERFACE( user_intf ) |
| 1079 | | { |
| 1080 | | DEVCB_DEVICE_LINE_MEMBER(M6522_TAG, via6522_device, write_ca1), |
| 1081 | | DEVCB_DEVICE_LINE_MEMBER(M6522_TAG, via6522_device, write_cb2) |
| 1082 | | }; |
| 1083 | | |
| 1084 | | |
| 1085 | | |
| 1086 | 1081 | //************************************************************************** |
| 1087 | 1082 | // VIDEO |
| 1088 | 1083 | //************************************************************************** |
| r26928 | r26929 | |
| 1447 | 1442 | |
| 1448 | 1443 | // devices |
| 1449 | 1444 | MCFG_DEVICE_ADD(M6522_TAG, VIA6522, XTAL_8MHz/8) |
| 1450 | | MCFG_VIA6522_READPA_HANDLER(DEVREAD8(PET_USER_PORT_TAG, pet_user_port_device, pa_r)) |
| 1451 | 1445 | MCFG_VIA6522_READPB_HANDLER(READ8(pet_state, via_pb_r)) |
| 1452 | 1446 | MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(pet_state, via_pa_w)) |
| 1453 | 1447 | MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(pet_state, via_pb_w)) |
| 1454 | | MCFG_VIA6522_CA1_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, ca1_w)) |
| 1448 | MCFG_VIA6522_CA1_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_b)) |
| 1455 | 1449 | MCFG_VIA6522_CA2_HANDLER(WRITELINE(pet_state, via_ca2_w)) |
| 1456 | 1450 | MCFG_VIA6522_CB2_HANDLER(WRITELINE(pet_state, via_cb2_w)) |
| 1457 | 1451 | MCFG_VIA6522_IRQ_HANDLER(WRITELINE(pet_state, via_irq_w)) |
| r26928 | r26929 | |
| 1465 | 1459 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT2_TAG, cbm_datassette_devices, NULL, DEVWRITELINE(M6522_TAG, via6522_device, write_cb1)) |
| 1466 | 1460 | MCFG_PET_EXPANSION_SLOT_ADD(PET_EXPANSION_SLOT_TAG, XTAL_8MHz/8, pet_expansion_cards, NULL) |
| 1467 | 1461 | MCFG_PET_EXPANSION_SLOT_DMA_CALLBACKS(READ8(pet_state, read), WRITE8(pet_state, write)) |
| 1468 | | MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, user_intf, pet_user_port_cards, NULL) |
| 1462 | |
| 1463 | MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, pet_user_port_cards, NULL) |
| 1464 | MCFG_PET_USER_PORT_B_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_ca1)) |
| 1465 | MCFG_PET_USER_PORT_C_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa0)) |
| 1466 | MCFG_PET_USER_PORT_D_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa1)) |
| 1467 | MCFG_PET_USER_PORT_E_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa2)) |
| 1468 | MCFG_PET_USER_PORT_F_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa3)) |
| 1469 | MCFG_PET_USER_PORT_H_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa4)) |
| 1470 | MCFG_PET_USER_PORT_J_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa5)) |
| 1471 | MCFG_PET_USER_PORT_K_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa6)) |
| 1472 | MCFG_PET_USER_PORT_L_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa7)) |
| 1473 | MCFG_PET_USER_PORT_M_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_cb2)) |
| 1474 | |
| 1469 | 1475 | MCFG_QUICKLOAD_ADD("quickload", pet_state, cbm_pet, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) |
| 1470 | 1476 | |
| 1471 | 1477 | // software lists |
| r26928 | r26929 | |
| 1736 | 1742 | |
| 1737 | 1743 | // devices |
| 1738 | 1744 | MCFG_DEVICE_ADD(M6522_TAG, VIA6522, XTAL_16MHz/16) |
| 1739 | | MCFG_VIA6522_READPA_HANDLER(DEVREAD8(PET_USER_PORT_TAG, pet_user_port_device, pa_r)) |
| 1740 | 1745 | MCFG_VIA6522_READPB_HANDLER(READ8(pet_state, via_pb_r)) |
| 1741 | 1746 | MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(pet_state, via_pa_w)) |
| 1742 | 1747 | MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(pet_state, via_pb_w)) |
| 1743 | | MCFG_VIA6522_CA1_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, ca1_w)) |
| 1748 | MCFG_VIA6522_CA1_HANDLER(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_b)) |
| 1744 | 1749 | MCFG_VIA6522_CA2_HANDLER(WRITELINE(pet_state, via_ca2_w)) |
| 1745 | 1750 | MCFG_VIA6522_CB2_HANDLER(WRITELINE(pet_state, via_cb2_w)) |
| 1746 | 1751 | MCFG_VIA6522_IRQ_HANDLER(WRITELINE(pet_state, via_irq_w)) |
| r26928 | r26929 | |
| 1754 | 1759 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT2_TAG, cbm_datassette_devices, NULL, DEVWRITELINE(M6522_TAG, via6522_device, write_cb1)) |
| 1755 | 1760 | MCFG_PET_EXPANSION_SLOT_ADD(PET_EXPANSION_SLOT_TAG, XTAL_16MHz/16, pet_expansion_cards, NULL) |
| 1756 | 1761 | MCFG_PET_EXPANSION_SLOT_DMA_CALLBACKS(READ8(pet_state, read), WRITE8(pet_state, write)) |
| 1757 | | MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, user_intf, pet_user_port_cards, NULL) |
| 1762 | |
| 1763 | MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, pet_user_port_cards, NULL) |
| 1764 | MCFG_PET_USER_PORT_B_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_ca1)) |
| 1765 | MCFG_PET_USER_PORT_C_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa0)) |
| 1766 | MCFG_PET_USER_PORT_D_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa1)) |
| 1767 | MCFG_PET_USER_PORT_E_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa2)) |
| 1768 | MCFG_PET_USER_PORT_F_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa3)) |
| 1769 | MCFG_PET_USER_PORT_H_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa4)) |
| 1770 | MCFG_PET_USER_PORT_J_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa5)) |
| 1771 | MCFG_PET_USER_PORT_K_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa6)) |
| 1772 | MCFG_PET_USER_PORT_L_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa7)) |
| 1773 | MCFG_PET_USER_PORT_M_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_cb2)) |
| 1774 | |
| 1758 | 1775 | MCFG_QUICKLOAD_ADD("quickload", pet_state, cbm_pet, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) |
| 1759 | 1776 | |
| 1760 | 1777 | MCFG_CARTSLOT_ADD("9000") |