Previous 15994 Revisions Next

r9101 Sunday 12th September, 2010 at 09:27:05 UTC by Curt Coder
[CONKORT] Fixed drive selection and busy bit.
[src/mess/machine]conkort.c

src/mess/machine/conkort.c
r9100r9101
178178    ---------------
179179   - controller reads a couple of sectors on boot, bails out, and starts to STEP_OUT ad infinitum
180180   - Z80 DMA reset command is broken (it keeps resetting A/B port addresses)
181   - status bit 0 (busy) ?
182181   - 2KB RAM option
183182   - some SW2 options make controller try to WRITE_TRK
184183
r9100r9101
244243   int fdc_irq;         /* FDC interrupt */
245244   int dma_irq;         /* DMA interrupt */
246245   int busy;            /* busy bit */
246   int force_busy;         /* force busy bit */
247247
248248   /* devices */
249249   running_device *bus;
r9100r9101
396396   conkort->sel1 = BIT(data, 1);
397397
398398   /* motor enable */
399   floppy_mon_w(conkort->image0, BIT(data, 3));
400   floppy_mon_w(conkort->image1, BIT(data, 3));
401   floppy_drive_set_ready_state(conkort->image0, 1, 1);
402   floppy_drive_set_ready_state(conkort->image1, 1, 1);
399   int mtron = BIT(data, 3);
400   floppy_mon_w(conkort->image0, mtron);
401   floppy_mon_w(conkort->image1, mtron);
402   floppy_drive_set_ready_state(conkort->image0, !mtron, 1);
403   floppy_drive_set_ready_state(conkort->image1, !mtron, 1);
403404
404405   /* disk side selection */
405406   //wd17xx_set_side(device, BIT(data, 4));
r9100r9101
495496{
496497   fast_t *conkort = get_safe_token_fast(device);
497498
498   UINT8 data = 0xff;
499   UINT8 data = 0;
499500
500501   if (conkort->cs)
501502   {
502      // LS240 inverts the data, D4/D5 not connected
503      data = (~conkort->status & 0xcf) | 0x30 | !(conkort->busy & BIT(conkort->status, 0));
503      data = (conkort->status & 0xce) | conkort->busy;
504504   }
505505
506   return data;
506   // LS240 inverts the data
507   return data ^ 0xff;
507508}
508509
509510READ8_DEVICE_HANDLER( luxor_55_21046_inp_r )
r9100r9101
566567{
567568   fast_t *conkort = get_safe_token_fast(device->owner());
568569
569   conkort->busy = 0;
570   if (BIT(conkort->status, 0))
571   {
572      conkort->busy = 0;
573   }
570574
571575   return conkort->data_in;
572576}
r9100r9101
575579{
576580   fast_t *conkort = get_safe_token_fast(device->owner());
577581   
578   conkort->busy = 0;
582   if (BIT(conkort->status, 0))
583   {
584      conkort->busy = 0;
585   }
579586
580587   conkort->data_out = data;
581588}
r9100r9101
586593
587594      bit      description
588595
589      0      busy
590      1      index pulse/DRQ
591      2      track 0/lost data
592      3      CRC error
593      4      seek error/RNF
594      5      head loaded/write fault
595      6      write protect
596      7      not ready
596      0      force busy
597      1     
598      2     
599      3     
600      4      N/C
601      5      N/C
602      6     
603      7     
597604
598605   */
599606
r9100r9101
601608
602609   conkort->status = data;
603610
604   if (BIT(data, 0))
611   /* busy */
612   if (!BIT(conkort->status, 0))
605613   {
606      conkort->busy = 0;
614      conkort->busy = 1;
607615   }
608616}
609617
r9100r9101
613621
614622      bit      description
615623
616      0      _MOTEA
617      1      _DRVSB
618      2      _DRVSA
619      3      _MOTEB
624      0      DS0
625      1      DS1
626      2      DS2
627      3      MTRON
620628      4      pin 2 of 50-pin floppy connector, not used
621      5      _SIDE1
629      5      SIDE1
622630      6
623631      7
624632
r9100r9101
626634
627635   fast_t *conkort = get_safe_token_fast(device->owner());
628636
629   /* motor enable */
630   floppy_mon_w(conkort->image0, !BIT(data, 0));
631   floppy_mon_w(conkort->image1, !BIT(data, 3));
632   floppy_drive_set_ready_state(conkort->image0, 1, 1);
633   floppy_drive_set_ready_state(conkort->image1, 1, 1);
634
635637   /* drive select */
636   if (BIT(data, 2)) wd17xx_set_drive(device, 0);
638   if (BIT(data, 0)) wd17xx_set_drive(device, 0);
637639   if (BIT(data, 1)) wd17xx_set_drive(device, 1);
640   //if (BIT(data, 2)) wd17xx_set_drive(device, 2);
638641
642   /* motor enable */
643   int mtron = BIT(data, 3);
644   floppy_mon_w(conkort->image0, !mtron);
645   floppy_mon_w(conkort->image1, !mtron);
646   floppy_drive_set_ready_state(conkort->image0, mtron, 1);
647   floppy_drive_set_ready_state(conkort->image1, mtron, 1);
648
639649   /* side select */
640650   wd17xx_set_side(device, BIT(data, 5));
641651}
r9100r9101
688698   UINT8 data = 0;
689699
690700   /* busy */
691   data |= (conkort->busy & BIT(conkort->status, 0));
701   data |= conkort->busy;
692702
693703   /* SW1 */
694704   UINT8 sw1 = input_port_read(device->machine, "luxor_55_21046:SW1") & 0x0f;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team