src/mess/devices/thomflop.c
| r5746 | r5747 | |
| 333 | 333 | const device_config *fdc = devtag_get_device(machine, "wd2793"); |
| 334 | 334 | LOG(( "to7_5p14_reset: CD 90-640 controller\n" )); |
| 335 | 335 | wd17xx_reset(fdc); |
| 336 | | for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ ) |
| 336 | for ( i = 0; i < floppy_get_count( machine ); i++ ) |
| 337 | 337 | { |
| 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 | } |
| 342 | 344 | } |
| 343 | 345 | } |
| 344 | 346 | |
| r5746 | r5747 | |
| 434 | 436 | { |
| 435 | 437 | int i; |
| 436 | 438 | 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++ ) |
| 438 | 440 | { |
| 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 | } |
| 445 | 448 | } |
| 446 | 449 | } |
| 447 | 450 | |
| r5746 | r5747 | |
| 544 | 547 | |
| 545 | 548 | static const device_config * to7_qdd_image ( running_machine *machine ) |
| 546 | 549 | { |
| 547 | | return image_from_devtype_and_index( machine, IO_FLOPPY, 0 ); |
| 550 | return floppy_get_device( machine, 0 ); |
| 548 | 551 | } |
| 549 | 552 | |
| 550 | 553 | |
| r5746 | r5747 | |
| 839 | 842 | int i; |
| 840 | 843 | LOG(( "to7_qdd_reset: CQ 90-028 controller\n" )); |
| 841 | 844 | |
| 842 | | for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ ) |
| 845 | for ( i = 0; i < floppy_get_count( machine ); i++ ) |
| 843 | 846 | { |
| 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 | } |
| 851 | 856 | } |
| 852 | 857 | |
| 853 | 858 | to7qdd->ctrl1 |= QDD_C1_TRESET | QDD_C1_RRESET; /* reset */ |
| r5746 | r5747 | |
| 939 | 944 | |
| 940 | 945 | static const device_config * thmfc_floppy_image ( running_machine *machine ) |
| 941 | 946 | { |
| 942 | | return image_from_devtype_and_index( machine, IO_FLOPPY, thmfc1->drive ); |
| 947 | return floppy_get_device( machine, thmfc1->drive ); |
| 943 | 948 | } |
| 944 | 949 | |
| 945 | 950 | |
| r5746 | r5747 | |
| 1520 | 1525 | int i; |
| 1521 | 1526 | LOG(( "thmfc_floppy_reset: THMFC1 controller\n" )); |
| 1522 | 1527 | |
| 1523 | | for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ ) |
| 1528 | for ( i = 0; i < floppy_get_count( machine ); i++ ) |
| 1524 | 1529 | { |
| 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 | } |
| 1529 | 1536 | } |
| 1530 | 1537 | |
| 1531 | 1538 | thmfc1->op = THMFC1_OP_RESET; |