Previous 199869 Revisions Next

r26920 Friday 3rd January, 2014 at 18:18:33 UTC by smf
Allow vic20/c64/c128 to share user port devices, removed c64 version of vic1011 and moved protovision 4 player adapter from bus/c64 to bus/vic20. Tried to test with http://code.google.com/p/commodore-multi-player/ as it supports protovision 4 player adapter, but it currently crashes. I have had to disable 1541 as it prevents quick loading from working. [smf]
[src/emu/bus]bus.mak
[src/emu/bus/c64]4cga.c 4cga.h 4dxh.c 4dxh.h 4ksa.c 4ksa.h 4tba.c 4tba.h bn1541.c bn1541.h geocable.c geocable.h user.c user.h vic1011.c vic1011.h
[src/emu/bus/vic20]4cga.c* 4cga.h* user.c user.h vic1011.c vic1011.h
[src/mess/drivers]c128.c c64.c vic20.c
[src/mess/includes]c128.h c64.h

trunk/src/emu/bus/vic20/vic1011.h
r26919r26920
2626
2727// ======================> vic1011_device
2828
29class vic1011_device :  public device_t,
30                  public device_vic20_user_port_interface
29class vic1011_device : public device_t,
30   public device_vic20_user_port_interface
3131{
3232public:
3333   // construction/destruction
r26919r26920
3636   // optional information overrides
3737   virtual machine_config_constructor device_mconfig_additions() const;
3838
39   DECLARE_WRITE_LINE_MEMBER( write_rxd );
40   DECLARE_WRITE_LINE_MEMBER( write_d );
41   DECLARE_WRITE_LINE_MEMBER( write_e );
42   DECLARE_WRITE_LINE_MEMBER( write_dcdin );
43   DECLARE_WRITE_LINE_MEMBER( write_j );
44   DECLARE_WRITE_LINE_MEMBER( write_cts );
45   DECLARE_WRITE_LINE_MEMBER( write_dsr );
46   DECLARE_WRITE_LINE_MEMBER( write_m );
39   // device_vic20_user_port_interface overrides
40   virtual DECLARE_WRITE_LINE_MEMBER( input_d );
41   virtual DECLARE_WRITE_LINE_MEMBER( input_e );
42   virtual DECLARE_WRITE_LINE_MEMBER( input_j );
43   virtual DECLARE_WRITE_LINE_MEMBER( input_m );
4744
45   DECLARE_WRITE_LINE_MEMBER( output_rxd );
46
4847protected:
4948   // device-level overrides
5049   virtual void device_start();
trunk/src/emu/bus/vic20/4cga.c
r0r26920
1// license:BSD-3-Clause
2// copyright-holders:Curt Coder
3/**********************************************************************
4
5    Classical Games/Protovision 4 Player Interface emulation
6
7    http://www.protovision-online.com/hardw/4_player.htm
8    http://hitmen.c02.at/html/hardware.html
9
10    Copyright MESS Team.
11    Visit http://mamedev.org for licensing and usage restrictions.
12
13**********************************************************************/
14
15#include "4cga.h"
16
17
18
19//**************************************************************************
20//  DEVICE DEFINITIONS
21//**************************************************************************
22
23const device_type C64_4CGA = &device_creator<c64_4cga_device>;
24
25
26static INPUT_PORTS_START( c64_4player )
27   PORT_START("JOY3")
28   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_0)
29   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_1)
30   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_2)
31   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_3)
32   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_4)
33   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
34
35   PORT_START("JOY4")
36   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_0)
37   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_1)
38   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_2)
39   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_3)
40   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_4)
41   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
42INPUT_PORTS_END
43
44
45//-------------------------------------------------
46//  input_ports - device-specific input ports
47//-------------------------------------------------
48
49ioport_constructor c64_4cga_device::device_input_ports() const
50{
51   return INPUT_PORTS_NAME( c64_4player );
52}
53
54
55
56//**************************************************************************
57//  LIVE DEVICE
58//**************************************************************************
59
60//-------------------------------------------------
61//  c64_4cga_device - constructor
62//-------------------------------------------------
63
64c64_4cga_device::c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
65   device_t(mconfig, C64_4CGA, "C64 Protovision 4 Player Interface", tag, owner, clock, "c64_4cga", __FILE__),
66   device_vic20_user_port_interface(mconfig, *this),
67   m_port(0)
68{
69}
70
71
72//-------------------------------------------------
73//  device_start - device-specific startup
74//-------------------------------------------------
75
76void c64_4cga_device::device_start()
77{
78   // state saving
79   save_item(NAME(m_port));
80}
81
82//-------------------------------------------------
83//  update_output
84//-------------------------------------------------
85
86void c64_4cga_device::update_output()
87{
88   UINT8 data;
89
90   if (m_port)
91   {
92      data = m_joy3;
93   }
94   else
95   {
96      data = m_joy4;
97   }
98
99   output_c((data>>0)&1);
100   output_d((data>>1)&1);
101   output_e((data>>2)&1);
102   output_f((data>>3)&1);
103   output_h((data>>4)&1);
104   output_j((data>>5)&1);
105}
106
107
108//-------------------------------------------------
109//  c64_pb_w - port B write
110//-------------------------------------------------
111
112WRITE_LINE_MEMBER( c64_4cga_device::input_l )
113{
114   m_port = state;
115   update_output();
116}
Property changes on: trunk/src/emu/bus/vic20/4cga.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/vic20/user.c
r26919r26920
139139}
140140
141141
142WRITE_LINE_MEMBER( vic20_user_port_device::write_3 ) { if (m_card != NULL) m_card->write_3(state); }
143WRITE_LINE_MEMBER( vic20_user_port_device::write_4 ) { if (m_card != NULL) m_card->write_4(state); }
144WRITE_LINE_MEMBER( vic20_user_port_device::write_5 ) { if (m_card != NULL) m_card->write_5(state); }
145WRITE_LINE_MEMBER( vic20_user_port_device::write_6 ) { if (m_card != NULL) m_card->write_6(state); }
146WRITE_LINE_MEMBER( vic20_user_port_device::write_7 ) { if (m_card != NULL) m_card->write_7(state); }
147WRITE_LINE_MEMBER( vic20_user_port_device::write_8 ) { if (m_card != NULL) m_card->write_8(state); }
148WRITE_LINE_MEMBER( vic20_user_port_device::write_9 ) { if (m_card != NULL) m_card->write_9(state); }
149WRITE_LINE_MEMBER( vic20_user_port_device::write_b ) { if (m_card != NULL) m_card->write_b(state); }
150WRITE_LINE_MEMBER( vic20_user_port_device::write_c ) { if (m_card != NULL) m_card->write_c(state); }
151WRITE_LINE_MEMBER( vic20_user_port_device::write_d ) { if (m_card != NULL) m_card->write_d(state); }
152WRITE_LINE_MEMBER( vic20_user_port_device::write_e ) { if (m_card != NULL) m_card->write_e(state); }
153WRITE_LINE_MEMBER( vic20_user_port_device::write_f ) { if (m_card != NULL) m_card->write_f(state); }
154WRITE_LINE_MEMBER( vic20_user_port_device::write_h ) { if (m_card != NULL) m_card->write_h(state); }
155WRITE_LINE_MEMBER( vic20_user_port_device::write_j ) { if (m_card != NULL) m_card->write_j(state); }
156WRITE_LINE_MEMBER( vic20_user_port_device::write_k ) { if (m_card != NULL) m_card->write_k(state); }
157WRITE_LINE_MEMBER( vic20_user_port_device::write_l ) { if (m_card != NULL) m_card->write_l(state); }
158WRITE_LINE_MEMBER( vic20_user_port_device::write_m ) { if (m_card != NULL) m_card->write_m(state); }
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); }
159159
160160
161161
r26919r26920
164164//-------------------------------------------------
165165
166166// slot devices
167#include "4cga.h"
167168#include "vic1011.h"
168169
169170SLOT_INTERFACE_START( vic20_user_port_cards )
171   SLOT_INTERFACE("4cga", C64_4CGA)
170172   SLOT_INTERFACE("rs232", VIC1011)
171173SLOT_INTERFACE_END
trunk/src/emu/bus/vic20/user.h
r26919r26920
175175
176176// ======================> device_vic20_user_port_interface
177177
178// class representing interface-specific live vic20_expansion card
178// class representing interface-specific vic20_expansion card
179179class device_vic20_user_port_interface : public device_slot_card_interface
180180{
181181public:
182182   device_vic20_user_port_interface(const machine_config &mconfig, device_t &device);
183183   virtual ~device_vic20_user_port_interface();
184184
185   DECLARE_WRITE_LINE_MEMBER( write_3 ) {}
186   DECLARE_WRITE_LINE_MEMBER( write_4 ) {}
187   DECLARE_WRITE_LINE_MEMBER( write_5 ) {}
188   DECLARE_WRITE_LINE_MEMBER( write_6 ) {}
189   DECLARE_WRITE_LINE_MEMBER( write_7 ) {}
190   DECLARE_WRITE_LINE_MEMBER( write_8 ) {}
191   DECLARE_WRITE_LINE_MEMBER( write_9 ) {}
192   DECLARE_WRITE_LINE_MEMBER( write_b ) {}
193   DECLARE_WRITE_LINE_MEMBER( write_c ) {}
194   DECLARE_WRITE_LINE_MEMBER( write_d ) {}
195   DECLARE_WRITE_LINE_MEMBER( write_e ) {}
196   DECLARE_WRITE_LINE_MEMBER( write_f ) {}
197   DECLARE_WRITE_LINE_MEMBER( write_h ) {}
198   DECLARE_WRITE_LINE_MEMBER( write_j ) {}
199   DECLARE_WRITE_LINE_MEMBER( write_k ) {}
200   DECLARE_WRITE_LINE_MEMBER( write_l ) {}
201   DECLARE_WRITE_LINE_MEMBER( write_m ) {}
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 ) {}
202202
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
203221protected:
204222   vic20_user_port_device *m_slot;
205223};
trunk/src/emu/bus/vic20/4cga.h
r0r26920
1// license:BSD-3-Clause
2// copyright-holders:Curt Coder
3/**********************************************************************
4
5    Classical Games/Protovision 4 Player Interface emulation
6
7    Copyright MESS Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10**********************************************************************/
11
12#pragma once
13
14#ifndef __C64_4CGA__
15#define __C64_4CGA__
16
17
18#include "emu.h"
19#include "user.h"
20
21
22
23//**************************************************************************
24//  TYPE DEFINITIONS
25//**************************************************************************
26
27// ======================> c64_4cga_device
28
29class c64_4cga_device : public device_t,
30   public device_vic20_user_port_interface
31{
32public:
33   // construction/destruction
34   c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
35
36   // optional information overrides
37   virtual ioport_constructor device_input_ports() const;
38
39   DECLARE_WRITE_LINE_MEMBER(write_joy3_0) { if (state) m_joy3 |= 1; else m_joy3 &= ~1; update_output(); }
40   DECLARE_WRITE_LINE_MEMBER(write_joy3_1) { if (state) m_joy3 |= 2; else m_joy3 &= ~2; update_output(); }
41   DECLARE_WRITE_LINE_MEMBER(write_joy3_2) { if (state) m_joy3 |= 4; else m_joy3 &= ~4; update_output(); }
42   DECLARE_WRITE_LINE_MEMBER(write_joy3_3) { if (state) m_joy3 |= 8; else m_joy3 &= ~8; update_output(); }
43   DECLARE_WRITE_LINE_MEMBER(write_joy3_4) { if (state) m_joy3 |= 16; else m_joy3 &= ~16; update_output(); }
44   DECLARE_WRITE_LINE_MEMBER(write_joy3_5) { if (state) m_joy3 |= 32; else m_joy3 &= ~32; update_output(); }
45
46   DECLARE_WRITE_LINE_MEMBER(write_joy4_0) { if (state) m_joy4 |= 1; else m_joy4 &= ~1; update_output(); }
47   DECLARE_WRITE_LINE_MEMBER(write_joy4_1) { if (state) m_joy4 |= 2; else m_joy4 &= ~2; update_output(); }
48   DECLARE_WRITE_LINE_MEMBER(write_joy4_2) { if (state) m_joy4 |= 4; else m_joy4 &= ~4; update_output(); }
49   DECLARE_WRITE_LINE_MEMBER(write_joy4_3) { if (state) m_joy4 |= 8; else m_joy4 &= ~8; update_output(); }
50   DECLARE_WRITE_LINE_MEMBER(write_joy4_4) { if (state) m_joy4 |= 16; else m_joy4 &= ~16; update_output(); }
51   DECLARE_WRITE_LINE_MEMBER(write_joy4_5) { if (state) m_joy4 |= 32; else m_joy4 &= ~32; update_output(); }
52
53protected:
54   // device-level overrides
55   virtual void device_start();
56
57   // device_vic20_user_port_interface overrides
58   virtual DECLARE_WRITE_LINE_MEMBER( input_l );
59
60private:
61   void update_output();
62
63   int m_port;
64   UINT8 m_joy3;
65   UINT8 m_joy4;
66};
67
68
69// device type definition
70extern const device_type C64_4CGA;
71
72
73#endif
Property changes on: trunk/src/emu/bus/vic20/4cga.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/vic20/vic1011.c
r26919r26920
3434
3535static MACHINE_CONFIG_FRAGMENT( vic1011 )
3636   MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL)
37   MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, write_rxd))
38   MCFG_RS232_OUT_DCD_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, write_dcdin))
39   MCFG_RS232_OUT_CTS_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, write_cts))
40   MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, write_dsr))
37   MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, output_rxd))
38   MCFG_RS232_OUT_DCD_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, output_h))
39   MCFG_RS232_OUT_CTS_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, output_k))
40   MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, output_l))
4141MACHINE_CONFIG_END
4242
4343
r26919r26920
7777{
7878}
7979
80WRITE_LINE_MEMBER( vic1011_device::write_rxd )
80WRITE_LINE_MEMBER( vic1011_device::output_rxd )
8181{
82   m_slot->m_b_handler(!state);
83   m_slot->m_c_handler(!state);
82   output_b(!state);
83   output_c(!state);
8484}
8585
86void vic1011_device::write_d(int state)
86void vic1011_device::input_d(int state)
8787{
8888   m_rs232->rts_w(state);
8989}
9090
91void vic1011_device::write_e(int state)
91void vic1011_device::input_e(int state)
9292{
9393   m_rs232->dtr_w(state);
9494}
9595
96WRITE_LINE_MEMBER( vic1011_device::write_dcdin )
96void vic1011_device::input_j(int state)
9797{
98   m_slot->m_h_handler(state);
99}
100
101void vic1011_device::write_j(int state)
102{
10398   /// dcdout
10499}
105100
106WRITE_LINE_MEMBER( vic1011_device::write_cts )
101void vic1011_device::input_m(int state)
107102{
108   m_slot->m_k_handler(state);
109}
110
111WRITE_LINE_MEMBER( vic1011_device::write_dsr )
112{
113   m_slot->m_l_handler(state);
114}
115
116void vic1011_device::write_m(int state)
117{
118103   m_rs232->tx(!state);
119104}
trunk/src/emu/bus/c64/4cga.c
r26919r26920
1// license:BSD-3-Clause
2// copyright-holders:Curt Coder
3/**********************************************************************
4
5    Classical Games/Protovision 4 Player Interface emulation
6
7    http://www.protovision-online.com/hardw/4_player.htm
8    http://hitmen.c02.at/html/hardware.html
9
10    Copyright MESS Team.
11    Visit http://mamedev.org for licensing and usage restrictions.
12
13**********************************************************************/
14
15#include "4cga.h"
16
17
18
19//**************************************************************************
20//  DEVICE DEFINITIONS
21//**************************************************************************
22
23const device_type C64_4CGA = &device_creator<c64_4cga_device>;
24
25
26static INPUT_PORTS_START( c64_4player )
27   PORT_START("JOY3")
28   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
29   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
30   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
31   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
32   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
33
34   PORT_START("JOY4")
35   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
36   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
37   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
38   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
39   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
40
41   PORT_START("FIRE")
42   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
43   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
44   PORT_BIT( 0xcf, IP_ACTIVE_LOW, IPT_UNUSED )
45INPUT_PORTS_END
46
47
48//-------------------------------------------------
49//  input_ports - device-specific input ports
50//-------------------------------------------------
51
52ioport_constructor c64_4cga_device::device_input_ports() const
53{
54   return INPUT_PORTS_NAME( c64_4player );
55}
56
57
58
59//**************************************************************************
60//  LIVE DEVICE
61//**************************************************************************
62
63//-------------------------------------------------
64//  c64_4cga_device - constructor
65//-------------------------------------------------
66
67c64_4cga_device::c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
68   device_t(mconfig, C64_4CGA, "C64 Protovision 4 Player Interface", tag, owner, clock, "c64_4cga", __FILE__),
69   device_c64_user_port_interface(mconfig, *this),
70   m_fire(*this, "FIRE"),
71   m_joy3(*this, "JOY3"),
72   m_joy4(*this, "JOY4"),
73   m_port(0)
74{
75}
76
77
78//-------------------------------------------------
79//  device_start - device-specific startup
80//-------------------------------------------------
81
82void c64_4cga_device::device_start()
83{
84   // state saving
85   save_item(NAME(m_port));
86}
87
88
89//-------------------------------------------------
90//  c64_pb_r - port B read
91//-------------------------------------------------
92
93UINT8 c64_4cga_device::c64_pb_r(address_space &space, offs_t offset)
94{
95   UINT8 data = m_fire->read();
96
97   if (m_port)
98   {
99      data &= m_joy3->read();
100   }
101   else
102   {
103      data &= m_joy4->read();
104   }
105
106   return data;
107}
108
109
110//-------------------------------------------------
111//  c64_pb_w - port B write
112//-------------------------------------------------
113
114void c64_4cga_device::c64_pb_w(address_space &space, offs_t offset, UINT8 data)
115{
116   m_port = BIT(data, 7);
117}
trunk/src/emu/bus/c64/4cga.h
r26919r26920
1// license:BSD-3-Clause
2// copyright-holders:Curt Coder
3/**********************************************************************
4
5    Classical Games/Protovision 4 Player Interface emulation
6
7    Copyright MESS Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10**********************************************************************/
11
12#pragma once
13
14#ifndef __C64_4CGA__
15#define __C64_4CGA__
16
17
18#include "emu.h"
19#include "user.h"
20
21
22
23//**************************************************************************
24//  TYPE DEFINITIONS
25//**************************************************************************
26
27// ======================> c64_4cga_device
28
29class c64_4cga_device : public device_t,
30                  public device_c64_user_port_interface
31{
32public:
33   // construction/destruction
34   c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
35
36   // optional information overrides
37   virtual ioport_constructor device_input_ports() const;
38
39protected:
40   // device-level overrides
41   virtual void device_start();
42
43   // device_c64_user_port_interface overrides
44   virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
45   virtual void c64_pb_w(address_space &space, offs_t offset, UINT8 data);
46
47private:
48   required_ioport m_fire;
49   required_ioport m_joy3;
50   required_ioport m_joy4;
51
52   int m_port;
53};
54
55
56// device type definition
57extern const device_type C64_4CGA;
58
59
60#endif
trunk/src/emu/bus/c64/vic1011.c
r26919r26920
1// license:BSD-3-Clause
2// copyright-holders:Curt Coder
3/**********************************************************************
4
5    Commodore VIC-1011A/B RS-232C Adapter emulation
6
7    Copyright MESS Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10**********************************************************************/
11
12#include "vic1011.h"
13
14
15
16//**************************************************************************
17//  MACROS/CONSTANTS
18//**************************************************************************
19
20#define RS232_TAG       "rs232"
21
22
23
24//**************************************************************************
25//  DEVICE DEFINITIONS
26//**************************************************************************
27
28const device_type C64_VIC1011 = &device_creator<c64_vic1011_device>;
29
30
31//-------------------------------------------------
32//  MACHINE_DRIVER( vic1011 )
33//-------------------------------------------------
34
35static MACHINE_CONFIG_FRAGMENT( vic1011 )
36   MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL)
37   MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(DEVICE_SELF, c64_vic1011_device, rxd_w))
38MACHINE_CONFIG_END
39
40
41//-------------------------------------------------
42//  machine_config_additions - device-specific
43//  machine configurations
44//-------------------------------------------------
45
46machine_config_constructor c64_vic1011_device::device_mconfig_additions() const
47{
48   return MACHINE_CONFIG_NAME( vic1011 );
49}
50
51
52
53//**************************************************************************
54//  LIVE DEVICE
55//**************************************************************************
56
57//-------------------------------------------------
58//  c64_vic1011_device - constructor
59//-------------------------------------------------
60
61c64_vic1011_device::c64_vic1011_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
62   : device_t(mconfig, C64_VIC1011, "C64 VIC1011", tag, owner, clock, "c64_vic1011", __FILE__),
63      device_c64_user_port_interface(mconfig, *this),
64      m_rs232(*this, RS232_TAG)
65{
66}
67
68
69//-------------------------------------------------
70//  device_start - device-specific startup
71//-------------------------------------------------
72
73void c64_vic1011_device::device_start()
74{
75}
76
77
78//-------------------------------------------------
79//  c64_pb_r - port B read
80//-------------------------------------------------
81
82UINT8 c64_vic1011_device::c64_pb_r(address_space &space, offs_t offset)
83{
84   /*
85
86       bit     description
87
88       0       Sin
89       1
90       2
91       3
92       4       DCDin
93       5
94       6       CTS
95       7       DSR
96
97   */
98
99   UINT8 data = 0;
100
101   data |= !m_rs232->rx();
102   data |= m_rs232->dcd_r() << 4;
103   data |= m_rs232->cts_r() << 6;
104   data |= m_rs232->dsr_r() << 7;
105
106   return data;
107}
108
109
110//-------------------------------------------------
111//  c64_pb_w - port B write
112//-------------------------------------------------
113
114void c64_vic1011_device::c64_pb_w(address_space &space, offs_t offset, UINT8 data)
115{
116   /*
117
118       bit     description
119
120       0
121       1       RTS
122       2       DTR
123       3
124       4
125       5       DCDout
126       6
127       7
128
129   */
130
131   m_rs232->rts_w(BIT(data, 1));
132   m_rs232->dtr_w(BIT(data, 2));
133}
134
135
136//-------------------------------------------------
137//  c64_pa2_w - PA2 write
138//-------------------------------------------------
139
140void c64_vic1011_device::c64_pa2_w(int state)
141{
142   m_rs232->tx(!state);
143}
144
145
146//-------------------------------------------------
147//  rxd_w -
148//-------------------------------------------------
149
150WRITE_LINE_MEMBER( c64_vic1011_device::rxd_w )
151{
152   m_slot->cia_flag2_w(!state);
153}
trunk/src/emu/bus/c64/vic1011.h
r26919r26920
1// license:BSD-3-Clause
2// copyright-holders:Curt Coder
3/**********************************************************************
4
5    Commodore VIC-1011A/B RS-232C Adapter emulation
6
7    Copyright MESS Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10**********************************************************************/
11
12#pragma once
13
14#ifndef __C64_VIC1011__
15#define __C64_VIC1011__
16
17#include "emu.h"
18#include "user.h"
19#include "machine/serial.h"
20
21
22
23//**************************************************************************
24//  TYPE DEFINITIONS
25//**************************************************************************
26
27// ======================> c64_vic1011_device
28
29class c64_vic1011_device :  public device_t,
30                     public device_c64_user_port_interface
31{
32public:
33   // construction/destruction
34   c64_vic1011_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
35
36   // optional information overrides
37   virtual machine_config_constructor device_mconfig_additions() const;
38
39   DECLARE_WRITE_LINE_MEMBER( rxd_w );
40
41protected:
42   // device-level overrides
43   virtual void device_start();
44
45   // device_c64_user_port_interface overrides
46   virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
47   virtual void c64_pb_w(address_space &space, offs_t offset, UINT8 data);
48   virtual void c64_pa2_w(int state);
49
50private:
51   required_device<rs232_port_device> m_rs232;
52};
53
54
55// device type definition
56extern const device_type C64_VIC1011;
57
58
59
60#endif
trunk/src/emu/bus/c64/user.c
r26919r26920
1111
1212#include "user.h"
1313
14
15
16//**************************************************************************
17//  GLOBAL VARIABLES
18//**************************************************************************
19
20const device_type C64_USER_PORT = &device_creator<c64_user_port_device>;
21
22
23
24//**************************************************************************
25//  CARD INTERFACE
26//**************************************************************************
27
2814//-------------------------------------------------
29//  device_c64_user_port_interface - constructor
30//-------------------------------------------------
31
32device_c64_user_port_interface::device_c64_user_port_interface(const machine_config &mconfig, device_t &device)
33   : device_slot_card_interface(mconfig,device)
34{
35   m_slot = dynamic_cast<c64_user_port_device *>(device.owner());
36}
37
38
39//-------------------------------------------------
40//  ~device_c64_user_port_interface - destructor
41//-------------------------------------------------
42
43device_c64_user_port_interface::~device_c64_user_port_interface()
44{
45}
46
47
48
49//**************************************************************************
50//  LIVE DEVICE
51//**************************************************************************
52
53//-------------------------------------------------
54//  c64_user_port_device - constructor
55//-------------------------------------------------
56
57c64_user_port_device::c64_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
58      device_t(mconfig, C64_USER_PORT, "C64 user port", tag, owner, clock, "c64_user_port", __FILE__),
59      device_slot_interface(mconfig, *this),
60      m_write_cnt1(*this),
61      m_write_sp1(*this),
62      m_write_cnt2(*this),
63      m_write_sp2(*this),
64      m_write_flag2(*this),
65      m_write_reset(*this)
66{
67}
68
69
70//-------------------------------------------------
71//  device_start - device-specific startup
72//-------------------------------------------------
73
74void c64_user_port_device::device_start()
75{
76   m_card = dynamic_cast<device_c64_user_port_interface *>(get_card_device());
77
78   // resolve callbacks
79   m_write_cnt1.resolve_safe();
80   m_write_sp1.resolve_safe();
81   m_write_cnt2.resolve_safe();
82   m_write_sp2.resolve_safe();
83   m_write_flag2.resolve_safe();
84   m_write_reset.resolve_safe();
85}
86
87
88//-------------------------------------------------
89//  device_reset - device-specific reset
90//-------------------------------------------------
91
92void c64_user_port_device::device_reset()
93{
94   if (get_card_device())
95   {
96      get_card_device()->reset();
97   }
98}
99
100
101READ8_MEMBER( c64_user_port_device::pb_r ) { UINT8 data = 0xff; if (m_card != NULL) data = m_card->c64_pb_r(space, offset); return data; }
102WRITE8_MEMBER( c64_user_port_device::pb_w ) { if (m_card != NULL) m_card->c64_pb_w(space, offset, data); }
103READ_LINE_MEMBER( c64_user_port_device::pa2_r ) { int state = 1; if (m_card != NULL) state = m_card->c64_pa2_r(); return state; }
104WRITE_LINE_MEMBER( c64_user_port_device::pa2_w ) { if (m_card != NULL) m_card->c64_pa2_w(state); }
105WRITE_LINE_MEMBER( c64_user_port_device::pc2_w ) { if (m_card != NULL) m_card->c64_pc2_w(state); }
106WRITE_LINE_MEMBER( c64_user_port_device::atn_w ) { if (m_card != NULL) m_card->c64_atn_w(state); }
107WRITE_LINE_MEMBER( c64_user_port_device::cnt1_w ) { if (m_card != NULL) m_card->c64_cnt1_w(state); }
108WRITE_LINE_MEMBER( c64_user_port_device::sp1_w ) { if (m_card != NULL) m_card->c64_sp1_w(state); }
109WRITE_LINE_MEMBER( c64_user_port_device::cnt2_w ) { if (m_card != NULL) m_card->c64_cnt2_w(state); }
110WRITE_LINE_MEMBER( c64_user_port_device::sp2_w ) { if (m_card != NULL) m_card->c64_sp2_w(state); }
111
112
113//-------------------------------------------------
11415//  SLOT_INTERFACE( c64_user_port_cards )
11516//-------------------------------------------------
11617
18// slot devices
19#include "bus/vic20/4cga.h"
20#include "4dxh.h"
21#include "4ksa.h"
22#include "4tba.h"
23#include "bn1541.h"
24#include "geocable.h"
25#include "bus/vic20/vic1011.h"
26
11727SLOT_INTERFACE_START( c64_user_port_cards )
11828   SLOT_INTERFACE("4cga", C64_4CGA)
11929   SLOT_INTERFACE("4dxh", C64_4DXH)
r26919r26920
12131   SLOT_INTERFACE("4tba", C64_4TBA)
12232   SLOT_INTERFACE("bn1541", C64_BN1541)
12333   SLOT_INTERFACE("geocable", C64_GEOCABLE)
124   SLOT_INTERFACE("rs232", C64_VIC1011)
34   SLOT_INTERFACE("rs232", VIC1011)
12535SLOT_INTERFACE_END
trunk/src/emu/bus/c64/user.h
r26919r26920
2929#ifndef __C64_USER_PORT__
3030#define __C64_USER_PORT__
3131
32#include "emu.h"
32#include "bus/vic20/user.h"
3333
34
35
36//**************************************************************************
37//  CONSTANTS
38//**************************************************************************
39
40#define C64_USER_PORT_TAG       "user"
41
42
43
44//**************************************************************************
45//  INTERFACE CONFIGURATION MACROS
46//**************************************************************************
47
48#define MCFG_C64_USER_PORT_ADD(_tag, _slot_intf, _def_slot, _reset) \
49   MCFG_DEVICE_ADD(_tag, C64_USER_PORT, 0) \
50   downcast<c64_user_port_device *>(device)->set_reset_callback(DEVCB2_##_reset); \
51   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
52
53
54#define MCFG_C64_USER_PORT_CIA1_CALLBACKS(_cnt, _sp) \
55   downcast<c64_user_port_device *>(device)->set_cia1_callbacks(DEVCB2_##_cnt, DEVCB2_##_sp);
56
57#define MCFG_C64_USER_PORT_CIA2_CALLBACKS(_cnt, _sp, _flag) \
58   downcast<c64_user_port_device *>(device)->set_cia2_callbacks(DEVCB2_##_cnt, DEVCB2_##_sp, DEVCB2_##_flag);
59
60
61
62//**************************************************************************
63//  TYPE DEFINITIONS
64//**************************************************************************
65
66// ======================> c64_user_port_device
67
68class device_c64_user_port_interface;
69
70class c64_user_port_device : public device_t,
71                        public device_slot_interface
72{
73public:
74   // construction/destruction
75   c64_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
76
77   template<class _reset> void set_reset_callback(_reset reset) { m_write_reset.set_callback(reset); }
78
79   template<class _cnt, class _sp> void set_cia1_callbacks(_cnt cnt, _sp sp) {
80      m_write_cnt1.set_callback(cnt);
81      m_write_sp1.set_callback(sp);
82   }
83
84   template<class _cnt, class _sp, class _flag> void set_cia2_callbacks(_cnt cnt, _sp sp, _flag flag) {
85      m_write_cnt2.set_callback(cnt);
86      m_write_sp2.set_callback(sp);
87      m_write_flag2.set_callback(flag);
88   }
89
90   // computer interface
91   DECLARE_READ8_MEMBER( pb_r );
92   DECLARE_WRITE8_MEMBER( pb_w );
93   DECLARE_READ_LINE_MEMBER( pa2_r );
94   DECLARE_WRITE_LINE_MEMBER( pa2_w );
95   DECLARE_WRITE_LINE_MEMBER( pc2_w );
96   DECLARE_WRITE_LINE_MEMBER( atn_w );
97   DECLARE_WRITE_LINE_MEMBER( cnt1_w );
98   DECLARE_WRITE_LINE_MEMBER( sp1_w );
99   DECLARE_WRITE_LINE_MEMBER( cnt2_w );
100   DECLARE_WRITE_LINE_MEMBER( sp2_w );
101
102   // cartridge interface
103   DECLARE_WRITE_LINE_MEMBER( cia_cnt1_w ) { m_write_cnt1(state); }
104   DECLARE_WRITE_LINE_MEMBER( cia_sp1_w ) { m_write_sp1(state); }
105   DECLARE_WRITE_LINE_MEMBER( cia_cnt2_w ) { m_write_cnt2(state); }
106   DECLARE_WRITE_LINE_MEMBER( cia_sp2_w ) { m_write_sp2(state); }
107   DECLARE_WRITE_LINE_MEMBER( cia_flag2_w ) { m_write_flag2(state); }
108   DECLARE_WRITE_LINE_MEMBER( reset_w ) { m_write_reset(state); }
109
110protected:
111   // device-level overrides
112   virtual void device_start();
113   virtual void device_reset();
114
115   devcb2_write_line   m_write_cnt1;
116   devcb2_write_line   m_write_sp1;
117   devcb2_write_line   m_write_cnt2;
118   devcb2_write_line   m_write_sp2;
119   devcb2_write_line   m_write_flag2;
120   devcb2_write_line   m_write_reset;
121
122   device_c64_user_port_interface *m_card;
123};
124
125
126// ======================> device_c64_user_port_interface
127
128// class representing interface-specific live c64_expansion card
129class device_c64_user_port_interface : public device_slot_card_interface
130{
131public:
132   // construction/destruction
133   device_c64_user_port_interface(const machine_config &mconfig, device_t &device);
134   virtual ~device_c64_user_port_interface();
135
136   virtual UINT8 c64_pb_r(address_space &space, offs_t offset) { return 0xff; };
137   virtual void c64_pb_w(address_space &space, offs_t offset, UINT8 data) { };
138
139   virtual int c64_pa2_r() { return 1; };
140   virtual void c64_pa2_w(int state) { };
141   virtual void c64_cnt1_w(int state) { };
142   virtual void c64_sp1_w(int state) { };
143   virtual void c64_pc2_w(int state) { };
144   virtual void c64_cnt2_w(int state) { };
145   virtual void c64_sp2_w(int state) { };
146   virtual void c64_atn_w(int state) { };
147
148protected:
149   c64_user_port_device *m_slot;
150};
151
152
153// device type definition
154extern const device_type C64_USER_PORT;
155
156
157// slot devices
158#include "4cga.h"
159#include "4dxh.h"
160#include "4ksa.h"
161#include "4tba.h"
162#include "bn1541.h"
163#include "geocable.h"
164#include "vic1011.h"
165
16634SLOT_INTERFACE_EXTERN( c64_user_port_cards );
16735
168
169
17036#endif
trunk/src/emu/bus/c64/4ksa.c
r26919r26920
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_OWNER, c64_user_port_device, cia_sp2_w)
31   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_7)
3232
3333   PORT_START("PB")
34   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
35   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
36   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
37   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
38   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
39   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
40   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
41   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
34   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_c)
35   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_d)
36   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_e)
37   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_f)
38   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_h)
39   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_j)
40   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_k)
41   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_l)
4242
4343   PORT_START("PA2")
44   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
44   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_m)
4545INPUT_PORTS_END
4646
4747
r26919r26920
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_c64_user_port_interface(mconfig, *this),
70   m_pb(*this, "PB"),
71   m_pa2(*this, "PA2")
69   device_vic20_user_port_interface(mconfig, *this)
7270{
7371}
7472
r26919r26920
8078void c64_4ksa_device::device_start()
8179{
8280}
83
84
85//-------------------------------------------------
86//  c64_pb_r - port B read
87//-------------------------------------------------
88
89UINT8 c64_4ksa_device::c64_pb_r(address_space &space, offs_t offset)
90{
91   return m_pb->read();
92}
93
94
95//-------------------------------------------------
96//  c64_pb_w - port B write
97//-------------------------------------------------
98
99int c64_4ksa_device::c64_pa2_r()
100{
101   return BIT(m_pa2->read(), 0);
102}
103
104
105//-------------------------------------------------
106//  c64_cnt1_w - CNT 1 write
107//-------------------------------------------------
108
109void c64_4ksa_device::c64_cnt1_w(int level)
110{
111   m_slot->cia_cnt2_w(level);
112}
trunk/src/emu/bus/c64/4ksa.h
r26919r26920
2727// ======================> c64_4ksa_device
2828
2929class c64_4ksa_device : public device_t,
30                  public device_c64_user_port_interface
30   public device_vic20_user_port_interface
3131{
3232public:
3333   // construction/destruction
r26919r26920
3939protected:
4040   // device-level overrides
4141   virtual void device_start();
42
43   // device_c64_user_port_interface overrides
44   virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
45   virtual int c64_pa2_r();
46   virtual void c64_cnt1_w(int level);
47
48private:
49   required_ioport m_pb;
50   required_ioport m_pa2;
5142};
5243
5344
trunk/src/emu/bus/c64/4tba.c
r26919r26920
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_OWNER, c64_user_port_device, cia_sp2_w)
31   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_7)
3232
3333   PORT_START("PB")
34   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
35   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
36   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
37   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
38   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
39   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
40   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
41   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
34   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_c)
35   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_d)
36   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_e)
37   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_f)
38   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_h)
39   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_j)
40   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_k)
41   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_l)
4242
4343   PORT_START("PA2")
44   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
44   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_m)
4545INPUT_PORTS_END
4646
4747
r26919r26920
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_c64_user_port_interface(mconfig, *this),
70   m_pb(*this, "PB"),
71   m_pa2(*this, "PA2")
69   device_vic20_user_port_interface(mconfig, *this)
7270{
7371}
7472
r26919r26920
8078void c64_4tba_device::device_start()
8179{
8280}
83
84
85//-------------------------------------------------
86//  c64_pb_r - port B read
87//-------------------------------------------------
88
89UINT8 c64_4tba_device::c64_pb_r(address_space &space, offs_t offset)
90{
91   return m_pb->read();
92}
93
94
95//-------------------------------------------------
96//  c64_pb_w - port B write
97//-------------------------------------------------
98
99int c64_4tba_device::c64_pa2_r()
100{
101   return BIT(m_pa2->read(), 0);
102}
103
104
105//-------------------------------------------------
106//  c64_cnt1_w - CNT 1 write
107//-------------------------------------------------
108
109void c64_4tba_device::c64_cnt1_w(int level)
110{
111   m_slot->cia_cnt2_w(level);
112}
trunk/src/emu/bus/c64/4tba.h
r26919r26920
2727// ======================> c64_4tba_device
2828
2929class c64_4tba_device : public device_t,
30                  public device_c64_user_port_interface
30                  public device_vic20_user_port_interface
3131{
3232public:
3333   // construction/destruction
r26919r26920
3939protected:
4040   // device-level overrides
4141   virtual void device_start();
42
43   // device_c64_user_port_interface overrides
44   virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
45   virtual int c64_pa2_r();
46   virtual void c64_cnt1_w(int level);
47
48private:
49   required_ioport m_pb;
50   required_ioport m_pa2;
5142};
5243
5344
trunk/src/emu/bus/c64/4dxh.c
r26919r26920
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_OWNER, c64_user_port_device, cia_sp2_w)
31   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_7)
3232
3333   PORT_START("PB")
34   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
35   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
36   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
37   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
38   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
39   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
40   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
41   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
34   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_c)
35   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_d)
36   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_e)
37   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_f)
38   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_h)
39   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_j)
40   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_k)
41   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_l)
4242
4343   PORT_START("PA2")
44   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
44   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_m)
4545INPUT_PORTS_END
4646
4747
r26919r26920
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_c64_user_port_interface(mconfig, *this),
70   m_pb(*this, "PB"),
71   m_pa2(*this, "PA2")
69   device_vic20_user_port_interface(mconfig, *this)
7270{
7371}
7472
r26919r26920
8078void c64_4dxh_device::device_start()
8179{
8280}
83
84
85//-------------------------------------------------
86//  c64_pb_r - port B read
87//-------------------------------------------------
88
89UINT8 c64_4dxh_device::c64_pb_r(address_space &space, offs_t offset)
90{
91   return m_pb->read();
92}
93
94
95//-------------------------------------------------
96//  c64_pb_w - port B write
97//-------------------------------------------------
98
99int c64_4dxh_device::c64_pa2_r()
100{
101   return BIT(m_pa2->read(), 0);
102}
103
104
105//-------------------------------------------------
106//  c64_cnt1_w - CNT 1 write
107//-------------------------------------------------
108
109void c64_4dxh_device::c64_cnt1_w(int level)
110{
111   m_slot->cia_cnt2_w(level);
112}
trunk/src/emu/bus/c64/bn1541.c
r26919r26920
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_c64_user_port_interface(mconfig, *this),
68   device_vic20_user_port_interface(mconfig, *this),
6969   device_c64_floppy_parallel_interface(mconfig, *this)
7070{
7171}
r26919r26920
106106{
107107   if (LOG) logerror("1541 parallel data %02x\n", data);
108108
109   m_parallel_data = data;
109   output_c((data>>0)&1);
110   output_d((data>>1)&1);
111   output_e((data>>2)&1);
112   output_f((data>>3)&1);
113   output_h((data>>4)&1);
114   output_j((data>>5)&1);
115   output_k((data>>6)&1);
116   output_l((data>>7)&1);
110117}
111118
112119
r26919r26920
118125{
119126   if (LOG) logerror("1541 parallel strobe %u\n", state);
120127
121   m_slot->cia_flag2_w(state);
128   output_b(state);
122129}
123130
124131
125132//-------------------------------------------------
126//  c64_pb_r - port B read
133//  update_output
127134//-------------------------------------------------
128135
129UINT8 c64_bn1541_device::c64_pb_r(address_space &space, offs_t offset)
136void c64_bn1541_device::update_output()
130137{
131   return m_parallel_data;
132}
133
134
135//-------------------------------------------------
136//  c64_pb_w - port B write
137//-------------------------------------------------
138
139void c64_bn1541_device::c64_pb_w(address_space &space, offs_t offset, UINT8 data)
140{
141   if (LOG) logerror("C64 parallel data %02x\n", data);
142
143138   if (m_other != NULL)
144139   {
145      m_other->parallel_data_w(data);
140      m_other->parallel_data_w(m_parallel_output);
146141   }
147142}
148143
149144
150145//-------------------------------------------------
151//  c64_pc2_w - CIA2 PC write
146//  input_8 - CIA2 PC write
152147//-------------------------------------------------
153148
154void c64_bn1541_device::c64_pc2_w(int state)
149WRITE_LINE_MEMBER(c64_bn1541_device::input_8)
155150{
156151   if (LOG) logerror("C64 parallel strobe %u\n", state);
157152
trunk/src/emu/bus/c64/4dxh.h
r26919r26920
2727// ======================> c64_4dxh_device
2828
2929class c64_4dxh_device : public device_t,
30                  public device_c64_user_port_interface
30   public device_vic20_user_port_interface
3131{
3232public:
3333   // construction/destruction
r26919r26920
3939protected:
4040   // device-level overrides
4141   virtual void device_start();
42
43   // device_c64_user_port_interface overrides
44   virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
45   virtual int c64_pa2_r();
46   virtual void c64_cnt1_w(int level);
47
48private:
49   required_ioport m_pb;
50   required_ioport m_pa2;
5142};
5243
5344
trunk/src/emu/bus/c64/bn1541.h
r26919r26920
4646// ======================> c64_bn1541_device
4747
4848class c64_bn1541_device : public device_t,
49                     public device_c64_user_port_interface,
50                     public device_c64_floppy_parallel_interface
49   public device_vic20_user_port_interface,
50   public device_c64_floppy_parallel_interface
5151{
5252public:
5353   // construction/destruction
r26919r26920
5757   // device-level overrides
5858   virtual void device_start();
5959
60   // device_c64_user_port_interface overrides
61   virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
62   virtual void c64_pb_w(address_space &space, offs_t offset, UINT8 data);
63   virtual void c64_pc2_w(int level);
64
6560   // device_c64_floppy_parallel_interface overrides
6661   virtual void parallel_data_w(UINT8 data);
6762   virtual void parallel_strobe_w(int state);
63
64   virtual DECLARE_WRITE_LINE_MEMBER(input_8);
65   virtual WRITE_LINE_MEMBER(input_c) { if (state) m_parallel_output |= 1; else m_parallel_output &= ~1; update_output(); }
66   virtual WRITE_LINE_MEMBER(input_d) { if (state) m_parallel_output |= 2; else m_parallel_output &= ~2; update_output(); }
67   virtual WRITE_LINE_MEMBER(input_e) { if (state) m_parallel_output |= 4; else m_parallel_output &= ~4; update_output(); }
68   virtual WRITE_LINE_MEMBER(input_f) { if (state) m_parallel_output |= 8; else m_parallel_output &= ~8; update_output(); }
69   virtual WRITE_LINE_MEMBER(input_h) { if (state) m_parallel_output |= 16; else m_parallel_output &= ~16; update_output(); }
70   virtual WRITE_LINE_MEMBER(input_j) { if (state) m_parallel_output |= 32; else m_parallel_output &= ~32; update_output(); }
71   virtual WRITE_LINE_MEMBER(input_k) { if (state) m_parallel_output |= 64; else m_parallel_output &= ~64; update_output(); }
72   virtual WRITE_LINE_MEMBER(input_l) { if (state) m_parallel_output |= 128; else m_parallel_output &= ~128; update_output(); }
73
74private:
75   void update_output();
76   UINT8 m_parallel_output;
6877};
6978
7079
trunk/src/emu/bus/c64/geocable.c
r26919r26920
1// license:BSD-3-Clause
1   // license:BSD-3-Clause
22// copyright-holders:Curt Coder
33/**********************************************************************
44
r26919r26920
3434
3535WRITE_LINE_MEMBER( c64_geocable_device::busy_w )
3636{
37   m_slot->cia_flag2_w(state);
37   output_b(state);
3838}
3939
4040static const centronics_interface centronics_intf =
r26919r26920
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_c64_user_port_interface(mconfig, *this),
79   device_vic20_user_port_interface(mconfig, *this),
8080   m_centronics(*this, CENTRONICS_TAG)
8181{
8282}
r26919r26920
9292
9393
9494//-------------------------------------------------
95//  c64_pb_w - port B write
95//  update_output
9696//-------------------------------------------------
9797
98void c64_geocable_device::c64_pb_w(address_space &space, offs_t offset, UINT8 data)
98void c64_geocable_device::update_output()
9999{
100   m_centronics->write(space, 0, data);
100   m_centronics->write(m_parallel_output);
101101}
102102
103103
104104//-------------------------------------------------
105//  c64_pb_w - port B write
105//  input_8 - CIA2 PC write
106106//-------------------------------------------------
107107
108void c64_geocable_device::c64_pa2_w(int level)
108WRITE_LINE_MEMBER(c64_geocable_device::input_8)
109109{
110   m_centronics->strobe_w(level);
110   m_centronics->strobe_w(state);
111111}
trunk/src/emu/bus/c64/geocable.h
r26919r26920
2828// ======================> c64_geocable_device
2929
3030class c64_geocable_device : public device_t,
31                     public device_c64_user_port_interface
31                     public device_vic20_user_port_interface
3232{
3333public:
3434   // construction/destruction
r26919r26920
4444   // device-level overrides
4545   virtual void device_start();
4646
47   // device_c64_user_port_interface overrides
48   virtual void c64_pb_w(address_space &space, offs_t offset, UINT8 data);
49   virtual void c64_pa2_w(int level);
47   // device_vic20_user_port_interface overrides
48   virtual DECLARE_WRITE_LINE_MEMBER(input_8);
49   virtual WRITE_LINE_MEMBER(input_c) { if (state) m_parallel_output |= 1; else m_parallel_output &= ~1; update_output(); }
50   virtual WRITE_LINE_MEMBER(input_d) { if (state) m_parallel_output |= 2; else m_parallel_output &= ~2; update_output(); }
51   virtual WRITE_LINE_MEMBER(input_e) { if (state) m_parallel_output |= 4; else m_parallel_output &= ~4; update_output(); }
52   virtual WRITE_LINE_MEMBER(input_f) { if (state) m_parallel_output |= 8; else m_parallel_output &= ~8; update_output(); }
53   virtual WRITE_LINE_MEMBER(input_h) { if (state) m_parallel_output |= 16; else m_parallel_output &= ~16; update_output(); }
54   virtual WRITE_LINE_MEMBER(input_j) { if (state) m_parallel_output |= 32; else m_parallel_output &= ~32; update_output(); }
55   virtual WRITE_LINE_MEMBER(input_k) { if (state) m_parallel_output |= 64; else m_parallel_output &= ~64; update_output(); }
56   virtual WRITE_LINE_MEMBER(input_l) { if (state) m_parallel_output |= 128; else m_parallel_output &= ~128; update_output(); }
5057
5158private:
5259   required_device<centronics_device> m_centronics;
60
61   void update_output();
62
63   UINT8 m_parallel_output;
5364};
5465
5566
trunk/src/emu/bus/bus.mak
r26919r26920
147147BUSOBJS += $(BUSOBJ)/c64/xl80.o
148148BUSOBJS += $(BUSOBJ)/c64/zaxxon.o
149149BUSOBJS += $(BUSOBJ)/c64/user.o
150BUSOBJS += $(BUSOBJ)/c64/4cga.o
151150BUSOBJS += $(BUSOBJ)/c64/4dxh.o
152151BUSOBJS += $(BUSOBJ)/c64/4ksa.o
153152BUSOBJS += $(BUSOBJ)/c64/4tba.o
154153BUSOBJS += $(BUSOBJ)/c64/16kb.o
155154BUSOBJS += $(BUSOBJ)/c64/bn1541.o
156155BUSOBJS += $(BUSOBJ)/c64/geocable.o
157BUSOBJS += $(BUSOBJ)/c64/vic1011.o
158156endif
159157
160158
r26919r26920
426424BUSOBJS += $(BUSOBJ)/vic20/vic1112.o
427425BUSOBJS += $(BUSOBJ)/vic20/vic1210.o
428426BUSOBJS += $(BUSOBJ)/vic20/user.o
427BUSOBJS += $(BUSOBJ)/vic20/4cga.o
429428BUSOBJS += $(BUSOBJ)/vic20/vic1011.o
430429endif
431430
trunk/src/mess/drivers/vic20.c
r26919r26920
563563
564564WRITE_LINE_MEMBER( vic20_state::exp_reset_w )
565565{
566   if (state == ASSERT_LINE)
566   if (!state)
567567   {
568568      machine_reset();
569569   }
r26919r26920
672672   MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE(M6502_TAG, m6502_device, irq_line))
673673
674674   MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(M6522_2_TAG, via6522_device, write_ca1))
675   MCFG_CBM_IEC_ADD("c1541")
675   MCFG_CBM_IEC_ADD(NULL)
676//   MCFG_CBM_IEC_ADD("c1541") - breaks quick load
676677   MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(M6522_2_TAG, via6522_device, write_cb1))
677678
678679   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy")
trunk/src/mess/drivers/c128.c
r26919r26920
10961096WRITE_LINE_MEMBER( c128_state::cia1_cnt_w )
10971097{
10981098   m_cnt1 = state;
1099   m_user->write_4(state);
10991100
11001101   update_iec();
11011102}
r26919r26920
11031104WRITE_LINE_MEMBER( c128_state::cia1_sp_w )
11041105{
11051106   m_sp1 = state;
1107   m_user->write_5(state);
11061108
11071109   update_iec();
11081110}
r26919r26920
11391141   UINT8 data = 0;
11401142
11411143   // user port
1142   data |= m_user->pa2_r() << 2;
1144   data |= m_user_pa2 << 2;
11431145
11441146   // IEC bus
11451147   data |= m_iec->clk_r() << 6;
r26919r26920
11701172   m_va15 = BIT(data, 1);
11711173
11721174   // user port
1173   m_user->pa2_w(BIT(data, 2));
1175   m_user->write_m(BIT(data, 2));
11741176
11751177   // IEC bus
11761178   m_iec->atn_w(!BIT(data, 3));
r26919r26920
11801182   update_iec();
11811183}
11821184
1185READ8_MEMBER( c128_state::cia2_pb_r )
1186{
1187   return m_user_pb;
1188}
11831189
1190WRITE8_MEMBER( c128_state::cia2_pb_w )
1191{
1192   m_user->write_c((data>>0)&1);
1193   m_user->write_d((data>>1)&1);
1194   m_user->write_e((data>>2)&1);
1195   m_user->write_f((data>>3)&1);
1196   m_user->write_h((data>>4)&1);
1197   m_user->write_j((data>>5)&1);
1198   m_user->write_k((data>>6)&1);
1199   m_user->write_l((data>>7)&1);
1200}
1201
11841202//-------------------------------------------------
11851203//  M6510_INTERFACE( cpu_intf )
11861204//-------------------------------------------------
r26919r26920
14631481   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia1_pa_r), NULL)
14641482   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia1_pb_r), WRITE8(c128_state, cia1_pb_w), NULL)
14651483   MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c128_state, cia2_irq_w))
1466   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
1484   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_6), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_7))
14671485   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia2_pa_r), WRITE8(c128_state, cia2_pa_w))
1468   MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
1486   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia2_pb_r), WRITE8(c128_state, cia2_pb_w), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_8))
14691487   MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
14701488   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
14711489   MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS8564_TAG, mos8564_device, lp_w))
r26919r26920
14731491   MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6567_CLOCK, c64_expansion_cards, NULL)
14741492   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c128_state, exp_irq_w), WRITELINE(c128_state, exp_nmi_w), WRITELINE(c128_state, exp_reset_w))
14751493   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c128_state, exp_dma_cd_r), WRITE8(c128_state, exp_dma_cd_w), WRITELINE(c128_state, exp_dma_w))
1476   MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, WRITELINE(c128_state, exp_reset_w))
1477   MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
1478   MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
1494
1495   MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, c64_user_port_cards, NULL)
1496   MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(c128_state, exp_reset_w))
1497   MCFG_VIC20_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w))
1498   MCFG_VIC20_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
1499   MCFG_VIC20_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w))
1500   MCFG_VIC20_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w))
1501   MCFG_VIC20_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w))
1502   MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
1503   MCFG_VIC20_USER_PORT_C_HANDLER(WRITELINE(c128_state, write_user_pb0))
1504   MCFG_VIC20_USER_PORT_D_HANDLER(WRITELINE(c128_state, write_user_pb1))
1505   MCFG_VIC20_USER_PORT_E_HANDLER(WRITELINE(c128_state, write_user_pb2))
1506   MCFG_VIC20_USER_PORT_F_HANDLER(WRITELINE(c128_state, write_user_pb3))
1507   MCFG_VIC20_USER_PORT_H_HANDLER(WRITELINE(c128_state, write_user_pb4))
1508   MCFG_VIC20_USER_PORT_J_HANDLER(WRITELINE(c128_state, write_user_pb5))
1509   MCFG_VIC20_USER_PORT_K_HANDLER(WRITELINE(c128_state, write_user_pb6))
1510   MCFG_VIC20_USER_PORT_L_HANDLER(WRITELINE(c128_state, write_user_pb7))
1511   MCFG_VIC20_USER_PORT_M_HANDLER(WRITELINE(c128_state, write_user_pa2))
1512
14791513   MCFG_QUICKLOAD_ADD("quickload", c128_state, cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
14801514
14811515   // software list
r26919r26920
15781612   MCFG_MOS6526_SERIAL_CALLBACKS(WRITELINE(c128_state, cia1_cnt_w), WRITELINE(c128_state, cia1_sp_w))
15791613   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia1_pa_r), NULL)
15801614   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia1_pb_r), WRITE8(c128_state, cia1_pb_w), NULL)
1581   MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, WRITELINE(c128_state, cia2_irq_w))
1582   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
1615   MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c128_state, cia2_irq_w))
1616   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_6), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_7))
15831617   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia2_pa_r), WRITE8(c128_state, cia2_pa_w))
1584   MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
1618   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia2_pb_r), WRITE8(c128_state, cia2_pb_w), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_8))
15851619   MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
15861620   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
15871621   MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS8566_TAG, mos8566_device, lp_w))
r26919r26920
15891623   MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, c64_expansion_cards, NULL)
15901624   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c128_state, exp_irq_w), WRITELINE(c128_state, exp_nmi_w), WRITELINE(c128_state, exp_reset_w))
15911625   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c128_state, exp_dma_cd_r), WRITE8(c128_state, exp_dma_cd_w), WRITELINE(c128_state, exp_dma_w))
1592   MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, WRITELINE(c128_state, exp_reset_w))
1593   MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
1594   MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
1626
1627   MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, c64_user_port_cards, NULL)
1628   MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(c128_state, exp_reset_w))
1629   MCFG_VIC20_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w))
1630   MCFG_VIC20_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
1631   MCFG_VIC20_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w))
1632   MCFG_VIC20_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w))
1633   MCFG_VIC20_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w))
1634   MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
1635   MCFG_VIC20_USER_PORT_C_HANDLER(WRITELINE(c128_state, write_user_pb0))
1636   MCFG_VIC20_USER_PORT_D_HANDLER(WRITELINE(c128_state, write_user_pb1))
1637   MCFG_VIC20_USER_PORT_E_HANDLER(WRITELINE(c128_state, write_user_pb2))
1638   MCFG_VIC20_USER_PORT_F_HANDLER(WRITELINE(c128_state, write_user_pb3))
1639   MCFG_VIC20_USER_PORT_H_HANDLER(WRITELINE(c128_state, write_user_pb4))
1640   MCFG_VIC20_USER_PORT_J_HANDLER(WRITELINE(c128_state, write_user_pb5))
1641   MCFG_VIC20_USER_PORT_K_HANDLER(WRITELINE(c128_state, write_user_pb6))
1642   MCFG_VIC20_USER_PORT_L_HANDLER(WRITELINE(c128_state, write_user_pb7))
1643   MCFG_VIC20_USER_PORT_M_HANDLER(WRITELINE(c128_state, write_user_pa2))
1644
15951645   MCFG_QUICKLOAD_ADD("quickload", c128_state, cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
15961646
15971647   // software list
trunk/src/mess/drivers/c64.c
r26919r26920
769769   UINT8 data = 0;
770770
771771   // user port
772   data |= m_user->pa2_r() << 2;
772   data |= m_user_pa2 << 2;
773773
774774   // IEC bus
775775   data |= m_iec->clk_r() << 6;
r26919r26920
800800   m_va15 = BIT(data, 1);
801801
802802   // user port
803   m_user->pa2_w(BIT(data, 2));
803   m_user->write_m(BIT(data, 2));
804804
805805   // IEC bus
806806   m_iec->atn_w(!BIT(data, 3));
r26919r26920
808808   m_iec->data_w(!BIT(data, 5));
809809}
810810
811READ8_MEMBER( c64_state::cia2_pb_r )
812{
813   return m_user_pb;
814}
811815
816WRITE8_MEMBER( c64_state::cia2_pb_w )
817{
818   m_user->write_c((data>>0)&1);
819   m_user->write_d((data>>1)&1);
820   m_user->write_e((data>>2)&1);
821   m_user->write_f((data>>3)&1);
822   m_user->write_h((data>>4)&1);
823   m_user->write_j((data>>5)&1);
824   m_user->write_k((data>>6)&1);
825   m_user->write_l((data>>7)&1);
826}
827
812828//-------------------------------------------------
813829//  M6510_INTERFACE( cpu_intf )
814830//-------------------------------------------------
r26919r26920
10321048   save_item(NAME(m_exp_irq));
10331049   save_item(NAME(m_exp_nmi));
10341050   save_item(NAME(m_exp_dma));
1051   save_item(NAME(m_user_pb));
1052   save_item(NAME(m_user_pa2));
10351053}
10361054
10371055
r26919r26920
10791097   // devices
10801098   MCFG_PLS100_ADD(PLA_TAG)
10811099   MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6567_CLOCK, 60, WRITELINE(c64_state, cia1_irq_w))
1082   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt1_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp1_w))
1100   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_4), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_5))
10831101   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL)
10841102   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL)
10851103   MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c64_state, cia2_irq_w))
1086   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
1104   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_6), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_7))
10871105   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia2_pa_r), WRITE8(c64_state, cia2_pa_w))
1088   MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
1106   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia2_pb_r), WRITE8(c64_state, cia2_pb_w), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_8))
10891107   MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
10901108   MCFG_CBM_IEC_ADD("c1541")
10911109   MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
1092   MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, atn_w))
1110   MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_9))
10931111   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
10941112   MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6567_TAG, mos6567_device, lp_w))
10951113   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
10961114   MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6567_CLOCK, c64_expansion_cards, NULL)
10971115   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c64_state, exp_irq_w), WRITELINE(c64_state, exp_nmi_w), WRITELINE(c64_state, exp_reset_w))
10981116   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w))
1099   MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, WRITELINE(c64_state, exp_reset_w))
1100   MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
1101   MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
1117
1118   MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, c64_user_port_cards, NULL)
1119   MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(c64_state, exp_reset_w))
1120   MCFG_VIC20_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w))
1121   MCFG_VIC20_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
1122   MCFG_VIC20_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w))
1123   MCFG_VIC20_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w))
1124   MCFG_VIC20_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w))
1125   MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
1126   MCFG_VIC20_USER_PORT_C_HANDLER(WRITELINE(c64_state, write_user_pb0))
1127   MCFG_VIC20_USER_PORT_D_HANDLER(WRITELINE(c64_state, write_user_pb1))
1128   MCFG_VIC20_USER_PORT_E_HANDLER(WRITELINE(c64_state, write_user_pb2))
1129   MCFG_VIC20_USER_PORT_F_HANDLER(WRITELINE(c64_state, write_user_pb3))
1130   MCFG_VIC20_USER_PORT_H_HANDLER(WRITELINE(c64_state, write_user_pb4))
1131   MCFG_VIC20_USER_PORT_J_HANDLER(WRITELINE(c64_state, write_user_pb5))
1132   MCFG_VIC20_USER_PORT_K_HANDLER(WRITELINE(c64_state, write_user_pb6))
1133   MCFG_VIC20_USER_PORT_L_HANDLER(WRITELINE(c64_state, write_user_pb7))
1134   MCFG_VIC20_USER_PORT_M_HANDLER(WRITELINE(c64_state, write_user_pa2))
1135
11021136   MCFG_QUICKLOAD_ADD("quickload", c64_state, cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
11031137
11041138   // software list
r26919r26920
11921226   // devices
11931227   MCFG_PLS100_ADD(PLA_TAG)
11941228   MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, WRITELINE(c64_state, cia1_irq_w))
1195   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt1_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp1_w))
1229   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_4), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_5))
11961230   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL)
11971231   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL)
1198   MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, WRITELINE(c64_state, cia2_irq_w))
1199   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
1232   MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c64_state, cia2_irq_w))
1233   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_6), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_7))
12001234   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia2_pa_r), WRITE8(c64_state, cia2_pa_w))
1201   MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
1235   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia2_pb_r), WRITE8(c64_state, cia2_pb_w), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_8))
12021236   MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
12031237   MCFG_CBM_IEC_ADD("c1541")
12041238   MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
1205   MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, atn_w))
1239   MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_9))
12061240   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
12071241   MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w))
12081242   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
12091243   MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, c64_expansion_cards, NULL)
12101244   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c64_state, exp_irq_w), WRITELINE(c64_state, exp_nmi_w), WRITELINE(c64_state, exp_reset_w))
12111245   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w))
1212   MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, WRITELINE(c64_state, exp_reset_w))
1213   MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
1214   MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
1246
1247   MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, c64_user_port_cards, NULL)
1248   MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(c64_state, exp_reset_w))
1249   MCFG_VIC20_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w))
1250   MCFG_VIC20_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
1251   MCFG_VIC20_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w))
1252   MCFG_VIC20_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w))
1253   MCFG_VIC20_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w))
1254   MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
1255   MCFG_VIC20_USER_PORT_C_HANDLER(WRITELINE(c64_state, write_user_pb0))
1256   MCFG_VIC20_USER_PORT_D_HANDLER(WRITELINE(c64_state, write_user_pb1))
1257   MCFG_VIC20_USER_PORT_E_HANDLER(WRITELINE(c64_state, write_user_pb2))
1258   MCFG_VIC20_USER_PORT_F_HANDLER(WRITELINE(c64_state, write_user_pb3))
1259   MCFG_VIC20_USER_PORT_H_HANDLER(WRITELINE(c64_state, write_user_pb4))
1260   MCFG_VIC20_USER_PORT_J_HANDLER(WRITELINE(c64_state, write_user_pb5))
1261   MCFG_VIC20_USER_PORT_K_HANDLER(WRITELINE(c64_state, write_user_pb6))
1262   MCFG_VIC20_USER_PORT_L_HANDLER(WRITELINE(c64_state, write_user_pb7))
1263   MCFG_VIC20_USER_PORT_M_HANDLER(WRITELINE(c64_state, write_user_pa2))
1264
12151265   MCFG_QUICKLOAD_ADD("quickload", c64_state, cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
12161266
12171267   // software list
r26919r26920
12831333   // devices
12841334   MCFG_PLS100_ADD(PLA_TAG)
12851335   MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, WRITELINE(c64_state, cia1_irq_w))
1286   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt1_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp1_w))
1287   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64gs_state, cia1_pa_r), NULL)
1288   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64gs_state, cia1_pb_r), NULL, NULL)
1289   MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, WRITELINE(c64_state, cia2_irq_w))
1290   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
1336   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_4), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_5))
1337   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL)
1338   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL)
1339   MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c64_state, cia2_irq_w))
1340   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_6), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_7))
12911341   MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia2_pa_r), WRITE8(c64_state, cia2_pa_w))
1292   MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
1342   MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia2_pb_r), WRITE8(c64_state, cia2_pb_w), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_8))
12931343   MCFG_CBM_IEC_ADD(NULL)
12941344   MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
1295   MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, atn_w))
1296
1345   MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_9))
12971346   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
12981347   MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w))
12991348   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
13001349   MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, c64_expansion_cards, NULL)
13011350   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c64_state, exp_irq_w), WRITELINE(c64_state, exp_nmi_w), WRITELINE(c64_state, exp_reset_w))
13021351   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w))
1303   MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, WRITELINE(c64_state, exp_reset_w))
1304   MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
1305   MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
1352
1353   MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, c64_user_port_cards, NULL)
1354   MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(c64_state, exp_reset_w))
1355   MCFG_VIC20_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w))
1356   MCFG_VIC20_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
1357   MCFG_VIC20_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w))
1358   MCFG_VIC20_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w))
1359   MCFG_VIC20_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w))
1360   MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
1361   MCFG_VIC20_USER_PORT_C_HANDLER(WRITELINE(c64_state, write_user_pb0))
1362   MCFG_VIC20_USER_PORT_D_HANDLER(WRITELINE(c64_state, write_user_pb1))
1363   MCFG_VIC20_USER_PORT_E_HANDLER(WRITELINE(c64_state, write_user_pb2))
1364   MCFG_VIC20_USER_PORT_F_HANDLER(WRITELINE(c64_state, write_user_pb3))
1365   MCFG_VIC20_USER_PORT_H_HANDLER(WRITELINE(c64_state, write_user_pb4))
1366   MCFG_VIC20_USER_PORT_J_HANDLER(WRITELINE(c64_state, write_user_pb5))
1367   MCFG_VIC20_USER_PORT_K_HANDLER(WRITELINE(c64_state, write_user_pb6))
1368   MCFG_VIC20_USER_PORT_L_HANDLER(WRITELINE(c64_state, write_user_pb7))
1369   MCFG_VIC20_USER_PORT_M_HANDLER(WRITELINE(c64_state, write_user_pa2))
1370
13061371   MCFG_QUICKLOAD_ADD("quickload", c64_state, cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
13071372
13081373   // software list
trunk/src/mess/includes/c128.h
r26919r26920
88#include "emu.h"
99#include "bus/cbmiec/cbmiec.h"
1010#include "bus/c64/exp.h"
11#include "bus/c64/user.h"
11#include "bus/vic20/user.h"
1212#include "bus/pet/cass.h"
1313#include "bus/vcs/ctrl.h"
1414#include "imagedev/snapquik.h"
r26919r26920
3535#define SCREEN_VDC_TAG  "screen80"
3636#define CONTROL1_TAG    "joy1"
3737#define CONTROL2_TAG    "joy2"
38#define VIC20_USER_PORT_TAG     "user"
3839
3940class c128_state : public driver_device
4041{
r26919r26920
5455         m_joy1(*this, CONTROL1_TAG),
5556         m_joy2(*this, CONTROL2_TAG),
5657         m_exp(*this, C64_EXPANSION_SLOT_TAG),
57         m_user(*this, C64_USER_PORT_TAG),
58         m_user(*this, VIC20_USER_PORT_TAG),
5859         m_ram(*this, RAM_TAG),
5960         m_cassette(*this, PET_DATASSETTE_PORT_TAG),
6061         m_rom(*this, M8502_TAG),
r26919r26920
112113   required_device<vcs_control_port_device> m_joy1;
113114   required_device<vcs_control_port_device> m_joy2;
114115   required_device<c64_expansion_slot_device> m_exp;
115   required_device<c64_user_port_device> m_user;
116   required_device<vic20_user_port_device> m_user;
116117   required_device<ram_device> m_ram;
117118   required_device<pet_datassette_port_device> m_cassette;
118119   required_memory_region m_rom;
r26919r26920
195196   DECLARE_INPUT_CHANGED_MEMBER( caps_lock );
196197
197198   DECLARE_QUICKLOAD_LOAD_MEMBER( cbm_c64 );
199
200   DECLARE_READ8_MEMBER( cia2_pb_r );
201   DECLARE_WRITE8_MEMBER( cia2_pb_w );
202
203   DECLARE_WRITE_LINE_MEMBER( write_user_pa2 ) { m_user_pa2 = state; }
204   DECLARE_WRITE_LINE_MEMBER( write_user_pb0 ) { if (state) m_user_pb |= 1; else m_user_pb &= ~1; }
205   DECLARE_WRITE_LINE_MEMBER( write_user_pb1 ) { if (state) m_user_pb |= 2; else m_user_pb &= ~2; }
206   DECLARE_WRITE_LINE_MEMBER( write_user_pb2 ) { if (state) m_user_pb |= 4; else m_user_pb &= ~4; }
207   DECLARE_WRITE_LINE_MEMBER( write_user_pb3 ) { if (state) m_user_pb |= 8; else m_user_pb &= ~8; }
208   DECLARE_WRITE_LINE_MEMBER( write_user_pb4 ) { if (state) m_user_pb |= 16; else m_user_pb &= ~16; }
209   DECLARE_WRITE_LINE_MEMBER( write_user_pb5 ) { if (state) m_user_pb |= 32; else m_user_pb &= ~32; }
210   DECLARE_WRITE_LINE_MEMBER( write_user_pb6 ) { if (state) m_user_pb |= 64; else m_user_pb &= ~64; }
211   DECLARE_WRITE_LINE_MEMBER( write_user_pb7 ) { if (state) m_user_pb |= 128; else m_user_pb &= ~128; }
212
198213   // memory state
199214   int m_z80en;
200215   int m_loram;
r26919r26920
227242   // keyboard state
228243   UINT8 m_vic_k;
229244   int m_caps_lock;
245
246   int m_user_pa2;
247   int m_user_pb;
230248};
231249
232250
trunk/src/mess/includes/c64.h
r26919r26920
88#include "emu.h"
99#include "bus/cbmiec/cbmiec.h"
1010#include "bus/c64/exp.h"
11#include "bus/c64/user.h"
11#include "bus/vic20/user.h"
1212#include "bus/pet/cass.h"
1313#include "bus/vcs/ctrl.h"
1414#include "cpu/m6502/m6510.h"
r26919r26920
2929#define SCREEN_TAG      "screen"
3030#define CONTROL1_TAG    "joy1"
3131#define CONTROL2_TAG    "joy2"
32#define VIC20_USER_PORT_TAG     "user"
3233
3334class c64_state : public driver_device
3435{
r26919r26920
4546         m_joy1(*this, CONTROL1_TAG),
4647         m_joy2(*this, CONTROL2_TAG),
4748         m_exp(*this, C64_EXPANSION_SLOT_TAG),
48         m_user(*this, C64_USER_PORT_TAG),
49         m_user(*this, VIC20_USER_PORT_TAG),
4950         m_ram(*this, RAM_TAG),
5051         m_cassette(*this, PET_DATASSETTE_PORT_TAG),
5152         m_basic(*this, "basic"),
r26919r26920
8485   required_device<vcs_control_port_device> m_joy1;
8586   required_device<vcs_control_port_device> m_joy2;
8687   required_device<c64_expansion_slot_device> m_exp;
87   required_device<c64_user_port_device> m_user;
88   required_device<vic20_user_port_device> m_user;
8889   required_device<ram_device> m_ram;
8990   optional_device<pet_datassette_port_device> m_cassette;
9091   optional_memory_region m_basic;
r26919r26920
139140
140141   DECLARE_QUICKLOAD_LOAD_MEMBER( cbm_c64 );
141142
143   DECLARE_READ8_MEMBER( cia2_pb_r );
144   DECLARE_WRITE8_MEMBER( cia2_pb_w );
145
146   DECLARE_WRITE_LINE_MEMBER( write_user_pa2 ) { m_user_pa2 = state; }
147   DECLARE_WRITE_LINE_MEMBER( write_user_pb0 ) { if (state) m_user_pb |= 1; else m_user_pb &= ~1; }
148   DECLARE_WRITE_LINE_MEMBER( write_user_pb1 ) { if (state) m_user_pb |= 2; else m_user_pb &= ~2; }
149   DECLARE_WRITE_LINE_MEMBER( write_user_pb2 ) { if (state) m_user_pb |= 4; else m_user_pb &= ~4; }
150   DECLARE_WRITE_LINE_MEMBER( write_user_pb3 ) { if (state) m_user_pb |= 8; else m_user_pb &= ~8; }
151   DECLARE_WRITE_LINE_MEMBER( write_user_pb4 ) { if (state) m_user_pb |= 16; else m_user_pb &= ~16; }
152   DECLARE_WRITE_LINE_MEMBER( write_user_pb5 ) { if (state) m_user_pb |= 32; else m_user_pb &= ~32; }
153   DECLARE_WRITE_LINE_MEMBER( write_user_pb6 ) { if (state) m_user_pb |= 64; else m_user_pb &= ~64; }
154   DECLARE_WRITE_LINE_MEMBER( write_user_pb7 ) { if (state) m_user_pb |= 128; else m_user_pb &= ~128; }
155
142156   // memory state
143157   int m_loram;
144158   int m_hiram;
r26919r26920
155169   int m_exp_irq;
156170   int m_exp_nmi;
157171   int m_exp_dma;
172
173   int m_user_pa2;
174   int m_user_pb;
158175};
159176
160177

Previous 199869 Revisions Next


© 1997-2024 The MAME Team