Previous 15994 Revisions Next

r7312 Wednesday 10th February, 2010 at 15:42:46 UTC by Curt Coder
[CBM drives] Fixed spindle/stepper motor behaviour.
[src/mess/machine]c1541.c c1571.c c2040.c

src/mess/machine/c2040.c
r7311r7312
622622
623623    */
624624
625   /* TODO active led 1 */
625   /* TODO activity led 1 */
626626
627   /* TODO active led 0 */
627   /* TODO activity led 0 */
628628
629629   /* TODO error led */
630630}
r7311r7312
667667{
668668   if (c2040->unit[unit].mtr != mtr)
669669   {
670      if (mtr)
670      if (!mtr)
671671      {
672672         /* read track data */
673673         read_current_track(c2040, unit);
674674      }
675675
676      floppy_mon_w(c2040->unit[unit].image, !mtr);
676      floppy_mon_w(c2040->unit[unit].image, mtr);
677677
678678      c2040->unit[unit].mtr = mtr;
679679   }
680680}
681681
682static void micropolis_step_motor(c2040_t *c2040, int unit, int stp)
682static void micropolis_step_motor(c2040_t *c2040, int unit, int mtr, int stp)
683683{
684   if (c2040->unit[unit].stp != stp)
684   if (!mtr && (c2040->unit[unit].stp != stp))
685685   {
686686      int tracks = 0;
687687
r7311r7312
771771
772772   c2040_t *c2040 = get_safe_token(device->owner);
773773
774   /* stepper motor 1 */
775   int s1 = data & 0x03;
776   micropolis_step_motor(c2040, 1, s1);
777
778   /* stepper motor 0 */
779   int s0 = (data >> 2) & 0x03;
780   micropolis_step_motor(c2040, 0, s0);
781
782774   /* spindle motor 1 */
783775   int mtr1 = BIT(data, 4);
784776   spindle_motor(c2040, 1, mtr1);
r7311r7312
787779   int mtr0 = BIT(data, 5);
788780   spindle_motor(c2040, 0, mtr0);
789781
790   timer_enable(c2040->bit_timer, mtr1 | mtr0);
782   /* stepper motor 1 */
783   int s1 = data & 0x03;
784   micropolis_step_motor(c2040, 1, mtr1, s1);
785
786   /* stepper motor 0 */
787   int s0 = (data >> 2) & 0x03;
788   micropolis_step_motor(c2040, 0, mtr0, s0);
789
790   timer_enable(c2040->bit_timer, !mtr1 | !mtr0);
791791}
792792
793793static READ_LINE_DEVICE_HANDLER( ready_r )
r7311r7312
938938   int s0 = (data >> 2) & 0x03;
939939   mpi_step_motor(c2040, 0, mtr0, s0);
940940
941   timer_enable(c2040->bit_timer, mtr1 | mtr0);
942
943   /* TODO pull sync */
941   timer_enable(c2040->bit_timer, !mtr1 | !mtr0);
944942}
945943
946944static const via6522_interface c8050_via_intf =
r7311r7312
15631561   /* toggle M6502 SO */
15641562   cpu_set_input_line(c2040->cpu_dos, M6502_SET_OVERFLOW, ASSERT_LINE);
15651563   cpu_set_input_line(c2040->cpu_dos, M6502_SET_OVERFLOW, CLEAR_LINE);
1564
1565   /* turn off spindle motors */
1566   c2040->unit[0].mtr = c2040->unit[1].mtr = 1;
15661567}
15671568
15681569/*-------------------------------------------------
src/mess/machine/c1541.c
r7311r7312
768768   }
769769}
770770
771static void step_motor(c1541_t *c1541, int stp)
771static void step_motor(c1541_t *c1541, int mtr, int stp)
772772{
773   if (c1541->stp != stp)
773   if (mtr & (c1541->stp != stp))
774774   {
775775      int tracks = 0;
776776
r7311r7312
896896
897897   c1541_t *c1541 = get_safe_token(device->owner);
898898
899   /* stepper motor */
900   int stp = data & 0x03;
901   step_motor(c1541, stp);
902
903899   /* spindle motor */
904900   int mtr = BIT(data, 2);
905901   spindle_motor(c1541, mtr);
906902
903   /* stepper motor */
904   int stp = data & 0x03;
905   step_motor(c1541, mtr, stp);
906
907907   /* activity LED */
908908
909909   /* density select */
src/mess/machine/c1571.c
r7311r7312
496496   }
497497}
498498
499static void step_motor(c1571_t *c1571, int stp)
499static void step_motor(c1571_t *c1571, int mtr, int stp)
500500{
501   if (c1571->stp != stp)
501   if (mtr & (c1571->stp != stp))
502502   {
503503      int tracks = 0;
504504
r7311r7312
620620
621621   c1571_t *c1571 = get_safe_token(device->owner);
622622
623   /* stepper motor */
624   int stp = data & 0x03;
625   step_motor(c1571, stp);
626
627623   /* spindle motor */
628624   int mtr = BIT(data, 2);
629625   spindle_motor(c1571, mtr);
630626
627   /* stepper motor */
628   int stp = data & 0x03;
629   step_motor(c1571, mtr, stp);
630
631631   /* activity LED */
632632
633633   /* density select */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team