Previous 15994 Revisions Next

r11949 Wednesday 15th June, 2011 at 10:28:40 UTC by Curt Coder
Refactored the Luxor ABC bus to use slot interface. ABC800 has an ABC832 disk drive for now until default device inputs can be passed onto slot devices. [Curt Coder]
[src/mess/drivers]abc80.c abc80x.c
[src/mess/includes]abc80.h
[src/mess/machine]abc830.c abc830.h abcbus.c abcbus.h lux10828.c lux10828.h lux21046.c lux21046.h s100.h

src/mess/machine/abcbus.c
r11948r11949
11/**********************************************************************
22
3    Luxor ABC-bus emulation
3    Luxor ABC (Databoard 4680) Bus emulation
44
55    Copyright MESS Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
r11948r11949
1212
1313
1414//**************************************************************************
15//  MACROS / CONSTANTS
15//  GLOBAL VARIABLES
1616//**************************************************************************
1717
18#define LOG 1
18const device_type ABCBUS_SLOT = &device_creator<abcbus_slot_device>;
1919
2020
2121
2222//**************************************************************************
23//  DEVICE DEFINITIONS
23//  LIVE DEVICE
2424//**************************************************************************
2525
26const device_type ABCBUS = &device_creator<abcbus_device>;
26//-------------------------------------------------
27//  abcbus_slot_device - constructor
28//-------------------------------------------------
2729
30abcbus_slot_device::abcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
31        device_t(mconfig, ABCBUS_SLOT, "ABC bus slot", tag, owner, clock),
32      device_slot_interface(mconfig, *this)
33{
34}
2835
29//**************************************************************************
30//  DEVICE INTERFACE
31//**************************************************************************
3236
3337//-------------------------------------------------
34//  device_abcbus_interface - constructor
38//  static_set_abcbus_slot -
3539//-------------------------------------------------
3640
37device_abcbus_interface::device_abcbus_interface(const machine_config &mconfig, device_t &device)
38   : device_interface(device)
41void abcbus_slot_device::static_set_abcbus_slot(device_t &device, const char *tag, int num)
3942{
43   abcbus_slot_device &abcbus_card = dynamic_cast<abcbus_slot_device &>(device);
44   abcbus_card.m_bus_tag = tag;
45   abcbus_card.m_bus_num = num;
4046}
4147
4248
4349//-------------------------------------------------
44//  ~device_abcbus_interface - destructor
50//  device_start - device-specific startup
4551//-------------------------------------------------
4652
47device_abcbus_interface::~device_abcbus_interface()
53void abcbus_slot_device::device_start()
4854{
55   m_bus = machine().device<abcbus_device>(m_bus_tag);
56   device_abcbus_card_interface *dev = dynamic_cast<device_abcbus_card_interface *>(get_card_device());
57   if (dev) m_bus->add_abcbus_card(dev, m_bus_num);
4958}
5059
5160
61
62//**************************************************************************
63//  GLOBAL VARIABLES
64//**************************************************************************
65
66const device_type ABCBUS = &device_creator<abcbus_device>;
67
68
69void abcbus_device::static_set_cputag(device_t &device, const char *tag)
70{
71   abcbus_device &abcbus = downcast<abcbus_device &>(device);
72   abcbus.m_cputag = tag;
73}
74
75
5276//-------------------------------------------------
5377//  device_config_complete - perform any
5478//  operations now that the configuration is
r11948r11949
5882void abcbus_device::device_config_complete()
5983{
6084   // inherit a copy of the static data
61   const abcbus_config *intf = reinterpret_cast<const abcbus_config *>(static_config());
85   const abcbus_interface *intf = reinterpret_cast<const abcbus_interface *>(static_config());
6286   if (intf != NULL)
63      *static_cast<abcbus_config *>(this) = *intf;
87   {
88      *static_cast<abcbus_interface *>(this) = *intf;
89   }
6490
6591   // or initialize to defaults if none provided
6692   else
6793   {
68      fatalerror("Daisy chain not provided!");
94       memset(&m_out_int_cb, 0, sizeof(m_out_int_cb));
95       memset(&m_out_nmi_cb, 0, sizeof(m_out_nmi_cb));
96       memset(&m_out_rdy_cb, 0, sizeof(m_out_rdy_cb));
97       memset(&m_out_resin_cb, 0, sizeof(m_out_resin_cb));
6998   }
99}
70100
71   m_daisy = intf;
101
102
103//**************************************************************************
104//  DEVICE ABCBUS CARD INTERFACE
105//**************************************************************************
106
107//-------------------------------------------------
108//  device_abcbus_card_interface - constructor
109//-------------------------------------------------
110
111device_abcbus_card_interface::device_abcbus_card_interface(const machine_config &mconfig, device_t &device)
112   : device_interface(device)
113{
72114}
73115
74116
117//-------------------------------------------------
118//  ~device_abcbus_card_interface - destructor
119//-------------------------------------------------
75120
121device_abcbus_card_interface::~device_abcbus_card_interface()
122{
123}
124
125
126
76127//**************************************************************************
77128//  LIVE DEVICE
78129//**************************************************************************
r11948r11949
81132//  abcbus_device - constructor
82133//-------------------------------------------------
83134
84abcbus_device::abcbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
85    : device_t(mconfig, ABCBUS, "Luxor ABC bus", tag, owner, clock)
135abcbus_device::abcbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
136        device_t(mconfig, ABCBUS, "ABC bus", tag, owner, clock)
86137{
138   for (int i = 0; i < MAX_ABCBUS_SLOTS; i++)
139      m_abcbus_device[i] = NULL;
87140}
88141
89142
r11948r11949
93146
94147void abcbus_device::device_start()
95148{
96   const abcbus_config *daisy = m_daisy;
149   m_maincpu = machine().device(m_cputag);
97150
98   // create a linked list of devices
99   daisy_entry **tailptr = &m_daisy_list;
100   for ( ; daisy->devname != NULL; daisy++)
101   {
102      // find the device
103      device_t *target = machine().device(daisy->devname);
104      if (target == NULL)
105         fatalerror("Unable to locate device '%s'", daisy->devname);
151   // resolve callbacks
152   m_out_int_func.resolve(m_out_int_cb, *this);
153   m_out_nmi_func.resolve(m_out_nmi_cb, *this);
154   m_out_rdy_func.resolve(m_out_rdy_cb, *this);
155   m_out_resin_func.resolve(m_out_resin_cb, *this);
156}
106157
107      // make sure it has an interface
108      device_abcbus_interface *intf;
109      if (!target->interface(intf))
110         fatalerror("Device '%s' does not implement the abcbus interface!", daisy->devname);
111158
112      // append to the end
113      *tailptr = auto_alloc(machine(), daisy_entry(target));
114      tailptr = &(*tailptr)->m_next;
115   }
159//-------------------------------------------------
160//  device_reset - device-specific reset
161//-------------------------------------------------
162
163void abcbus_device::device_reset()
164{
116165}
117166
118167
119168//-------------------------------------------------
120//  daisy_entry - constructor
169//  add_abcbus_card - add ABC bus card
121170//-------------------------------------------------
122171
123abcbus_device::daisy_entry::daisy_entry(device_t *device)
124   : m_next(NULL),
125     m_device(device),
126     m_interface(NULL)
172void abcbus_device::add_abcbus_card(device_abcbus_card_interface *card, int pos)
127173{
128   device->interface(m_interface);
174   m_abcbus_device[pos] = card;
129175}
130176
131
177   
132178//-------------------------------------------------
133179//  cs_w -
134180//-------------------------------------------------
135181
136182WRITE8_MEMBER( abcbus_device::cs_w )
137183{
138   for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
184   for (int i = 0; i < MAX_ABCBUS_SLOTS; i++)
139185   {
140      daisy->m_interface->abcbus_cs(data);
186      if (m_abcbus_device[i] != NULL)
187      {
188         m_abcbus_device[i]->abcbus_cs(data);
189      }
141190   }
142191}
143192
r11948r11949
148197
149198READ8_MEMBER( abcbus_device::rst_r )
150199{
151   for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
200   for (int i = 0; i < MAX_ABCBUS_SLOTS; i++)
152201   {
153      daisy->m_interface->abcbus_rst(0);
154      daisy->m_interface->abcbus_rst(1);
202      if (m_abcbus_device[i] != NULL)
203      {
204         m_abcbus_device[i]->abcbus_rst(0);
205         m_abcbus_device[i]->abcbus_rst(1);
206      }
155207   }
156208
157209   return 0xff;
r11948r11949
166218{
167219   UINT8 data = 0xff;
168220
169   for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
221   for (int i = 0; i < MAX_ABCBUS_SLOTS; i++)
170222   {
171      data &= daisy->m_interface->abcbus_inp();
223      if (m_abcbus_device[i] != NULL)
224      {
225         data &= m_abcbus_device[i]->abcbus_inp();
226      }
172227   }
173228
174229   return data;
r11948r11949
181236
182237WRITE8_MEMBER( abcbus_device::utp_w )
183238{
184   for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
239   for (int i = 0; i < MAX_ABCBUS_SLOTS; i++)
185240   {
186      daisy->m_interface->abcbus_utp(data);
241      if (m_abcbus_device[i] != NULL)
242      {
243         m_abcbus_device[i]->abcbus_utp(data);
244      }
187245   }
188246}
189247
r11948r11949
196254{
197255   UINT8 data = 0xff;
198256
199   for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
257   for (int i = 0; i < MAX_ABCBUS_SLOTS; i++)
200258   {
201      data &= daisy->m_interface->abcbus_stat();
259      if (m_abcbus_device[i] != NULL)
260      {
261         data &= m_abcbus_device[i]->abcbus_stat();
262      }
202263   }
203264
204265   return data;
r11948r11949
211272
212273WRITE8_MEMBER( abcbus_device::c1_w )
213274{
214   for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
275   for (int i = 0; i < MAX_ABCBUS_SLOTS; i++)
215276   {
216      daisy->m_interface->abcbus_c1(data);
277      if (m_abcbus_device[i] != NULL)
278      {
279         m_abcbus_device[i]->abcbus_c1(data);
280      }
217281   }
218282}
219283
r11948r11949
224288
225289WRITE8_MEMBER( abcbus_device::c2_w )
226290{
227   for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
291   for (int i = 0; i < MAX_ABCBUS_SLOTS; i++)
228292   {
229      daisy->m_interface->abcbus_c2(data);
293      if (m_abcbus_device[i] != NULL)
294      {
295         m_abcbus_device[i]->abcbus_c2(data);
296      }
230297   }
231298}
232299
r11948r11949
237304
238305WRITE8_MEMBER( abcbus_device::c3_w )
239306{
240   for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
307   for (int i = 0; i < MAX_ABCBUS_SLOTS; i++)
241308   {
242      daisy->m_interface->abcbus_c3(data);
309      if (m_abcbus_device[i] != NULL)
310      {
311         m_abcbus_device[i]->abcbus_c3(data);
312      }
243313   }
244314}
245315
r11948r11949
250320
251321WRITE8_MEMBER( abcbus_device::c4_w )
252322{
253   for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
323   for (int i = 0; i < MAX_ABCBUS_SLOTS; i++)
254324   {
255      daisy->m_interface->abcbus_c4(data);
325      if (m_abcbus_device[i] != NULL)
326      {
327         m_abcbus_device[i]->abcbus_c4(data);
328      }
256329   }
257330}
258331
259332
260333//-------------------------------------------------
261//  resin_w -
334//  int_w -
262335//-------------------------------------------------
263336
264WRITE_LINE_MEMBER( abcbus_device::resin_w )
337WRITE_LINE_MEMBER( abcbus_device::int_w )
265338{
339   m_out_int_func(state);
266340}
267341
268342
269343//-------------------------------------------------
270//  int_w -
344//  nmi_w -
271345//-------------------------------------------------
272346
273WRITE_LINE_MEMBER( abcbus_device::int_w )
347WRITE_LINE_MEMBER( abcbus_device::nmi_w )
274348{
349   m_out_nmi_func(state);
275350}
276351
277352
278353//-------------------------------------------------
279//  nmi_w -
354//  rdy_w -
280355//-------------------------------------------------
281356
282WRITE_LINE_MEMBER( abcbus_device::nmi_w )
357WRITE_LINE_MEMBER( abcbus_device::rdy_w )
283358{
359   m_out_rdy_func(state);
284360}
285361
286362
287363//-------------------------------------------------
288//  rdy_w -
364//  resin_w -
289365//-------------------------------------------------
290366
291WRITE_LINE_MEMBER( abcbus_device::rdy_w )
367WRITE_LINE_MEMBER( abcbus_device::resin_w )
292368{
369   m_out_resin_func(state);
293370}
src/mess/machine/abcbus.h
r11948r11949
11/**********************************************************************
22
3    Luxor ABC-bus emulation
3    Luxor ABC (Databoard 4680) Bus emulation
44
55    Copyright MESS Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
r11948r11949
6464#define __ABCBUS__
6565
6666#include "emu.h"
67#include "machine/devhelpr.h"
6867
6968
7069//**************************************************************************
70//  CONSTANTS
71//**************************************************************************
72
73#define ABCBUS_TAG         "abcbus"
74
75
76#define MAX_ABCBUS_SLOTS   16
77
78
79
80//**************************************************************************
7181//  INTERFACE CONFIGURATION MACROS
7282//**************************************************************************
7383
74#define MCFG_ABCBUS_ADD(_tag, _config) \
75   MCFG_DEVICE_ADD(_tag, ABCBUS, 0) \
76   MCFG_DEVICE_CONFIG(_config)
84#define MCFG_ABCBUS_ADD(_cpu_tag, _config) \
85   MCFG_DEVICE_ADD(ABCBUS_TAG, ABCBUS, 0) \
86   MCFG_DEVICE_CONFIG(_config) \
87    abcbus_device::static_set_cputag(*device, _cpu_tag);
7788
7889
79#define ABCBUS_DAISY(_name) \
80   const abcbus_config (_name)[] =
90#define ABCBUS_INTERFACE(_name) \
91   const abcbus_interface (_name) =
8192
8293
94#define MCFG_ABCBUS_SLOT_ADD(_num, _tag, _slot_intf, _def_slot) \
95    MCFG_DEVICE_ADD(_tag, ABCBUS_SLOT, 0) \
96   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot) \
97   abcbus_slot_device::static_set_abcbus_slot(*device, ABCBUS_TAG, _num);
8398
99
100
84101//**************************************************************************
85102//  TYPE DEFINITIONS
86103//**************************************************************************
87104
88// ======================> abcbus_config
105// ======================> abcbus_slot_device
89106
90struct abcbus_config
107class abcbus_device;
108
109class abcbus_slot_device : public device_t,
110                     public device_slot_interface
91111{
92   const char *   devname;               // name of the device
112public:
113   // construction/destruction
114   abcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
115   
116   // device-level overrides
117   virtual void device_start();
118
119    // inline configuration
120    static void static_set_abcbus_slot(device_t &device, const char *tag, int num);
121
122private:
123   // configuration
124   const char *m_bus_tag;
125   int m_bus_num;
126   abcbus_device  *m_bus;
93127};
94128
95129
96// ======================> device_abcbus_interface
130// device type definition
131extern const device_type ABCBUS_SLOT;
97132
98class device_abcbus_interface : public device_interface
99{
100public:
101   // construction/destruction
102   device_abcbus_interface(const machine_config &mconfig, device_t &device);
103   virtual ~device_abcbus_interface();
104133
105   // required operation overrides
106   virtual void abcbus_cs(UINT8 data) = 0;
134// ======================> abcbus_interface
107135
108   // optional operation overrides
109   virtual void abcbus_rst(int state) { };
110   virtual UINT8 abcbus_inp() { return 0xff; };
111   virtual void abcbus_utp(UINT8 data) { };
112   virtual UINT8 abcbus_stat() { return 0xff; };
113   virtual void abcbus_c1(UINT8 data) { };
114   virtual void abcbus_c2(UINT8 data) { };
115   virtual void abcbus_c3(UINT8 data) { };
116   virtual void abcbus_c4(UINT8 data) { };
136struct abcbus_interface
137{
138    devcb_write_line   m_out_int_cb;
139    devcb_write_line   m_out_nmi_cb;
140    devcb_write_line   m_out_rdy_cb;
141    devcb_write_line   m_out_resin_cb;
117142};
118143
144class device_abcbus_card_interface;
145
146
119147// ======================> abcbus_device
120148
121class abcbus_device :  public device_t,
122                  public abcbus_config
149class abcbus_device : public device_t,
150                 public abcbus_interface
123151{
124152public:
125    // construction/destruction
126    abcbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
153   // construction/destruction
154   abcbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
155   // inline configuration
156   static void static_set_cputag(device_t &device, const char *tag);
127157
158   void add_abcbus_card(device_abcbus_card_interface *card, int pos);
159
128160   DECLARE_WRITE8_MEMBER( cs_w );
129161   DECLARE_READ8_MEMBER( rst_r );
130162   DECLARE_READ8_MEMBER( inp_r );
r11948r11949
135167   DECLARE_WRITE8_MEMBER( c3_w );
136168   DECLARE_WRITE8_MEMBER( c4_w );
137169
138   DECLARE_WRITE_LINE_MEMBER( resin_w );
139170   DECLARE_WRITE_LINE_MEMBER( int_w );
140171   DECLARE_WRITE_LINE_MEMBER( nmi_w );
141172   DECLARE_WRITE_LINE_MEMBER( rdy_w );
173   DECLARE_WRITE_LINE_MEMBER( resin_w );
142174
143175protected:
144    // device-level overrides
145    virtual void device_start();
146    virtual void device_config_complete();
176   // device-level overrides
177   virtual void device_start();
178   virtual void device_reset();
179   virtual void device_config_complete();
147180
148   class daisy_entry
149   {
150   public:
151      daisy_entry(device_t *device);
181private:
182   // internal state
183   device_t   *m_maincpu;
152184
153      daisy_entry *            m_next;         // next device
154      device_t *               m_device;      // associated device
155      device_abcbus_interface *   m_interface;   // associated device's daisy interface
156   };
157
158   daisy_entry *         m_daisy_list;   // head of the daisy chain
159
160private:
161    const abcbus_config *m_daisy;
185   devcb_resolved_write_line   m_out_int_func;
186   devcb_resolved_write_line   m_out_nmi_func;
187   devcb_resolved_write_line   m_out_rdy_func;
188   devcb_resolved_write_line   m_out_resin_func;
189   
190   device_abcbus_card_interface *m_abcbus_device[MAX_ABCBUS_SLOTS];
191   const char *m_cputag;
162192};
163193
164194
r11948r11949
166196extern const device_type ABCBUS;
167197
168198
199// ======================> device_abcbus_card_interface
200
201// class representing interface-specific live abcbus card
202class device_abcbus_card_interface : public device_interface
203{
204   friend class abcbus_device;
205   
206public:
207   // construction/destruction
208   device_abcbus_card_interface(const machine_config &mconfig, device_t &device);
209   virtual ~device_abcbus_card_interface();
210
211   // required operation overrides
212   virtual void abcbus_cs(UINT8 data) = 0;
213
214   // optional operation overrides
215   virtual void abcbus_rst(int state) { };
216   virtual UINT8 abcbus_inp() { return 0xff; };
217   virtual void abcbus_utp(UINT8 data) { };
218   virtual UINT8 abcbus_stat() { return 0xff; };
219   virtual void abcbus_c1(UINT8 data) { };
220   virtual void abcbus_c2(UINT8 data) { };
221   virtual void abcbus_c3(UINT8 data) { };
222   virtual void abcbus_c4(UINT8 data) { };
223
224public:
225   abcbus_device  *m_abcbus;
226};
227
169228#endif
src/mess/machine/lux21046.c
r11948r11949
8888
8989
9090//-------------------------------------------------
91//  device_config_complete - perform any
92//  operations now that the configuration is
93//  complete
94//-------------------------------------------------
95
96void luxor_55_21046_device::device_config_complete()
97{
98   // inherit a copy of the static data
99   const luxor_55_21046_interface *intf = reinterpret_cast<const luxor_55_21046_interface *>(static_config());
100   if (intf != NULL)
101      *static_cast<luxor_55_21046_interface *>(this) = *intf;
102
103   // or initialize to defaults if none provided
104   else
105   {
106      fatalerror("Interface not provided!");
107   }
108
109   m_sw1 = intf->m_sw1;
110   m_sw2 = intf->m_sw2;
111   m_sw3 = intf->m_sw3;
112
113   m_shortname = "lux21046";
114}
115
116
117//-------------------------------------------------
11891//  ROM( luxor_55_21046 )
11992//-------------------------------------------------
12093
r11948r11949
143116static ADDRESS_MAP_START( luxor_55_21046_mem, AS_PROGRAM, 8, luxor_55_21046_device )
144117   ADDRESS_MAP_UNMAP_HIGH
145118   ADDRESS_MAP_GLOBAL_MASK(0x3fff)
146   AM_RANGE(0x0000, 0x1fff) AM_ROM AM_REGION("luxor_55_21046:conkort", 0x2000)
119   AM_RANGE(0x0000, 0x1fff) AM_ROM AM_REGION("abc1:fast:conkort", 0x2000)
147120   AM_RANGE(0x2000, 0x3fff) AM_RAM
148121ADDRESS_MAP_END
149122
r11948r11949
303276INPUT_PORTS_START( luxor_55_21046 )
304277   PORT_START("SW1")
305278   // ABC 838
306   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:1,2,3,4") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
307   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
279   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:1,2,3,4") PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
280   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
308281   // ABC 830
309   PORT_DIPNAME( 0x01, 0x00, "Drive 0 Sided" ) PORT_DIPLOCATION("SW1:1") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
310   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
311   PORT_DIPSETTING(    0x01, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
312   PORT_DIPNAME( 0x02, 0x00, "Drive 1 Sided" ) PORT_DIPLOCATION("SW1:2") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
313   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
314   PORT_DIPSETTING(    0x02, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
315   PORT_DIPNAME( 0x04, 0x00, "Drive 0 Density" ) PORT_DIPLOCATION("SW1:3") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
316   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
317   PORT_DIPSETTING(    0x04, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
318   PORT_DIPNAME( 0x08, 0x00, "Drive 1 Density" ) PORT_DIPLOCATION("SW1:4") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
319   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
320   PORT_DIPSETTING(    0x08, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
282   PORT_DIPNAME( 0x01, 0x00, "Drive 0 Sided" ) PORT_DIPLOCATION("SW1:1") PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
283   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
284   PORT_DIPSETTING(    0x01, "Double" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
285   PORT_DIPNAME( 0x02, 0x00, "Drive 1 Sided" ) PORT_DIPLOCATION("SW1:2") PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
286   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
287   PORT_DIPSETTING(    0x02, "Double" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
288   PORT_DIPNAME( 0x04, 0x00, "Drive 0 Density" ) PORT_DIPLOCATION("SW1:3") PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
289   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
290   PORT_DIPSETTING(    0x04, "Double" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
291   PORT_DIPNAME( 0x08, 0x00, "Drive 1 Density" ) PORT_DIPLOCATION("SW1:4") PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
292   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
293   PORT_DIPSETTING(    0x08, "Double" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
321294   // ABC 832/834/850
322   PORT_DIPNAME( 0x01, 0x01, "Drive 0 Sided" ) PORT_DIPLOCATION("SW1:1") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
323   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
324   PORT_DIPSETTING(    0x01, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
325   PORT_DIPNAME( 0x02, 0x02, "Drive 1 Sided" ) PORT_DIPLOCATION("SW1:2") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
326   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
327   PORT_DIPSETTING(    0x02, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
328   PORT_DIPNAME( 0x04, 0x00, "Drive 0 Tracks" ) PORT_DIPLOCATION("SW1:3") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
329   PORT_DIPSETTING(    0x00, "80" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
330   PORT_DIPSETTING(    0x04, "40" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
331   PORT_DIPNAME( 0x08, 0x00, "Drive 1 Tracks" ) PORT_DIPLOCATION("SW1:4") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
332   PORT_DIPSETTING(    0x00, "80" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
333   PORT_DIPSETTING(    0x08, "40" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
295   PORT_DIPNAME( 0x01, 0x01, "Drive 0 Sided" ) PORT_DIPLOCATION("SW1:1") PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
296   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
297   PORT_DIPSETTING(    0x01, "Double" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
298   PORT_DIPNAME( 0x02, 0x02, "Drive 1 Sided" ) PORT_DIPLOCATION("SW1:2") PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
299   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
300   PORT_DIPSETTING(    0x02, "Double" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
301   PORT_DIPNAME( 0x04, 0x00, "Drive 0 Tracks" ) PORT_DIPLOCATION("SW1:3") PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
302   PORT_DIPSETTING(    0x00, "80" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
303   PORT_DIPSETTING(    0x04, "40" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
304   PORT_DIPNAME( 0x08, 0x00, "Drive 1 Tracks" ) PORT_DIPLOCATION("SW1:4") PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
305   PORT_DIPSETTING(    0x00, "80" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
306   PORT_DIPSETTING(    0x08, "40" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
334307
335308   PORT_START("SW2")
336309   PORT_DIPNAME( 0x0f, 0x01, "Drive Type" ) PORT_DIPLOCATION("SW2:1,2,3,4")
337   PORT_DIPSETTING(    0x01, "TEAC FD55F (ABC 834)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 230 7802-01
338   PORT_DIPSETTING(    0x02, "BASF 6138 (ABC 850)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 230 8440-15
339   PORT_DIPSETTING(    0x03, "Micropolis 1015F (ABC 832)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 190 9711-15
340   PORT_DIPSETTING(    0x04, "BASF 6118 (ABC 832)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 190 9711-16
341   PORT_DIPSETTING(    0x05, "Micropolis 1115F (ABC 832)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 190 9711-17
342   PORT_DIPSETTING(    0x08, "BASF 6106/08 (ABC 830)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d) // 190 9206-16
343   PORT_DIPSETTING(    0x09, "MPI 51 (ABC 830)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d) // 190 9206-16
344   PORT_DIPSETTING(    0x0e, "BASF 6105 (ABC 838)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
345   PORT_DIPSETTING(    0x0f, "BASF 6106 (ABC 838)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2e) // 230 8838-15
310   PORT_DIPSETTING(    0x01, "TEAC FD55F (ABC 834)" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 230 7802-01
311   PORT_DIPSETTING(    0x02, "BASF 6138 (ABC 850)" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 230 8440-15
312   PORT_DIPSETTING(    0x03, "Micropolis 1015F (ABC 832)" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 190 9711-15
313   PORT_DIPSETTING(    0x04, "BASF 6118 (ABC 832)" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 190 9711-16
314   PORT_DIPSETTING(    0x05, "Micropolis 1115F (ABC 832)" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 190 9711-17
315   PORT_DIPSETTING(    0x08, "BASF 6106/08 (ABC 830)" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2d) // 190 9206-16
316   PORT_DIPSETTING(    0x09, "MPI 51 (ABC 830)" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2d) // 190 9206-16
317   PORT_DIPSETTING(    0x0e, "BASF 6105 (ABC 838)" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
318   PORT_DIPSETTING(    0x0f, "BASF 6106 (ABC 838)" ) PORT_CONDITION("abc1:fast:SW3", 0x7f, PORTCOND_EQUALS, 0x2e) // 230 8838-15
346319
347320   PORT_START("SW3")
348321   PORT_DIPNAME( 0x7f, 0x2c, "Card Address" ) PORT_DIPLOCATION("SW3:1,2,3,4,5,6,7")
r11948r11949
388361
389362luxor_55_21046_device::luxor_55_21046_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
390363    : device_t(mconfig, LUXOR_55_21046, "Luxor 55 21046", tag, owner, clock),
391     device_abcbus_interface(mconfig, *this),
364     device_abcbus_card_interface(mconfig, *this),
365     device_slot_card_interface(mconfig, *this),
392366     m_maincpu(*this, Z80_TAG),
393367     m_dma(*this, Z80DMA_TAG),
394368     m_fdc(*this, SAB1793_TAG),
395     m_image0(*this->owner(), FLOPPY_0),
396     m_image1(*this->owner(), FLOPPY_1),
397369     m_cs(false),
398370     m_fdc_irq(0),
399371     m_dma_irq(0),
r11948r11949
409381
410382void luxor_55_21046_device::device_start()
411383{
384   // find floppy image devices
385   m_image0 = machine().device(FLOPPY_0);
386   m_image1 = machine().device(FLOPPY_1);
387
412388   // state saving
413389   save_item(NAME(m_cs));
414390   save_item(NAME(m_status));
r11948r11949
453429
454430void luxor_55_21046_device::abcbus_cs(UINT8 data)
455431{
456   m_cs = (data == m_sw3);
432   m_cs = (data == input_port_read(this, "SW3"));
457433}
458434
459435
r11948r11949
710686   data |= m_busy;
711687
712688   // SW1
713//  UINT8 sw1 = input_port_read(this, "SW1") & 0x0f;
714   UINT8 sw1 = m_sw1;
689   UINT8 sw1 = input_port_read(this, "SW1") & 0x0f;
715690
716691   data |= sw1 << 4;
717692
718693   // SW2
719//  UINT8 sw2 = input_port_read(this, "SW2") & 0x0f;
720   UINT8 sw2 = m_sw2;
694   UINT8 sw2 = input_port_read(this, "SW2") & 0x0f;
721695
722696   // TTL inputs float high so DIP switch in off position equals 1
723697   int sw2_1 = BIT(sw2, 0) ? 1 : BIT(offset, 8);
src/mess/machine/lux21046.h
r11948r11949
2121//  MACROS / CONSTANTS
2222//**************************************************************************
2323
24#define LUXOR_55_21046_TAG   "luxor_55_21046"
24#define LUXOR_55_21046_TAG      "luxor_55_21046"
2525
2626
2727#define ADDRESS_ABC832         44
r11948r11949
4242
4343
4444//**************************************************************************
45//  INTERFACE CONFIGURATION MACROS
46//**************************************************************************
47
48#define MCFG_LUXOR_55_21046_ADD(_config) \
49    MCFG_DEVICE_ADD(LUXOR_55_21046_TAG, LUXOR_55_21046, 0) \
50   MCFG_DEVICE_CONFIG(_config)
51
52
53#define LUXOR_55_21046_INTERFACE(name) \
54   const luxor_55_21046_interface (name) =
55
56
57
58//**************************************************************************
5945//  TYPE DEFINITIONS
6046//**************************************************************************
6147
62// ======================> luxor_55_21046_interface
63
64struct luxor_55_21046_interface
65{
66   UINT8 m_sw1;            // single/double sided/density
67   UINT8 m_sw2;            // drive type
68   UINT8 m_sw3;            // ABC bus address
69};
70
7148// ======================> luxor_55_21046_device
7249
7350class luxor_55_21046_device :  public device_t,
74                        public device_abcbus_interface,
75                        public luxor_55_21046_interface
51                        public device_abcbus_card_interface,
52                        public device_slot_card_interface
7653{
7754public:
7855    // construction/destruction
r11948r11949
8360   virtual machine_config_constructor device_mconfig_additions() const;
8461   virtual ioport_constructor device_input_ports() const;
8562
63   // not really public
8664   DECLARE_READ8_MEMBER( _3d_r );
8765   DECLARE_WRITE8_MEMBER( _4d_w );
8866   DECLARE_WRITE8_MEMBER( _4b_w );
8967   DECLARE_WRITE8_MEMBER( _9b_w );
9068   DECLARE_WRITE8_MEMBER( _8a_w );
9169   DECLARE_READ8_MEMBER( _9a_r );
92
9370   DECLARE_WRITE_LINE_MEMBER( dma_int_w );
9471   DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w );
9572
r11948r11949
9774    // device-level overrides
9875    virtual void device_start();
9976   virtual void device_reset();
100   virtual void device_config_complete();
77    virtual void device_config_complete() { m_shortname = "lux21046"; }
10178
10279   // device_abcbus_interface overrides
10380   virtual void abcbus_cs(UINT8 data);
r11948r11949
11289   required_device<cpu_device> m_maincpu;
11390   required_device<z80dma_device> m_dma;
11491   required_device<device_t> m_fdc;
115   required_device<device_t> m_image0;
116   required_device<device_t> m_image1;
92   device_t *m_image0;
93   device_t *m_image1;
11794
11895   bool m_cs;               // card selected
11996   UINT8 m_status;            // ABC BUS status
r11948r11949
123100   int m_dma_irq;            // DMA interrupt
124101   int m_busy;               // busy bit
125102   int m_force_busy;         // force busy bit
126
127   UINT8 m_sw1;            // DS/DD
128   UINT8 m_sw2;            // drive type
129   UINT8 m_sw3;            // ABC bus address
130103};
131104
132105
src/mess/machine/abc830.c
r11948r11949
142142
143143
144144//**************************************************************************
145//  LUXOR 55 10828 INTERFACES
145//  LUXOR 55 10828 DEVICE INPUT DEFAULTS
146146//**************************************************************************
147147
148148//-------------------------------------------------
149//  LUXOR_55_10828_INTERFACE( abc830_slow_intf )
149//  DEVICE_INPUT_DEFAULTS( abc830_slow )
150150//-------------------------------------------------
151151
152LUXOR_55_10828_INTERFACE( abc830_slow_intf )
153{
154   0x03,
155   DRIVE_MPI_51,
156   ADDRESS_ABC830
157};
152DEVICE_INPUT_DEFAULTS_START( abc830_slow )
153   DEVICE_INPUT_DEFAULTS("SW1", 0x0f, 0x03)
154   DEVICE_INPUT_DEFAULTS("S1", 0x01, 0x01)
155DEVICE_INPUT_DEFAULTS_END
158156
159157
160158
161159//**************************************************************************
162//  LUXOR 55 21046 INTERFACES
160//  LUXOR 55 21046 DEVICE INPUT DEFAULTS
163161//**************************************************************************
164162
165163//-------------------------------------------------
166//  LUXOR_55_21046_INTERFACE( abc830_fast_intf )
164//  DEVICE_INPUT_DEFAULTS( abc830_fast_intf )
167165//-------------------------------------------------
168166
169LUXOR_55_21046_INTERFACE( abc830_fast_intf )
170{
171   0x03,
172   DRIVE_BASF_6106_08,
173   ADDRESS_ABC830
174};
167DEVICE_INPUT_DEFAULTS_START( abc830_fast )
168   DEVICE_INPUT_DEFAULTS("SW1", 0x0f, 0x03)
169   DEVICE_INPUT_DEFAULTS("SW2", 0x0f, DRIVE_BASF_6106_08)
170   DEVICE_INPUT_DEFAULTS("SW3", 0x7f, ADDRESS_ABC830)
171DEVICE_INPUT_DEFAULTS_END
175172
176173
177174//-------------------------------------------------
178//  LUXOR_55_21046_INTERFACE( abc832_fast_intf )
175//  DEVICE_INPUT_DEFAULTS( abc832_fast )
179176//-------------------------------------------------
180177
181LUXOR_55_21046_INTERFACE( abc832_fast_intf )
182{
183   0x03,
184   DRIVE_TEAC_FD55F,
185   ADDRESS_ABC832
186};
178DEVICE_INPUT_DEFAULTS_START( abc832_fast )
179   DEVICE_INPUT_DEFAULTS("SW1", 0x0f, 0x03)
180   DEVICE_INPUT_DEFAULTS("SW2", 0x0f, DRIVE_TEAC_FD55F)
181   DEVICE_INPUT_DEFAULTS("SW3", 0x7f, ADDRESS_ABC832)
182DEVICE_INPUT_DEFAULTS_END
187183
188184
189185//-------------------------------------------------
190//  LUXOR_55_21046_INTERFACE( abc834_fast_intf )
186//  DEVICE_INPUT_DEFAULTS( abc834_fast )
191187//-------------------------------------------------
192188
193LUXOR_55_21046_INTERFACE( abc834_fast_intf )
194{
195   0x03,
196   DRIVE_TEAC_FD55F,
197   ADDRESS_ABC832
198};
189DEVICE_INPUT_DEFAULTS_START( abc834_fast )
190   DEVICE_INPUT_DEFAULTS("SW1", 0x0f, 0x03)
191   DEVICE_INPUT_DEFAULTS("SW2", 0x0f, DRIVE_TEAC_FD55F)
192   DEVICE_INPUT_DEFAULTS("SW3", 0x7f, ADDRESS_ABC832)
193DEVICE_INPUT_DEFAULTS_END
199194
200195
201196//-------------------------------------------------
202//  LUXOR_55_21046_INTERFACE( abc838_fast_intf )
197//  DEVICE_INPUT_DEFAULTS( abc838_fast )
203198//-------------------------------------------------
204199
205LUXOR_55_21046_INTERFACE( abc838_fast_intf )
206{
207   0x03,
208   DRIVE_BASF_6105,
209   ADDRESS_ABC838
210};
200DEVICE_INPUT_DEFAULTS_START( abc838_fast )
201   DEVICE_INPUT_DEFAULTS("SW1", 0x0f, 0x03)
202   DEVICE_INPUT_DEFAULTS("SW2", 0x0f, DRIVE_BASF_6105)
203   DEVICE_INPUT_DEFAULTS("SW3", 0x7f, ADDRESS_ABC838)
204DEVICE_INPUT_DEFAULTS_END
src/mess/machine/abc830.h
r11948r11949
4444
4545
4646// conkort interfaces
47extern const luxor_55_10828_interface( abc830_slow_intf );
48extern const luxor_55_21046_interface( abc830_fast_intf );
49extern const luxor_55_21046_interface( abc832_fast_intf );
50extern const luxor_55_21046_interface( abc834_fast_intf );
51extern const luxor_55_21046_interface( abc838_fast_intf );
47extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME( abc830_slow )[];
48extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME( abc830_fast )[];
49extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME( abc832_fast )[];
50extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME( abc834_fast )[];
51extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME( abc838_fast )[];
5252
5353
5454#endif
src/mess/machine/lux10828.c
r11948r11949
132132
133133const device_type LUXOR_55_10828 = &device_creator<luxor_55_10828_device>;
134134
135//-------------------------------------------------
136//  device_config_complete - perform any
137//  operations now that the configuration is
138//  complete
139//-------------------------------------------------
140135
141void luxor_55_10828_device::device_config_complete()
142{
143   // inherit a copy of the static data
144   const luxor_55_10828_interface *intf = reinterpret_cast<const luxor_55_10828_interface *>(static_config());
145   if (intf != NULL)
146      *static_cast<luxor_55_10828_interface *>(this) = *intf;
147
148   // or initialize to defaults if none provided
149   else
150   {
151      fatalerror("Interface not provided!");
152   }
153
154   m_sw1 = intf->m_sw1;
155   m_drive_type = intf->m_drive_type;
156   m_s1 = intf->m_s1;
157
158   m_shortname = "lux10828";
159}
160
161
162136//-------------------------------------------------
163137//  ROM( luxor_55_10828 )
164138//-------------------------------------------------
r11948r11949
195169
196170static ADDRESS_MAP_START( luxor_55_10828_mem, AS_PROGRAM, 8, luxor_55_10828_device )
197171   ADDRESS_MAP_GLOBAL_MASK(0x1fff)
198   AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x0800) AM_ROM AM_REGION("luxor_55_10828:abc830", 0)
172   AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x0800) AM_ROM AM_REGION("abc1:slow:abc830", 0)
199173   AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0x0c00) AM_RAM
200174ADDRESS_MAP_END
201175
r11948r11949
428402
429403luxor_55_10828_device::luxor_55_10828_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
430404    : device_t(mconfig, LUXOR_55_10828, "Luxor 55 10828", tag, owner, clock),
431     device_abcbus_interface(mconfig, *this),
405     device_abcbus_card_interface(mconfig, *this),
406     device_slot_card_interface(mconfig, *this),
432407     m_maincpu(*this, Z80_TAG),
433408     m_pio(*this, Z80PIO_TAG),
434409     m_fdc(*this, FD1791_TAG),
435     m_image0(*this->owner(), FLOPPY_0),
436     m_image1(*this->owner(), FLOPPY_1),
437410     m_cs(false),
438411     m_fdc_irq(0),
439412     m_fdc_drq(0),
r11948r11949
450423
451424void luxor_55_10828_device::device_start()
452425{
426   // find floppy image devices
427   m_image0 = machine().device(FLOPPY_0);
428   m_image1 = machine().device(FLOPPY_1);
429
453430   // state saving
454431   save_item(NAME(m_cs));
455432   save_item(NAME(m_status));
src/mess/machine/lux10828.h
r11948r11949
4343
4444
4545//**************************************************************************
46//  INTERFACE CONFIGURATION MACROS
47//**************************************************************************
48
49#define MCFG_LUXOR_55_10828_ADD(_config) \
50    MCFG_DEVICE_ADD(LUXOR_55_10828_TAG, LUXOR_55_10828, 0) \
51   MCFG_DEVICE_CONFIG(_config)
52
53
54#define LUXOR_55_10828_INTERFACE(name) \
55   const luxor_55_10828_interface (name) =
56
57
58
59//**************************************************************************
6046//  TYPE DEFINITIONS
6147//**************************************************************************
6248
63// ======================> luxor_55_10828_interface
64
65struct luxor_55_10828_interface
66{
67   UINT8 m_sw1;            // single/double sided/density
68   UINT8 m_drive_type;         // drive type
69   UINT8 m_s1;               // ABC bus address
70};
71
72
7349// ======================> luxor_55_10828_device
7450
7551class luxor_55_10828_device :  public device_t,
76                        public device_abcbus_interface,
77                        public luxor_55_10828_interface
52                        public device_abcbus_card_interface,
53                        public device_slot_card_interface
7854{
7955public:
8056    // construction/destruction
r11948r11949
10278    // device-level overrides
10379    virtual void device_start();
10480   virtual void device_reset();
105    virtual void device_config_complete();
81    virtual void device_config_complete() { m_shortname = "lux10828"; }
10682
10783   // device_abcbus_interface overrides
10884   virtual void abcbus_cs(UINT8 data);
r11948r11949
11793   required_device<cpu_device> m_maincpu;
11894   required_device<z80pio_device> m_pio;
11995   required_device<device_t> m_fdc;
120   required_device<device_t> m_image0;
121   required_device<device_t> m_image1;
96   device_t* m_image0;
97   device_t* m_image1;
12298
12399   bool m_cs;            // card selected
124100   UINT8 m_status;         // ABC BUS status
src/mess/machine/s100.h
r11948r11949
278278   virtual void s100_poc_w(int state) { }
279279   virtual void s100_reset_w(int state) { }
280280   virtual void s100_slave_clr_w(int state) { }
281
282    // inline configuration
283    static void static_set_s100_tag(device_t &device, const char *tag);
284281   
285282public:
286283   s100_device  *m_s100;
src/mess/includes/abc80.h
r11948r11949
4646#define Z80PIO_TAG      "cd67"
4747#define SN76477_TAG      "g8"
4848#define ABCBUS_TAG      "abcbus"
49#define RS232_TAG      "rs232"
5049
5150class abc80_state : public driver_device
5251{
r11948r11949
5554      : driver_device(mconfig, type, tag),
5655        m_maincpu(*this, Z80_TAG),
5756        m_pio(*this, Z80PIO_TAG),
58        m_rs232(*this, RS232_TAG),
5957        m_cassette(*this, CASSETTE_TAG),
6058        m_ram(*this, RAM_TAG)
6159   { }
6260
6361   required_device<cpu_device> m_maincpu;
6462   required_device<device_t> m_pio;
65   required_device<device_t> m_rs232;
6663   required_device<cassette_image_device> m_cassette;
6764   required_device<device_t> m_ram;
6865
src/mess/drivers/abc80.c
r11948r11949
187187#include "machine/abcbus.h"
188188#include "machine/abc830.h"
189189#include "machine/lux10828.h"
190#include "machine/rs232.h"
191190#include "machine/z80pio.h"
192191#include "sound/sn76477.h"
193192#include "includes/abc80.h"
r11948r11949
587586   UINT8 data = 0;
588587
589588   /* serial receive */
590   data |= rs232_rd_r(m_rs232);
591589
592590   /* clear to send */
593   data |= rs232_cts_r(m_rs232) << 1;
594591
595592   /* data connection detect */
596   data |= rs232_dcd_r(m_rs232) << 2;
597593
598594   /* cassette data */
599595   data |= ((m_cassette)->input() > +1.0) << 7;
r11948r11949
619615    */
620616
621617   /* transmit */
622   rs232_td_w(m_rs232, m_pio, BIT(data, 3));
623618
624619   /* request to send */
625   rs232_rts_w(m_rs232, BIT(data, 4));
626620
627621   /* cassette motor */
628622   m_cassette->change_state(BIT(data,5) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
r11948r11949
669663
670664
671665//-------------------------------------------------
672//  ABCBUS_DAISY( abcbus_daisy )
666//  ABCBUS_INTERFACE( abcbus_intf )
673667//-------------------------------------------------
674668
675static ABCBUS_DAISY( abcbus_daisy )
676{
677   { LUXOR_55_10828_TAG },
678   { NULL }
679};
669static SLOT_INTERFACE_START( abc80_abcbus_cards )
670   SLOT_INTERFACE("slow", LUXOR_55_10828)
671SLOT_INTERFACE_END
680672
681673
682//-------------------------------------------------
683//  RS232_INTERFACE( rs232_intf )
684//-------------------------------------------------
685
686static RS232_INTERFACE( rs232_intf )
674static ABCBUS_INTERFACE( abcbus_intf )
687675{
688   { Z80PIO_TAG ,
689676   DEVCB_NULL,
690677   DEVCB_NULL,
691678   DEVCB_NULL,
692   DEVCB_NULL,
693   DEVCB_NULL,
694   DEVCB_NULL,
695679   DEVCB_NULL
696   }
697680};
698681
699682
r11948r11949
749732   /* keyboard */
750733   MCFG_TIMER_ADD_PERIODIC("keyboard", abc80_keyboard_tick, attotime::from_usec(2500))
751734
752   /* Luxor Conkort 55-10828 */
753   MCFG_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy)
754   MCFG_ABC830_ADD()
755   MCFG_LUXOR_55_10828_ADD(abc830_slow_intf)
756
757735   /* devices */
758736   MCFG_TIMER_ADD_SCANLINE("pio_astb", z80pio_astb_tick, SCREEN_TAG, 0, 1)
759737   MCFG_Z80PIO_ADD(Z80PIO_TAG, ABC80_XTAL/2/2, pio_intf)
760   MCFG_RS232_ADD(RS232_TAG, rs232_intf)
761738   MCFG_PRINTER_ADD("printer")
762739   MCFG_CASSETTE_ADD(CASSETTE_TAG, abc80_cassette_interface)
740   MCFG_ABC830_ADD()
763741
742   // ABC bus
743   MCFG_ABCBUS_ADD(Z80_TAG, abcbus_intf)
744   MCFG_ABCBUS_SLOT_ADD( 1, "abc1", abc80_abcbus_cards, "slow")
745   MCFG_ABCBUS_SLOT_ADD( 2, "abc2", abc80_abcbus_cards, NULL)
746   MCFG_ABCBUS_SLOT_ADD( 3, "abc3", abc80_abcbus_cards, NULL)
747   MCFG_ABCBUS_SLOT_ADD( 4, "abc4", abc80_abcbus_cards, NULL)
748   MCFG_ABCBUS_SLOT_ADD( 5, "abc5", abc80_abcbus_cards, NULL)
749
764750   /* internal ram */
765751   MCFG_RAM_ADD(RAM_TAG)
766752   MCFG_RAM_DEFAULT_SIZE("16K")
src/mess/drivers/abc80x.c
r11948r11949
12351235
12361236
12371237//-------------------------------------------------
1238//  ABCBUS_DAISY( abcbus_daisy )
1238//  ABCBUS_INTERFACE( abcbus_intf )
12391239//-------------------------------------------------
12401240
1241static ABCBUS_DAISY( abcbus_daisy )
1241static SLOT_INTERFACE_START( abc800_abcbus_cards )
1242   SLOT_INTERFACE("fast", LUXOR_55_21046)
1243SLOT_INTERFACE_END
1244
1245
1246static ABCBUS_INTERFACE( abcbus_intf )
12421247{
1243   { LUXOR_55_21046_TAG },
1244   { NULL }
1248   DEVCB_NULL,
1249   DEVCB_NULL,
1250   DEVCB_NULL,
1251   DEVCB_NULL
12451252};
12461253
12471254
r11948r11949
14321439   MCFG_PRINTER_ADD("printer")
14331440   MCFG_CASSETTE_ADD(CASSETTE_TAG, abc800_cassette_interface)
14341441   MCFG_TIMER_ADD_PERIODIC("keyboard_t1", keyboard_t1_tick, attotime::from_hz(XTAL_5_9904MHz/(3*5)/20)) // TODO correct frequency?
1442   MCFG_ABC832_ADD()
14351443
14361444   // ABC bus
1437   MCFG_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy)
1438   MCFG_ABC830_ADD()
1439   MCFG_LUXOR_55_21046_ADD(abc830_fast_intf)
1445   MCFG_ABCBUS_ADD(Z80_TAG, abcbus_intf)
1446   MCFG_ABCBUS_SLOT_ADD( 1, "abc1", abc800_abcbus_cards, "fast")
1447   MCFG_ABCBUS_SLOT_ADD( 2, "abc2", abc800_abcbus_cards, NULL)
1448   MCFG_ABCBUS_SLOT_ADD( 3, "abc3", abc800_abcbus_cards, NULL)
1449   MCFG_ABCBUS_SLOT_ADD( 4, "abc4", abc800_abcbus_cards, NULL)
1450   MCFG_ABCBUS_SLOT_ADD( 5, "abc5", abc800_abcbus_cards, NULL)
14401451
14411452   // internal ram
14421453   MCFG_RAM_ADD(RAM_TAG)
r11948r11949
14791490   MCFG_PRINTER_ADD("printer")
14801491   MCFG_CASSETTE_ADD(CASSETTE_TAG, abc800_cassette_interface)
14811492   MCFG_TIMER_ADD_PERIODIC("keyboard_t1", keyboard_t1_tick, attotime::from_hz(XTAL_5_9904MHz/(3*5)/20)) // TODO correct frequency?
1493   MCFG_ABC832_ADD()
14821494
14831495   // ABC bus
1484   MCFG_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy)
1485   MCFG_ABC830_ADD()
1486   MCFG_LUXOR_55_21046_ADD(abc830_fast_intf)
1496   MCFG_ABCBUS_ADD(Z80_TAG, abcbus_intf)
1497   MCFG_ABCBUS_SLOT_ADD( 1, "abc1", abc800_abcbus_cards, "fast")
1498   MCFG_ABCBUS_SLOT_ADD( 2, "abc2", abc800_abcbus_cards, NULL)
1499   MCFG_ABCBUS_SLOT_ADD( 3, "abc3", abc800_abcbus_cards, NULL)
1500   MCFG_ABCBUS_SLOT_ADD( 4, "abc4", abc800_abcbus_cards, NULL)
1501   MCFG_ABCBUS_SLOT_ADD( 5, "abc5", abc800_abcbus_cards, NULL)
14871502
14881503   // internal ram
14891504   MCFG_RAM_ADD(RAM_TAG)
r11948r11949
15231538   MCFG_ABC77_ADD(abc77_intf)
15241539   MCFG_PRINTER_ADD("printer")
15251540   MCFG_CASSETTE_ADD(CASSETTE_TAG, abc800_cassette_interface)
1541   MCFG_ABC834_ADD()
15261542
15271543   // ABC bus
1528   MCFG_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy)
1529   MCFG_ABC834_ADD()
1530   MCFG_LUXOR_55_21046_ADD(abc834_fast_intf)
1544   MCFG_ABCBUS_ADD(Z80_TAG, abcbus_intf)
1545   MCFG_ABCBUS_SLOT_ADD( 1, "abc1", abc800_abcbus_cards, "fast")
1546   MCFG_ABCBUS_SLOT_ADD( 2, "abc2", abc800_abcbus_cards, NULL)
1547   MCFG_ABCBUS_SLOT_ADD( 3, "abc3", abc800_abcbus_cards, NULL)
1548   MCFG_ABCBUS_SLOT_ADD( 4, "abc4", abc800_abcbus_cards, NULL)
1549   MCFG_ABCBUS_SLOT_ADD( 5, "abc5", abc800_abcbus_cards, NULL)
15311550
15321551   // internal ram
15331552   MCFG_RAM_ADD(RAM_TAG)
r11948r11949
15581577   MCFG_ABC77_ADD(abc77_intf)
15591578   MCFG_PRINTER_ADD("printer")
15601579   MCFG_CASSETTE_ADD(CASSETTE_TAG, abc800_cassette_interface)
1580   MCFG_ABC832_ADD()
15611581
15621582   // ABC bus
1563   MCFG_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy)
1564   MCFG_ABC832_ADD()
1565   MCFG_LUXOR_55_21046_ADD(abc832_fast_intf)
1583   MCFG_ABCBUS_ADD(Z80_TAG, abcbus_intf)
1584   MCFG_ABCBUS_SLOT_ADD( 1, "abc1", abc800_abcbus_cards, "fast")
1585   MCFG_ABCBUS_SLOT_ADD( 2, "abc2", abc800_abcbus_cards, NULL)
1586   MCFG_ABCBUS_SLOT_ADD( 3, "abc3", abc800_abcbus_cards, NULL)
1587   MCFG_ABCBUS_SLOT_ADD( 4, "abc4", abc800_abcbus_cards, NULL)
1588   MCFG_ABCBUS_SLOT_ADD( 5, "abc5", abc800_abcbus_cards, NULL)
15661589
15671590   // internal ram
15681591   MCFG_RAM_ADD(RAM_TAG)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team