Previous 15994 Revisions Next

r13217 Friday 11th November, 2011 at 23:42:30 UTC by Curt Coder
Refactored the Commodore IEC bus to use slots. You can now connect up to 4 IEC floppy drives of your choice (1540/1541/1571/1581) to a VIC-20, C64, C128, C16, Plus-4, or C65. [Curt Coder]
[src/mess]mess.lst mess.mak
[src/mess/drivers]c128.c c16.c c64.c c65.c primo.c vic20.c
[src/mess/machine]c1541.c c1541.h c1571.c c1571.h c1581.c c1581.h c64.c cbmiec.c cbmiec.h iecstub.c

src/mess/machine/iecstub.c
r13216r13217
1#include "cbmiec.h"
2
3
4
5//**************************************************************************
6//  DEVICE DEFINITIONS
7//**************************************************************************
8
9const device_type CBM_IEC_STUB = &device_creator<cbm_iec_stub_device>;
10
11//-------------------------------------------------
12//  device_config_complete - perform any
13//  operations now that the configuration is
14//  complete
15//-------------------------------------------------
16
17void cbm_iec_stub_device::device_config_complete()
18{
19   // inherit a copy of the static data
20   const cbm_iec_stub_interface *intf = reinterpret_cast<const cbm_iec_stub_interface *>(static_config());
21   if (intf != NULL)
22      *static_cast<cbm_iec_stub_interface *>(this) = *intf;
23
24   // or initialize to defaults if none provided
25   else
26   {
27      memset(&m_out_srq_cb, 0, sizeof(m_out_srq_cb));
28      memset(&m_out_atn_cb, 0, sizeof(m_out_atn_cb));
29      memset(&m_out_clk_cb, 0, sizeof(m_out_clk_cb));
30      memset(&m_out_data_cb, 0, sizeof(m_out_data_cb));
31      memset(&m_out_reset_cb, 0, sizeof(m_out_reset_cb));
32   }
33}
34
35
36//**************************************************************************
37//  LIVE DEVICE
38//**************************************************************************
39
40//-------------------------------------------------
41//  cbm_iec_stub_device - constructor
42//-------------------------------------------------
43
44cbm_iec_stub_device::cbm_iec_stub_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
45    : device_t(mconfig, CBM_IEC_STUB, "CBM IEC driver stub", tag, owner, clock),
46     device_cbm_iec_interface(mconfig, *this)
47{
48}
49
50
51//-------------------------------------------------
52//  device_start - device-specific startup
53//-------------------------------------------------
54
55void cbm_iec_stub_device::device_start()
56{
57   // resolve callbacks
58    m_out_srq_func.resolve(m_out_srq_cb, *this);
59    m_out_atn_func.resolve(m_out_atn_cb, *this);
60    m_out_clk_func.resolve(m_out_clk_cb, *this);
61    m_out_data_func.resolve(m_out_data_cb, *this);
62    m_out_reset_func.resolve(m_out_reset_cb, *this);
63}
64
65
66//-------------------------------------------------
67//  cbm_iec_srq -
68//-------------------------------------------------
69
70void cbm_iec_stub_device::cbm_iec_srq(int state)
71{
72   m_out_srq_func(state);
73}
74
75
76//-------------------------------------------------
77//  cbm_iec_atn -
78//-------------------------------------------------
79
80void cbm_iec_stub_device::cbm_iec_atn(int state)
81{
82   m_out_atn_func(state);
83}
84
85
86//-------------------------------------------------
87//  cbm_iec_clk -
88//-------------------------------------------------
89
90void cbm_iec_stub_device::cbm_iec_clk(int state)
91{
92   m_out_clk_func(state);
93}
94
95
96//-------------------------------------------------
97//  cbm_iec_data -
98//-------------------------------------------------
99
100void cbm_iec_stub_device::cbm_iec_data(int state)
101{
102   m_out_data_func(state);
103}
104
105
106//-------------------------------------------------
107//  cbm_iec_reset -
108//-------------------------------------------------
109
110void cbm_iec_stub_device::cbm_iec_reset(int state)
111{
112   m_out_reset_func(state);
113}
src/mess/machine/cbmiec.c
r13216r13217
211211//**************************************************************************
212212
213213const device_type CBM_IEC = &device_creator<cbm_iec_device>;
214const device_type CBM_IEC_SLOT = &device_creator<cbm_iec_slot_device>;
214215
215216
217
216218//**************************************************************************
217219//  DEVICE INTERFACE
218220//**************************************************************************
r13216r13217
222224//-------------------------------------------------
223225
224226device_cbm_iec_interface::device_cbm_iec_interface(const machine_config &mconfig, device_t &device)
225   : device_interface(device)
227   : device_slot_card_interface(mconfig, device)
226228{
227229}
228230
r13216r13217
238240
239241
240242//**************************************************************************
241//  DEVICE CONFIGURATION
243//  LIVE DEVICE
242244//**************************************************************************
243245
246//-------------------------------------------------
247//  cbm_iec_slot_device - constructor
248//-------------------------------------------------
244249
250cbm_iec_slot_device::cbm_iec_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
251        device_t(mconfig, CBM_IEC_SLOT, "CBM IEC slot", tag, owner, clock),
252      device_slot_interface(mconfig, *this)
253{
254}
255
256
245257//-------------------------------------------------
258//  static_set_slot -
259//-------------------------------------------------
260
261void cbm_iec_slot_device::static_set_slot(device_t &device, int address)
262{
263   cbm_iec_slot_device &cbm_iec_card = dynamic_cast<cbm_iec_slot_device &>(device);
264   cbm_iec_card.m_address = address;
265}
266
267
268//-------------------------------------------------
269//  get_address -
270//-------------------------------------------------
271
272int cbm_iec_slot_device::get_address()
273{
274   return m_address;
275}
276
277
278//-------------------------------------------------
279//  device_start - device-specific startup
280//-------------------------------------------------
281
282void cbm_iec_slot_device::device_start()
283{
284   m_bus = machine().device<cbm_iec_device>(CBM_IEC_TAG);
285   device_cbm_iec_interface *dev = dynamic_cast<device_cbm_iec_interface *>(get_card_device());
286   if (dev) m_bus->add_device(get_card_device());
287}
288
289
290
291//**************************************************************************
292//  DEVICE CONFIGURATION
293//**************************************************************************
294
295//-------------------------------------------------
246296//  device_config_complete - perform any
247297//  operations now that the configuration is
248298//  complete
r13216r13217
251301void cbm_iec_device::device_config_complete()
252302{
253303   // inherit a copy of the static data
254   const cbm_iec_config *intf = reinterpret_cast<const cbm_iec_config *>(static_config());
304   const cbm_iec_interface *intf = reinterpret_cast<const cbm_iec_interface *>(static_config());
255305   if (intf != NULL)
256      *static_cast<cbm_iec_config *>(this) = *intf;
306      *static_cast<cbm_iec_interface *>(this) = *intf;
257307
258308   // or initialize to defaults if none provided
259309   else
260310   {
261      fatalerror("Daisy chain not provided!");
311      memset(&m_out_srq_cb, 0, sizeof(m_out_srq_cb));
312      memset(&m_out_atn_cb, 0, sizeof(m_out_atn_cb));
313      memset(&m_out_clk_cb, 0, sizeof(m_out_clk_cb));
314      memset(&m_out_data_cb, 0, sizeof(m_out_data_cb));
315      memset(&m_out_reset_cb, 0, sizeof(m_out_reset_cb));
262316   }
263
264   m_daisy = intf;
265317}
266318
267319
r13216r13217
278330{
279331   bool changed = false;
280332
281   for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
333   if (device == this)
282334   {
283      if (!strcmp(daisy->m_device->tag(), device->tag()))
335      if (m_line[signal] != state)
284336      {
285         if (daisy->m_line[signal] != state)
337         if (LOG) logerror("CBM IEC: '%s' %s %u\n", tag(), SIGNAL_NAME[signal], state);
338         m_line[signal] = state;
339         changed = true;
340      }
341   }
342   else
343   {
344      daisy_entry *entry = m_device_list.first();
345     
346      while (entry)
347      {
348         if (!strcmp(entry->m_device->tag(), device->tag()))
286349         {
287            if (LOG) logerror("CBM IEC: '%s' %s %u\n", device->tag(), SIGNAL_NAME[signal], state);
288            daisy->m_line[signal] = state;
289            changed = true;
350            if (entry->m_line[signal] != state)
351            {
352               if (LOG) logerror("CBM IEC: '%s' %s %u\n", device->tag(), SIGNAL_NAME[signal], state);
353               entry->m_line[signal] = state;
354               changed = true;
355            }
290356         }
357         
358         entry = entry->next();
291359      }
292360   }
293361
294362   if (changed)
295363   {
296      for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
364      switch (signal)
297365      {
366      case SRQ:   m_out_srq_func(state);   break;
367      case ATN:   m_out_atn_func(state);   break;
368      case CLK:   m_out_clk_func(state);   break;
369      case DATA:   m_out_data_func(state);   break;
370      case RESET:   m_out_reset_func(state);break;
371      }
372
373      daisy_entry *entry = m_device_list.first();
374     
375      while (entry)
376      {
298377         switch (signal)
299378         {
300379         case SRQ:
301            daisy->m_interface->cbm_iec_srq(state);
380            entry->m_interface->cbm_iec_srq(state);
302381            break;
303382
304383         case ATN:
305            daisy->m_interface->cbm_iec_atn(state);
384            entry->m_interface->cbm_iec_atn(state);
306385            break;
307386
308387         case CLK:
309            daisy->m_interface->cbm_iec_clk(state);
388            entry->m_interface->cbm_iec_clk(state);
310389            break;
311390
312391         case DATA:
313            daisy->m_interface->cbm_iec_data(state);
392            entry->m_interface->cbm_iec_data(state);
314393            break;
315394
316395         case RESET:
317            daisy->m_interface->cbm_iec_reset(state);
396            entry->m_interface->cbm_iec_reset(state);
318397            break;
319398         }
399         
400         entry = entry->next();
320401      }
321402
322403      if (LOG) logerror("CBM IEC: SRQ %u ATN %u CLK %u DATA %u RESET %u\n", get_signal(SRQ),get_signal(ATN),get_signal(CLK),get_signal(DATA),get_signal(RESET));
r13216r13217
330411
331412inline int cbm_iec_device::get_signal(int signal)
332413{
333   int state = 1;
414   int state = m_line[signal];
334415
335   for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
416   if (state)
336417   {
337      if (!daisy->m_line[signal])
418      daisy_entry *entry = m_device_list.first();
419     
420      while (entry)
338421      {
339         state = 0;
340         break;
422         if (!entry->m_line[signal])
423         {
424            state = 0;
425            break;
426         }
427         
428         entry = entry->next();
341429      }
342430   }
343
431   
344432   return state;
345433}
346434
r13216r13217
355443//-------------------------------------------------
356444
357445cbm_iec_device::cbm_iec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
358    : device_t(mconfig, CBM_IEC, "CBM_IEC", tag, owner, clock),
359   m_stub(NULL)
446    : device_t(mconfig, CBM_IEC, "CBM IEC bus", tag, owner, clock)
360447{
448   for (int i = 0; i < SIGNAL_COUNT; i++)
449   {
450      m_line[i] = 1;
451   }
361452}
362453
363454
r13216r13217
367458
368459void cbm_iec_device::device_start()
369460{
370   m_stub = machine().device<cbm_iec_stub_device>(CBM_IEC_STUB_TAG);
371   const cbm_iec_config *daisy = m_daisy;
372   // create a linked list of devices
373   daisy_entry **tailptr = &m_daisy_list;
374   for ( ; daisy->m_tag != NULL; daisy++)
375   {
376      // find the device
377      device_t *target = machine().device(daisy->m_tag);
378      if (target == NULL)
379         fatalerror("Unable to locate device '%s'", daisy->m_tag);
461   // resolve callbacks
462    m_out_srq_func.resolve(m_out_srq_cb, *this);
463    m_out_atn_func.resolve(m_out_atn_cb, *this);
464    m_out_clk_func.resolve(m_out_clk_cb, *this);
465    m_out_data_func.resolve(m_out_data_cb, *this);
466    m_out_reset_func.resolve(m_out_reset_cb, *this);
467}
380468
381      // make sure it has an interface
382      device_cbm_iec_interface *intf;
383      if (!target->interface(intf))
384         fatalerror("Device '%s' does not implement the CBM IEC interface!", daisy->m_tag);
385469
386      // append to the end
387      *tailptr = auto_alloc(machine(), daisy_entry(target));
388      tailptr = &(*tailptr)->m_next;
389   }
470//-------------------------------------------------
471//  add_device -
472//-------------------------------------------------
390473
391   // append driver stub to the end
392   device_t *target = machine().device(CBM_IEC_STUB_TAG);
393   *tailptr = auto_alloc(machine(), daisy_entry(target));
394   tailptr = &(*tailptr)->m_next;
474void cbm_iec_device::add_device(device_t *target)
475{
476   daisy_entry *entry = auto_alloc(machine(), daisy_entry(target));
477   m_device_list.append(*entry);
395478}
396479
397480
r13216r13217
469552
470553WRITE_LINE_MEMBER( cbm_iec_device::srq_w )
471554{
472   set_signal(m_stub, SRQ, state);
555   set_signal(this, SRQ, state);
473556}
474557
475558
r13216r13217
479562
480563WRITE_LINE_MEMBER( cbm_iec_device::atn_w )
481564{
482   set_signal(m_stub, ATN, state);
565   set_signal(this, ATN, state);
483566}
484567
485568
r13216r13217
489572
490573WRITE_LINE_MEMBER( cbm_iec_device::clk_w )
491574{
492   set_signal(m_stub, CLK, state);
575   set_signal(this, CLK, state);
493576}
494577
495578
r13216r13217
499582
500583WRITE_LINE_MEMBER( cbm_iec_device::data_w )
501584{
502   set_signal(m_stub, DATA, state);
585   set_signal(this, DATA, state);
503586}
504587
505588
r13216r13217
509592
510593WRITE_LINE_MEMBER( cbm_iec_device::reset_w )
511594{
512   set_signal(m_stub, RESET, state);
595   set_signal(this, RESET, state);
513596}
514597
515598
src/mess/machine/cbmiec.h
r13216r13217
2121//**************************************************************************
2222
2323#define CBM_IEC_TAG         "iec_bus"
24#define CBM_IEC_STUB_TAG   "iec_stub"
2524
2625
2726
r13216r13217
2928//  INTERFACE CONFIGURATION MACROS
3029//**************************************************************************
3130
32#define MCFG_CBM_IEC_ADD(_daisy) \
33    MCFG_DEVICE_ADD(CBM_IEC_STUB_TAG, CBM_IEC_STUB, 0) \
34   MCFG_DEVICE_CONFIG(default_cbm_iec_stub_interface) \
35   MCFG_DEVICE_ADD(CBM_IEC_TAG, CBM_IEC, 0) \
36   MCFG_DEVICE_CONFIG(_daisy)
31#define MCFG_CBM_IEC_BUS_ADD(_config) \
32    MCFG_DEVICE_ADD(CBM_IEC_TAG, CBM_IEC, 0) \
33    MCFG_DEVICE_CONFIG(_config)
3734
3835
39#define MCFG_CBM_IEC_CONFIG_ADD(_daisy, _config) \
40    MCFG_DEVICE_ADD(CBM_IEC_STUB_TAG, CBM_IEC_STUB, 0) \
41   MCFG_DEVICE_CONFIG(_config) \
42   MCFG_DEVICE_ADD(CBM_IEC_TAG, CBM_IEC, 0) \
43   MCFG_DEVICE_CONFIG(_daisy)
36#define CBM_IEC_INTERFACE(_name) \
37   const cbm_iec_interface (_name) =
4438
4539
46#define MCFG_CBM_IEC_REMOVE() \
47   MCFG_DEVICE_REMOVE(CBM_IEC_STUB_TAG) \
48   MCFG_DEVICE_REMOVE(CBM_IEC_TAG)
40#define MCFG_CBM_IEC_SLOT_ADD(_tag, _num, _slot_intf, _def_slot, _def_inp) \
41    MCFG_DEVICE_ADD(_tag, CBM_IEC_SLOT, 0) \
42   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp) \
43   cbm_iec_slot_device::static_set_slot(*device, _num);
4944
5045
51#define CBM_IEC_DAISY(_name) \
52   const cbm_iec_config (_name)[] =
5346
54
55#define CBM_IEC_INTERFACE(_name) \
56   const cbm_iec_stub_interface (_name) =
57
58
59
6047//**************************************************************************
6148//  TYPE DEFINITIONS
6249//**************************************************************************
6350
64// ======================> cbm_iec_config
51// ======================> cbm_iec_interface
6552
66struct cbm_iec_config
53struct cbm_iec_interface
6754{
68   const char *m_tag;
55   devcb_write_line   m_out_srq_cb;
56   devcb_write_line   m_out_atn_cb;
57   devcb_write_line   m_out_clk_cb;
58   devcb_write_line   m_out_data_cb;
59   devcb_write_line   m_out_reset_cb;
6960};
7061
7162
72// ======================> device_cbm_iec_interface
73
74class device_cbm_iec_interface : public device_interface
75{
76public:
77   // construction/destruction
78   device_cbm_iec_interface(const machine_config &mconfig, device_t &device);
79   virtual ~device_cbm_iec_interface();
80
81   // optional operation overrides
82   virtual void cbm_iec_atn(int state) { };
83   virtual void cbm_iec_clk(int state) { };
84   virtual void cbm_iec_data(int state) { };
85   virtual void cbm_iec_srq(int state) { };
86   virtual void cbm_iec_reset(int state) { };
87};
88
89
9063// ======================> cbm_iec_device
9164
92class cbm_iec_stub_device;
65class device_cbm_iec_interface;
9366
94class cbm_iec_device :  public device_t,
95                  public cbm_iec_config
67class cbm_iec_device : public device_t,
68                  public cbm_iec_interface
9669{
9770public:
98    // construction/destruction
99    cbm_iec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
71   // construction/destruction
72   cbm_iec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
10073
74   void add_device(device_t *target);
75   
10176   // reads for both host and peripherals
10277   DECLARE_READ_LINE_MEMBER( srq_r );
10378   DECLARE_READ_LINE_MEMBER( atn_r );
r13216r13217
11893   void clk_w(device_t *device, int state);
11994   void data_w(device_t *device, int state);
12095   void reset_w(device_t *device, int state);
121
96   
12297protected:
12398   enum
12499   {
r13216r13217
132107
133108   // device-level overrides
134109    virtual void device_start();
135    // device_config overrides
136110    virtual void device_config_complete();
137
111   
138112   class daisy_entry
139113   {
140114   public:
141115      daisy_entry(device_t *device);
116      daisy_entry *next() const { return m_next; }
142117
143118      daisy_entry *            m_next;         // next device
144119      device_t *               m_device;      // associated device
r13216r13217
147122      int m_line[SIGNAL_COUNT];
148123   };
149124
150   daisy_entry *         m_daisy_list;   // head of the daisy chain
151
125   simple_list<daisy_entry> m_device_list;
126   
152127private:
128   devcb_resolved_write_line   m_out_atn_func;
129   devcb_resolved_write_line   m_out_clk_func;
130   devcb_resolved_write_line   m_out_data_func;
131   devcb_resolved_write_line   m_out_srq_func;
132   devcb_resolved_write_line   m_out_reset_func;
133
153134   inline void set_signal(device_t *device, int signal, int state);
154135   inline int get_signal(int signal);
155136
156   cbm_iec_stub_device *m_stub;
157
158   const cbm_iec_config *m_daisy;
137   int m_line[SIGNAL_COUNT];
159138};
160139
161140
162// ======================> cbm_iec_stub_interface
141// ======================> cbm_iec_slot_device
163142
164struct cbm_iec_stub_interface
143class cbm_iec_slot_device : public device_t,
144                     public device_slot_interface
165145{
166   devcb_write_line   m_out_srq_cb;
167   devcb_write_line   m_out_atn_cb;
168   devcb_write_line   m_out_clk_cb;
169   devcb_write_line   m_out_data_cb;
170   devcb_write_line   m_out_reset_cb;
146public:
147   // construction/destruction
148   cbm_iec_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
149
150   // device-level overrides
151   virtual void device_start();
152
153    // inline configuration
154    static void static_set_slot(device_t &device, int address);
155   int get_address();
156
157private:
158   // configuration
159   int m_address;
160   cbm_iec_device  *m_bus;
171161};
172162
173const cbm_iec_stub_interface default_cbm_iec_stub_interface = { DEVCB_NULL, };
174163
175// ======================> cbm_iec_stub_device
164// ======================> device_cbm_iec_interface
176165
177class cbm_iec_stub_device :  public device_t,
178                      public device_cbm_iec_interface,
179                      public cbm_iec_stub_interface
166class device_cbm_iec_interface : public device_slot_card_interface
180167{
168   friend class cbm_iec_device;
169
181170public:
182    // construction/destruction
183    cbm_iec_stub_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
171   // construction/destruction
172   device_cbm_iec_interface(const machine_config &mconfig, device_t &device);
173   virtual ~device_cbm_iec_interface();
184174
185protected:
186    // device-level overrides
187    virtual void device_start();
188    virtual void device_config_complete();
175   device_cbm_iec_interface *next() const { return m_next; }
176   
177   // optional operation overrides
178   virtual void cbm_iec_atn(int state) { };
179   virtual void cbm_iec_clk(int state) { };
180   virtual void cbm_iec_data(int state) { };
181   virtual void cbm_iec_srq(int state) { };
182   virtual void cbm_iec_reset(int state) { };
189183
190   // device_cbm_iec_interface overrides
191   void cbm_iec_atn(int state);
192   void cbm_iec_clk(int state);
193   void cbm_iec_data(int state);
194   void cbm_iec_srq(int state);
195   void cbm_iec_reset(int state);
196
197private:
198   devcb_resolved_write_line   m_out_atn_func;
199   devcb_resolved_write_line   m_out_clk_func;
200   devcb_resolved_write_line   m_out_data_func;
201   devcb_resolved_write_line   m_out_srq_func;
202   devcb_resolved_write_line   m_out_reset_func;
184   cbm_iec_device  *m_bus;
185   device_cbm_iec_interface *m_next;
203186};
204187
205188
206189// device type definition
207190extern const device_type CBM_IEC;
208extern const device_type CBM_IEC_STUB;
191extern const device_type CBM_IEC_SLOT;
209192
210193
194
211195#endif
src/mess/machine/c1581.c
r13216r13217
5959
6060
6161//-------------------------------------------------
62//  static_set_config - configuration helper
63//-------------------------------------------------
64
65void base_c1581_device::static_set_config(device_t &device, int address)
66{
67   base_c1581_device &c1581 = downcast<base_c1581_device &>(device);
68
69   assert((address > 7) && (address < 12));
70
71   c1581.m_address = address - 8;
72}
73
74
75//-------------------------------------------------
7662//  ROM( c1581 )
7763//-------------------------------------------------
7864
r13216r13217
121107   AM_RANGE(0x0000, 0x1fff) AM_MIRROR(0x2000) AM_RAM
122108   AM_RANGE(0x4000, 0x400f) AM_MIRROR(0x1ff0) AM_DEVREADWRITE_LEGACY(M8520_TAG, mos6526_r, mos6526_w)
123109   AM_RANGE(0x6000, 0x6003) AM_MIRROR(0x1ffc) AM_DEVREADWRITE_LEGACY(WD1770_TAG, wd17xx_r, wd17xx_w)
124   AM_RANGE(0x8000, 0xffff) // AM_ROM
110   AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION(M6502_TAG, 0)
125111ADDRESS_MAP_END
126112
127113
r13216r13217
413399     m_cia(*this, M8520_TAG),
414400     m_fdc(*this, WD1770_TAG),
415401     m_image(*this, FLOPPY_0),
416     m_bus(NULL),
417402     m_variant(variant)
418403{
419404}
r13216r13217
443428{
444429   m_bus = machine().device<cbm_iec_device>(CBM_IEC_TAG);
445430
446   // map ROM
447   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
448   program->install_rom(0x8000, 0xbfff, subregion(M6502_TAG)->base());
431   // get bus address
432   cbm_iec_slot_device *slot = downcast<cbm_iec_slot_device*>(owner());
433   m_address = slot->get_address() - 8;
449434
450435   // state saving
451436   save_item(NAME(m_data_out));
src/mess/machine/c1581.h
r13216r13217
3333
3434
3535//**************************************************************************
36//  INTERFACE CONFIGURATION MACROS
37//**************************************************************************
38
39#define MCFG_C1581_ADD(_tag, _address) \
40    MCFG_DEVICE_ADD(_tag, C1581, 0) \
41   base_c1581_device::static_set_config(*device, _address);
42
43
44#define MCFG_C1563_ADD(_tag, _address) \
45    MCFG_DEVICE_ADD(_tag, C1563, 0) \
46   base_c1581_device::static_set_config(*device, _address);
47
48
49
50//**************************************************************************
5136//  TYPE DEFINITIONS
5237//**************************************************************************
5338
r13216r13217
6752      TYPE_1581
6853   };
6954
70   // inline configuration helpers
71   static void static_set_config(device_t &device, int address);
72
7355   // optional information overrides
7456   virtual const rom_entry *device_rom_region() const;
7557   virtual machine_config_constructor device_mconfig_additions() const;
58   
7659   // not really public
7760   DECLARE_WRITE_LINE_MEMBER( cnt_w );
7861   DECLARE_WRITE_LINE_MEMBER( sp_w );
src/mess/machine/c1541.c
r13216r13217
167167const device_type SX1541 = &device_creator<sx1541_device>;
168168const device_type OC118 = &device_creator<oc118_device>;
169169
170
170171c1540_device::c1540_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
171172   :c1541_device(mconfig, C1540, "C1540", tag, owner, clock) { m_variant = TYPE_1540; }
172173
174   
173175c1541c_device::c1541c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
174176   :c1541_device(mconfig, C1541C, "C1541C", tag, owner, clock) { m_variant = TYPE_1541C; }
175177
178   
176179c1541ii_device::c1541ii_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
177180   :c1541_device(mconfig, C1541II, "C1541II", tag, owner, clock) { m_variant = TYPE_1541II; }
178181
182   
179183sx1541_device::sx1541_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
180184   :c1541_device(mconfig, SX1541, "SX1541", tag, owner, clock) { m_variant = TYPE_SX1541; }
181185
186   
182187oc118_device::oc118_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
183188   :c1541_device(mconfig, OC118, "OC118", tag, owner, clock) { m_variant = TYPE_OC118; }
189   
190   
184191//-------------------------------------------------
185192//  device_config_complete - perform any
186193//  operations now that the configuration is
r13216r13217
220227
221228
222229//-------------------------------------------------
223//  static_set_config - configuration helper
224//-------------------------------------------------
225
226void c1541_device::static_set_config(device_t &device, int address)
227{
228   c1541_device &c1541 = downcast<c1541_device &>(device);
229
230   assert((address > 7) && (address < 12));
231
232   c1541.m_address = address - 8;
233}
234
235
236//-------------------------------------------------
237230//  ROM( c1540 )
238231//-------------------------------------------------
239232
r13216r13217
346339   AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x6000) AM_RAM
347340   AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x63f0) AM_DEVREADWRITE(M6522_0_TAG, via6522_device, read, write)
348341   AM_RANGE(0x1c00, 0x1c0f) AM_MIRROR(0x63f0) AM_DEVREADWRITE(M6522_1_TAG, via6522_device, read, write)
349   AM_RANGE(0x8000, 0xbfff) AM_MIRROR(0x4000) // AM_ROM
342   AM_RANGE(0x8000, 0xbfff) AM_MIRROR(0x4000) AM_ROM AM_REGION(M6502_TAG, 0)
350343ADDRESS_MAP_END
351344
352345
r13216r13217
733726     m_via1(*this, M6522_1_TAG),
734727     m_ga(*this, C64H156_TAG),
735728     m_image(*this, FLOPPY_0),
736     m_bus(NULL),
737729     m_data_out(1),
738730     m_via0_irq(0),
739731     m_via1_irq(0)
r13216r13217
741733   m_variant = TYPE_1541;
742734}
743735
736
744737c1541_device::c1541_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
745738    : device_t(mconfig, type, name, tag, owner, clock),
746739     device_cbm_iec_interface(mconfig, *this),
r13216r13217
749742     m_via1(*this, M6522_1_TAG),
750743     m_ga(*this, C64H156_TAG),
751744     m_image(*this, FLOPPY_0),
752     m_bus(NULL),
753745     m_data_out(1),
754746     m_via0_irq(0),
755747     m_via1_irq(0)
756748{
757749}
758750
751
759752//-------------------------------------------------
760753//  device_start - device-specific startup
761754//-------------------------------------------------
r13216r13217
764757{
765758    m_bus = machine().device<cbm_iec_device>(CBM_IEC_TAG);
766759
767   // map ROM
768   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
769   program->install_rom(0x8000, 0xbfff, 0, 0x4000, subregion(M6502_TAG)->base());
760   // get bus address
761   cbm_iec_slot_device *slot = downcast<cbm_iec_slot_device*>(owner());
762   m_address = slot->get_address() - 8;
770763
771764   // install image callbacks
772765   floppy_install_unload_proc(m_image, c1541_device::on_disk_change);
src/mess/machine/c1541.h
r13216r13217
3434
3535
3636//**************************************************************************
37//  INTERFACE CONFIGURATION MACROS
38//**************************************************************************
39
40#define MCFG_C1540_ADD(_tag, _address) \
41    MCFG_DEVICE_ADD(_tag, C1540, 0) \
42   c1541_device::static_set_config(*device, _address);
43
44#define MCFG_C1541_ADD(_tag, _address) \
45    MCFG_DEVICE_ADD(_tag, C1541, 0) \
46   c1541_device::static_set_config(*device, _address);
47
48#define MCFG_C1541C_ADD(_tag, _address) \
49    MCFG_DEVICE_ADD(_tag, C1541C, 0) \
50   c1541_device::static_set_config(*device, _address);
51
52#define MCFG_C1541II_ADD(_tag, _address) \
53    MCFG_DEVICE_ADD(_tag, C1541II, 0) \
54   c1541_device::static_set_config(*device, _address);
55
56#define MCFG_SX1541_ADD(_tag, _address) \
57    MCFG_DEVICE_ADD(_tag, SX1541, 0) \
58   c1541_device::static_set_config(*device, _address);
59
60#define MCFG_OC118_ADD(_tag, _address) \
61    MCFG_DEVICE_ADD(_tag, OC118, 0) \
62   c1541_device::static_set_config(*device, _address);
63
64
65
66//**************************************************************************
6737//  TYPE DEFINITIONS
6838//**************************************************************************
6939
r13216r13217
10272   DECLARE_WRITE_LINE_MEMBER( atn_w );
10373   DECLARE_WRITE_LINE_MEMBER( byte_w );
10474
105   // inline configuration helpers
106   static void static_set_config(device_t &device, int address);
107
10875   // optional information overrides
10976   virtual const rom_entry *device_rom_region() const;
11077   virtual machine_config_constructor device_mconfig_additions() const;
src/mess/machine/c1571.c
r13216r13217
7777
7878
7979//-------------------------------------------------
80//  static_set_config - configuration helper
81//-------------------------------------------------
82
83void base_c1571_device::static_set_config(device_t &device, int address)
84{
85   base_c1571_device &c1571 = downcast<base_c1571_device &>(device);
86
87   assert((address > 7) && (address < 12));
88
89   c1571.m_address = address - 8;
90}
91
92
93//-------------------------------------------------
9480//  ROM( c1570 )
9581//-------------------------------------------------
9682
r13216r13217
154140   AM_RANGE(0x1c00, 0x1c0f) AM_MIRROR(0x03f0) AM_DEVREADWRITE(M6522_1_TAG, via6522_device, read, write)
155141   AM_RANGE(0x2000, 0x2003) AM_MIRROR(0x1ffc) AM_DEVREADWRITE_LEGACY(WD1770_TAG, wd17xx_r, wd17xx_w)
156142   AM_RANGE(0x4000, 0x400f) AM_MIRROR(0x3ff0) AM_DEVREADWRITE_LEGACY(M6526_TAG, mos6526_r, mos6526_w)
157   AM_RANGE(0x8000, 0xffff) // AM_ROM
143   AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION(M6502_TAG, 0)
158144ADDRESS_MAP_END
159145
160146
r13216r13217
694680     m_fdc(*this, WD1770_TAG),
695681     m_ga(*this, C64H156_TAG),
696682     m_image(*this, FLOPPY_0),
697     m_bus(NULL),
698683     m_1_2mhz(0),
699684     m_data_out(1),
700685     m_ser_dir(0),
r13216r13217
740725{
741726   m_bus = machine().device<cbm_iec_device>(CBM_IEC_TAG);
742727
728   // get bus address
729   cbm_iec_slot_device *slot = downcast<cbm_iec_slot_device*>(owner());
730   m_address = slot->get_address() - 8;
731
743732   // map ROM
744733   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
745734   program->install_rom(0x8000, 0xffff, subregion(M6502_TAG)->base());
src/mess/machine/c1571.h
r13216r13217
3636
3737
3838//**************************************************************************
39//  INTERFACE CONFIGURATION MACROS
40//**************************************************************************
41
42#define MCFG_C1570_ADD(_tag, _address) \
43    MCFG_DEVICE_ADD(_tag, C1570, 0) \
44   base_c1571_device::static_set_config(*device, _address);
45
46
47#define MCFG_C1571_ADD(_tag, _address) \
48    MCFG_DEVICE_ADD(_tag, C1571, 0) \
49   base_c1571_device::static_set_config(*device, _address);
50
51
52#define MCFG_C1571CR_ADD(_tag, _address) \
53    MCFG_DEVICE_ADD(_tag, C1571CR, 0) \
54   base_c1571_device::static_set_config(*device, _address);
55
56
57
58//**************************************************************************
5939//  TYPE DEFINITIONS
6040//**************************************************************************
6141
r13216r13217
7555    // construction/destruction
7656    base_c1571_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
7757
78   // inline configuration helpers
79   static void static_set_config(device_t &device, int address);
80
8158   // optional information overrides
8259   virtual const rom_entry *device_rom_region() const;
8360   virtual machine_config_constructor device_mconfig_additions() const;
src/mess/machine/c64.c
r13216r13217
460460   loram  = (data & 1) ? 1 : 0;
461461   hiram  = (data & 2) ? 1 : 0;
462462   charen = (data & 4) ? 1 : 0;
463   logerror("Bankswitch mode || charen, state->m_ultimax\n");
464   logerror("%d, %d, %d, %d  ||   %d,      %d  \n", loram, hiram, state->m_game, state->m_exrom, charen, ultimax_mode);
463   //logerror("Bankswitch mode || charen, state->m_ultimax\n");
464   //logerror("%d, %d, %d, %d  ||   %d,      %d  \n", loram, hiram, state->m_game, state->m_exrom, charen, ultimax_mode);
465465
466466   if (ultimax_mode)
467467   {
src/mess/mess.lst
r13216r13217
578578p500     // Commodore P500 (proto, a.k.a. C128-40, PET-II)
579579
580580c16      // Commodore 16
581c16c     // Commodore 16  c1551
582c16v     // Commodore 16  vc1541
583581c16hun   // Commodore 16 Novotrade (Hungarian Character Set)
584582c116     // Commodore 116
585c116c    // Commodore 116  c1551
586c116v    // Commodore 116  vc1541
587583plus4    // Commodore +4
588plus4c   // Commodore +4  c1551
589plus4v   // Commodore +4  vc1541
590584c232     // Commodore 232 - Prototype
591585c264     // Commodore 264 - Prototype
592586c364     // Commodore V364 - Prototype
src/mess/mess.mak
r13216r13217
781781   $(MESS_DRIVERS)/c65.o      \
782782   $(MESS_DRIVERS)/c128.o      \
783783   $(MESS_MACHINE)/cbmiec.o   \
784   $(MESS_MACHINE)/iecstub.o   \
785784   $(MESS_MACHINE)/c1541.o      \
786785   $(MESS_MACHINE)/c1551.o      \
787786   $(MESS_MACHINE)/c1571.o      \
src/mess/drivers/c65.c
r13216r13217
5252
5353#include "emu.h"
5454#include "cpu/m6502/m4510.h"
55
5655#include "sound/sid6581.h"
5756#include "machine/6526cia.h"
58
57#include "machine/c1541.h"
58#include "machine/c1571.h"
59#include "machine/c1581.h"
5960#include "machine/cbmipt.h"
6061#include "video/vic4567.h"
61
62/* devices config */
6362#include "includes/cbm.h"
6463#include "formats/cbm_snqk.h"
65
6664#include "includes/c64.h"
6765#include "includes/c65.h"
6866#include "machine/cbmiec.h"
r13216r13217
200198};
201199
202200
203static CBM_IEC_DAISY( cbm_iec_daisy )
201static SLOT_INTERFACE_START( cbm_iec_devices )
202   SLOT_INTERFACE("c1540", C1540)
203   SLOT_INTERFACE("c1541", C1541)
204   SLOT_INTERFACE("c1541c", C1541C)
205   SLOT_INTERFACE("c1541ii", C1541II)
206   SLOT_INTERFACE("oc118", OC118)
207   SLOT_INTERFACE("c1570", C1570)
208   SLOT_INTERFACE("c1571", C1571)
209   SLOT_INTERFACE("c1581", C1581)
210SLOT_INTERFACE_END
211
212static CBM_IEC_INTERFACE( cbm_iec_intf )
204213{
205   { NULL}
214   DEVCB_NULL,
215   DEVCB_NULL,
216   DEVCB_NULL,
217   DEVCB_NULL,
218   DEVCB_NULL
206219};
207220
208221
r13216r13217
321334   MCFG_MOS6526R1_ADD("cia_1", 3500000, c65_ntsc_cia1)
322335
323336   /* floppy from serial bus */
324   MCFG_CBM_IEC_ADD(cbm_iec_daisy)
337   MCFG_CBM_IEC_BUS_ADD(cbm_iec_intf)
338   MCFG_CBM_IEC_SLOT_ADD("iec4", 4, cbm_iec_devices, NULL, NULL)
339   MCFG_CBM_IEC_SLOT_ADD("iec8", 8, cbm_iec_devices, NULL, NULL)
340   MCFG_CBM_IEC_SLOT_ADD("iec9", 9, cbm_iec_devices, NULL, NULL)
341   MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, NULL, NULL)
342   MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL)
325343
326344   MCFG_FRAGMENT_ADD(c64_cartslot)
327345
src/mess/drivers/vic20.c
r13216r13217
7979#include "machine/ram.h"
8080#include "machine/6522via.h"
8181#include "machine/c1541.h"
82#include "machine/c1571.h"
83#include "machine/c1581.h"
8284#include "machine/c2031.h"
8385#include "machine/cbmiec.h"
8486#include "machine/ieee488.h"
r13216r13217
432434
433435/* IEC Serial Bus */
434436
435static CBM_IEC_DAISY( cbm_iec_daisy )
436{
437   { C1541_TAG },
438   { NULL }
439};
437static SLOT_INTERFACE_START( cbm_iec_devices )
438   SLOT_INTERFACE("c1540", C1540)
439   SLOT_INTERFACE("c1541", C1541)
440   SLOT_INTERFACE("c1541c", C1541C)
441   SLOT_INTERFACE("c1541ii", C1541II)
442   SLOT_INTERFACE("oc118", OC118)
443   SLOT_INTERFACE("c1570", C1570)
444   SLOT_INTERFACE("c1571", C1571)
445   SLOT_INTERFACE("c1581", C1581)
446SLOT_INTERFACE_END
440447
441448static CBM_IEC_INTERFACE( cbm_iec_intf )
442449{
r13216r13217
689696
690697   MCFG_QUICKLOAD_ADD("quickload", cbm_vc20, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
691698   MCFG_CASSETTE_ADD(CASSETTE_TAG, cbm_cassette_interface )
692   MCFG_CBM_IEC_CONFIG_ADD(cbm_iec_daisy, cbm_iec_intf)
693   MCFG_C1541_ADD(C1541_TAG, 8)
699
700   MCFG_CBM_IEC_BUS_ADD(cbm_iec_intf)
701   MCFG_CBM_IEC_SLOT_ADD("iec4", 4, cbm_iec_devices, NULL, NULL)
702   MCFG_CBM_IEC_SLOT_ADD("iec8", 8, cbm_iec_devices, "c1541", NULL)
703   MCFG_CBM_IEC_SLOT_ADD("iec9", 9, cbm_iec_devices, NULL, NULL)
704   MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, NULL, NULL)
705   MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL)
694706#ifdef INCLUDE_VIC1112
695707    MCFG_VIC1112_ADD(ieee488_daisy)
696708    MCFG_C2031_ADD(C2031_TAG, 9)
src/mess/drivers/c128.c
r13216r13217
178178#include "machine/6526cia.h"
179179
180180#include "machine/cbmipt.h"
181#include "machine/c1541.h"
181182#include "machine/c1571.h"
182183#include "machine/c1581.h"
183184#include "video/vic6567.h"
r13216r13217
658659   DEVCB_HANDLER(c128_m6510_port_write)   /* port_write_func */
659660};
660661
661static CBM_IEC_DAISY( c128_iec_bus )
662{
663   { C1571_TAG },
664   { NULL }
665};
662static SLOT_INTERFACE_START( c128dcr_iec_devices )
663   SLOT_INTERFACE("c1571cr", C1571CR)
664SLOT_INTERFACE_END
666665
667static CBM_IEC_DAISY( c128d81_iec_bus )
668{
669   { C1581_TAG },
670   { NULL }
671};
666static SLOT_INTERFACE_START( c128d81_iec_devices )
667   SLOT_INTERFACE("c1563", C1563)
668SLOT_INTERFACE_END
672669
673static CBM_IEC_INTERFACE( c128_iec_intf )
670static SLOT_INTERFACE_START( cbm_iec_devices )
671   SLOT_INTERFACE("c1540", C1540)
672   SLOT_INTERFACE("c1541", C1541)
673   SLOT_INTERFACE("c1541c", C1541C)
674   SLOT_INTERFACE("c1541ii", C1541II)
675   SLOT_INTERFACE("oc118", OC118)
676   SLOT_INTERFACE("c1570", C1570)
677   SLOT_INTERFACE("c1571", C1571)
678   SLOT_INTERFACE("c1581", C1581)
679SLOT_INTERFACE_END
680
681static CBM_IEC_INTERFACE( cbm_iec_intf )
674682{
675683   DEVCB_DEVICE_LINE("cia_0", c128_iec_srq_w),
676684   DEVCB_NULL,
r13216r13217
743751 *
744752 *************************************/
745753
746static MACHINE_CONFIG_START( c128, c128_state )
754static MACHINE_CONFIG_START( common, c128_state )
747755   /* basic machine hardware */
748756   MCFG_CPU_ADD("maincpu", Z80, VIC6567_CLOCK)
749757   MCFG_CPU_PROGRAM_MAP( c128_z80_mem)
r13216r13217
794802   MCFG_MOS6526R1_ADD("cia_0", VIC6567_CLOCK, c128_ntsc_cia0)
795803   MCFG_MOS6526R1_ADD("cia_1", VIC6567_CLOCK, c128_ntsc_cia1)
796804
797   /* floppy from serial bus */
798   MCFG_CBM_IEC_CONFIG_ADD(c128_iec_bus, c128_iec_intf)
799   MCFG_C1571_ADD(C1571_TAG, 8)
800
801805   MCFG_FRAGMENT_ADD(c64_cartslot)
802806   MCFG_SOFTWARE_LIST_ADD("c64_disk_list", "c64_flop")
803807   MCFG_SOFTWARE_LIST_ADD("c128_disk_list", "c128_flop")
804808MACHINE_CONFIG_END
805809
810static MACHINE_CONFIG_DERIVED( c128, common )
811   MCFG_CBM_IEC_BUS_ADD(cbm_iec_intf)
812   MCFG_CBM_IEC_SLOT_ADD("iec4", 4, cbm_iec_devices, NULL, NULL)
813   MCFG_CBM_IEC_SLOT_ADD("iec8", 8, cbm_iec_devices, "c1571", NULL)
814   MCFG_CBM_IEC_SLOT_ADD("iec9", 9, cbm_iec_devices, NULL, NULL)
815   MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, NULL, NULL)
816   MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL)
817MACHINE_CONFIG_END
806818
807static MACHINE_CONFIG_DERIVED( c128d, c128 )
819static MACHINE_CONFIG_DERIVED( c128d, common )
820   MCFG_CBM_IEC_BUS_ADD(cbm_iec_intf)
821   MCFG_CBM_IEC_SLOT_ADD("iec4", 4, cbm_iec_devices, NULL, NULL)
822   MCFG_CBM_IEC_SLOT_ADD("iec8", 8, cbm_iec_devices, "c1571", NULL)
823   MCFG_CBM_IEC_SLOT_ADD("iec9", 9, cbm_iec_devices, NULL, NULL)
824   MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, NULL, NULL)
825   MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL)
808826MACHINE_CONFIG_END
809827
810static MACHINE_CONFIG_DERIVED( c128dcr, c128 )
811   MCFG_DEVICE_REMOVE(C1571_TAG)
812   MCFG_C1571CR_ADD(C1571_TAG, 8)
828static MACHINE_CONFIG_DERIVED( c128dcr, common )
829   MCFG_CBM_IEC_BUS_ADD(cbm_iec_intf)
830   MCFG_CBM_IEC_SLOT_ADD("iec4", 4, cbm_iec_devices, NULL, NULL)
831   MCFG_CBM_IEC_SLOT_ADD("iec8", 8, c128dcr_iec_devices, "c1571cr", NULL)
832   MCFG_CBM_IEC_SLOT_ADD("iec9", 9, cbm_iec_devices, NULL, NULL)
833   MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, NULL, NULL)
834   MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL)
813835MACHINE_CONFIG_END
814836
815static MACHINE_CONFIG_DERIVED( c128d81, c128 )
816
817   MCFG_CBM_IEC_REMOVE()
818   MCFG_DEVICE_REMOVE(C1571_TAG)
819
820   MCFG_CBM_IEC_CONFIG_ADD(c128d81_iec_bus, c128_iec_intf)
821   MCFG_C1563_ADD(C1581_TAG, 8)
837static MACHINE_CONFIG_DERIVED( c128d81, common )
838   MCFG_CBM_IEC_BUS_ADD(cbm_iec_intf)
839   MCFG_CBM_IEC_SLOT_ADD("iec4", 4, cbm_iec_devices, NULL, NULL)
840   MCFG_CBM_IEC_SLOT_ADD("iec8", 8, c128d81_iec_devices, "c1563", NULL)
841   MCFG_CBM_IEC_SLOT_ADD("iec9", 9, cbm_iec_devices, NULL, NULL)
842   MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, NULL, NULL)
843   MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL)
822844MACHINE_CONFIG_END
823845
824
825846static MACHINE_CONFIG_DERIVED( c128pal, c128 )
826847   MCFG_CPU_MODIFY("maincpu")
827848   MCFG_CPU_CLOCK( VIC6569_CLOCK)
r13216r13217
851872static MACHINE_CONFIG_DERIVED( c128dpal, c128pal )
852873MACHINE_CONFIG_END
853874
854static MACHINE_CONFIG_DERIVED( c128dcrp, c128pal )
875static MACHINE_CONFIG_DERIVED( c128dcrp, c128dcr )
876   MCFG_CPU_MODIFY("maincpu")
877   MCFG_CPU_CLOCK( VIC6569_CLOCK)
878   MCFG_CPU_MODIFY("m8502")
879   MCFG_CPU_CLOCK( VIC6569_CLOCK)
880   MCFG_CPU_CONFIG( c128_m8502_interface )
855881
882   MCFG_SCREEN_MODIFY("screen")
883   MCFG_SCREEN_REFRESH_RATE(VIC6569_VRETRACERATE)
884   MCFG_SCREEN_SIZE(VIC6569_COLUMNS * 2, VIC6569_LINES)
885   MCFG_SCREEN_VISIBLE_AREA(0, VIC6569_VISIBLECOLUMNS - 1, 0, VIC6569_VISIBLELINES - 1)
886
887   MCFG_DEVICE_REMOVE("vic2e")
888   MCFG_VIC2_ADD("vic2e", c128_vic2_pal_intf)
889
890   /* sound hardware */
891   MCFG_SOUND_REPLACE("sid6581", SID6581, VIC6569_CLOCK)
892   MCFG_SOUND_CONFIG(c128_sound_interface)
893
894   /* cia */
895   MCFG_DEVICE_REMOVE("cia_0")
896   MCFG_DEVICE_REMOVE("cia_1")
897   MCFG_MOS6526R1_ADD("cia_0", VIC6569_CLOCK, c128_pal_cia0)
898   MCFG_MOS6526R1_ADD("cia_1", VIC6569_CLOCK, c128_pal_cia1)
856899MACHINE_CONFIG_END
857900
858901
src/mess/drivers/c16.c
r13216r13217
122122#include "includes/c16.h"
123123#include "machine/c1541.h"
124124#include "machine/c1551.h"
125#include "machine/c1571.h"
126#include "machine/c1581.h"
125127#include "machine/cbmiec.h"
126128#include "machine/cbmipt.h"
127129#include "sound/sid6581.h"
r13216r13217
417419   DEVCB_HANDLER(c16_m7501_port_write)   /* port_write_func */
418420};
419421
420static CBM_IEC_DAISY( c16_iec_no_drives )
421{
422   { NULL }
423};
422static SLOT_INTERFACE_START( cbm_iec_devices )
423   SLOT_INTERFACE("c1540", C1540)
424   SLOT_INTERFACE("c1541", C1541)
425   SLOT_INTERFACE("c1541c", C1541C)
426   SLOT_INTERFACE("c1541ii", C1541II)
427   SLOT_INTERFACE("oc118", OC118)
428   SLOT_INTERFACE("c1570", C1570)
429   SLOT_INTERFACE("c1571", C1571)
430   SLOT_INTERFACE("c1581", C1581)
431SLOT_INTERFACE_END
424432
425static CBM_IEC_DAISY( c16_iec_1541 )
433static CBM_IEC_INTERFACE( cbm_iec_intf )
426434{
427   { C1541_TAG },
428   { NULL }
435   DEVCB_NULL,
436   DEVCB_NULL,
437   DEVCB_NULL,
438   DEVCB_NULL,
439   DEVCB_NULL
429440};
430441
431442static SCREEN_UPDATE( c16 )
r13216r13217
460471}
461472
462473static MACHINE_CONFIG_START( c16, c16_state )
463
464474   /* basic machine hardware */
465475   MCFG_CPU_ADD("maincpu", M7501, XTAL_17_73447MHz/20)
466476   MCFG_CPU_PROGRAM_MAP(c16_map)
r13216r13217
496506   MCFG_CASSETTE_ADD( CASSETTE_TAG, cbm_cassette_interface )
497507
498508   MCFG_FRAGMENT_ADD(c16_cartslot)
509
510   MCFG_C1551_ADD(C1551_TAG, 8)
499511   MCFG_SOFTWARE_LIST_ADD("disk_list", "plus4_flop")
500512
501513   /* IEC serial bus */
502   MCFG_CBM_IEC_ADD(c16_iec_no_drives)
514   MCFG_CBM_IEC_BUS_ADD(cbm_iec_intf)
515   MCFG_CBM_IEC_SLOT_ADD("iec4", 4, cbm_iec_devices, NULL, NULL)
516   MCFG_CBM_IEC_SLOT_ADD("iec8", 8, cbm_iec_devices, NULL, NULL)
517   MCFG_CBM_IEC_SLOT_ADD("iec9", 9, cbm_iec_devices, NULL, NULL)
518   MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, NULL, NULL)
519   MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL)
503520
504521   /* internal ram */
505522   MCFG_RAM_ADD(RAM_TAG)
r13216r13217
507524   MCFG_RAM_EXTRA_OPTIONS("16K,32K")
508525MACHINE_CONFIG_END
509526
510
511static MACHINE_CONFIG_DERIVED( c16c, c16 )
512
513   MCFG_C1551_ADD(C1551_TAG, 8)
514
515#ifdef CPU_SYNC
516   MCFG_QUANTUM_TIME(attotime::from_hz(60))
517#else
518   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
519#endif
520MACHINE_CONFIG_END
521
522
523static MACHINE_CONFIG_DERIVED( c16v, c16 )
524
525   /* floppy from serial bus */
526   MCFG_CBM_IEC_REMOVE()
527   MCFG_CBM_IEC_ADD(c16_iec_1541)
528   MCFG_C1541_ADD(C1541_TAG, 8)
529#ifdef CPU_SYNC
530   MCFG_QUANTUM_TIME(attotime::from_hz(60))
531#else
532   MCFG_QUANTUM_TIME(attotime::from_hz(300000))
533#endif
534MACHINE_CONFIG_END
535
536
537527static MACHINE_CONFIG_DERIVED( plus4, c16 )
538
539528   MCFG_CPU_MODIFY( "maincpu" )
540529   MCFG_CPU_CLOCK( XTAL_14_31818MHz/16 )
541530   MCFG_CPU_PROGRAM_MAP(plus4_map)
r13216r13217
553542   MCFG_RAM_DEFAULT_SIZE("64K")
554543MACHINE_CONFIG_END
555544
556
557static MACHINE_CONFIG_DERIVED( plus4c, plus4 )
558
559   MCFG_C1551_ADD(C1551_TAG, 8)
560
561   MCFG_SCREEN_MODIFY("screen")
562   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
563#ifdef CPU_SYNC
564   MCFG_QUANTUM_TIME(attotime::from_hz(60))
565#else
566   MCFG_QUANTUM_TIME(attotime::from_hz(60000))
567#endif
568MACHINE_CONFIG_END
569
570
571static MACHINE_CONFIG_DERIVED( plus4v, plus4 )
572
573   /* floppy from serial bus */
574   MCFG_CBM_IEC_REMOVE()
575   MCFG_CBM_IEC_ADD(c16_iec_1541)
576   MCFG_C1541_ADD(C1541_TAG, 8)
577
578   MCFG_SCREEN_MODIFY("screen")
579   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
580#ifdef CPU_SYNC
581   MCFG_QUANTUM_TIME(attotime::from_hz(60))
582#else
583   MCFG_QUANTUM_TIME(attotime::from_hz(300000))
584#endif
585MACHINE_CONFIG_END
586
587
588545static MACHINE_CONFIG_DERIVED( c364, plus4 )
589546   MCFG_SCREEN_MODIFY("screen")
590547   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
r13216r13217
698655/*    YEAR  NAME  PARENT COMPAT MACHINE     INPUT      INIT      COMPANY                         FULLNAME            FLAGS */
699656
700657COMP( 1984, c16,      0,     0,  c16,       c16,       c16,      "Commodore Business Machines",  "Commodore 16 (PAL)", 0)
701COMP( 1984, c16c,     c16,   0,  c16c,      c16,       c16,      "Commodore Business Machines",  "Commodore 16 (PAL, 1551)", 0 )
702COMP( 1984, c16v,     c16,   0,  c16v,      c16,       c16,      "Commodore Business Machines",  "Commodore 16 (PAL, VC1541)", 0)
703658COMP( 1984, c16hun,   c16,   0,  c16,       c16,       c16,      "Commodore Business Machines",  "Commodore 16 Novotrade (PAL, Hungary)", 0)
704659
705660COMP( 1984, c116,     c16,   0,  c16,       c16,       c16,      "Commodore Business Machines",  "Commodore 116 (PAL)", 0)
706COMP( 1984, c116c,    c16,   0,  c16c,      c16,       c16,      "Commodore Business Machines",  "Commodore 116 (PAL, 1551)", 0 )
707COMP( 1984, c116v,    c16,   0,  c16v,      c16,       c16,      "Commodore Business Machines",  "Commodore 116 (PAL, VC1541)", 0 )
708661
709662COMP( 1984, plus4,    c16,   0,  plus4,     plus4,     plus4,    "Commodore Business Machines",  "Commodore Plus/4 (NTSC)", 0)
710COMP( 1984, plus4c,   c16,   0,  plus4c,    plus4,     plus4,    "Commodore Business Machines",  "Commodore Plus/4 (NTSC, 1551)", 0 )
711COMP( 1984, plus4v,   c16,   0,  plus4v,    plus4,     plus4,    "Commodore Business Machines",  "Commodore Plus/4 (NTSC, VC1541)", 0)
712663
713664COMP( 1984, c232,     c16,   0,  c16,       c16,       c16,      "Commodore Business Machines",  "Commodore 232 (Prototype)", 0)
714665COMP( 1984, c264,     c16,   0,  c264,      plus4,     plus4,    "Commodore Business Machines",  "Commodore 264 (Prototype)", 0)
src/mess/drivers/primo.c
r13216r13217
247247   NULL
248248};
249249
250static CBM_IEC_DAISY( cbm_iec_daisy )
250static SLOT_INTERFACE_START( cbm_iec_devices )
251SLOT_INTERFACE_END
252
253static CBM_IEC_INTERFACE( cbm_iec_intf )
251254{
252   { NULL}
255   DEVCB_NULL,
256   DEVCB_NULL,
257   DEVCB_NULL,
258   DEVCB_NULL,
259   DEVCB_NULL
253260};
254261
255262static MACHINE_CONFIG_START( primoa32, primo_state )
r13216r13217
289296   /* floppy from serial bus */
290297   /* for some reason machine/primo.c sets up the serial bus
291298    but no floppy drive has been apparently added... incomplete driver? */
292   MCFG_CBM_IEC_ADD(cbm_iec_daisy)
299   MCFG_CBM_IEC_BUS_ADD(cbm_iec_intf)
293300
294301   /* cartridge */
295302   MCFG_CARTSLOT_ADD("cart1")
src/mess/drivers/c64.c
r13216r13217
341341#include "formats/cbm_snqk.h"
342342#include "machine/cbmiec.h"
343343#include "machine/c1541.h"
344#include "machine/c1571.h"
345#include "machine/c1581.h"
344346#include "machine/c2040.h"
345347#include "machine/interpod.h"
346348#include "machine/c64exp.h"
r13216r13217
557559   DEVCB_HANDLER(c64_m6510_port_write)
558560};
559561
560static CBM_IEC_DAISY( cbm_iec_null_daisy )
561{
562   { NULL }
563};
562static SLOT_INTERFACE_START( sx1541_iec_devices )
563   SLOT_INTERFACE("sx1541", SX1541)
564SLOT_INTERFACE_END
564565
565static CBM_IEC_DAISY( cbm_iec_daisy )
566{
567   { C1541_TAG },
568#ifdef INCLUDE_INTERPOD
569   { INTERPOD_TAG },
570#endif
571   { NULL }
572};
566static SLOT_INTERFACE_START( cbm_iec_devices )
567   SLOT_INTERFACE("c1540", C1540)
568   SLOT_INTERFACE("c1541", C1541)
569   SLOT_INTERFACE("c1541c", C1541C)
570   SLOT_INTERFACE("c1541ii", C1541II)
571   SLOT_INTERFACE("oc118", OC118)
572   SLOT_INTERFACE("c1570", C1570)
573   SLOT_INTERFACE("c1571", C1571)
574   SLOT_INTERFACE("c1581", C1581)
575SLOT_INTERFACE_END
573576
574#ifdef INCLUDE_INTERPOD
575static IEEE488_DAISY( ieee488_daisy )
577static CBM_IEC_INTERFACE( cbm_iec_intf )
576578{
577   { C4040_TAG },
578   { NULL}
579   DEVCB_NULL,
580   DEVCB_NULL,
581   DEVCB_NULL,
582   DEVCB_NULL,
583   DEVCB_NULL
579584};
580#endif
581585
586
582587/*************************************
583588 *
584589 *  VIC II interfaces
r13216r13217
706711 *
707712 *************************************/
708713
714static MACHINE_CONFIG_START( ultimax, c64_state )
715   /* basic machine hardware */
716   MCFG_CPU_ADD("maincpu", M6510, VIC6567_CLOCK)
717   MCFG_CPU_PROGRAM_MAP( ultimax_mem)
718   MCFG_CPU_CONFIG( c64_m6510_interface )
719   MCFG_CPU_VBLANK_INT("screen", c64_frame_interrupt)
720   //MCFG_CPU_PERIODIC_INT(vic2_raster_irq, VIC6567_HRETRACERATE)
721   MCFG_QUANTUM_TIME(attotime::from_hz(60))
722
723   MCFG_MACHINE_START( c64 )
724   MCFG_MACHINE_RESET( c64 )
725
726   /* video hardware */
727   MCFG_SCREEN_ADD("screen", RASTER)
728   MCFG_SCREEN_REFRESH_RATE(VIC6567_VRETRACERATE)
729   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) /* not accurate */
730   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
731   MCFG_SCREEN_SIZE(VIC6567_COLUMNS, VIC6567_LINES)
732   MCFG_SCREEN_VISIBLE_AREA(0, VIC6567_VISIBLECOLUMNS - 1, 0, VIC6567_VISIBLELINES - 1)
733   MCFG_SCREEN_UPDATE( c64 )
734
735   MCFG_PALETTE_INIT( c64 )
736   MCFG_PALETTE_LENGTH(ARRAY_LENGTH(c64_palette) / 3)
737
738   MCFG_VIC2_ADD("vic2", ultimax_vic2_intf)
739
740   /* sound hardware */
741   MCFG_SPEAKER_STANDARD_MONO("mono")
742   MCFG_SOUND_ADD("sid6581", SID6581, VIC6567_CLOCK)
743   MCFG_SOUND_CONFIG(c64_sound_interface)
744   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
745   MCFG_SOUND_ADD("dac", DAC, 0)
746   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
747
748   /* quickload */
749   MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
750
751   /* cassette */
752   MCFG_CASSETTE_ADD( CASSETTE_TAG, cbm_cassette_interface )
753
754   /* cia */
755   MCFG_MOS6526R1_ADD("cia_0", VIC6567_CLOCK, c64_ntsc_cia0)
756   MCFG_MOS6526R1_ADD("cia_1", VIC6567_CLOCK, c64_ntsc_cia1)
757   
758   MCFG_FRAGMENT_ADD(ultimax_cartslot)
759
760   MCFG_C64_EXPANSION_SLOT_ADD("exp", c64_expansion_intf, c64_expansion_cards, NULL, NULL)
761MACHINE_CONFIG_END
762
709763static MACHINE_CONFIG_START( c64, c64_state )
710764   /* basic machine hardware */
711765   MCFG_CPU_ADD("maincpu", M6510, VIC6567_CLOCK)
r13216r13217
751805   MCFG_MOS6526R1_ADD("cia_1", VIC6567_CLOCK, c64_ntsc_cia1)
752806
753807   /* floppy from serial bus */
754   MCFG_CBM_IEC_ADD(cbm_iec_daisy)
755   MCFG_C1541_ADD(C1541_TAG, 8)
756
808   MCFG_CBM_IEC_BUS_ADD(cbm_iec_intf)
809   MCFG_CBM_IEC_SLOT_ADD("iec4", 4, cbm_iec_devices, NULL, NULL)
810   MCFG_CBM_IEC_SLOT_ADD("iec8", 8, cbm_iec_devices, "c1541", NULL)
811   MCFG_CBM_IEC_SLOT_ADD("iec9", 9, cbm_iec_devices, NULL, NULL)
812   MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, NULL, NULL)
813   MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL)
814   
757815   MCFG_FRAGMENT_ADD(c64_cartslot)
758816   MCFG_SOFTWARE_LIST_ADD("disk_list", "c64_flop")
759817
r13216r13217
804862   MCFG_MOS6526R1_ADD("cia_1", VIC6569_CLOCK, c64_pal_cia1)
805863
806864   /* floppy from serial bus */
807   MCFG_CBM_IEC_ADD(cbm_iec_daisy)
808   MCFG_C1541_ADD(C1541_TAG, 8)
809#ifdef INCLUDE_INTERPOD
810   MCFG_INTERPOD_ADD(ieee488_daisy)
811   MCFG_C4040_ADD(C4040_TAG, 9)
812#endif
813
865   MCFG_CBM_IEC_BUS_ADD(cbm_iec_intf)
866   MCFG_CBM_IEC_SLOT_ADD("iec4", 4, cbm_iec_devices, NULL, NULL)
867   MCFG_CBM_IEC_SLOT_ADD("iec8", 8, cbm_iec_devices, "c1541", NULL)
868   MCFG_CBM_IEC_SLOT_ADD("iec9", 9, cbm_iec_devices, NULL, NULL)
869   MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, NULL, NULL)
870   MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL)
871   
814872   MCFG_FRAGMENT_ADD(c64_cartslot)
815873   MCFG_SOFTWARE_LIST_ADD("disk_list", "c64_flop")
816874
817875   MCFG_C64_EXPANSION_SLOT_ADD("exp", c64_expansion_intf, c64_expansion_cards, NULL, NULL)
818876MACHINE_CONFIG_END
819877
820static MACHINE_CONFIG_DERIVED( ultimax, c64 )
821   MCFG_CPU_REPLACE( "maincpu", M6510, VIC6567_CLOCK)
822   MCFG_CPU_PROGRAM_MAP( ultimax_mem)
878static MACHINE_CONFIG_DERIVED( pet64, c64 )
879   MCFG_PALETTE_INIT( pet64 )
880MACHINE_CONFIG_END
881
882static MACHINE_CONFIG_START( c64gs, c64_state )
883   MCFG_CPU_ADD( "maincpu", M6510, VIC6569_CLOCK)
884   MCFG_CPU_PROGRAM_MAP(c64_mem)
823885   MCFG_CPU_CONFIG( c64_m6510_interface )
886   MCFG_CPU_VBLANK_INT("screen", c64_frame_interrupt)
887   // MCFG_CPU_PERIODIC_INT(vic2_raster_irq, VIC6569_HRETRACERATE)
888   MCFG_QUANTUM_TIME(attotime::from_hz(50))
824889
825   MCFG_SOUND_REPLACE("sid6581", SID6581, VIC6567_CLOCK)
890   MCFG_MACHINE_START( c64 )
891   MCFG_MACHINE_RESET( c64 )
892
893   /* video hardware */
894   MCFG_SCREEN_ADD("screen", RASTER)
895   MCFG_SCREEN_REFRESH_RATE(VIC6569_VRETRACERATE)
896   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) /* 2500 not accurate */
897   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
898   MCFG_SCREEN_SIZE(VIC6569_COLUMNS, VIC6569_LINES)
899   MCFG_SCREEN_VISIBLE_AREA(0, VIC6569_VISIBLECOLUMNS - 1, 0, VIC6569_VISIBLELINES - 1)
900   MCFG_SCREEN_UPDATE( c64 )
901
902   MCFG_PALETTE_INIT( c64 )
903   MCFG_PALETTE_LENGTH(ARRAY_LENGTH(c64_palette) / 3)
904
905   MCFG_VIC2_ADD("vic2", c64_vic2_pal_intf)
906
907   /* sound hardware */
908   MCFG_SPEAKER_STANDARD_MONO("mono")
909   MCFG_SOUND_ADD("sid6581", SID6581, VIC6569_CLOCK)
826910   MCFG_SOUND_CONFIG(c64_sound_interface)
827911   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
828912
829   MCFG_DEVICE_REMOVE("vic2")
830   MCFG_VIC2_ADD("vic2", ultimax_vic2_intf)
913   /* cia */
914   MCFG_MOS6526R1_ADD("cia_0", VIC6569_CLOCK, c64_pal_cia0)
915   MCFG_MOS6526R1_ADD("cia_1", VIC6569_CLOCK, c64_pal_cia1)
916   
917   MCFG_FRAGMENT_ADD(c64_cartslot)
831918
832   MCFG_CBM_IEC_REMOVE()
833   MCFG_DEVICE_REMOVE(C1541_TAG)
834   MCFG_DEVICE_REMOVE("cart1")
835   MCFG_DEVICE_REMOVE("cart2")
836
837   MCFG_FRAGMENT_ADD(ultimax_cartslot)
919   MCFG_C64_EXPANSION_SLOT_ADD("exp", c64_expansion_intf, c64_expansion_cards, NULL, NULL)
838920MACHINE_CONFIG_END
839921
922static MACHINE_CONFIG_START( sx64, c64_state )
923   MCFG_CPU_ADD( "maincpu", M6510, VIC6569_CLOCK)
924   MCFG_CPU_PROGRAM_MAP(c64_mem)
925   MCFG_CPU_CONFIG( c64_m6510_interface )
926   MCFG_CPU_VBLANK_INT("screen", c64_frame_interrupt)
927   // MCFG_CPU_PERIODIC_INT(vic2_raster_irq, VIC6569_HRETRACERATE)
928   MCFG_QUANTUM_TIME(attotime::from_hz(50))
840929
841static MACHINE_CONFIG_DERIVED( pet64, c64 )
842   MCFG_PALETTE_INIT( pet64 )
843MACHINE_CONFIG_END
930   MCFG_MACHINE_START( c64 )
931   MCFG_MACHINE_RESET( c64 )
844932
845static MACHINE_CONFIG_DERIVED( c64gs, c64pal )
846   MCFG_DEVICE_REMOVE( "dac" )
847   MCFG_DEVICE_REMOVE( CASSETTE_TAG )
848   MCFG_DEVICE_REMOVE( "quickload" )
849   MCFG_CBM_IEC_REMOVE()
850   MCFG_DEVICE_REMOVE(C1541_TAG)
851   MCFG_CBM_IEC_ADD(cbm_iec_null_daisy)
852MACHINE_CONFIG_END
933   /* video hardware */
934   MCFG_SCREEN_ADD("screen", RASTER)
935   MCFG_SCREEN_REFRESH_RATE(VIC6569_VRETRACERATE)
936   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) /* 2500 not accurate */
937   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
938   MCFG_SCREEN_SIZE(VIC6569_COLUMNS, VIC6569_LINES)
939   MCFG_SCREEN_VISIBLE_AREA(0, VIC6569_VISIBLECOLUMNS - 1, 0, VIC6569_VISIBLELINES - 1)
940   MCFG_SCREEN_UPDATE( c64 )
853941
942   MCFG_PALETTE_INIT( c64 )
943   MCFG_PALETTE_LENGTH(ARRAY_LENGTH(c64_palette) / 3)
854944
855static MACHINE_CONFIG_DERIVED( sx64, c64pal )
856   MCFG_DEVICE_REMOVE( C1541_TAG )
857   MCFG_SX1541_ADD(C1541_TAG, 8)
945   MCFG_VIC2_ADD("vic2", c64_vic2_pal_intf)
858946
859   MCFG_DEVICE_REMOVE( "dac" )
860   MCFG_DEVICE_REMOVE( CASSETTE_TAG )
861#ifdef CPU_SYNC
862   MCFG_QUANTUM_TIME(attotime::from_hz(60))
863#else
864   MCFG_QUANTUM_TIME(attotime::from_hz(180000))
865#endif
947   /* sound hardware */
948   MCFG_SPEAKER_STANDARD_MONO("mono")
949   MCFG_SOUND_ADD("sid6581", SID6581, VIC6569_CLOCK)
950   MCFG_SOUND_CONFIG(c64_sound_interface)
951   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
952
953   /* quickload */
954   MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
955
956   /* cia */
957   MCFG_MOS6526R1_ADD("cia_0", VIC6569_CLOCK, c64_pal_cia0)
958   MCFG_MOS6526R1_ADD("cia_1", VIC6569_CLOCK, c64_pal_cia1)
959
960   /* floppy from serial bus */
961   MCFG_CBM_IEC_BUS_ADD(cbm_iec_intf)
962   MCFG_CBM_IEC_SLOT_ADD("iec4", 4, cbm_iec_devices, NULL, NULL)
963   MCFG_CBM_IEC_SLOT_ADD("iec8", 8, sx1541_iec_devices, "sx1541", NULL)
964   MCFG_CBM_IEC_SLOT_ADD("iec9", 9, cbm_iec_devices, NULL, NULL)
965   MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, NULL, NULL)
966   MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL)
967   
968   MCFG_FRAGMENT_ADD(c64_cartslot)
969   MCFG_SOFTWARE_LIST_ADD("disk_list", "c64_flop")
970
971   MCFG_C64_EXPANSION_SLOT_ADD("exp", c64_expansion_intf, c64_expansion_cards, NULL, NULL)
866972MACHINE_CONFIG_END
867973
868974

Previous 15994 Revisions Next


© 1998-2018 The MESS Team