Previous 15994 Revisions Next

r9089 Saturday 11th September, 2010 at 04:34:35 UTC by Curt Coder
[CONKORT] Added plumbing to connect conkort, abcbus and main cpu properly. Fixed SW2 polarity, and added INT to CPU from slow controller.
[src/mess/drivers]abc80.c abc80x.c
[src/mess/machine]abcbus.c abcbus.h conkort.c conkort.h

src/mess/machine/conkort.c
r9088r9089
178178    ---------------
179179   - status bit 0 (busy)
180180   - SW2 reading
181   - "track 0 sector 25 not found!"
181   - "track 0 sector 25 not found!" -> SW2 options were wrong, though always ABC838
182   - INT/NMI to ABC800 ?
183   - Z80 DMA INT on end of block ?
182184
183185*/
184186
r9088r9089
222224   int wait_enable;      /* wait enable */
223225
224226   /* devices */
227   running_device *bus;
225228   running_device *cpu;
226229   running_device *z80pio;
227230   running_device *fd1791;
r9088r9089
241244   int busy;            /* busy bit */
242245
243246   /* devices */
247   running_device *bus;
244248   running_device *cpu;
245249   running_device *z80dma;
246250   running_device *wd1793;
r9088r9089
266270   return (fast_t *)downcast<legacy_device_base *>(device)->token();
267271}
268272
273INLINE conkort_config *get_safe_config(running_device *device)
274{
275   assert(device != NULL);
276   assert((device->type() == LUXOR_55_10828) || (device->type() == LUXOR_55_21046));
277   return (conkort_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
278}
279
269280/***************************************************************************
270281    IMPLEMENTATION
271282***************************************************************************/
r9088r9089
416427
417428   slow_t *conkort = get_safe_token_slow(device->owner());
418429
419   conkort->status = data;
430   /* interrupt */
431   abcbus_int_w(conkort->bus, BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE);
432
433   conkort->status = data & 0xfe;
420434}
421435
422436static READ8_DEVICE_HANDLER( slow_fdc_r )
r9088r9089
432446
433447   switch (offset & 0x03)
434448   {
435   case 0: data = wd17xx_status_r(device, 0);
436   case 1:   data = wd17xx_track_r(device, 0);
437   case 2:   data = wd17xx_sector_r(device, 0);
438   case 3:   data = wd17xx_data_r(device, 0);
449   case 0: data = wd17xx_status_r(device, 0); break;
450   case 1:   data = wd17xx_track_r(device, 0); break;
451   case 2:   data = wd17xx_sector_r(device, 0); break;
452   case 3:   data = wd17xx_data_r(device, 0); break;
439453   }
440454
441455   /* FD1791 has inverted data lines */
r9088r9089
459473   switch (offset & 0x03)
460474   {
461475   case 0: wd17xx_command_w(device, 0, data); break;
462   case 1:   wd17xx_track_w(device, 0, data);   break;
463   case 2: wd17xx_sector_w(device, 0, data);  break;
464   case 3: wd17xx_data_w(device, 0, data);    break;
476   case 1:   wd17xx_track_w(device, 0, data); break;
477   case 2: wd17xx_sector_w(device, 0, data); break;
478   case 3: wd17xx_data_w(device, 0, data); break;
465479   }
466480}
467481
r9088r9089
716730   data |= BIT(sw1, 3) << 7;
717731
718732   /* SW2 */
719/*   UINT8 sw2 = input_port_read(device->machine, "abc830:SW2");
733   UINT8 sw2 = input_port_read(device->machine, "abc830:SW2");
720734
721735   int sw2_1 = BIT(offset, 8) & BIT(sw2, 0);
722736   int sw2_2 = BIT(offset, 9) & BIT(sw2, 1);
r9088r9089
724738   int sw2_4 = BIT(offset, 11) & BIT(sw2, 3);
725739   int sw2_data = !(sw2_1 & sw2_2 & !(sw2_3 ^ sw2_4));
726740   
727   data |= sw2_data << 2;*/
741   data |= sw2_data << 2;
728742
729743   return data ^ 0xff;
730744}
r9088r9089
793807   PORT_DIPSETTING(    0x0a, "DS DD 40" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
794808
795809   PORT_START("abc830:SW2")
796   PORT_DIPNAME( 0x0f, 0x08, "Disk Drive" ) PORT_DIPLOCATION("SW2:1,2,3,4")
797   PORT_DIPSETTING(    0x08, "BASF 6106/08 (ABC 830, 190 9206-16)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
798   PORT_DIPSETTING(    0x09, "MPI 51 (ABC 830, 190 9206-16)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
799   PORT_DIPSETTING(    0x04, "BASF 6118 (ABC 832, 190 9711-16)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
800   PORT_DIPSETTING(    0x03, "Micropolis 1015F (ABC 832, 190 9711-15)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
801   PORT_DIPSETTING(    0x05, "Micropolis 1115F (ABC 832, 190 9711-17)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
802   PORT_DIPSETTING(    0x01, "TEAC FD55F (ABC 834, 230 7802-01)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
803   PORT_DIPSETTING(    0x02, "BASF 6138 (ABC 850, 230 8440-15)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
804   PORT_DIPSETTING(    0x0e, "BASF 6105" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
805   PORT_DIPSETTING(    0x0f, "BASF 6106 (ABC 838, 230 8838-15)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
810   PORT_DIPNAME( 0x0f, 0x0b, "Disk Drive" ) PORT_DIPLOCATION("SW2:1,2,3,4")
811   PORT_DIPSETTING(    0x07, "BASF 6106/08 (ABC 830, 190 9206-16)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
812   PORT_DIPSETTING(    0x06, "MPI 51 (ABC 830, 190 9206-16)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
813   PORT_DIPSETTING(    0x0b, "BASF 6118 (ABC 832, 190 9711-16)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
814   PORT_DIPSETTING(    0x0c, "Micropolis 1015F (ABC 832, 190 9711-15)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
815   PORT_DIPSETTING(    0x0a, "Micropolis 1115F (ABC 832, 190 9711-17)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
816   PORT_DIPSETTING(    0x0e, "TEAC FD55F (ABC 834, 230 7802-01)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
817   PORT_DIPSETTING(    0x0d, "BASF 6138 (ABC 850, 230 8440-15)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
818   PORT_DIPSETTING(    0x01, "BASF 6105" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
819   PORT_DIPSETTING(    0x00, "BASF 6106 (ABC 838, 230 8838-15)" ) PORT_CONDITION("abc830:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
806820   
807821   PORT_START("abc830:SW3") // controller card ABC bus address
808822   PORT_DIPNAME( 0x7f, 0x2d, "Disk Drive" ) PORT_DIPLOCATION("SW3:1,2,3,4,5,6,7")
r9088r9089
11501164static DEVICE_START( luxor_55_10828 )
11511165{
11521166   slow_t *conkort = get_safe_token_slow(device);
1167   const conkort_config *config = get_safe_config(device);
11531168
11541169   /* find our CPU */
11551170   conkort->cpu = device->subdevice(Z80_TAG);
11561171
11571172   /* find devices */
1173   conkort->bus = device->machine->device(config->bus_tag);
11581174   conkort->z80pio = device->subdevice(Z80PIO_TAG);
11591175   conkort->fd1791 = device->subdevice(FD1791_TAG);
11601176   conkort->image0 = device->subdevice(FLOPPY_0);
r9088r9089
12001216   switch (state)
12011217   {
12021218      /* --- the following bits of info are returned as 64-bit signed integers --- */
1203      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                                    break;
1219      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = sizeof(conkort_config);                     break;
12041220      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(slow_t);                           break;
12051221
12061222      /* --- the following bits of info are returned as pointers --- */
r9088r9089
12281244static DEVICE_START( luxor_55_21046 )
12291245{
12301246   fast_t *conkort = get_safe_token_fast(device);
1247   const conkort_config *config = get_safe_config(device);
12311248
12321249   /* find our CPU */
12331250   conkort->cpu = device->subdevice(Z80_TAG);
12341251
12351252   /* find devices */
1253   conkort->bus = device->machine->device(config->bus_tag);
12361254   conkort->z80dma = device->subdevice(Z80DMA_TAG);
12371255   conkort->wd1793 = device->subdevice(SAB1793_TAG);
12381256   conkort->image0 = device->subdevice(FLOPPY_0);
r9088r9089
12761294   switch (state)
12771295   {
12781296      /* --- the following bits of info are returned as 64-bit signed integers --- */
1279      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                                    break;
1297      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = sizeof(conkort_config);                     break;
12801298      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(fast_t);                           break;
12811299
12821300      /* --- the following bits of info are returned as pointers --- */
src/mess/machine/conkort.h
r9088r9089
1111DECLARE_LEGACY_DEVICE(LUXOR_55_10828, luxor_55_10828);
1212DECLARE_LEGACY_DEVICE(LUXOR_55_21046, luxor_55_21046);
1313
14#define MDRV_LUXOR_55_10828_ADD(_tag) \
15   MDRV_DEVICE_ADD(_tag, LUXOR_55_10828, 0)
14#define MDRV_LUXOR_55_10828_ADD(_tag, _bus_tag) \
15   MDRV_DEVICE_ADD(_tag, LUXOR_55_10828, 0) \
16   MDRV_DEVICE_CONFIG_DATAPTR(conkort_config, bus_tag, _bus_tag)
1617
17#define MDRV_LUXOR_55_21046_ADD(_tag) \
18   MDRV_DEVICE_ADD(_tag, LUXOR_55_21046, 0)
18#define MDRV_LUXOR_55_21046_ADD(_tag, _bus_tag) \
19   MDRV_DEVICE_ADD(_tag, LUXOR_55_21046, 0) \
20   MDRV_DEVICE_CONFIG_DATAPTR(conkort_config, bus_tag, _bus_tag)
1921
2022#define LUXOR_55_10828_ABCBUS(_tag) \
2123   _tag, DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_cs_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_stat_r), \
r9088r9089
2830   DEVCB_NULL, DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_c3_w), DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, luxor_55_21046_rst_w)
2931
3032/***************************************************************************
33    TYPE DEFINITIONS
34***************************************************************************/
35
36typedef struct _conkort_config conkort_config;
37struct _conkort_config
38{
39   const char *bus_tag;      /* bus device */
40};
41
42/***************************************************************************
3143    PROTOTYPES
3244***************************************************************************/
3345/* configuration dips */
src/mess/machine/abcbus.c
r9088r9089
4242struct _abcbus_t
4343{
4444   abcbus_daisy_state *daisy_state;
45
46   running_device *cpu;
47
48   int resin;
49   int irq;
50   int nmi;
51   int rdy;
4552};
4653
4754/***************************************************************************
r9088r9089
6269   return (const abcbus_daisy_chain *) device->baseconfig().static_config();
6370}
6471
72INLINE abcbus_config *get_safe_config(running_device *device)
73{
74   assert(device != NULL);
75   assert(device->type() == ABCBUS);
76   return (abcbus_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
77}
78
6579/***************************************************************************
6680    IMPLEMENTATION
6781***************************************************************************/
r9088r9089
158172WRITE8_DEVICE_HANDLER( abcbus_c3_w ) { command_w(device, 2, data); }
159173WRITE8_DEVICE_HANDLER( abcbus_c4_w ) { command_w(device, 3, data); }
160174
175WRITE_LINE_DEVICE_HANDLER( abcbus_resin_w )
176{
177   abcbus_t *abcbus = get_safe_token(device);
178
179   if (abcbus->resin != state)
180   {
181      if (LOG) logerror("ABCBUS: '%s' RESIN %u\n", device->tag(), state);
182     
183      cpu_set_input_line(abcbus->cpu, INPUT_LINE_RESET, state);
184      abcbus->resin = state;
185   }
186}
187
188WRITE_LINE_DEVICE_HANDLER( abcbus_int_w )
189{
190   abcbus_t *abcbus = get_safe_token(device);
191
192   if (abcbus->irq != state)
193   {
194      if (LOG) logerror("ABCBUS: '%s' INT %u\n", device->tag(), state);
195
196      cpu_set_input_line(abcbus->cpu, INPUT_LINE_IRQ0, state);
197      abcbus->irq = state;
198   }
199}
200
201WRITE_LINE_DEVICE_HANDLER( abcbus_nmi_w )
202{
203   abcbus_t *abcbus = get_safe_token(device);
204
205   if (abcbus->nmi != state)
206   {
207      if (LOG) logerror("ABCBUS: '%s' NMI %u\n", device->tag(), state);
208
209      cpu_set_input_line(abcbus->cpu, INPUT_LINE_NMI, state);
210      abcbus->nmi = state;
211   }
212}
213
214WRITE_LINE_DEVICE_HANDLER( abcbus_rdy_w )
215{
216   abcbus_t *abcbus = get_safe_token(device);
217
218   if (abcbus->rdy != state)
219   {
220      if (LOG) logerror("ABCBUS: '%s' RDY %u\n", device->tag(), state);
221      abcbus->rdy = state;
222   }
223}
224
161225/*-------------------------------------------------
162226    DEVICE_START( abcbus )
163227-------------------------------------------------*/
r9088r9089
166230{
167231   abcbus_t *abcbus = get_safe_token(device);
168232   const abcbus_daisy_chain *daisy = get_interface(device);
233   const abcbus_config *config = get_safe_config(device);
169234
170235   abcbus_daisy_state *head = NULL;
171236   abcbus_daisy_state **tailptr = &head;
172237
238   /* get CPU */
239   abcbus->cpu = device->machine->device(config->cpu_tag);
240
173241   /* create a linked list of devices */
174242   for ( ; daisy->tag != NULL; daisy++)
175243   {
r9088r9089
211279   {
212280      /* --- the following bits of info are returned as 64-bit signed integers --- */
213281      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(abcbus_t);                           break;
214      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                                    break;
282      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = sizeof(abcbus_config);                     break;
215283
216284      /* --- the following bits of info are returned as pointers to data or functions --- */
217285      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(abcbus);               break;
src/mess/machine/abcbus.h
r9088r9089
9595
9696DECLARE_LEGACY_DEVICE(ABCBUS, abcbus);
9797
98#define MDRV_ABCBUS_ADD(_tag, _daisy_chain) \
98#define MDRV_ABCBUS_ADD(_tag, _daisy_chain, _cpu_tag) \
9999   MDRV_DEVICE_ADD(_tag, ABCBUS, 0) \
100   MDRV_DEVICE_CONFIG(_daisy_chain)
100   MDRV_DEVICE_CONFIG(_daisy_chain) \
101   MDRV_DEVICE_CONFIG_DATAPTR(abcbus_config, cpu_tag, _cpu_tag)
101102
102103#define ABCBUS_DAISY(_name) \
103104   const abcbus_daisy_chain (_name)[] =
r9088r9089
126127   devcb_write_line   out_rst_func;
127128};
128129
130typedef struct _abcbus_config abcbus_config;
131struct _abcbus_config
132{
133   const char *cpu_tag;      /* CPU device */
134};
135
129136/***************************************************************************
130137    PROTOTYPES
131138***************************************************************************/
r9088r9089
148155WRITE8_DEVICE_HANDLER( abcbus_c3_w );
149156WRITE8_DEVICE_HANDLER( abcbus_c4_w );
150157
158/* inputs */
159WRITE_LINE_DEVICE_HANDLER( abcbus_resin_w );
160WRITE_LINE_DEVICE_HANDLER( abcbus_int_w );
161WRITE_LINE_DEVICE_HANDLER( abcbus_nmi_w );
162WRITE_LINE_DEVICE_HANDLER( abcbus_rdy_w );
163
151164#endif
src/mess/drivers/abc80.c
r9088r9089
534534   MDRV_Z80PIO_ADD(Z80PIO_TAG, ABC80_XTAL/2/2, pio_intf)
535535
536536   /* Luxor Conkort 55-10828 */
537   MDRV_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy)
538   MDRV_LUXOR_55_10828_ADD("abc830")
537   MDRV_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy, Z80_TAG)
538   MDRV_LUXOR_55_10828_ADD("abc830", ABCBUS_TAG)
539539
540540   /* video hardware */
541541   MDRV_FRAGMENT_ADD(abc80_video)
src/mess/drivers/abc80x.c
r9088r9089
11801180   MDRV_CASSETTE_ADD(CASSETTE_TAG, abc800_cassette_config)
11811181
11821182   /* ABC bus */
1183   MDRV_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy)
1184   MDRV_LUXOR_55_21046_ADD("abc830")
1183   MDRV_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy, Z80_TAG)
1184   MDRV_LUXOR_55_21046_ADD("abc830", ABCBUS_TAG)
11851185
11861186   /* fake keyboard */
11871187   MDRV_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, USEC(2500))
r9088r9089
12221222   MDRV_CASSETTE_ADD(CASSETTE_TAG, abc800_cassette_config)
12231223
12241224   /* ABC bus */
1225   MDRV_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy)
1226   MDRV_LUXOR_55_21046_ADD("abc830")
1225   MDRV_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy, Z80_TAG)
1226   MDRV_LUXOR_55_21046_ADD("abc830", ABCBUS_TAG)
12271227
12281228   /* fake keyboard */
12291229   MDRV_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, USEC(2500))
r9088r9089
12641264   MDRV_CASSETTE_ADD(CASSETTE_TAG, abc800_cassette_config)
12651265
12661266   /* ABC bus */
1267   MDRV_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy)
1268   MDRV_LUXOR_55_21046_ADD("abc830")
1267   MDRV_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy, Z80_TAG)
1268   MDRV_LUXOR_55_21046_ADD("abc830", ABCBUS_TAG)
12691269
12701270   /* fake keyboard */
12711271   MDRV_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, USEC(2500))
r9088r9089
13031303   MDRV_CASSETTE_ADD(CASSETTE_TAG, abc800_cassette_config)
13041304
13051305   /* ABC bus */
1306   MDRV_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy)
1307   MDRV_LUXOR_55_21046_ADD("abc830")
1306   MDRV_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy, Z80_TAG)
1307   MDRV_LUXOR_55_21046_ADD("abc830", ABCBUS_TAG)
13081308
13091309   /* fake keyboard */
13101310   MDRV_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, USEC(2500))

Previous 15994 Revisions Next


© 1998-2018 The MESS Team