Previous 15994 Revisions Next

r9077 Thursday 9th September, 2010 at 13:05:31 UTC by Curt Coder
[CONKORT] Almost fixed ABCBUS interface.
[src/mess/machine]conkort.c conkort.h

src/mess/machine/conkort.c
r9076r9077
176176
177177    Fast Controller
178178    ---------------
179   - status bit 0
179180   - drive select
180181   - side select
181182   - motor on
182   - Z80 NMI
183   - FDC INTRQ
184    - CPU is in HALT waiting for the FDC interrupt after commands
185183
186184*/
187185
r9076r9077
237235{
238236   int cs;               /* card selected */
239237   UINT8 status;         /* ABC BUS status */
240   UINT8 data;            /* ABC BUS data */
238   UINT8 data_in;         /* ABC BUS data in */
239   UINT8 data_out;         /* ABC BUS data out */
241240   int fdc_irq;         /* FDC interrupt */
242241
243242   /* devices */
r9076r9077
482481
483482   if (conkort->cs)
484483   {
485      data = conkort->status;
484      // TODO: D0 handling (NANDed with something)
485      // LS240 inverts the data, D4/D5 not connected
486      data = (~conkort->status & 0xcf) | 0x31;
486487   }
487488
488489   return data;
r9076r9077
494495
495496   UINT8 data = 0xff;
496497
497   if (conkort->cs && !BIT(conkort->status, 6))
498   if (conkort->cs)
498499   {
499      data = conkort->data;
500      data = conkort->data_out;
500501   }
501502
502503   return data;
r9076r9077
506507{
507508   fast_t *conkort = get_safe_token_fast(device);
508509
509   if (conkort->cs && BIT(conkort->status, 6))
510   if (conkort->cs)
510511   {
511      conkort->data = data;
512      conkort->data_in = data;
512513   }
513514}
514515
r9076r9077
541542   }
542543}
543544
544static READ8_DEVICE_HANDLER( fast_data_r )
545static READ8_DEVICE_HANDLER( fast_3d_r )
545546{
547   /*
548
549      bit      description
550
551      0     
552      1     
553      2     
554      3     
555      4     
556      5     
557      6     
558      7     
559
560   */
561
546562   fast_t *conkort = get_safe_token_fast(device->owner());
547563
548   return conkort->data;
564   return conkort->data_in;
549565}
550566
551static WRITE8_DEVICE_HANDLER( fast_data_w )
567static WRITE8_DEVICE_HANDLER( fast_4d_w )
552568{
553   fast_t *conkort = get_safe_token_fast(device->owner());
569   /*
554570
555   conkort->data = data;
556}
571      bit      description
557572
558static WRITE8_DEVICE_HANDLER( fast_status_w )
559{
573      0     
574      1     
575      2     
576      3     
577      4     
578      5     
579      6     
580      7     
581
582   */
583
560584   fast_t *conkort = get_safe_token_fast(device->owner());
561585
562   conkort->status = data;
586   conkort->data_out = data;
563587}
564588
565static WRITE8_DEVICE_HANDLER( fast_fdc_ctrl_w )
589static WRITE8_DEVICE_HANDLER( fast_4b_w )
566590{
567591   /*
568592
569593      bit      description
570594
571      0      FD1793 _MR
572      1      FD1793 _DDEN, FDC9229 DENS
573      2      FDC9229 MINI
574      3      ?
575      4      FDC9229 P2
576      5      FDC9229 P1
577      6
578      7
595      0     
596      1     
597      2     
598      3     
599      4     
600      5     
601      6     
602      7     
579603
580      FDC9229 P0 is grounded
581
582604   */
583605
584   /* master reset */
585   wd17xx_mr_w(device, BIT(data, 0));
606   fast_t *conkort = get_safe_token_fast(device->owner());
586607
587   /* density select */
588   wd17xx_dden_w(device, BIT(data, 1));
589
590   logerror("0x30 %02x\n", data);
608   conkort->status = data;
591609}
592610
593static WRITE8_DEVICE_HANDLER( fast_other_w )
611static WRITE8_DEVICE_HANDLER( fast_9b_w )
594612{
595613   /*
596614
r9076r9077
605623      6
606624      7
607625
608      this has to be drive/side select
626   */
609627
628   /* side select */
629   //wd17xx_set_side(device, BIT(data, 3));
630}
631
632static WRITE8_DEVICE_HANDLER( fast_8a_w )
633{
634   /*
635
636      bit      description
637
638      0      FD1793 _MR
639      1      FD1793 _DDEN, FDC9229 DENS
640      2      FDC9229 MINI
641      3      READY signal polarity (0=inverted)
642      4      FDC9229 P2
643      5      FDC9229 P1
644      6
645      7
646
647      FDC9229 P0 is grounded
648
610649   */
611   logerror("0x40 %02x\n", data);
650
651   /* master reset */
652   wd17xx_mr_w(device, BIT(data, 0));
653
654   /* density select */
655   wd17xx_dden_w(device, BIT(data, 1));
612656}
613657
614658/* Memory Maps */
r9076r9077
638682
639683static ADDRESS_MAP_START( fast_io_map, ADDRESS_SPACE_IO, 8 )
640684   ADDRESS_MAP_GLOBAL_MASK(0xff)
641   AM_RANGE(0x00, 0x00) AM_MIRROR(0x0f) AM_DEVREAD(SAB1793_TAG, fast_data_r)
642   AM_RANGE(0x10, 0x10) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_data_w)
643   AM_RANGE(0x20, 0x20) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_status_w)
644   AM_RANGE(0x30, 0x30) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_fdc_ctrl_w)
645   AM_RANGE(0x40, 0x40) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_other_w)
685   AM_RANGE(0x00, 0x00) AM_MIRROR(0x0f) AM_DEVREAD(SAB1793_TAG,  fast_3d_r)
686   AM_RANGE(0x10, 0x10) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_4d_w)
687   AM_RANGE(0x20, 0x20) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_4b_w)
688   AM_RANGE(0x30, 0x30) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_9b_w)
689   AM_RANGE(0x40, 0x40) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_8a_w)
646690   AM_RANGE(0x50, 0x50) AM_MIRROR(0x0f) AM_READ_PORT("SW1")
647691   AM_RANGE(0x60, 0x63) AM_MIRROR(0x0c) AM_DEVREAD(SAB1793_TAG, wd17xx_r)
648692   AM_RANGE(0x70, 0x73) AM_MIRROR(0x0c) AM_DEVWRITE(SAB1793_TAG, wd17xx_w)
r9076r9077
917961{
918962   fast_t *conkort = get_safe_token_fast(device->owner());
919963
920   //if (INTRQ enabled)
921   {
922      cpu_set_input_line(conkort->cpu, INPUT_LINE_NMI, state);
923   }
964   cpu_set_input_line(conkort->cpu, INPUT_LINE_IRQ0, state);
924965}
925966
926967static const wd17xx_interface fast_wd17xx_interface =
r9076r9077
11141155   /* register for state saving */
11151156   state_save_register_device_item(device, 0, conkort->cs);
11161157   state_save_register_device_item(device, 0, conkort->status);
1117   state_save_register_device_item(device, 0, conkort->data);
1158   state_save_register_device_item(device, 0, conkort->data_in);
1159   state_save_register_device_item(device, 0, conkort->data_out);
11181160   state_save_register_device_item(device, 0, conkort->fdc_irq);
11191161}
11201162
src/mess/machine/conkort.h
r9076r9077
2020#define LUXOR_55_10828_ABCBUS(_tag) \
2121   _tag, DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_cs_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_stat_r), \
2222   DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_inp_r), DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_utp_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_c1_w), \
23   DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_c3_w), DEVCB_DEVICE_LINE(_tag, luxor_55_10828_rst_w)
23   DEVCB_NULL, DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_c3_w), DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, luxor_55_10828_rst_w)
2424
2525#define LUXOR_55_21046_ABCBUS(_tag) \
2626   _tag, DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_cs_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_stat_r), \
2727   DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_inp_r), DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_utp_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_c1_w), \
28   DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_c3_w), DEVCB_DEVICE_LINE(_tag, luxor_55_21046_rst_w)
28   DEVCB_NULL, DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_c3_w), DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, luxor_55_21046_rst_w)
2929
3030/***************************************************************************
3131    PROTOTYPES

Previous 15994 Revisions Next


© 1998-2018 The MESS Team