Previous 199869 Revisions Next

r26929 Saturday 4th January, 2014 at 05:01:35 UTC by smf
Merged pet/vic20/c64/plus4/c128 user ports, the pinout is slightly different on each one but there are cards that are compatible with each of the different machines. [smf]
[src/emu/bus/c64]4dxh.c 4dxh.h 4ksa.c 4ksa.h 4tba.c 4tba.h bn1541.c bn1541.h geocable.c geocable.h user.c user.h
[src/emu/bus/pet]user.c user.h
[src/emu/bus/plus4]diag264_lb_user.c diag264_lb_user.h user.c user.h
[src/emu/bus/vic20]4cga.c 4cga.h user.c user.h vic1011.c vic1011.h
[src/mess/drivers]c128.c c64.c pet.c plus4.c vic20.c
[src/mess/includes]c128.h c64.h pet.h plus4.h vic20.h

trunk/src/emu/bus/vic20/4cga.c
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Classical Games/Protovision 4 Player Interface emulation
r26928r26929
2929   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_1)
3030   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_2)
3131   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_3)
32   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_h)
32   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)
3333   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
3434
3535   PORT_START("JOY4")
r26928r26929
3737   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_1)
3838   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_2)
3939   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_3)
40   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_j)
40   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_user_port_interface, output_j)
4141   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
4242INPUT_PORTS_END
4343
r26928r26929
6363
6464c64_4cga_device::c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
6565   device_t(mconfig, C64_4CGA, "C64 Protovision 4 Player Interface", tag, owner, clock, "c64_4cga", __FILE__),
66   device_vic20_user_port_interface(mconfig, *this),
66   device_pet_user_port_interface(mconfig, *this),
6767   m_port(0),
6868   m_joy3(0xf),
6969   m_joy4(0xf)
trunk/src/emu/bus/vic20/user.c
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Commodore VIC-20 User Port emulation
r26928r26929
1111
1212#include "user.h"
1313
14
15
16//**************************************************************************
17//  GLOBAL VARIABLES
18//**************************************************************************
19
20const device_type VIC20_USER_PORT = &device_creator<vic20_user_port_device>;
21
22
23
24//**************************************************************************
25//  CARD INTERFACE
26//**************************************************************************
27
2814//-------------------------------------------------
29//  device_vic20_user_port_interface - constructor
30//-------------------------------------------------
31
32device_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
43device_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
57vic20_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
85void 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
133void vic20_user_port_device::device_reset()
134{
135   if (get_card_device())
136   {
137      get_card_device()->reset();
138   }
139}
140
141
142WRITE_LINE_MEMBER( vic20_user_port_device::write_3 ) { if (m_card != NULL) m_card->input_3(state); }
143WRITE_LINE_MEMBER( vic20_user_port_device::write_4 ) { if (m_card != NULL) m_card->input_4(state); }
144WRITE_LINE_MEMBER( vic20_user_port_device::write_5 ) { if (m_card != NULL) m_card->input_5(state); }
145WRITE_LINE_MEMBER( vic20_user_port_device::write_6 ) { if (m_card != NULL) m_card->input_6(state); }
146WRITE_LINE_MEMBER( vic20_user_port_device::write_7 ) { if (m_card != NULL) m_card->input_7(state); }
147WRITE_LINE_MEMBER( vic20_user_port_device::write_8 ) { if (m_card != NULL) m_card->input_8(state); }
148WRITE_LINE_MEMBER( vic20_user_port_device::write_9 ) { if (m_card != NULL) m_card->input_9(state); }
149WRITE_LINE_MEMBER( vic20_user_port_device::write_b ) { if (m_card != NULL) m_card->input_b(state); }
150WRITE_LINE_MEMBER( vic20_user_port_device::write_c ) { if (m_card != NULL) m_card->input_c(state); }
151WRITE_LINE_MEMBER( vic20_user_port_device::write_d ) { if (m_card != NULL) m_card->input_d(state); }
152WRITE_LINE_MEMBER( vic20_user_port_device::write_e ) { if (m_card != NULL) m_card->input_e(state); }
153WRITE_LINE_MEMBER( vic20_user_port_device::write_f ) { if (m_card != NULL) m_card->input_f(state); }
154WRITE_LINE_MEMBER( vic20_user_port_device::write_h ) { if (m_card != NULL) m_card->input_h(state); }
155WRITE_LINE_MEMBER( vic20_user_port_device::write_j ) { if (m_card != NULL) m_card->input_j(state); }
156WRITE_LINE_MEMBER( vic20_user_port_device::write_k ) { if (m_card != NULL) m_card->input_k(state); }
157WRITE_LINE_MEMBER( vic20_user_port_device::write_l ) { if (m_card != NULL) m_card->input_l(state); }
158WRITE_LINE_MEMBER( vic20_user_port_device::write_m ) { if (m_card != NULL) m_card->input_m(state); }
159
160
161
162//-------------------------------------------------
16315//  SLOT_INTERFACE( vic20_user_port_cards )
16416//-------------------------------------------------
16517
trunk/src/emu/bus/vic20/user.h
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Commodore VIC-20 User Port emulation
r26928r26929
2929#ifndef __VIC20_USER_PORT__
3030#define __VIC20_USER_PORT__
3131
32#include "emu.h"
32#include "bus/pet/user.h"
3333
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
102class device_vic20_user_port_interface;
103
104class vic20_user_port_device : public device_t,
105   public device_slot_interface
106{
107public:
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
167protected:
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
179class device_vic20_user_port_interface : public device_slot_card_interface
180{
181public:
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
221protected:
222   vic20_user_port_device *m_slot;
223};
224
225
226// device type definition
227extern const device_type VIC20_USER_PORT;
228
22934SLOT_INTERFACE_EXTERN( vic20_user_port_cards );
23035
23136#endif
trunk/src/emu/bus/vic20/4cga.h
r26928r26929
2727// ======================> c64_4cga_device
2828
2929class c64_4cga_device : public device_t,
30   public device_vic20_user_port_interface
30   public device_pet_user_port_interface
3131{
3232public:
3333   // construction/destruction
r26928r26929
5050   // device-level overrides
5151   virtual void device_start();
5252
53   // device_vic20_user_port_interface overrides
53   // device_pet_user_port_interface overrides
5454   virtual DECLARE_WRITE_LINE_MEMBER( input_l );
5555
5656private:
trunk/src/emu/bus/vic20/vic1011.c
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Commodore VIC-1011A/B RS-232C Adapter emulation
r26928r26929
6363
6464vic1011_device::vic1011_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
6565   : device_t(mconfig, VIC1011, "VIC1011", tag, owner, clock, "vic1011", __FILE__),
66      device_vic20_user_port_interface(mconfig, *this),
66      device_pet_user_port_interface(mconfig, *this),
6767      m_rs232(*this, RS232_TAG)
6868{
6969}
trunk/src/emu/bus/vic20/vic1011.h
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Commodore VIC-1011A/B RS-232C Adapter emulation
r26928r26929
2727// ======================> vic1011_device
2828
2929class vic1011_device : public device_t,
30   public device_vic20_user_port_interface
30   public device_pet_user_port_interface
3131{
3232public:
3333   // construction/destruction
r26928r26929
3636   // optional information overrides
3737   virtual machine_config_constructor device_mconfig_additions() const;
3838
39   // device_vic20_user_port_interface overrides
39   // device_pet_user_port_interface overrides
4040   virtual DECLARE_WRITE_LINE_MEMBER( input_d );
4141   virtual DECLARE_WRITE_LINE_MEMBER( input_e );
4242   virtual DECLARE_WRITE_LINE_MEMBER( input_j );
trunk/src/emu/bus/pet/user.h
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Commodore PET User Port emulation
r26928r26929
3434
3535
3636//**************************************************************************
37//  CONSTANTS
37//  INTERFACE CONFIGURATION MACROS
3838//**************************************************************************
3939
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)
4143
44#define MCFG_PET_USER_PORT_3_HANDLER(_devcb) \
45   devcb = &pet_user_port_device::set_3_handler(*device, DEVCB2_##_devcb);
4246
47#define MCFG_PET_USER_PORT_4_HANDLER(_devcb) \
48   devcb = &pet_user_port_device::set_4_handler(*device, DEVCB2_##_devcb);
4349
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);
4752
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);
5055
56#define MCFG_PET_USER_PORT_7_HANDLER(_devcb) \
57   devcb = &pet_user_port_device::set_7_handler(*device, DEVCB2_##_devcb);
5158
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);
5661
62#define MCFG_PET_USER_PORT_9_HANDLER(_devcb) \
63   devcb = &pet_user_port_device::set_9_handler(*device, DEVCB2_##_devcb);
5764
65#define MCFG_PET_USER_PORT_B_HANDLER(_devcb) \
66   devcb = &pet_user_port_device::set_b_handler(*device, DEVCB2_##_devcb);
5867
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
5996//**************************************************************************
6097//  TYPE DEFINITIONS
6198//**************************************************************************
6299
63// ======================> pet_user_port_interface
64
65struct pet_user_port_interface
66{
67   devcb_write_line    m_out_ca1_cb;
68   devcb_write_line    m_out_cb2_cb;
69};
70
71
72100// ======================> pet_user_port_device
73101
74102class device_pet_user_port_interface;
75103
76104class pet_user_port_device : public device_t,
77                        public pet_user_port_interface,
78                        public device_slot_interface
105   public device_slot_interface
79106{
80107public:
81108   // construction/destruction
82109   pet_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
83110
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
84129   // 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 );
91147
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;
95166
96167protected:
97168   // device-level overrides
98   virtual void device_config_complete();
99169   virtual void device_start();
100170   virtual void device_reset();
101171
102   devcb_resolved_write_line   m_out_ca1_func;
103   devcb_resolved_write_line   m_out_cb2_func;
104
105172   device_pet_user_port_interface *m_card;
106173};
107174
108175
109176// ======================> device_pet_user_port_interface
110177
111// class representing interface-specific live pet_expansion card
178// class representing interface-specific pet_expansion card
112179class device_pet_user_port_interface : public device_slot_card_interface
113180{
114181public:
115   // construction/destruction
116182   device_pet_user_port_interface(const machine_config &mconfig, device_t &device);
117183   virtual ~device_pet_user_port_interface();
118184
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 ) {}
121202
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); }
126220
127221protected:
128222   pet_user_port_device *m_slot;
r26928r26929
136230// slot devices
137231SLOT_INTERFACE_EXTERN( pet_user_port_cards );
138232
139
140
141233#endif
trunk/src/emu/bus/pet/user.c
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Commodore PET User Port emulation
r26928r26929
5555//-------------------------------------------------
5656
5757pet_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)
6077{
6178}
6279
6380
6481//-------------------------------------------------
65//  device_config_complete - perform any
66//  operations now that the configuration is
67//  complete
68//-------------------------------------------------
69
70void 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//-------------------------------------------------
8982//  device_start - device-specific startup
9083//-------------------------------------------------
9184
r26928r26929
9487   m_card = dynamic_cast<device_pet_user_port_interface *>(get_card_device());
9588
9689   // 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);
99126}
100127
101128
r26928r26929
105132
106133void pet_user_port_device::device_reset()
107134{
135   if (get_card_device())
136   {
137      get_card_device()->reset();
138   }
108139}
109140
110141
111READ8_MEMBER( pet_user_port_device::pa_r ) { UINT8 data = 0xff; if (m_card != NULL) data = m_card->pet_pa_r(space, offset); return data; }
112WRITE8_MEMBER( pet_user_port_device::pa_w ) { if (m_card != NULL) m_card->pet_pa_w(space, offset, data); }
113READ_LINE_MEMBER( pet_user_port_device::ca1_r ) { int state = 1; if (m_card != NULL) state = m_card->pet_ca1_r(); return state; }
114WRITE_LINE_MEMBER( pet_user_port_device::ca1_w ) { if (m_card != NULL) m_card->pet_ca1_w(state); }
115READ_LINE_MEMBER( pet_user_port_device::cb2_r ) { int state = 1; if (m_card != NULL) state = m_card->pet_cb2_r(); return state; }
116WRITE_LINE_MEMBER( pet_user_port_device::cb2_w ) { if (m_card != NULL) m_card->pet_cb2_w(state); }
142WRITE_LINE_MEMBER( pet_user_port_device::write_3 ) { if (m_card != NULL) m_card->input_3(state); }
143WRITE_LINE_MEMBER( pet_user_port_device::write_4 ) { if (m_card != NULL) m_card->input_4(state); }
144WRITE_LINE_MEMBER( pet_user_port_device::write_5 ) { if (m_card != NULL) m_card->input_5(state); }
145WRITE_LINE_MEMBER( pet_user_port_device::write_6 ) { if (m_card != NULL) m_card->input_6(state); }
146WRITE_LINE_MEMBER( pet_user_port_device::write_7 ) { if (m_card != NULL) m_card->input_7(state); }
147WRITE_LINE_MEMBER( pet_user_port_device::write_8 ) { if (m_card != NULL) m_card->input_8(state); }
148WRITE_LINE_MEMBER( pet_user_port_device::write_9 ) { if (m_card != NULL) m_card->input_9(state); }
149WRITE_LINE_MEMBER( pet_user_port_device::write_b ) { if (m_card != NULL) m_card->input_b(state); }
150WRITE_LINE_MEMBER( pet_user_port_device::write_c ) { if (m_card != NULL) m_card->input_c(state); }
151WRITE_LINE_MEMBER( pet_user_port_device::write_d ) { if (m_card != NULL) m_card->input_d(state); }
152WRITE_LINE_MEMBER( pet_user_port_device::write_e ) { if (m_card != NULL) m_card->input_e(state); }
153WRITE_LINE_MEMBER( pet_user_port_device::write_f ) { if (m_card != NULL) m_card->input_f(state); }
154WRITE_LINE_MEMBER( pet_user_port_device::write_h ) { if (m_card != NULL) m_card->input_h(state); }
155WRITE_LINE_MEMBER( pet_user_port_device::write_j ) { if (m_card != NULL) m_card->input_j(state); }
156WRITE_LINE_MEMBER( pet_user_port_device::write_k ) { if (m_card != NULL) m_card->input_k(state); }
157WRITE_LINE_MEMBER( pet_user_port_device::write_l ) { if (m_card != NULL) m_card->input_l(state); }
158WRITE_LINE_MEMBER( pet_user_port_device::write_m ) { if (m_card != NULL) m_card->input_m(state); }
117159
118160
161
162
163
119164//-------------------------------------------------
120165//  SLOT_INTERFACE( pet_user_port_cards )
121166//-------------------------------------------------
trunk/src/emu/bus/c64/user.c
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Commodore 64 User Port emulation
trunk/src/emu/bus/c64/user.h
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Commodore 64 User Port emulation
r26928r26929
2929#ifndef __C64_USER_PORT__
3030#define __C64_USER_PORT__
3131
32#include "bus/vic20/user.h"
32#include "bus/pet/user.h"
3333
3434SLOT_INTERFACE_EXTERN( c64_user_port_cards );
3535
trunk/src/emu/bus/c64/geocable.c
r26928r26929
11   // license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:Curt Coder, smf
33/**********************************************************************
44
55    geoCable Centronics Cable emulation
r26928r26929
7676
7777c64_geocable_device::c64_geocable_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
7878   device_t(mconfig, C64_GEOCABLE, "C64 geoCable", tag, owner, clock, "c64_geocable", __FILE__),
79   device_vic20_user_port_interface(mconfig, *this),
79   device_pet_user_port_interface(mconfig, *this),
8080   m_centronics(*this, CENTRONICS_TAG)
8181{
8282}
trunk/src/emu/bus/c64/4ksa.c
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Kingsoft 4-Player Adapter emulation
r26928r26929
2828
2929static INPUT_PORTS_START( c64_4ksa )
3030   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)
3232
3333   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)
4242
4343   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)
4545INPUT_PORTS_END
4646
4747
r26928r26929
6666
6767c64_4ksa_device::c64_4ksa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
6868   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)
7070{
7171}
7272
trunk/src/emu/bus/c64/geocable.h
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:Curt Coder, smf
33/**********************************************************************
44
55    geoCable Centronics Cable emulation
r26928r26929
2828// ======================> c64_geocable_device
2929
3030class c64_geocable_device : public device_t,
31                     public device_vic20_user_port_interface
31   public device_pet_user_port_interface
3232{
3333public:
3434   // construction/destruction
r26928r26929
4444   // device-level overrides
4545   virtual void device_start();
4646
47   // device_vic20_user_port_interface overrides
47   // device_pet_user_port_interface overrides
4848   virtual DECLARE_WRITE_LINE_MEMBER(input_8);
4949   virtual WRITE_LINE_MEMBER(input_c) { if (state) m_parallel_output |= 1; else m_parallel_output &= ~1; update_output(); }
5050   virtual WRITE_LINE_MEMBER(input_d) { if (state) m_parallel_output |= 2; else m_parallel_output &= ~2; update_output(); }
trunk/src/emu/bus/c64/4ksa.h
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Kingsoft 4-Player Adapter emulation
r26928r26929
2727// ======================> c64_4ksa_device
2828
2929class c64_4ksa_device : public device_t,
30   public device_vic20_user_port_interface
30   public device_pet_user_port_interface
3131{
3232public:
3333   // construction/destruction
trunk/src/emu/bus/c64/4tba.c
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Starbyte Software Tie Break Adaptor emulation
r26928r26929
2828
2929static INPUT_PORTS_START( c64_4tba )
3030   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)
3232
3333   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)
4242
4343   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)
4545INPUT_PORTS_END
4646
4747
r26928r26929
6666
6767c64_4tba_device::c64_4tba_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
6868   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)
7070{
7171}
7272
trunk/src/emu/bus/c64/4tba.h
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Starbyte Software Tie Break Adaptor emulation
r26928r26929
2727// ======================> c64_4tba_device
2828
2929class c64_4tba_device : public device_t,
30                  public device_vic20_user_port_interface
30   public device_pet_user_port_interface
3131{
3232public:
3333   // construction/destruction
trunk/src/emu/bus/c64/4dxh.c
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    The Digital Excess & Hitmen 4-Player Joystick adapter emulation
r26928r26929
2828
2929static INPUT_PORTS_START( c64_4dxh )
3030   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)
3232
3333   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)
4242
4343   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)
4545INPUT_PORTS_END
4646
4747
r26928r26929
6666
6767c64_4dxh_device::c64_4dxh_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
6868   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)
7070{
7171}
7272
trunk/src/emu/bus/c64/4dxh.h
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    The Digital Excess & Hitmen 4-Player Joystick adapter emulation
r26928r26929
2727// ======================> c64_4dxh_device
2828
2929class c64_4dxh_device : public device_t,
30   public device_vic20_user_port_interface
30   public device_pet_user_port_interface
3131{
3232public:
3333   // construction/destruction
trunk/src/emu/bus/c64/bn1541.c
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:Curt Coder, smf
33/**********************************************************************
44
55    SpeedDOS / Burst Nibbler 1541/1571 Parallel Cable emulation
r26928r26929
6565
6666c64_bn1541_device::c64_bn1541_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
6767   device_t(mconfig, C64_BN1541, "C64 Burst Nibbler 1541/1571 Parallel Cable", tag, owner, clock, "c64_bn1541", __FILE__),
68   device_vic20_user_port_interface(mconfig, *this),
68   device_pet_user_port_interface(mconfig, *this),
6969   device_c64_floppy_parallel_interface(mconfig, *this)
7070{
7171}
trunk/src/emu/bus/c64/bn1541.h
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:Curt Coder, smf
33/**********************************************************************
44
55    SpeedDOS / Burst Nibbler 1541/1571 Parallel Cable emulation
r26928r26929
4646// ======================> c64_bn1541_device
4747
4848class c64_bn1541_device : public device_t,
49   public device_vic20_user_port_interface,
49   public device_pet_user_port_interface,
5050   public device_c64_floppy_parallel_interface
5151{
5252public:
trunk/src/emu/bus/plus4/diag264_lb_user.c
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Diag264 User Port Loop Back Connector emulation
r26928r26929
3131
3232diag264_user_port_loopback_device::diag264_user_port_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
3333   : device_t(mconfig, DIAG264_USER_PORT_LOOPBACK, "Diag264 User Port Loopback", tag, owner, clock, "diag264_user_port_loopback", __FILE__),
34   device_plus4_user_port_interface(mconfig, *this)
34   device_pet_user_port_interface(mconfig, *this)
3535{
3636}
3737
trunk/src/emu/bus/plus4/user.c
r26928r26929
1
2
1// license:BSD-3-Clause
2// copyright-holders:smf
33/**********************************************************************
44
55    Commodore Plus/4 User Port emulation
r26928r26929
1111
1212#include "user.h"
1313
14
15
16//**************************************************************************
17//  GLOBAL VARIABLES
18//**************************************************************************
19
20const device_type PLUS4_USER_PORT = &device_creator<plus4_user_port_device>;
21
22
23
24//**************************************************************************
25//  CARD INTERFACE
26//**************************************************************************
27
2814//-------------------------------------------------
29//  device_plus4_user_port_interface - constructor
30//-------------------------------------------------
31
32device_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
43device_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
57plus4_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
80void 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
118void plus4_user_port_device::device_reset()
119{
120   if (get_card_device())
121   {
122      get_card_device()->reset();
123   }
124}
125
126
127WRITE_LINE_MEMBER( plus4_user_port_device::write_4 ) { if (m_cart != NULL) m_cart->write_4(state); }
128WRITE_LINE_MEMBER( plus4_user_port_device::write_5 ) { if (m_cart != NULL) m_cart->write_5(state); }
129WRITE_LINE_MEMBER( plus4_user_port_device::write_6 ) { if (m_cart != NULL) m_cart->write_6(state); }
130WRITE_LINE_MEMBER( plus4_user_port_device::write_7 ) { if (m_cart != NULL) m_cart->write_7(state); }
131WRITE_LINE_MEMBER( plus4_user_port_device::write_8 ) { if (m_cart != NULL) m_cart->write_8(state); }
132WRITE_LINE_MEMBER( plus4_user_port_device::write_9 ) { if (m_cart != NULL) m_cart->write_9(state); }
133WRITE_LINE_MEMBER( plus4_user_port_device::write_b ) { if (m_cart != NULL) m_cart->write_b(state); }
134WRITE_LINE_MEMBER( plus4_user_port_device::write_d ) { if (m_cart != NULL) m_cart->write_d(state); }
135WRITE_LINE_MEMBER( plus4_user_port_device::write_e ) { if (m_cart != NULL) m_cart->write_e(state); }
136WRITE_LINE_MEMBER( plus4_user_port_device::write_f ) { if (m_cart != NULL) m_cart->write_f(state); }
137WRITE_LINE_MEMBER( plus4_user_port_device::write_j ) { if (m_cart != NULL) m_cart->write_j(state); }
138WRITE_LINE_MEMBER( plus4_user_port_device::write_k ) { if (m_cart != NULL) m_cart->write_k(state); }
139WRITE_LINE_MEMBER( plus4_user_port_device::write_m ) { if (m_cart != NULL) m_cart->write_m(state); }
140
141
142
143//-------------------------------------------------
14415//  SLOT_INTERFACE( plus4_user_port_cards )
14516//-------------------------------------------------
14617
14718// slot devices
14819#include "diag264_lb_user.h"
20#include "bus/vic20/vic1011.h"
14921
15022SLOT_INTERFACE_START( plus4_user_port_cards )
15123   SLOT_INTERFACE("diag264", DIAG264_USER_PORT_LOOPBACK)
24   SLOT_INTERFACE("rs232", VIC1011)
15225SLOT_INTERFACE_END
trunk/src/emu/bus/plus4/diag264_lb_user.h
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Diag264 User Port Loop Back Connector emulation
r26928r26929
2626// ======================> diag264_user_port_loopback_device
2727
2828class diag264_user_port_loopback_device :  public device_t,
29   public device_plus4_user_port_interface
29   public device_pet_user_port_interface
3030{
3131public:
3232   // construction/destruction
r26928r26929
3636   // device-level overrides
3737   virtual void device_start();
3838
39   // device_plus4_user_port_interface overrides
40   virtual DECLARE_WRITE_LINE_MEMBER(write_b) { m_slot->m_6_handler(state); }
41   virtual DECLARE_WRITE_LINE_MEMBER(write_k) { m_slot->m_7_handler(state); }
42   virtual DECLARE_WRITE_LINE_MEMBER(write_4) { m_slot->m_j_handler(state); }
43   virtual DECLARE_WRITE_LINE_MEMBER(write_5) { m_slot->m_f_handler(state); }
39   // device_pet_user_port_interface overrides
40   virtual DECLARE_WRITE_LINE_MEMBER(input_b) { output_6(state); }
41   virtual DECLARE_WRITE_LINE_MEMBER(input_k) { output_7(state); }
42   virtual DECLARE_WRITE_LINE_MEMBER(input_4) { output_j(state); }
43   virtual DECLARE_WRITE_LINE_MEMBER(input_5) { output_f(state); }
4444
45   virtual DECLARE_WRITE_LINE_MEMBER(write_6) { m_slot->m_b_handler(state); }
46   virtual DECLARE_WRITE_LINE_MEMBER(write_7) { m_slot->m_k_handler(state); }
47   virtual DECLARE_WRITE_LINE_MEMBER(write_j) { m_slot->m_4_handler(state); }
48   virtual DECLARE_WRITE_LINE_MEMBER(write_f) { m_slot->m_5_handler(state); }
45   virtual DECLARE_WRITE_LINE_MEMBER(input_6) { output_b(state); }
46   virtual DECLARE_WRITE_LINE_MEMBER(input_7) { output_k(state); }
47   virtual DECLARE_WRITE_LINE_MEMBER(input_j) { output_4(state); }
48   virtual DECLARE_WRITE_LINE_MEMBER(input_f) { output_5(state); }
4949
50   //virtual DECLARE_WRITE_LINE_MEMBER(write_c) { m_slot->m_m_handler(state); }
51   virtual DECLARE_WRITE_LINE_MEMBER(write_d) { m_slot->m_l_handler(state); }
52   virtual DECLARE_WRITE_LINE_MEMBER(write_e) { m_slot->m_h_handler(state); }
50   //virtual DECLARE_WRITE_LINE_MEMBER(input_c) { output_m(state); }
51   virtual DECLARE_WRITE_LINE_MEMBER(input_d) { output_l(state); }
52   virtual DECLARE_WRITE_LINE_MEMBER(input_e) { output_h(state); }
5353
54   virtual DECLARE_WRITE_LINE_MEMBER(write_m) { m_slot->m_c_handler(state); }
55   //virtual DECLARE_WRITE_LINE_MEMBER(write_l) { m_slot->m_d_handler(state); }
56   //virtual DECLARE_WRITE_LINE_MEMBER(write_h) { m_slot->m_e_handler(state); }
54   virtual DECLARE_WRITE_LINE_MEMBER(input_m) { output_c(state); }
55   //virtual DECLARE_WRITE_LINE_MEMBER(input_l) { output_d(state); }
56   //virtual DECLARE_WRITE_LINE_MEMBER(input_h) { output_e(state); }
5757};
5858
5959// device type definition
trunk/src/emu/bus/plus4/user.h
r26928r26929
11// license:BSD-3-Clause
2// copyright-holders:Curt Coder
2// copyright-holders:smf
33/**********************************************************************
44
55    Commodore Plus/4 User Port emulation
r26928r26929
2929#ifndef __PLUS4_USER_PORT__
3030#define __PLUS4_USER_PORT__
3131
32#include "emu.h"
32#include "bus/vic20/user.h"
3333
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
94class device_plus4_user_port_interface;
95
96class plus4_user_port_device : public device_t,
97   public device_slot_interface
98{
99public:
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
145protected:
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
157class device_plus4_user_port_interface : public device_slot_card_interface
158{
159public:
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
178protected:
179   plus4_user_port_device *m_slot;
180};
181
182
183// device type definition
184extern const device_type PLUS4_USER_PORT;
185
186
18734SLOT_INTERFACE_EXTERN( plus4_user_port_cards );
18835
18936#endif
trunk/src/mess/drivers/vic20.c
r26928r26929
659659   MCFG_VIA6522_READPA_HANDLER(READ8(vic20_state, via1_pa_r))
660660   MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(vic20_state, via1_pa_w))
661661   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))
663663   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))
665665   MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE(M6502_TAG, m6502_device, nmi_line))
666666
667667   MCFG_DEVICE_ADD(M6522_2_TAG, VIA6522, 0)
r26928r26929
680680   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy")
681681   MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(WRITELINE(vic20_state, write_light_pen))
682682
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))
700700
701701   MCFG_QUICKLOAD_ADD("quickload", vic20_state, cbm_vc20, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
702702
trunk/src/mess/drivers/plus4.c
r26928r26929
745745   MCFG_PLS100_ADD(PLA_TAG)
746746
747747   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))
751751   MCFG_MOS6551_IRQ_HANDLER(WRITELINE(plus4_state, acia_irq_w))
752752
753753   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))
762762
763763   MCFG_DEVICE_ADD(MOS6529_KB_TAG, MOS6529, 0)
764764   MCFG_MOS6529_P0_HANDLER(WRITELINE(plus4_state, write_kb0))
r26928r26929
773773   MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, plus4_datassette_devices, "c1531", NULL)
774774
775775   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))
777777
778778   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
779779   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
780780   MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, XTAL_14_31818MHz/16, plus4_expansion_cards, "c1551", WRITELINE(plus4_state, exp_irq_w))
781781   MCFG_PLUS4_EXPANSION_SLOT_DMA_CALLBACKS(READ8(plus4_state, read), WRITE8(plus4_state, write), INPUTLINE(MOS7501_TAG, INPUT_LINE_HALT))
782782
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))
796796
797797   MCFG_QUICKLOAD_ADD("quickload", plus4_state, cbm_c16, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
798798
r26928r26929
853853
854854   MCFG_DEVICE_REMOVE(MOS6551_TAG)
855855   MCFG_DEVICE_REMOVE(MOS6529_USER_TAG)
856   MCFG_DEVICE_REMOVE(PLUS4_USER_PORT_TAG)
856   MCFG_DEVICE_REMOVE(PET_USER_PORT_TAG)
857857
858858   MCFG_DEVICE_MODIFY(CBM_IEC_TAG)
859859   MCFG_CBM_IEC_BUS_ATN_CALLBACK(NULL)
r26928r26929
875875
876876   MCFG_DEVICE_REMOVE(MOS6551_TAG)
877877   MCFG_DEVICE_REMOVE(MOS6529_USER_TAG)
878   MCFG_DEVICE_REMOVE(PLUS4_USER_PORT_TAG)
878   MCFG_DEVICE_REMOVE(PET_USER_PORT_TAG)
879879
880880   MCFG_DEVICE_MODIFY(CBM_IEC_TAG)
881881   MCFG_CBM_IEC_BUS_ATN_CALLBACK(NULL)
trunk/src/mess/drivers/c64.c
r26928r26929
10971097   // devices
10981098   MCFG_PLS100_ADD(PLA_TAG)
10991099   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))
11011101   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL)
11021102   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL)
11031103   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))
11051105   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))
11071107   MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
11081108   MCFG_CBM_IEC_ADD("c1541")
11091109   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))
11111111   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
11121112   MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6567_TAG, mos6567_device, lp_w))
11131113   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
r26928r26929
11151115   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c64_state, exp_irq_w), WRITELINE(c64_state, exp_nmi_w), WRITELINE(c64_state, exp_reset_w))
11161116   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w))
11171117
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))
11351135
11361136   MCFG_QUICKLOAD_ADD("quickload", c64_state, cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
11371137
r26928r26929
12261226   // devices
12271227   MCFG_PLS100_ADD(PLA_TAG)
12281228   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))
12301230   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL)
12311231   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL)
12321232   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))
12341234   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))
12361236   MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
12371237   MCFG_CBM_IEC_ADD("c1541")
12381238   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))
12401240   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
12411241   MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w))
12421242   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
r26928r26929
12441244   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c64_state, exp_irq_w), WRITELINE(c64_state, exp_nmi_w), WRITELINE(c64_state, exp_reset_w))
12451245   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w))
12461246
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))
12641264
12651265   MCFG_QUICKLOAD_ADD("quickload", c64_state, cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
12661266
r26928r26929
13331333   // devices
13341334   MCFG_PLS100_ADD(PLA_TAG)
13351335   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))
13371337   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL)
13381338   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL)
13391339   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))
13411341   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))
13431343   MCFG_CBM_IEC_ADD(NULL)
13441344   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))
13461346   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
13471347   MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w))
13481348   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
r26928r26929
13501350   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c64_state, exp_irq_w), WRITELINE(c64_state, exp_nmi_w), WRITELINE(c64_state, exp_reset_w))
13511351   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w))
13521352
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))
13701370
13711371   MCFG_QUICKLOAD_ADD("quickload", c64_state, cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
13721372
trunk/src/mess/drivers/c128.c
r26928r26929
14811481   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia1_pa_r), NULL)
14821482   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia1_pb_r), WRITE8(c128_state, cia1_pb_w), NULL)
14831483   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))
14851485   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))
14871487   MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
14881488   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
14891489   MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS8564_TAG, mos8564_device, lp_w))
r26928r26929
14921492   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c128_state, exp_irq_w), WRITELINE(c128_state, exp_nmi_w), WRITELINE(c128_state, exp_reset_w))
14931493   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))
14941494
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))
15121512
15131513   MCFG_QUICKLOAD_ADD("quickload", c128_state, cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
15141514
r26928r26929
16131613   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia1_pa_r), NULL)
16141614   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia1_pb_r), WRITE8(c128_state, cia1_pb_w), NULL)
16151615   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))
16171617   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))
16191619   MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
16201620   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
16211621   MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS8566_TAG, mos8566_device, lp_w))
r26928r26929
16241624   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c128_state, exp_irq_w), WRITELINE(c128_state, exp_nmi_w), WRITELINE(c128_state, exp_reset_w))
16251625   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))
16261626
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))
16441644
16451645   MCFG_QUICKLOAD_ADD("quickload", c128_state, cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
16461646
trunk/src/mess/drivers/pet.c
r26928r26929
795795
796796WRITE8_MEMBER( pet_state::via_pa_w )
797797{
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);
799806
800807   m_via_pa = data;
801808}
r26928r26929
867874   m_via_cb2 = state;
868875   update_speaker();
869876
870   m_user->cb2_w(state);
877   m_user->write_m(state);
871878}
872879
873880
r26928r26929
10711078};
10721079
10731080
1074//-------------------------------------------------
1075//  PET_USER_PORT_INTERFACE( user_intf )
1076//-------------------------------------------------
1077
1078static 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
10861081//**************************************************************************
10871082//  VIDEO
10881083//**************************************************************************
r26928r26929
14471442
14481443   // devices
14491444   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))
14511445   MCFG_VIA6522_READPB_HANDLER(READ8(pet_state, via_pb_r))
14521446   MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(pet_state, via_pa_w))
14531447   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))
14551449   MCFG_VIA6522_CA2_HANDLER(WRITELINE(pet_state, via_ca2_w))
14561450   MCFG_VIA6522_CB2_HANDLER(WRITELINE(pet_state, via_cb2_w))
14571451   MCFG_VIA6522_IRQ_HANDLER(WRITELINE(pet_state, via_irq_w))
r26928r26929
14651459   MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT2_TAG, cbm_datassette_devices, NULL, DEVWRITELINE(M6522_TAG, via6522_device, write_cb1))
14661460   MCFG_PET_EXPANSION_SLOT_ADD(PET_EXPANSION_SLOT_TAG, XTAL_8MHz/8, pet_expansion_cards, NULL)
14671461   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
14691475   MCFG_QUICKLOAD_ADD("quickload", pet_state, cbm_pet, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
14701476
14711477   // software lists
r26928r26929
17361742
17371743   // devices
17381744   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))
17401745   MCFG_VIA6522_READPB_HANDLER(READ8(pet_state, via_pb_r))
17411746   MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(pet_state, via_pa_w))
17421747   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))
17441749   MCFG_VIA6522_CA2_HANDLER(WRITELINE(pet_state, via_ca2_w))
17451750   MCFG_VIA6522_CB2_HANDLER(WRITELINE(pet_state, via_cb2_w))
17461751   MCFG_VIA6522_IRQ_HANDLER(WRITELINE(pet_state, via_irq_w))
r26928r26929
17541759   MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT2_TAG, cbm_datassette_devices, NULL, DEVWRITELINE(M6522_TAG, via6522_device, write_cb1))
17551760   MCFG_PET_EXPANSION_SLOT_ADD(PET_EXPANSION_SLOT_TAG, XTAL_16MHz/16, pet_expansion_cards, NULL)
17561761   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
17581775   MCFG_QUICKLOAD_ADD("quickload", pet_state, cbm_pet, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
17591776
17601777   MCFG_CARTSLOT_ADD("9000")
trunk/src/mess/includes/plus4.h
r26928r26929
3131#define SCREEN_TAG          "screen"
3232#define CONTROL1_TAG        "joy1"
3333#define CONTROL2_TAG        "joy2"
34#define PET_USER_PORT_TAG     "user"
3435
3536class plus4_state : public driver_device
3637{
r26928r26929
4849         m_joy1(*this, CONTROL1_TAG),
4950         m_joy2(*this, CONTROL2_TAG),
5051         m_exp(*this, PLUS4_EXPANSION_SLOT_TAG),
51         m_user(*this, PLUS4_USER_PORT_TAG),
52         m_user(*this, PET_USER_PORT_TAG),
5253         m_ram(*this, RAM_TAG),
5354         m_cassette(*this, PET_DATASSETTE_PORT_TAG),
5455         m_kernal(*this, "kernal"),
r26928r26929
8081   required_device<vcs_control_port_device> m_joy1;
8182   required_device<vcs_control_port_device> m_joy2;
8283   required_device<plus4_expansion_slot_device> m_exp;
83   optional_device<plus4_user_port_device> m_user;
84   optional_device<pet_user_port_device> m_user;
8485   required_device<ram_device> m_ram;
8586   required_device<pet_datassette_port_device> m_cassette;
8687   required_memory_region m_kernal;
trunk/src/mess/includes/c64.h
r26928r26929
2929#define SCREEN_TAG      "screen"
3030#define CONTROL1_TAG    "joy1"
3131#define CONTROL2_TAG    "joy2"
32#define VIC20_USER_PORT_TAG     "user"
32#define PET_USER_PORT_TAG     "user"
3333
3434class c64_state : public driver_device
3535{
r26928r26929
4646         m_joy1(*this, CONTROL1_TAG),
4747         m_joy2(*this, CONTROL2_TAG),
4848         m_exp(*this, C64_EXPANSION_SLOT_TAG),
49         m_user(*this, VIC20_USER_PORT_TAG),
49         m_user(*this, PET_USER_PORT_TAG),
5050         m_ram(*this, RAM_TAG),
5151         m_cassette(*this, PET_DATASSETTE_PORT_TAG),
5252         m_basic(*this, "basic"),
r26928r26929
8585   required_device<vcs_control_port_device> m_joy1;
8686   required_device<vcs_control_port_device> m_joy2;
8787   required_device<c64_expansion_slot_device> m_exp;
88   required_device<vic20_user_port_device> m_user;
88   required_device<pet_user_port_device> m_user;
8989   required_device<ram_device> m_ram;
9090   optional_device<pet_datassette_port_device> m_cassette;
9191   optional_memory_region m_basic;
trunk/src/mess/includes/pet.h
r26928r26929
2727#define SCREEN_TAG      "screen"
2828#define PLA1_TAG        "ue6"
2929#define PLA2_TAG        "ue5"
30#define PET_USER_PORT_TAG "user"
3031
3132class pet_state : public driver_device
3233{
trunk/src/mess/includes/c128.h
r26928r26929
3535#define SCREEN_VDC_TAG  "screen80"
3636#define CONTROL1_TAG    "joy1"
3737#define CONTROL2_TAG    "joy2"
38#define VIC20_USER_PORT_TAG     "user"
38#define PET_USER_PORT_TAG     "user"
3939
4040class c128_state : public driver_device
4141{
r26928r26929
5555         m_joy1(*this, CONTROL1_TAG),
5656         m_joy2(*this, CONTROL2_TAG),
5757         m_exp(*this, C64_EXPANSION_SLOT_TAG),
58         m_user(*this, VIC20_USER_PORT_TAG),
58         m_user(*this, PET_USER_PORT_TAG),
5959         m_ram(*this, RAM_TAG),
6060         m_cassette(*this, PET_DATASSETTE_PORT_TAG),
6161         m_rom(*this, M8502_TAG),
r26928r26929
113113   required_device<vcs_control_port_device> m_joy1;
114114   required_device<vcs_control_port_device> m_joy2;
115115   required_device<c64_expansion_slot_device> m_exp;
116   required_device<vic20_user_port_device> m_user;
116   required_device<pet_user_port_device> m_user;
117117   required_device<ram_device> m_ram;
118118   required_device<pet_datassette_port_device> m_cassette;
119119   required_memory_region m_rom;
trunk/src/mess/includes/vic20.h
r26928r26929
2727#define IEC_TAG         "iec"
2828#define SCREEN_TAG      "screen"
2929#define CONTROL1_TAG    "joy1"
30#define VIC20_USER_PORT_TAG     "user"
30#define PET_USER_PORT_TAG     "user"
3131
3232class vic20_state : public driver_device
3333{
r26928r26929
4141         m_iec(*this, CBM_IEC_TAG),
4242         m_joy(*this, CONTROL1_TAG),
4343         m_exp(*this, VIC20_EXPANSION_SLOT_TAG),
44         m_user(*this, VIC20_USER_PORT_TAG),
44         m_user(*this, PET_USER_PORT_TAG),
4545         m_cassette(*this, PET_DATASSETTE_PORT_TAG),
4646         m_ram(*this, RAM_TAG),
4747         m_basic(*this, "basic"),
r26928r26929
6767   required_device<cbm_iec_device> m_iec;
6868   required_device<vcs_control_port_device> m_joy;
6969   required_device<vic20_expansion_slot_device> m_exp;
70   required_device<vic20_user_port_device> m_user;
70   required_device<pet_user_port_device> m_user;
7171   required_device<pet_datassette_port_device> m_cassette;
7272   required_device<ram_device> m_ram;
7373   required_memory_region m_basic;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team