Previous 15994 Revisions Next

r5747 Wednesday 16th September, 2009 at 18:11:15 UTC by Miodrag Milanović
[THOMSON] Fixed floppy
[src/mess/devices]thomflop.c

src/mess/devices/thomflop.c
r5746r5747
333333   const device_config *fdc = devtag_get_device(machine, "wd2793");
334334   LOG(( "to7_5p14_reset: CD 90-640 controller\n" ));
335335   wd17xx_reset(fdc);
336   for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ )
336   for ( i = 0; i < floppy_get_count( machine ); i++ )
337337   {
338      const device_config * img = image_from_devtype_and_index( machine, IO_FLOPPY, i );
339      floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
340      floppy_drive_set_rpm( img, 300. );
341      floppy_drive_seek( img, - floppy_drive_get_current_track( img ) );
338      const device_config * img = floppy_get_device( machine, i );
339      if (img) {
340         floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
341         floppy_drive_set_rpm( img, 300. );
342         floppy_drive_seek( img, - floppy_drive_get_current_track( img ) );
343      }
342344   }
343345}
344346
r5746r5747
434436{
435437   int i;
436438   LOG(( "to7_5p14sd_reset: CD 90-015 controller\n" ));
437   for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ )
439   for ( i = 0; i < floppy_get_count( machine ); i++ )
438440   {
439      const device_config * img = image_from_devtype_and_index( machine, IO_FLOPPY, i );
440      floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
441      floppy_drive_set_rpm( img, 300. );
442      floppy_drive_seek( img, - floppy_drive_get_current_track( img ) );
443      floppy_drive_set_index_pulse_callback( img, to7_5p14_index_pulse_callback );
444
441      const device_config * img = floppy_get_device( machine, i );
442      if (img) {
443         floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
444         floppy_drive_set_rpm( img, 300. );
445         floppy_drive_seek( img, - floppy_drive_get_current_track( img ) );
446         floppy_drive_set_index_pulse_callback( img, to7_5p14_index_pulse_callback );
447      }
445448   }
446449}
447450
r5746r5747
544547
545548static const device_config * to7_qdd_image ( running_machine *machine )
546549{
547   return image_from_devtype_and_index( machine, IO_FLOPPY, 0 );
550   return floppy_get_device( machine, 0 );
548551}
549552
550553
r5746r5747
839842   int i;
840843   LOG(( "to7_qdd_reset: CQ 90-028 controller\n" ));
841844
842   for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ )
845   for ( i = 0; i < floppy_get_count( machine ); i++ )
843846   {
844      const device_config * img = image_from_devtype_and_index( machine, IO_FLOPPY, i );
845      floppy_drive_set_index_pulse_callback( img, to7_qdd_index_pulse_cb );
846      floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
847      floppy_drive_set_motor_state( img, 1 );
848      /* pulse each time the whole-disk spiraling track ends */
849      /* at 90us per byte read, the disk can be read in 6s */
850      floppy_drive_set_rpm( img, 60. / 6. );
847      const device_config * img = floppy_get_device( machine, i );
848      if (img) {
849         floppy_drive_set_index_pulse_callback( img, to7_qdd_index_pulse_cb );
850         floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
851         floppy_drive_set_motor_state( img, 1 );
852         /* pulse each time the whole-disk spiraling track ends */
853         /* at 90us per byte read, the disk can be read in 6s */
854         floppy_drive_set_rpm( img, 60. / 6. );
855      }
851856   }
852857
853858   to7qdd->ctrl1 |= QDD_C1_TRESET | QDD_C1_RRESET; /* reset */
r5746r5747
939944
940945static const device_config * thmfc_floppy_image ( running_machine *machine )
941946{
942   return image_from_devtype_and_index( machine, IO_FLOPPY, thmfc1->drive );
947   return floppy_get_device( machine, thmfc1->drive );
943948}
944949
945950
r5746r5747
15201525   int i;
15211526   LOG(( "thmfc_floppy_reset: THMFC1 controller\n" ));
15221527
1523   for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ )
1528   for ( i = 0; i < floppy_get_count( machine ); i++ )
15241529   {
1525      const device_config * img = image_from_devtype_and_index( machine, IO_FLOPPY, i );
1526      floppy_drive_set_index_pulse_callback( img, thmfc_floppy_index_pulse_cb );
1527      floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
1528      floppy_drive_seek( img, - floppy_drive_get_current_track( img ) );
1530      const device_config * img = floppy_get_device( machine, i );
1531      if (img) {
1532         floppy_drive_set_index_pulse_callback( img, thmfc_floppy_index_pulse_cb );
1533         floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
1534         floppy_drive_seek( img, - floppy_drive_get_current_track( img ) );
1535      }
15291536   }
15301537
15311538   thmfc1->op = THMFC1_OP_RESET;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team