Previous 15994 Revisions Next

r6677 Wednesday 16th December, 2009 at 14:35:12 UTC by Curt Coder
[CBMSERIAL] Renamed to CBM IEC.
[src/mess]mess.mak
[src/mess/drivers]c64.c vc20.c
[src/mess/machine]c1541.c c1551.c c1571.c c1581.c c64.c cbmiec.c* cbmiec.h* cbmserial.c cbmserial.h vc20.c

src/mess/machine/cbmserial.c
r6676r6677
1/**********************************************************************
2
3    Commodore Serial Bus emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10/*
11
12C64 SERIAL BUS
13
14
15 Serial Bus Pinouts
16
17
18    Pin Name    Description
19     1  SRQ     Serial Service Request In
20     2  GND     Ground
21     3  ATN     Serial Attention In/Out
22     4  CLK     Serial Clock In/Out
23     5  DATA    Serial Data In/Out
24     6  RESET   Serial Reset
25
26    All signals are active low.
27
28
29  SRQ: Serial Service Request In
30
31 This signal is not used on the C64. On C128 it is replaced with Fast Serial
32 Clock for the 1571 disk drive.
33
34
35  ATN: Serial Attention In/Out
36
37 Sending any byte with the ATN line low (sending under attention) causes it
38 to be interpreted as a Bus Command for peripherals on the serial bus.
39
40 When the C64 brings this signal LOW, all other devices start listening for
41 it to transmit an address. The device addressed must respond in a preset
42 period of time; otherwise, the C64 will assume that the device addressed is
43 not on the bus, and will return an error in the STATUS word.
44
45 Usually, the address byte will be followed by one to two commands for the
46 device addressed, meaning the secondary address and channel on the peripheral.
47 Such a command can be one of the following:
48
49    20
50    40
51    60
52    E0
53    F0
54
55
56  CLK: Serial Clock In/Out
57
58  This signal is for timing the data sent on the serial bus. This signal is
59  always generated by the active TALKER. RISING EDGE OF THE CLOCK means data
60  bit is valid.
61
62
63  DATA: Serial Data In/Out
64
65  Data on the serial bus is transmitted bit by bit at a time on this line.
66
67
68  RESET: Serial Reset
69
70  You may disconnect this line to save your disk drive. The easiest way is to
71  do that on the cable, thus avoiding any modifications on your peripherals.
72
73
74
75  Serial Bus Timing
76
77 ___
78 CLK    |____|~~~~| Ts Bit Set-up time
79    : Ts : Tv : Tv Bit Valid time
80
81
82
83     |<--------- Byte sent under attention (to devices) ------------>|
84
85 ___    ____                                                        _____ _____
86 ATN       |________________________________________________________|
87       :                                :
88 ___    ______     ________ ___ ___ ___ ___ ___ ___ ___ ___         :
89 CLK       : |_____|      |_| |_| |_| |_| |_| |_| |_| |_| |______________ _____
90       :       :        :                 :         :
91       : Tat : :Th: Tne :                             : Tf : Tr :
92 ____   ________ : :  :___________________________________:____:
93 DATA   ___|\\\\\\\\\\__:__|    |__||__||__||__||__||__||__||__|    |_________ _____
94                  :     0   1   2   3   4   5   6   7      :
95                  :    LSB                         MSB     :
96              :     :                      :
97              :     : Data Valid      Listener: Data Accepted
98              : Listener READY-FOR-DATA
99
100
101
102
103        END-OR-IDENTIFY HANDSHAKE (LAST BYTE IN MESSAGE)
104 ___    _______________________________________________________________________
105 ATN
106 ___     ___ ___      ________________ ___ ___ ___ ___ ___ ___ ___ ___       __
107 CLK    _| |_| |______|              |_| |_| |_| |_| |_| |_| |_| |_| |_______|_
108           :      :          :                               :       :
109           :Tf:Tbb:Th:Tye:Tei:Try:                               :Tf :Tfr:
110 ____   __________:   :  :___:   :_______________________________________:   :_
111 DATA   |__||__|  |______|   |___|   :                                   |___|_
112     6   7        :  :   :   :   :                   :
113        MSB       :  :   :   :   : Talker Sending            :
114              :  :   :   : Listener READY-FOR-DATA      System
115              :  :   : EOI-Timeout Handshake          Line Release
116              :  : Listener READY-FOR-DATA
117              : Talker Ready-To-Send
118
119
120
121
122        TALK-ATTENTION TURN AROUND (TALKER AND LISTENER REVERSED)
123 ___                 _________________________________________________________
124 ATN    _____________|
125             :
126 ___     ___ ___     :   _____   ________ ___ ___ ___ ___ ___ ___ ___ ___
127 CLK    _| |_| |_________|   |___|      |_| |_| |_| |_| |_| |_| |_| |_| |_____
128           :     :   :   :   :      :                               :
129           :Tf:Tr:Ttk:Tdc:Tda:Th:Try:                               :Tf :
130 ____   __________:  :       :   :  :_______________________________________:
131 DATA   |__||__|  |_________________|   :|__||__||__||__||__||__||__||__|   |_
132     6   7       :   :   :   :  :   : 0   1   2   3   4   5   6   7
133        MSB      :   :   :   :  :   :LSB                         MSB
134             :   :   :   :  :   :
135             :   :   :   :  :   : Data Valid
136             :   :   :   :  : Listener READY-FOR-DATA
137             :   :   :   : Talker Ready-To-Send
138             :   :   : Device acknowledges it's now TALKER.
139             :   : Becomes LISTENER, Clock = High, Data = Low
140             : Talker Ready-To-Send
141
142
143
144
145 ___    _____________________________________________________________________
146 ATN
147 ___        _________ ___ ___ ___ ___ ___ ___ ___ ___       ________ ___ ___
148 CLK    ____|       |_| |_| |_| |_| |_| |_| |_| |_| |_______|      |_| |_| |_
149        :       :                   :       :      :
150        :Th :Tne:                               :Tf :Tbb:Th:Tne:
151 ____       :   :___:___________________________________:      :_____________
152 DATA   ________|   :|__||__||__||__||__||__||__||__|   |______|
153        :   :   : 0   1   2   3   4   5   6   7     :
154        :   :   :LSB                         MSB    :
155        :   :   :                   :
156        :   :   : TALKER SENDING        Listener: Data Accepted
157        :   : LISTENER READY-FOR-DATA
158        : TALKER READY-TO-SEND
159
160
161
162  Serial Bus Timing
163
164
165    Description         Symbol   Min     Typ     Max
166
167    ATN Response (required) 1)   Tat      -   - 1000us
168    Listener Hold-Off        Th   0   -  oo
169    Non-EOI Response to RFD 2)   Tne      -  40us   200us
170    Bit Set-Up Talker  4)        Ts  20us    70us     -
171    Data Valid           Tv  20us    20us     -
172    Frame Handshake  3)      Tf   0   20    1000us
173    Frame to Release of ATN      Tr  20us     -   -
174    Between Bytes Time       Tbb    100us     -   -
175    EOI Response Time        Tye    200us   250us     -
176    EOI Response Hold Time  5)   Tei     60us     -   -
177    Talker Response Limit        Try      0  30us    60us
178    Byte-Acknowledge  4)         Tpr     20us    30us     -
179    Talk-Attention Release       Ttk     20us    30us   100us
180    Talk-Attention Acknowledge   Tdc      0   -   -
181    Talk-Attention Ack. Hold     Tda     80us     -   -
182    EOI Acknowledge          Tfr     60us     -   -
183
184
185   Notes:
186    1)  If maximum time exceeded, device not present error.
187    2)  If maximum time exceeded, EOI response required.
188    3)  If maximum time exceeded, frame error.
189    4)  Tv and Tpr minimum must be 60us for external device to be a talker.
190    5)  Tei minimum must be 80us for external device to be a listener.
191*/
192
193#include "driver.h"
194#include "cbmserial.h"
195
196/***************************************************************************
197    PARAMETERS
198***************************************************************************/
199
200#define LOG 0
201
202enum
203{
204   SRQ = 0,
205   ATN,
206   CLK,
207   DATA,
208   RESET,
209   SIGNAL_COUNT
210};
211
212static const char *const SIGNAL_NAME[] = { "SRQ", "ATN", "CLK", "DATA", "RESET" };
213
214/***************************************************************************
215    TYPE DEFINITIONS
216***************************************************************************/
217
218typedef struct _cbmserial_daisy_state cbmserial_daisy_state;
219struct _cbmserial_daisy_state
220{
221   cbmserial_daisy_state      *next;         /* next device */
222   const device_config         *device;      /* associated device */
223
224   int line[SIGNAL_COUNT];            /* serial signal states */
225
226   cbmserial_line            out_line_func[SIGNAL_COUNT];
227};
228
229typedef struct _cbmserial_t cbmserial_t;
230struct _cbmserial_t
231{
232   cbmserial_daisy_state *daisy_state;
233};
234
235/***************************************************************************
236    INLINE FUNCTIONS
237***************************************************************************/
238
239INLINE cbmserial_t *get_safe_token(const device_config *device)
240{
241   assert(device != NULL);
242   assert(device->token != NULL);
243   assert(device->type == CBMSERIAL);
244   return (cbmserial_t *)device->token;
245}
246
247INLINE const cbmserial_daisy_chain *get_interface(const device_config *device)
248{
249   assert(device != NULL);
250   assert((device->type == CBMSERIAL));
251   return (const cbmserial_daisy_chain *) device->static_config;
252}
253
254INLINE int get_signal(const device_config *device, int line)
255{
256   cbmserial_t *cbmserial = get_safe_token(device);
257   cbmserial_daisy_state *daisy = cbmserial->daisy_state;
258   int state = 1;
259
260   for ( ; daisy != NULL; daisy = daisy->next)
261   {
262      if (!daisy->line[line])
263      {
264         state = 0;
265         break;
266      }
267   }
268
269   return state;
270}
271
272INLINE void set_signal(const device_config *serial_bus_device, const device_config *calling_device, int line, int state)
273{
274   cbmserial_t *cbmserial = get_safe_token(serial_bus_device);
275   cbmserial_daisy_state *daisy = cbmserial->daisy_state;
276   int data = 1;
277
278   for ( ; daisy != NULL; daisy = daisy->next)
279   {
280      if (!strcmp(daisy->device->tag, calling_device->tag))
281      {
282         if (daisy->line[line] != state)
283         {
284            if (LOG) logerror("CBM Serial Bus: '%s' %s %u\n", calling_device->tag, SIGNAL_NAME[line], state);
285            daisy->line[line] = state;
286         }
287         break;
288      }
289   }
290
291   data = get_signal(serial_bus_device, line);
292   daisy = cbmserial->daisy_state;
293
294   for ( ; daisy != NULL; daisy = daisy->next)
295   {
296      if (daisy->out_line_func[line]) (daisy->out_line_func[line])(daisy->device, data);
297   }
298
299   if (LOG) logerror("CBM Serial Bus: SRQ %u ATN %u CLK %u DATA %u RESET %u\n", get_signal(serial_bus_device, SRQ),get_signal(serial_bus_device, ATN),get_signal(serial_bus_device, CLK),get_signal(serial_bus_device, DATA),get_signal(serial_bus_device, RESET));
300}
301
302/***************************************************************************
303    IMPLEMENTATION
304***************************************************************************/
305
306void cbmserial_srq_w(const device_config *serial_bus_device, const device_config *calling_device, int state)
307{
308   set_signal(serial_bus_device, calling_device, SRQ, state);
309}
310
311READ_LINE_DEVICE_HANDLER( cbmserial_srq_r )
312{
313   return get_signal(device, SRQ);
314}
315
316void cbmserial_atn_w(const device_config *serial_bus_device, const device_config *calling_device, int state)
317{
318   set_signal(serial_bus_device, calling_device, ATN, state);
319}
320
321READ_LINE_DEVICE_HANDLER( cbmserial_atn_r )
322{
323   return get_signal(device, ATN);
324}
325
326void cbmserial_clk_w(const device_config *serial_bus_device, const device_config *calling_device, int state)
327{
328   set_signal(serial_bus_device, calling_device, CLK, state);
329}
330
331READ_LINE_DEVICE_HANDLER( cbmserial_clk_r )
332{
333   return get_signal(device, CLK);
334}
335
336void cbmserial_data_w(const device_config *serial_bus_device, const device_config *calling_device, int state)
337{
338   set_signal(serial_bus_device, calling_device, DATA, state);
339}
340
341READ_LINE_DEVICE_HANDLER( cbmserial_data_r )
342{
343   return get_signal(device, DATA);
344}
345
346void cbmserial_reset_w(const device_config *serial_bus_device, const device_config *calling_device, int state)
347{
348   set_signal(serial_bus_device, calling_device, RESET, state);
349}
350
351READ_LINE_DEVICE_HANDLER( cbmserial_reset_r )
352{
353   return get_signal(device, RESET);
354}
355
356/*-------------------------------------------------
357    DEVICE_START( cbmserial )
358-------------------------------------------------*/
359
360static DEVICE_START( cbmserial )
361{
362   cbmserial_t *cbmserial = get_safe_token(device);
363   const cbmserial_daisy_chain *daisy = get_interface(device);
364   int i;
365
366   astring *tempstring = astring_alloc();
367   cbmserial_daisy_state *head = NULL;
368   cbmserial_daisy_state **tailptr = &head;
369
370   /* create a linked list of devices */
371   for ( ; daisy->tag != NULL; daisy++)
372   {
373      *tailptr = auto_alloc(device->machine, cbmserial_daisy_state);
374
375      (*tailptr)->next = NULL;
376      (*tailptr)->device = devtag_get_device(device->machine, daisy->tag);
377
378      if ((*tailptr)->device == NULL)
379      {
380         astring_free(tempstring);
381         fatalerror("Unable to locate device '%s'", daisy->tag);
382      }
383
384      for (i = SRQ; i < SIGNAL_COUNT; i++)
385      {
386         (*tailptr)->line[i] = 1;
387      }
388
389      (*tailptr)->out_line_func[SRQ] = (cbmserial_line)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_CBM_SERIAL_SRQ);
390      (*tailptr)->out_line_func[ATN] = (cbmserial_line)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_CBM_SERIAL_ATN);
391      (*tailptr)->out_line_func[CLK] = (cbmserial_line)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_CBM_SERIAL_CLK);
392      (*tailptr)->out_line_func[DATA] = (cbmserial_line)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_CBM_SERIAL_DATA);
393      (*tailptr)->out_line_func[RESET] = (cbmserial_line)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_CBM_SERIAL_RESET);
394
395      tailptr = &(*tailptr)->next;
396   }
397
398   cbmserial->daisy_state = head;
399
400   astring_free(tempstring);
401
402   /* register for state saving */
403//  state_save_register_device_item(device, 0, cbmserial->);
404}
405
406/*-------------------------------------------------
407    DEVICE_GET_INFO( cbmserial )
408-------------------------------------------------*/
409
410DEVICE_GET_INFO( cbmserial )
411{
412   switch (state)
413   {
414      /* --- the following bits of info are returned as 64-bit signed integers --- */
415      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(cbmserial_t);                        break;
416      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                                    break;
417      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;                     break;
418
419      /* --- the following bits of info are returned as pointers to data or functions --- */
420      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(cbmserial);               break;
421      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
422      case DEVINFO_FCT_RESET:                     /* Nothing */                                    break;
423
424      /* --- the following bits of info are returned as NULL-terminated strings --- */
425      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore Serial Bus");               break;
426      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "IEEE-488");                        break;
427      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                              break;
428      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                           break;
429      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright the MESS Team");             break;
430   }
431}
src/mess/machine/cbmserial.h
r6676r6677
1/**********************************************************************
2
3    Commodore Serial Bus emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#ifndef __CBMSERIAL__
11#define __CBMSERIAL__
12
13#include "driver.h"
14
15/***************************************************************************
16    MACROS / CONSTANTS
17***************************************************************************/
18
19#define CBMSERIAL DEVICE_GET_INFO_NAME( cbmserial )
20
21#define MDRV_CBMSERIAL_ADD(_tag, _daisy_chain) \
22   MDRV_DEVICE_ADD(_tag, CBMSERIAL, 0) \
23   MDRV_DEVICE_CONFIG(_daisy_chain)
24
25#define CBMSERIAL_DAISY(_name) \
26   const cbmserial_daisy_chain (_name)[] =
27
28enum
29{
30   DEVINFO_FCT_CBM_SERIAL_SRQ = DEVINFO_FCT_DEVICE_SPECIFIC,
31   DEVINFO_FCT_CBM_SERIAL_ATN,
32   DEVINFO_FCT_CBM_SERIAL_CLK,
33   DEVINFO_FCT_CBM_SERIAL_DATA,
34   DEVINFO_FCT_CBM_SERIAL_RESET
35};
36
37#define CBMSERIAL_SRQ_NAME(name)   cbmserial_srq_##name
38#define CBMSERIAL_SRQ(name)         void CBMSERIAL_SRQ_NAME(name)(const device_config *device, int state)
39
40#define CBMSERIAL_ATN_NAME(name)   cbmserial_atn_##name
41#define CBMSERIAL_ATN(name)         void CBMSERIAL_ATN_NAME(name)(const device_config *device, int state)
42
43#define CBMSERIAL_CLK_NAME(name)   cbmserial_clk_##name
44#define CBMSERIAL_CLK(name)         void CBMSERIAL_CLK_NAME(name)(const device_config *device, int state)
45
46#define CBMSERIAL_DATA_NAME(name)   cbmserial_data_##name
47#define CBMSERIAL_DATA(name)      void CBMSERIAL_DATA_NAME(name)(const device_config *device, int state)
48
49#define CBMSERIAL_RESET_NAME(name)   cbmserial_reset_##name
50#define CBMSERIAL_RESET(name)      void CBMSERIAL_RESET_NAME(name)(const device_config *device, int state)
51
52/***************************************************************************
53    TYPE DEFINITIONS
54***************************************************************************/
55
56typedef struct _cbmserial_daisy_chain cbmserial_daisy_chain;
57struct _cbmserial_daisy_chain
58{
59   const char *tag;   /* device tag */
60};
61
62typedef void (*cbmserial_line)(const device_config *device, int state);
63
64/***************************************************************************
65    PROTOTYPES
66***************************************************************************/
67
68/* device interface */
69DEVICE_GET_INFO( cbmserial );
70
71/* serial service request */
72void cbmserial_srq_w(const device_config *serial_bus_device, const device_config *calling_device, int state);
73READ_LINE_DEVICE_HANDLER( cbmserial_srq_r );
74
75/* attention */
76void cbmserial_atn_w(const device_config *serial_bus_device, const device_config *calling_device, int state);
77READ_LINE_DEVICE_HANDLER( cbmserial_atn_r );
78
79/* clock */
80void cbmserial_clk_w(const device_config *serial_bus_device, const device_config *calling_device, int state);
81READ_LINE_DEVICE_HANDLER( cbmserial_clk_r );
82
83/* data */
84void cbmserial_data_w(const device_config *serial_bus_device, const device_config *calling_device, int state);
85READ_LINE_DEVICE_HANDLER( cbmserial_data_r );
86
87/* reset */
88void cbmserial_reset_w(const device_config *serial_bus_device, const device_config *calling_device, int state);
89READ_LINE_DEVICE_HANDLER( cbmserial_reset_r );
90
91#endif
src/mess/machine/cbmiec.c
r0r6677
1/**********************************************************************
2
3    Commodore IEC Serial Bus emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10/*
11
12C64 SERIAL BUS
13
14
15 Serial Bus Pinouts
16
17
18    Pin Name    Description
19     1  SRQ     Serial Service Request In
20     2  GND     Ground
21     3  ATN     Serial Attention In/Out
22     4  CLK     Serial Clock In/Out
23     5  DATA    Serial Data In/Out
24     6  RESET   Serial Reset
25
26    All signals are active low.
27
28
29  SRQ: Serial Service Request In
30
31 This signal is not used on the C64. On C128 it is replaced with Fast Serial
32 Clock for the 1571 disk drive.
33
34
35  ATN: Serial Attention In/Out
36
37 Sending any byte with the ATN line low (sending under attention) causes it
38 to be interpreted as a Bus Command for peripherals on the serial bus.
39
40 When the C64 brings this signal LOW, all other devices start listening for
41 it to transmit an address. The device addressed must respond in a preset
42 period of time; otherwise, the C64 will assume that the device addressed is
43 not on the bus, and will return an error in the STATUS word.
44
45 Usually, the address byte will be followed by one to two commands for the
46 device addressed, meaning the secondary address and channel on the peripheral.
47 Such a command can be one of the following:
48
49    20
50    40
51    60
52    E0
53    F0
54
55
56  CLK: Serial Clock In/Out
57
58  This signal is for timing the data sent on the serial bus. This signal is
59  always generated by the active TALKER. RISING EDGE OF THE CLOCK means data
60  bit is valid.
61
62
63  DATA: Serial Data In/Out
64
65  Data on the serial bus is transmitted bit by bit at a time on this line.
66
67
68  RESET: Serial Reset
69
70  You may disconnect this line to save your disk drive. The easiest way is to
71  do that on the cable, thus avoiding any modifications on your peripherals.
72
73
74
75  Serial Bus Timing
76
77 ___
78 CLK    |____|~~~~| Ts Bit Set-up time
79    : Ts : Tv : Tv Bit Valid time
80
81
82
83     |<--------- Byte sent under attention (to devices) ------------>|
84
85 ___    ____                                                        _____ _____
86 ATN       |________________________________________________________|
87       :                                :
88 ___    ______     ________ ___ ___ ___ ___ ___ ___ ___ ___         :
89 CLK       : |_____|      |_| |_| |_| |_| |_| |_| |_| |_| |______________ _____
90       :       :        :                 :         :
91       : Tat : :Th: Tne :                             : Tf : Tr :
92 ____   ________ : :  :___________________________________:____:
93 DATA   ___|\\\\\\\\\\__:__|    |__||__||__||__||__||__||__||__|    |_________ _____
94                  :     0   1   2   3   4   5   6   7      :
95                  :    LSB                         MSB     :
96              :     :                      :
97              :     : Data Valid      Listener: Data Accepted
98              : Listener READY-FOR-DATA
99
100
101
102
103        END-OR-IDENTIFY HANDSHAKE (LAST BYTE IN MESSAGE)
104 ___    _______________________________________________________________________
105 ATN
106 ___     ___ ___      ________________ ___ ___ ___ ___ ___ ___ ___ ___       __
107 CLK    _| |_| |______|              |_| |_| |_| |_| |_| |_| |_| |_| |_______|_
108           :      :          :                               :       :
109           :Tf:Tbb:Th:Tye:Tei:Try:                               :Tf :Tfr:
110 ____   __________:   :  :___:   :_______________________________________:   :_
111 DATA   |__||__|  |______|   |___|   :                                   |___|_
112     6   7        :  :   :   :   :                   :
113        MSB       :  :   :   :   : Talker Sending            :
114              :  :   :   : Listener READY-FOR-DATA      System
115              :  :   : EOI-Timeout Handshake          Line Release
116              :  : Listener READY-FOR-DATA
117              : Talker Ready-To-Send
118
119
120
121
122        TALK-ATTENTION TURN AROUND (TALKER AND LISTENER REVERSED)
123 ___                 _________________________________________________________
124 ATN    _____________|
125             :
126 ___     ___ ___     :   _____   ________ ___ ___ ___ ___ ___ ___ ___ ___
127 CLK    _| |_| |_________|   |___|      |_| |_| |_| |_| |_| |_| |_| |_| |_____
128           :     :   :   :   :      :                               :
129           :Tf:Tr:Ttk:Tdc:Tda:Th:Try:                               :Tf :
130 ____   __________:  :       :   :  :_______________________________________:
131 DATA   |__||__|  |_________________|   :|__||__||__||__||__||__||__||__|   |_
132     6   7       :   :   :   :  :   : 0   1   2   3   4   5   6   7
133        MSB      :   :   :   :  :   :LSB                         MSB
134             :   :   :   :  :   :
135             :   :   :   :  :   : Data Valid
136             :   :   :   :  : Listener READY-FOR-DATA
137             :   :   :   : Talker Ready-To-Send
138             :   :   : Device acknowledges it's now TALKER.
139             :   : Becomes LISTENER, Clock = High, Data = Low
140             : Talker Ready-To-Send
141
142
143
144
145 ___    _____________________________________________________________________
146 ATN
147 ___        _________ ___ ___ ___ ___ ___ ___ ___ ___       ________ ___ ___
148 CLK    ____|       |_| |_| |_| |_| |_| |_| |_| |_| |_______|      |_| |_| |_
149        :       :                   :       :      :
150        :Th :Tne:                               :Tf :Tbb:Th:Tne:
151 ____       :   :___:___________________________________:      :_____________
152 DATA   ________|   :|__||__||__||__||__||__||__||__|   |______|
153        :   :   : 0   1   2   3   4   5   6   7     :
154        :   :   :LSB                         MSB    :
155        :   :   :                   :
156        :   :   : TALKER SENDING        Listener: Data Accepted
157        :   : LISTENER READY-FOR-DATA
158        : TALKER READY-TO-SEND
159
160
161
162  Serial Bus Timing
163
164
165    Description         Symbol   Min     Typ     Max
166
167    ATN Response (required) 1)   Tat      -   - 1000us
168    Listener Hold-Off        Th   0   -  oo
169    Non-EOI Response to RFD 2)   Tne      -  40us   200us
170    Bit Set-Up Talker  4)        Ts  20us    70us     -
171    Data Valid           Tv  20us    20us     -
172    Frame Handshake  3)      Tf   0   20    1000us
173    Frame to Release of ATN      Tr  20us     -   -
174    Between Bytes Time       Tbb    100us     -   -
175    EOI Response Time        Tye    200us   250us     -
176    EOI Response Hold Time  5)   Tei     60us     -   -
177    Talker Response Limit        Try      0  30us    60us
178    Byte-Acknowledge  4)         Tpr     20us    30us     -
179    Talk-Attention Release       Ttk     20us    30us   100us
180    Talk-Attention Acknowledge   Tdc      0   -   -
181    Talk-Attention Ack. Hold     Tda     80us     -   -
182    EOI Acknowledge          Tfr     60us     -   -
183
184
185   Notes:
186    1)  If maximum time exceeded, device not present error.
187    2)  If maximum time exceeded, EOI response required.
188    3)  If maximum time exceeded, frame error.
189    4)  Tv and Tpr minimum must be 60us for external device to be a talker.
190    5)  Tei minimum must be 80us for external device to be a listener.
191*/
192
193#include "driver.h"
194#include "cbmiec.h"
195
196/***************************************************************************
197    PARAMETERS
198***************************************************************************/
199
200#define LOG 0
201
202enum
203{
204   SRQ = 0,
205   ATN,
206   CLK,
207   DATA,
208   RESET,
209   SIGNAL_COUNT
210};
211
212static const char *const SIGNAL_NAME[] = { "SRQ", "ATN", "CLK", "DATA", "RESET" };
213
214/***************************************************************************
215    TYPE DEFINITIONS
216***************************************************************************/
217
218typedef struct _cbm_iec_daisy_state cbm_iec_daisy_state;
219struct _cbm_iec_daisy_state
220{
221   cbm_iec_daisy_state         *next;         /* next device */
222   const device_config         *device;      /* associated device */
223
224   int line[SIGNAL_COUNT];                  /* serial signal states */
225
226   cbm_iec_line            out_line_func[SIGNAL_COUNT];
227};
228
229typedef struct _cbm_iec_t cbm_iec_t;
230struct _cbm_iec_t
231{
232   cbm_iec_daisy_state *daisy_state;
233};
234
235/***************************************************************************
236    INLINE FUNCTIONS
237***************************************************************************/
238
239INLINE cbm_iec_t *get_safe_token(const device_config *device)
240{
241   assert(device != NULL);
242   assert(device->token != NULL);
243   assert(device->type == CBM_IEC);
244   return (cbm_iec_t *)device->token;
245}
246
247INLINE const cbm_iec_daisy_chain *get_interface(const device_config *device)
248{
249   assert(device != NULL);
250   assert(device->type == CBM_IEC);
251   return (const cbm_iec_daisy_chain *) device->static_config;
252}
253
254INLINE int get_signal(const device_config *device, int line)
255{
256   cbm_iec_t *cbm_iec = get_safe_token(device);
257   cbm_iec_daisy_state *daisy = cbm_iec->daisy_state;
258   int state = 1;
259
260   for ( ; daisy != NULL; daisy = daisy->next)
261   {
262      if (!daisy->line[line])
263      {
264         state = 0;
265         break;
266      }
267   }
268
269   return state;
270}
271
272INLINE void set_signal(const device_config *iec, const device_config *device, int line, int state)
273{
274   cbm_iec_t *cbm_iec = get_safe_token(iec);
275   cbm_iec_daisy_state *daisy = cbm_iec->daisy_state;
276   int data = 1;
277
278   for ( ; daisy != NULL; daisy = daisy->next)
279   {
280      if (!strcmp(daisy->device->tag, device->tag))
281      {
282         if (daisy->line[line] != state)
283         {
284            if (LOG) logerror("CBM IEC: '%s' %s %u\n", device->tag, SIGNAL_NAME[line], state);
285            daisy->line[line] = state;
286         }
287         break;
288      }
289   }
290
291   data = get_signal(iec, line);
292   daisy = cbm_iec->daisy_state;
293
294   for ( ; daisy != NULL; daisy = daisy->next)
295   {
296      if (daisy->out_line_func[line]) (daisy->out_line_func[line])(daisy->device, data);
297   }
298
299   if (LOG) logerror("CBM IEC: SRQ %u ATN %u CLK %u DATA %u RESET %u\n", get_signal(iec, SRQ),get_signal(iec, ATN),get_signal(iec, CLK),get_signal(iec, DATA),get_signal(iec, RESET));
300}
301
302/***************************************************************************
303    IMPLEMENTATION
304***************************************************************************/
305
306void cbm_iec_srq_w(const device_config *iec, const device_config *device, int state)
307{
308   set_signal(iec, device, SRQ, state);
309}
310
311READ_LINE_DEVICE_HANDLER( cbm_iec_srq_r )
312{
313   return get_signal(device, SRQ);
314}
315
316void cbm_iec_atn_w(const device_config *iec, const device_config *device, int state)
317{
318   set_signal(iec, device, ATN, state);
319}
320
321READ_LINE_DEVICE_HANDLER( cbm_iec_atn_r )
322{
323   return get_signal(device, ATN);
324}
325
326void cbm_iec_clk_w(const device_config *iec, const device_config *device, int state)
327{
328   set_signal(iec, device, CLK, state);
329}
330
331READ_LINE_DEVICE_HANDLER( cbm_iec_clk_r )
332{
333   return get_signal(device, CLK);
334}
335
336void cbm_iec_data_w(const device_config *iec, const device_config *device, int state)
337{
338   set_signal(iec, device, DATA, state);
339}
340
341READ_LINE_DEVICE_HANDLER( cbm_iec_data_r )
342{
343   return get_signal(device, DATA);
344}
345
346void cbm_iec_reset_w(const device_config *iec, const device_config *device, int state)
347{
348   set_signal(iec, device, RESET, state);
349}
350
351READ_LINE_DEVICE_HANDLER( cbm_iec_reset_r )
352{
353   return get_signal(device, RESET);
354}
355
356/*-------------------------------------------------
357    DEVICE_START( cbm_iec )
358-------------------------------------------------*/
359
360static DEVICE_START( cbm_iec )
361{
362   cbm_iec_t *cbm_iec = get_safe_token(device);
363   const cbm_iec_daisy_chain *daisy = get_interface(device);
364   int i;
365
366   astring *tempstring = astring_alloc();
367   cbm_iec_daisy_state *head = NULL;
368   cbm_iec_daisy_state **tailptr = &head;
369
370   /* create a linked list of devices */
371   for ( ; daisy->tag != NULL; daisy++)
372   {
373      *tailptr = auto_alloc(device->machine, cbm_iec_daisy_state);
374
375      (*tailptr)->next = NULL;
376      (*tailptr)->device = devtag_get_device(device->machine, daisy->tag);
377
378      if ((*tailptr)->device == NULL)
379      {
380         astring_free(tempstring);
381         fatalerror("Unable to locate device '%s'", daisy->tag);
382      }
383
384      for (i = SRQ; i < SIGNAL_COUNT; i++)
385      {
386         (*tailptr)->line[i] = 1;
387      }
388
389      (*tailptr)->out_line_func[SRQ] = (cbm_iec_line)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_CBM_IEC_SRQ);
390      (*tailptr)->out_line_func[ATN] = (cbm_iec_line)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_CBM_IEC_ATN);
391      (*tailptr)->out_line_func[CLK] = (cbm_iec_line)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_CBM_IEC_CLK);
392      (*tailptr)->out_line_func[DATA] = (cbm_iec_line)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_CBM_IEC_DATA);
393      (*tailptr)->out_line_func[RESET] = (cbm_iec_line)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_CBM_IEC_RESET);
394
395      tailptr = &(*tailptr)->next;
396   }
397
398   cbm_iec->daisy_state = head;
399
400   astring_free(tempstring);
401
402   /* register for state saving */
403//  state_save_register_device_item(device, 0, cbm_iec->);
404}
405
406/*-------------------------------------------------
407    DEVICE_GET_INFO( cbm_iec )
408-------------------------------------------------*/
409
410DEVICE_GET_INFO( cbm_iec )
411{
412   switch (state)
413   {
414      /* --- the following bits of info are returned as 64-bit signed integers --- */
415      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(cbm_iec_t);                        break;
416      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                                    break;
417      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;                     break;
418
419      /* --- the following bits of info are returned as pointers to data or functions --- */
420      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(cbm_iec);               break;
421      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
422      case DEVINFO_FCT_RESET:                     /* Nothing */                                    break;
423
424      /* --- the following bits of info are returned as NULL-terminated strings --- */
425      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore Serial Bus");               break;
426      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "IEEE-488");                        break;
427      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                              break;
428      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                           break;
429      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright the MESS Team");             break;
430   }
431}
src/mess/machine/cbmiec.h
r0r6677
1/**********************************************************************
2
3    Commodore IEC Serial Bus emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#ifndef __CBM_IEC__
11#define __CBM_IEC__
12
13#include "driver.h"
14
15/***************************************************************************
16    MACROS / CONSTANTS
17***************************************************************************/
18
19#define CBM_IEC DEVICE_GET_INFO_NAME( cbm_iec )
20
21#define MDRV_CBM_IEC_ADD(_tag, _daisy_chain) \
22   MDRV_DEVICE_ADD(_tag, CBM_IEC, 0) \
23   MDRV_DEVICE_CONFIG(_daisy_chain)
24
25#define CBM_IEC_DAISY(_name) \
26   const cbm_iec_daisy_chain (_name)[] =
27
28enum
29{
30   DEVINFO_FCT_CBM_IEC_SRQ = DEVINFO_FCT_DEVICE_SPECIFIC,
31   DEVINFO_FCT_CBM_IEC_ATN,
32   DEVINFO_FCT_CBM_IEC_CLK,
33   DEVINFO_FCT_CBM_IEC_DATA,
34   DEVINFO_FCT_CBM_IEC_RESET
35};
36
37#define CBM_IEC_SRQ_NAME(name)      cbm_iec_srq_##name
38#define CBM_IEC_SRQ(name)         void CBM_IEC_SRQ_NAME(name)(const device_config *device, int state)
39
40#define CBM_IEC_ATN_NAME(name)      cbm_iec_atn_##name
41#define CBM_IEC_ATN(name)         void CBM_IEC_ATN_NAME(name)(const device_config *device, int state)
42
43#define CBM_IEC_CLK_NAME(name)      cbm_iec_clk_##name
44#define CBM_IEC_CLK(name)         void CBM_IEC_CLK_NAME(name)(const device_config *device, int state)
45
46#define CBM_IEC_DATA_NAME(name)      cbm_iec_data_##name
47#define CBM_IEC_DATA(name)         void CBM_IEC_DATA_NAME(name)(const device_config *device, int state)
48
49#define CBM_IEC_RESET_NAME(name)   cbm_iec_reset_##name
50#define CBM_IEC_RESET(name)         void CBM_IEC_RESET_NAME(name)(const device_config *device, int state)
51
52/***************************************************************************
53    TYPE DEFINITIONS
54***************************************************************************/
55
56typedef struct _cbm_iec_daisy_chain cbm_iec_daisy_chain;
57struct _cbm_iec_daisy_chain
58{
59   const char *tag;   /* device tag */
60};
61
62typedef void (*cbm_iec_line)(const device_config *device, int state);
63
64/***************************************************************************
65    PROTOTYPES
66***************************************************************************/
67
68/* device interface */
69DEVICE_GET_INFO( cbm_iec );
70
71/* service request */
72void cbm_iec_srq_w(const device_config *iec, const device_config *device, int state);
73READ_LINE_DEVICE_HANDLER( cbm_iec_srq_r );
74
75/* attention */
76void cbm_iec_atn_w(const device_config *iec, const device_config *device, int state);
77READ_LINE_DEVICE_HANDLER( cbm_iec_atn_r );
78
79/* clock */
80void cbm_iec_clk_w(const device_config *iec, const device_config *device, int state);
81READ_LINE_DEVICE_HANDLER( cbm_iec_clk_r );
82
83/* data */
84void cbm_iec_data_w(const device_config *iec, const device_config *device, int state);
85READ_LINE_DEVICE_HANDLER( cbm_iec_data_r );
86
87/* reset */
88void cbm_iec_reset_w(const device_config *iec, const device_config *device, int state);
89READ_LINE_DEVICE_HANDLER( cbm_iec_reset_r );
90
91#endif
src/mess/machine/c1581.c
r6676r6677
2727#include "devices/flopdrv.h"
2828#include "formats/basicdsk.h"
2929#include "machine/6526cia.h"
30#include "machine/cbmserial.h"
30#include "machine/cbmiec.h"
3131#include "machine/wd17xx.h"
3232
3333/***************************************************************************
r6676r6677
8787    c1581_atn_w - serial bus attention
8888-------------------------------------------------*/
8989
90static CBMSERIAL_ATN( c1581 )
90static CBM_IEC_ATN( c1581 )
9191{
9292   c1581_t *c1581 = get_safe_token(device);
9393   int data_out = !c1581->data_out && !(c1581->atn_ack && !state);
9494
9595   mos6526_flag_w(c1581->cia, state);
9696
97   cbmserial_data_w(c1581->serial_bus, device, data_out);
97   cbm_iec_data_w(c1581->serial_bus, device, data_out);
9898}
9999
100100/*-------------------------------------------------
101101    c1581_reset_w - serial bus reset
102102-------------------------------------------------*/
103103
104static CBMSERIAL_RESET( c1581 )
104static CBM_IEC_RESET( c1581 )
105105{
106106   if (!state)
107107   {
r6676r6677
207207   UINT8 data = 0;
208208
209209   /* data in */
210   data = !cbmserial_data_r(c1581->serial_bus);
210   data = !cbm_iec_data_r(c1581->serial_bus);
211211
212212   /* clock in */
213   data |= !cbmserial_clk_r(c1581->serial_bus) << 2;
213   data |= !cbm_iec_clk_r(c1581->serial_bus) << 2;
214214
215215   /* write protect */
216216   data |= !floppy_wpt_r(c1581->image) << 6;
217217
218218   /* attention in */
219   data |= !cbmserial_atn_r(c1581->serial_bus) << 7;
219   data |= !cbm_iec_atn_r(c1581->serial_bus) << 7;
220220
221221   return data;
222222}
r6676r6677
245245   int atn_ack = BIT(data, 4);
246246
247247   /* data out */
248   int serial_data = !data_out && !(atn_ack && !cbmserial_atn_r(c1581->serial_bus));
249   cbmserial_data_w(c1581->serial_bus, device->owner, serial_data);
248   int serial_data = !data_out && !(atn_ack && !cbm_iec_atn_r(c1581->serial_bus));
249   cbm_iec_data_w(c1581->serial_bus, device->owner, serial_data);
250250   c1581->data_out = data_out;
251251
252252   /* clock out */
253   cbmserial_clk_w(c1581->serial_bus, device->owner, !clk_out);
253   cbm_iec_clk_w(c1581->serial_bus, device->owner, !clk_out);
254254
255255   /* attention acknowledge */
256256   c1581->atn_ack = BIT(data, 4);
r6676r6677
403403      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(c1581);                  break;
404404      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
405405      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(c1581);                  break;
406      case DEVINFO_FCT_CBM_SERIAL_ATN:            info->f = (genf *)CBMSERIAL_ATN_NAME(c1581);            break;
407      case DEVINFO_FCT_CBM_SERIAL_RESET:            info->f = (genf *)CBMSERIAL_RESET_NAME(c1581);            break;
406      case DEVINFO_FCT_CBM_IEC_ATN:               info->f = (genf *)CBM_IEC_ATN_NAME(c1581);            break;
407      case DEVINFO_FCT_CBM_IEC_RESET:               info->f = (genf *)CBM_IEC_RESET_NAME(c1581);            break;
408408
409409      /* --- the following bits of info are returned as NULL-terminated strings --- */
410410      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore 1581");                     break;
src/mess/machine/c1541.c
r6676r6677
141141#include "devices/flopdrv.h"
142142#include "formats/g64_dsk.h"
143143#include "machine/6522via.h"
144#include "machine/cbmserial.h"
144#include "machine/cbmiec.h"
145145
146146/***************************************************************************
147147    PARAMETERS
r6676r6677
293293    c1541_atn_w - serial bus attention
294294-------------------------------------------------*/
295295
296static CBMSERIAL_ATN( c1541 )
296static CBM_IEC_ATN( c1541 )
297297{
298298   c1541_t *c1541 = get_safe_token(device);
299299   int data_out = !c1541->data_out && !(c1541->atna ^ !state);
300300
301301   via_ca1_w(c1541->via0, 0, !state);
302302
303   cbmserial_data_w(c1541->serial_bus, device, data_out);
303   cbm_iec_data_w(c1541->serial_bus, device, data_out);
304304}
305305
306306/*-------------------------------------------------
307307    c1541_reset_w - serial bus reset
308308-------------------------------------------------*/
309309
310static CBMSERIAL_RESET( c1541 )
310static CBM_IEC_RESET( c1541 )
311311{
312312   if (!state)
313313   {
r6676r6677
410410   UINT8 data = 0;
411411
412412   /* data in */
413   data = !cbmserial_data_r(c1541->serial_bus);
413   data = !cbm_iec_data_r(c1541->serial_bus);
414414
415415   /* clock in */
416   data |= !cbmserial_clk_r(c1541->serial_bus) << 2;
416   data |= !cbm_iec_clk_r(c1541->serial_bus) << 2;
417417
418418   /* serial bus address */
419419   data |= c1541->address << 5;
420420
421421   /* attention in */
422   data |= !cbmserial_atn_r(c1541->serial_bus) << 7;
422   data |= !cbm_iec_atn_r(c1541->serial_bus) << 7;
423423
424424   return data;
425425}
r6676r6677
448448   int atna = BIT(data, 4);
449449
450450   /* data out */
451   int serial_data = !data_out && !(atna ^ !cbmserial_atn_r(c1541->serial_bus));
452   cbmserial_data_w(c1541->serial_bus, device->owner, serial_data);
451   int serial_data = !data_out && !(atna ^ !cbm_iec_atn_r(c1541->serial_bus));
452   cbm_iec_data_w(c1541->serial_bus, device->owner, serial_data);
453453   c1541->data_out = data_out;
454454
455455   /* clock out */
456   cbmserial_clk_w(c1541->serial_bus, device->owner, !clk_out);
456   cbm_iec_clk_w(c1541->serial_bus, device->owner, !clk_out);
457457
458458   /* attention acknowledge */
459459   c1541->atna = atna;
r6676r6677
10741074      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(c1541);                  break;
10751075      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
10761076      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(c1541);                  break;
1077      case DEVINFO_FCT_CBM_SERIAL_ATN:            info->f = (genf *)CBMSERIAL_ATN_NAME(c1541);            break;
1078      case DEVINFO_FCT_CBM_SERIAL_RESET:            info->f = (genf *)CBMSERIAL_RESET_NAME(c1541);            break;
1077      case DEVINFO_FCT_CBM_IEC_ATN:               info->f = (genf *)CBM_IEC_ATN_NAME(c1541);            break;
1078      case DEVINFO_FCT_CBM_IEC_RESET:               info->f = (genf *)CBM_IEC_RESET_NAME(c1541);            break;
10791079
10801080      /* --- the following bits of info are returned as NULL-terminated strings --- */
10811081      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore VIC-1540");                  break;
r6676r6677
11071107      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(c1541);                  break;
11081108      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
11091109      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(c1541);                  break;
1110      case DEVINFO_FCT_CBM_SERIAL_ATN:            info->f = (genf *)CBMSERIAL_ATN_NAME(c1541);            break;
1111      case DEVINFO_FCT_CBM_SERIAL_RESET:            info->f = (genf *)CBMSERIAL_RESET_NAME(c1541);            break;
1110      case DEVINFO_FCT_CBM_IEC_ATN:               info->f = (genf *)CBM_IEC_ATN_NAME(c1541);            break;
1111      case DEVINFO_FCT_CBM_IEC_RESET:               info->f = (genf *)CBM_IEC_RESET_NAME(c1541);            break;
11121112
11131113      /* --- the following bits of info are returned as NULL-terminated strings --- */
11141114      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore 1541");                     break;
r6676r6677
11401140      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(c1541);                  break;
11411141      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
11421142      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(c1541);                  break;
1143      case DEVINFO_FCT_CBM_SERIAL_ATN:            info->f = (genf *)CBMSERIAL_ATN_NAME(c1541);            break;
1144      case DEVINFO_FCT_CBM_SERIAL_RESET:            info->f = (genf *)CBMSERIAL_RESET_NAME(c1541);            break;
1143      case DEVINFO_FCT_CBM_IEC_ATN:               info->f = (genf *)CBM_IEC_ATN_NAME(c1541);            break;
1144      case DEVINFO_FCT_CBM_IEC_RESET:               info->f = (genf *)CBM_IEC_RESET_NAME(c1541);            break;
11451145
11461146      /* --- the following bits of info are returned as NULL-terminated strings --- */
11471147      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore 1541C");                     break;
r6676r6677
11731173      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(c1541);                  break;
11741174      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
11751175      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(c1541);                  break;
1176      case DEVINFO_FCT_CBM_SERIAL_ATN:            info->f = (genf *)CBMSERIAL_ATN_NAME(c1541);            break;
1177      case DEVINFO_FCT_CBM_SERIAL_RESET:            info->f = (genf *)CBMSERIAL_RESET_NAME(c1541);            break;
1176      case DEVINFO_FCT_CBM_IEC_ATN:               info->f = (genf *)CBM_IEC_ATN_NAME(c1541);            break;
1177      case DEVINFO_FCT_CBM_IEC_RESET:               info->f = (genf *)CBM_IEC_RESET_NAME(c1541);            break;
11781178
11791179      /* --- the following bits of info are returned as NULL-terminated strings --- */
11801180      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore 1541-II");                  break;
src/mess/machine/c1551.c
r6676r6677
1313#include "devices/flopdrv.h"
1414#include "formats/g64_dsk.h"
1515#include "machine/6525tpi.h"
16#include "machine/cbmserial.h"
1716
1817/***************************************************************************
1918    PARAMETERS
src/mess/machine/vc20.c
r6676r6677
2020#include "machine/6522via.h"
2121#include "video/vic6560.h"
2222#include "includes/vc1541.h"
23#include "includes/cbmserb.h"
23#include "machine/cbmiec.h"
2424#include "includes/cbmieeeb.h"
2525#include "includes/cbmdrive.h"
2626
r6676r6677
107107
108108static READ8_DEVICE_HANDLER( vc20_via0_read_porta )
109109{
110   UINT8 value = 0xff;
111   const device_config *serbus = devtag_get_device(device->machine, "serial_bus");
110   const device_config *serbus = devtag_get_device(device->machine, "iec");
111   UINT8 data = 0xfc;
112112
113   value &= ~(input_port_read(device->machine, "JOY") & 0x3c);
113   data &= ~(input_port_read(device->machine, "JOY") & 0x3c);
114114
115115   /* to short to be recognized normally */
116116   /* should be reduced to about 1 or 2 microseconds */
117117   /*  if ((input_port_read(space->machine, "CTRLSEL") & 0x20 ) && (input_port_read(space->machine, "JOY") & 0x40) )  // i.e. LIGHTPEN_BUTTON
118        value &= ~0x20; */
119   if (!serial_clock || !cbm_serial_clock_read(serbus, 0))
120      value &= ~0x01;
121   if (!serial_data || !cbm_serial_data_read(serbus, 0))
122      value &= ~0x02;
118        data &= ~0x20; */
123119
120   data |= cbm_iec_clk_r(serbus);
121   data |= cbm_iec_data_r(serbus) << 1;
122
124123   if ((cassette_get_state(devtag_get_device(device->machine, "cassette")) & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED)
125      value &= ~0x40;
124      data &= ~0x40;
126125   else
127      value |=  0x40;
126      data |=  0x40;
128127
129   return value;
128   return data;
130129}
131130
132131static WRITE8_DEVICE_HANDLER( vc20_via0_write_porta )
133132{
134   const device_config *serbus = devtag_get_device(device->machine, "serial_bus");
133   const device_config *serbus = devtag_get_device(device->machine, "iec");
135134
136   cbm_serial_atn_write(serbus, 0, serial_atn = !(data & 0x80));
135   cbm_iec_atn_w(serbus, device, !(data & 0x80));
137136   DBG_LOG(device->machine, 1, "serial out", ("atn %s\n", serial_atn ? "high" : "low"));
138137}
139138
r6676r6677
192191
193192static WRITE8_DEVICE_HANDLER( vc20_via1_write_ca2 )
194193{
195   const device_config *serbus = devtag_get_device(device->machine, "serial_bus");
194   const device_config *serbus = devtag_get_device(device->machine, "iec");
196195
197   cbm_serial_clock_write(serbus, 0, serial_clock = !data);
196   cbm_iec_clk_w(serbus, device, !data);
198197}
199198
200199static READ8_DEVICE_HANDLER( vc20_via1_read_portb )
r6676r6677
333332
334333static READ8_DEVICE_HANDLER( vc20_via1_read_cb1 )
335334{
336   const device_config *serbus = devtag_get_device(device->machine, "serial_bus");
335   const device_config *serbus = devtag_get_device(device->machine, "iec");
337336
338337   DBG_LOG(device->machine, 1, "serial in", ("request read\n"));
339   return cbm_serial_request_read(serbus, 0);
338   return cbm_iec_srq_r(serbus);
340339}
341340
342341static WRITE8_DEVICE_HANDLER( vc20_via1_write_cb2 )
343342{
344   const device_config *serbus = devtag_get_device(device->machine, "serial_bus");
345   cbm_serial_data_write(serbus, 0, serial_data = !data);
343   const device_config *serbus = devtag_get_device(device->machine, "iec");
344   cbm_iec_data_w(serbus, device, !data);
346345}
347346
348347/* ieee 6522 number 1 (via4)
src/mess/machine/c1571.c
r6676r6677
1414#include "formats/g64_dsk.h"
1515#include "machine/6522via.h"
1616#include "machine/6526cia.h"
17#include "machine/cbmserial.h"
17#include "machine/cbmiec.h"
1818#include "machine/wd17xx.h"
1919 
2020/***************************************************************************
r6676r6677
8787    c1571_atn_w - serial bus attention
8888-------------------------------------------------*/
8989 
90static CBMSERIAL_ATN( c1571 )
90static CBM_IEC_ATN( c1571 )
9191{
9292   c1571_t *c1571 = get_safe_token(device);
9393   int data_out = !c1571->data_out && !(c1571->atn_ack ^ !state);
9494 
9595   via_ca1_w(c1571->via0, 0, !state);
9696 
97   cbmserial_data_w(c1571->serial_bus, device, data_out);
97   cbm_iec_data_w(c1571->serial_bus, device, data_out);
9898}
9999 
100100/*-------------------------------------------------
101101    c1571_reset_w - serial bus reset
102102-------------------------------------------------*/
103103 
104static CBMSERIAL_RESET( c1571 )
104static CBM_IEC_RESET( c1571 )
105105{
106106   if (!state)
107107   {
r6676r6677
229229   UINT8 data = 0;
230230 
231231   /* data in */
232   data = !cbmserial_data_r(c1571->serial_bus);
232   data = !cbm_iec_data_r(c1571->serial_bus);
233233 
234234   /* clock in */
235   data |= !cbmserial_clk_r(c1571->serial_bus) << 2;
235   data |= !cbm_iec_clk_r(c1571->serial_bus) << 2;
236236 
237237   /* serial bus address */
238238   data |= c1571->address << 5;
239239 
240240   /* attention in */
241   data |= !cbmserial_atn_r(c1571->serial_bus) << 7;
241   data |= !cbm_iec_atn_r(c1571->serial_bus) << 7;
242242 
243243   return data;
244244}
r6676r6677
267267   int atn_ack = BIT(data, 4);
268268 
269269   /* data out */
270   int serial_data = !data_out && !(atn_ack ^ !cbmserial_atn_r(c1571->serial_bus));
271   cbmserial_data_w(c1571->serial_bus, device->owner, serial_data);
270   int serial_data = !data_out && !(atn_ack ^ !cbm_iec_atn_r(c1571->serial_bus));
271   cbm_iec_data_w(c1571->serial_bus, device->owner, serial_data);
272272   c1571->data_out = data_out;
273273 
274274   /* clock out */
275   cbmserial_clk_w(c1571->serial_bus, device->owner, !clk_out);
275   cbm_iec_clk_w(c1571->serial_bus, device->owner, !clk_out);
276276 
277277   /* attention acknowledge */
278278   c1571->atn_ack = atn_ack;
r6676r6677
643643      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(c1571);                  break;
644644      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
645645      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(c1571);                  break;
646      case DEVINFO_FCT_CBM_SERIAL_ATN:            info->f = (genf *)CBMSERIAL_ATN_NAME(c1571);            break;
647      case DEVINFO_FCT_CBM_SERIAL_RESET:            info->f = (genf *)CBMSERIAL_RESET_NAME(c1571);            break;
646      case DEVINFO_FCT_CBM_IEC_ATN:               info->f = (genf *)CBM_IEC_ATN_NAME(c1571);            break;
647      case DEVINFO_FCT_CBM_IEC_RESET:               info->f = (genf *)CBM_IEC_RESET_NAME(c1571);            break;
648648 
649649      /* --- the following bits of info are returned as NULL-terminated strings --- */
650650      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore 1570");                     break;
r6676r6677
676676      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(c1571);                  break;
677677      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
678678      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(c1571);                  break;
679      case DEVINFO_FCT_CBM_SERIAL_ATN:            info->f = (genf *)CBMSERIAL_ATN_NAME(c1571);            break;
680      case DEVINFO_FCT_CBM_SERIAL_RESET:            info->f = (genf *)CBMSERIAL_RESET_NAME(c1571);            break;
679      case DEVINFO_FCT_CBM_IEC_ATN:               info->f = (genf *)CBM_IEC_ATN_NAME(c1571);            break;
680      case DEVINFO_FCT_CBM_IEC_RESET:               info->f = (genf *)CBM_IEC_RESET_NAME(c1571);            break;
681681 
682682      /* --- the following bits of info are returned as NULL-terminated strings --- */
683683      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore 1571");                     break;
r6676r6677
709709      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(c1571);                  break;
710710      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
711711      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(c1571);                  break;
712      case DEVINFO_FCT_CBM_SERIAL_ATN:            info->f = (genf *)CBMSERIAL_ATN_NAME(c1571);            break;
713      case DEVINFO_FCT_CBM_SERIAL_RESET:            info->f = (genf *)CBMSERIAL_RESET_NAME(c1571);            break;
712      case DEVINFO_FCT_CBM_IEC_ATN:               info->f = (genf *)CBM_IEC_ATN_NAME(c1571);            break;
713      case DEVINFO_FCT_CBM_IEC_RESET:               info->f = (genf *)CBM_IEC_RESET_NAME(c1571);            break;
714714 
715715      /* --- the following bits of info are returned as NULL-terminated strings --- */
716716      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore 1571CR");                  break;
src/mess/machine/c64.c
r6676r6677
1919#include "cpu/z80/z80.h"
2020#include "sound/sid6581.h"
2121#include "machine/6526cia.h"
22#include "machine/cbmserial.h"
22#include "machine/cbmiec.h"
2323#include "video/vic6567.h"
2424#include "video/vdc8563.h"
2525
r6676r6677
203203static READ8_DEVICE_HANDLER( c64_cia1_port_a_r )
204204{
205205   UINT8 value = 0xff;
206   const device_config *serbus = devtag_get_device(device->machine, "serial_bus");
206   const device_config *serbus = devtag_get_device(device->machine, "iec");
207207
208   if (!cbmserial_clk_r(serbus))
208   if (!cbm_iec_clk_r(serbus))
209209      value &= ~0x40;
210210
211   if (!cbmserial_data_r(serbus))
211   if (!cbm_iec_data_r(serbus))
212212      value &= ~0x80;
213213
214214   return value;
r6676r6677
217217static WRITE8_DEVICE_HANDLER( c64_cia1_port_a_w )
218218{
219219   static const int helper[4] = {0xc000, 0x8000, 0x4000, 0x0000};
220   const device_config *serbus = devtag_get_device(device->machine, "serial_bus");
220   const device_config *serbus = devtag_get_device(device->machine, "iec");
221221
222   cbmserial_clk_w(serbus, device, !(data & 0x10));
223   cbmserial_data_w(serbus, device, !(data & 0x20));
224   cbmserial_atn_w(serbus, device, !(data & 0x08));
222   cbm_iec_clk_w(serbus, device, !(data & 0x10));
223   cbm_iec_data_w(serbus, device, !(data & 0x20));
224   cbm_iec_atn_w(serbus, device, !(data & 0x08));
225225   c64_vicaddr = c64_memory + helper[data & 0x03];
226226}
227227
src/mess/mess.mak
r6676r6677
683683   $(MESS_AUDIO)/vic6560.o      \
684684   $(MESS_VIDEO)/ted7360.o      \
685685   $(MESS_VIDEO)/vic6560.o      \
686   $(MESS_MACHINE)/cbmserial.o   \
686   $(MESS_MACHINE)/cbmiec.o   \
687687   $(MESS_MACHINE)/c1541.o      \
688688   $(MESS_MACHINE)/c1551.o      \
689689   $(MESS_MACHINE)/c1571.o      \
src/mess/drivers/vc20.c
r6676r6677
9292
9393/* devices config */
9494#include "includes/cbm.h"
95#include "includes/cbmserb.h"   // needed for MDRV_DEVICE_REMOVE
96#include "includes/cbmdrive.h"
95#include "machine/cbmiec.h"
96#include "machine/c1541.h"
9797#include "includes/vc1541.h"
9898#include "includes/cbmieeeb.h"
9999#include "devices/messram.h"
r6676r6677
246246   }
247247}
248248
249static CBM_IEC_DAISY( cbm_iec_daisy )
250{
251   { "via6522_0" },
252   { "via6522_1" },
253   { "c1540" },
254   { NULL}
255};
249256
250257
251258/*************************************
r6676r6677
290297   MDRV_CASSETTE_ADD( "cassette", cbm_cassette_config )
291298
292299   /* floppy from serial bus */
293   MDRV_IMPORT_FROM(simulated_drive)
300   MDRV_CBM_IEC_ADD("iec", cbm_iec_daisy)
301   MDRV_C1540_ADD("c1540", "iec", 8)
294302
295303   /* IEEE bus */
296304   MDRV_CBM_IEEEBUS_ADD("ieee_bus")
r6676r6677
313321static MACHINE_DRIVER_START( vic20v )
314322   MDRV_IMPORT_FROM( vic20 )
315323
316   MDRV_DEVICE_REMOVE("serial_bus")   // in the current code, serial bus device is tied to the floppy drive
317   MDRV_IMPORT_FROM( cpu_vc1540 )
324   MDRV_DEVICE_REMOVE("iec")
325   MDRV_DEVICE_REMOVE("c1540")
318326#ifdef CPU_SYNC
319327   MDRV_QUANTUM_TIME(HZ(60))
320328#else
r6676r6677
353361static MACHINE_DRIVER_START( vc20v )
354362   MDRV_IMPORT_FROM( vc20 )
355363
356   MDRV_DEVICE_REMOVE("serial_bus")   // in the current code, serial bus device is tied to the floppy drive
357   MDRV_IMPORT_FROM( cpu_vc1540 )
364   MDRV_DEVICE_REMOVE("iec")
365   MDRV_DEVICE_REMOVE("c1540")
358366#ifdef CPU_SYNC
359367   MDRV_QUANTUM_TIME(HZ(60))
360368#else
r6676r6677
434442   ROM_FILL( 0x9000, 0x3000, 0xff )
435443   ROM_LOAD( "901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d) )
436444   ROM_LOAD( "901486.06", 0xe000, 0x2000, CRC(e5e7c174) SHA1(06de7ec017a5e78bd6746d89c2ecebb646efeb19) )
437
438   VC1540_ROM("cpu_vc1540")
439445ROM_END
440446
441447ROM_START( vic20plv )
r6676r6677
445451   ROM_FILL( 0x9000, 0x3000, 0xff )
446452   ROM_LOAD( "901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d) )
447453   ROM_LOAD( "901486.07", 0xe000, 0x2000, CRC(4be07cb4) SHA1(ce0137ed69f003a299f43538fa9eee27898e621e) )
448
449   VC1540_ROM("cpu_vc1540")
450454ROM_END
451455
452456#define rom_vc20v      rom_vic20plv
453457
454458
455/*************************************
456 *
457 *  System configuration(s)
458 *
459 *************************************/
460
461
462static SYSTEM_CONFIG_START(vic20)
463   CONFIG_DEVICE(cbmfloppy_device_getinfo)
464
465SYSTEM_CONFIG_END
466
467static SYSTEM_CONFIG_START(vic20v)
468   CONFIG_DEVICE(vc1541_device_getinfo)
469SYSTEM_CONFIG_END
470
471
472459/***************************************************************************
473460
474461  Game driver(s)
r6676r6677
477464
478465/*    YEAR  NAME      PARENT COMPAT MACHINE INPUT    INIT     CONFIG     COMPANY                             FULLNAME            FLAGS */
479466
480COMP( 1981, vic1001,   vic20,  0,  vic20,   vic1001,  vic20,  vic20,     "Commodore Business Machines Co.",  "VIC-1001 (NTSC, Japan)", GAME_IMPERFECT_SOUND)
467COMP( 1981, vic1001,   vic20,  0,  vic20,   vic1001,  vic20,  0,     "Commodore Business Machines Co.",  "VIC-1001 (NTSC, Japan)", GAME_IMPERFECT_SOUND)
481468
482COMP( 1981, vic20,     0,      0,   vic20,  vic20,    vic20,  vic20,     "Commodore Business Machines Co.",  "VIC 20 (NTSC)", GAME_IMPERFECT_SOUND)
483COMP( 1981, vic20cr,   vic20,  0,   vic20,  vic20,    vic20,  vic20,     "Commodore Business Machines Co.",  "VIC 20CR (NTSC)", GAME_IMPERFECT_SOUND)
484COMP( 1981, vic20i,    vic20,  0,   vic20i, vic20,    vic20i, vic20,     "Commodore Business Machines Co.",  "VIC 20 (NTSC, IEEE488 Interface - SYS45065)", GAME_IMPERFECT_SOUND)
485COMP( 1981, vic20v,    vic20,  0,   vic20v, vic20,    vic20v, vic20v,    "Commodore Business Machines Co.",  "VIC 20 (NTSC, VC1540)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
469COMP( 1981, vic20,     0,      0,   vic20,  vic20,    vic20,  0,     "Commodore Business Machines Co.",  "VIC 20 (NTSC)", GAME_IMPERFECT_SOUND)
470COMP( 1981, vic20cr,   vic20,  0,   vic20,  vic20,    vic20,  0,     "Commodore Business Machines Co.",  "VIC 20CR (NTSC)", GAME_IMPERFECT_SOUND)
471COMP( 1981, vic20i,    vic20,  0,   vic20i, vic20,    vic20i, 0,     "Commodore Business Machines Co.",  "VIC 20 (NTSC, IEEE488 Interface - SYS45065)", GAME_IMPERFECT_SOUND)
472COMP( 1981, vic20v,    vic20,  0,   vic20v, vic20,    vic20v, 0,     "Commodore Business Machines Co.",  "VIC 20 (NTSC, VC1540)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
486473
487COMP( 1981, vic20pal,  vic20,  0,   vc20,   vc20,     vc20,   vic20,     "Commodore Business Machines Co.",  "VC 20 (PAL)", GAME_IMPERFECT_SOUND)
488COMP( 1981, vic20crp,  vic20,  0,   vc20,   vc20,     vc20,   vic20,     "Commodore Business Machines Co.",  "VC 20CR (PAL)", GAME_IMPERFECT_SOUND)
489COMP( 1981, vic20plv,  vic20,  0,   vc20v,  vic20,    vc20v,  vic20v,    "Commodore Business Machines Co.",  "VC 20 (PAL, VC1540)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
490COMP( 1981, vc20,      vic20,  0,   vc20,   vc20,     vc20,   vic20,     "Commodore Business Machines Co.",  "VIC 20 (PAL, Germany)", GAME_IMPERFECT_SOUND)
491COMP( 1981, vc20v,     vic20,  0,   vc20v,  vic20,    vc20v,  vic20v,    "Commodore Business Machines Co.",  "VIC 20 (PAL, Germany, VC1540)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
474COMP( 1981, vic20pal,  vic20,  0,   vc20,   vc20,     vc20,   0,     "Commodore Business Machines Co.",  "VC 20 (PAL)", GAME_IMPERFECT_SOUND)
475COMP( 1981, vic20crp,  vic20,  0,   vc20,   vc20,     vc20,   0,     "Commodore Business Machines Co.",  "VC 20CR (PAL)", GAME_IMPERFECT_SOUND)
476COMP( 1981, vic20plv,  vic20,  0,   vc20v,  vic20,    vc20v,  0,     "Commodore Business Machines Co.",  "VC 20 (PAL, VC1540)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
477COMP( 1981, vc20,      vic20,  0,   vc20,   vc20,     vc20,   0,     "Commodore Business Machines Co.",  "VIC 20 (PAL, Germany)", GAME_IMPERFECT_SOUND)
478COMP( 1981, vc20v,     vic20,  0,   vc20v,  vic20,    vc20v,  0,     "Commodore Business Machines Co.",  "VIC 20 (PAL, Germany, VC1540)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
492479
493COMP( 1981, vic20swe,  vic20,  0,   vc20,   vic20swe, vc20,   vic20,     "Commodore Business Machines Co.",  "VIC 20 (PAL, Swedish Expansion Kit)", GAME_IMPERFECT_SOUND)
480COMP( 1981, vic20swe,  vic20,  0,   vc20,   vic20swe, vc20,   0,     "Commodore Business Machines Co.",  "VIC 20 (PAL, Swedish Expansion Kit)", GAME_IMPERFECT_SOUND)
src/mess/drivers/c64.c
r6676r6677
335335#include "includes/cbm.h"
336336#include "includes/cbmdrive.h"
337337#include "includes/vc1541.h"
338#include "machine/cbmserial.h"
338#include "machine/cbmiec.h"
339339#include "machine/c1541.h"
340340
341341#include "includes/c64.h"
r6676r6677
479479   c64_m6510_port_write
480480};
481481
482static CBMSERIAL_DAISY( cbmserial_daisy )
482static CBM_IEC_DAISY( cbm_iec_daisy )
483483{
484484   { "cia_1" },
485485   { "c1541" },
r6676r6677
529529   MDRV_CIA6526_ADD("cia_1", CIA6526R1, VIC6567_CLOCK, c64_ntsc_cia1)
530530
531531   /* floppy from serial bus */
532   MDRV_CBMSERIAL_ADD("serial_bus", cbmserial_daisy)
533   MDRV_C1541_ADD("c1541", "serial_bus", 8)
532   MDRV_CBM_IEC_ADD("iec", cbm_iec_daisy)
533   MDRV_C1541_ADD("c1541", "iec", 8)
534534
535535   MDRV_IMPORT_FROM(c64_cartslot)
536536MACHINE_DRIVER_END
r6676r6677
571571   MDRV_CIA6526_ADD("cia_1", CIA6526R1, VIC6569_CLOCK, c64_pal_cia1)
572572
573573   /* floppy from serial bus */
574   MDRV_CBMSERIAL_ADD("serial_bus", cbmserial_daisy)
575   MDRV_C1541_ADD("c1541", "serial_bus", 8)
574   MDRV_CBM_IEC_ADD("iec", cbm_iec_daisy)
575   MDRV_C1541_ADD("c1541", "iec", 8)
576576
577577   MDRV_IMPORT_FROM(c64_cartslot)
578578MACHINE_DRIVER_END
r6676r6677
587587   MDRV_SOUND_CONFIG(c64_sound_interface)
588588   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
589589
590   MDRV_DEVICE_REMOVE("serial_bus")
590   MDRV_DEVICE_REMOVE("iec")
591591   MDRV_DEVICE_REMOVE("c1541")
592592   MDRV_DEVICE_REMOVE("cart1")
593593   MDRV_DEVICE_REMOVE("cart2")
r6676r6677
606606   MDRV_DEVICE_REMOVE( "dac" )
607607   MDRV_DEVICE_REMOVE( "cassette" )
608608   MDRV_DEVICE_REMOVE( "quickload" )
609   MDRV_DEVICE_REMOVE("serial_bus")
609   MDRV_DEVICE_REMOVE("iec")
610610   MDRV_DEVICE_REMOVE("c1541")
611611MACHINE_DRIVER_END
612612

Previous 15994 Revisions Next


© 1998-2018 The MESS Team