src/mess/machine/wd17xx.c
| r5055 | r5056 | |
| 42 | 42 | - Added simulation of head loaded feedback from drive |
| 43 | 43 | - Bugfix: busy flag was cleared too early |
| 44 | 44 | |
| 45 | 2009-June-21 Robbbert: |
| 46 | - The Bugfix above, while valid, caused the Osborne1 to fail. This |
| 47 | is because the delay must not exceed 14usec (found by extensive testing). |
| 48 | - The minimum delay is 1usec, need by z80netf while formatting a disk. |
| 49 | - http://www.bannister.org/forums/ubbthreads.php?ubb=showflat&Number=50889#Post50889 |
| 50 | explains the problems, testing done, and the test procedure for the z80netf. |
| 51 | - Thus, the delay is set to 10usec, and all the disks I have (not many) |
| 52 | seem to work. |
| 53 | - Note to anyone who wants to change something: Make sure that the |
| 54 | Osborne1 boots up! It is extremely sensitive to timing! |
| 55 | - For testing only: The osborne1 rom can be patched to make it much |
| 56 | more stable, by changing the byte at 0x0da7 from 0x28 to 0x18. |
| 57 | |
| 45 | 58 | TODO: |
| 46 | 59 | - Multiple record write |
| 47 | 60 | - What happens if a track is read that doesn't have any id's on it? |
| r5055 | r5056 | |
| 859 | 872 | |
| 860 | 873 | w->hld_count = 2; |
| 861 | 874 | |
| 875 | #if 0 |
| 862 | 876 | /* clear busy bit */ |
| 863 | 877 | /* RL - removed, busy bit must be on until wd17xx_misc_timer_callback() is fired */ |
| 864 | | /* Robbbert - put back in, it broke too many systems */ |
| 878 | /* Robbbert - adjusted delay value (see notes above) to fix the osborne1 */ |
| 865 | 879 | w->status &= ~STA_2_BUSY; |
| 866 | 880 | |
| 867 | 881 | usecs = floppy_drive_get_datarate_in_us(w->density); |
| 868 | 882 | usecs *= delay; |
| 883 | #endif |
| 869 | 884 | |
| 885 | usecs = 10; |
| 886 | |
| 870 | 887 | /* set new timer */ |
| 871 | 888 | timer_adjust_oneshot(w->timer, ATTOTIME_IN_USEC(usecs), MISCCALLBACK_COMMAND); |
| 872 | 889 | } |
src/mess/machine/z80ne.c
| r5055 | r5056 | |
| 741 | 741 | * 1 1 0 x |
| 742 | 742 | * |
| 743 | 743 | */ |
| 744 | | static WD17XX_CALLBACK( z80ne_fdc_callback ) |
| 745 | | { |
| 746 | | switch (state) |
| 747 | | { |
| 748 | | case WD17XX_IRQ_CLR: |
| 749 | | wd17xx_state.intrq = FALSE; |
| 750 | | break; |
| 751 | | case WD17XX_IRQ_SET: |
| 752 | | wd17xx_state.intrq = TRUE; |
| 753 | | output_set_value("drv0", 0); |
| 754 | | output_set_value("drv1", 0); |
| 755 | | break; |
| 756 | | case WD17XX_DRQ_CLR: |
| 757 | | wd17xx_state.drq = FALSE; |
| 758 | | break; |
| 759 | | case WD17XX_DRQ_SET: |
| 760 | | wd17xx_state.drq = TRUE; |
| 761 | | break; |
| 762 | | } |
| 763 | | } |
| 764 | 744 | |
| 765 | | const wd17xx_interface z80ne_wd17xx_interface = { z80ne_fdc_callback, NULL }; |
| 766 | | |
| 767 | 745 | WRITE8_DEVICE_HANDLER(lx390_motor_w) |
| 768 | 746 | { |
| 769 | 747 | /* Selection of drive and parameters |
| r5055 | r5056 | |
| 848 | 826 | LOG(("lx390_fdc_r, WD17xx sector: %02x\n", d)); |
| 849 | 827 | break; |
| 850 | 828 | case 3: |
| 851 | | if(!wd17xx_state.drq && !wd17xx_state.intrq) |
| 852 | | { |
| 853 | | d = wd17xx_data_r(device, 0); |
| 854 | | LOG(("lx390_fdc_r, WD17xx data3, ready: %02x\n", d)); |
| 855 | | } |
| 856 | | else |
| 857 | | { |
| 858 | | d = 0xff; |
| 859 | | LOG(("lx390_fdc_r, WD17xx data3, busy: intrq %01x drq %01x \n", wd17xx_state.intrq, wd17xx_state.drq)); |
| 860 | | } |
| 829 | d = wd17xx_data_r(device, 0); |
| 830 | LOG(("lx390_fdc_r, WD17xx data3: %02x\n", d)); |
| 861 | 831 | break; |
| 862 | 832 | case 6: |
| 863 | 833 | d = 0xff; |
| r5055 | r5056 | |
| 897 | 867 | wd17xx_sector_w(device, offset, d); |
| 898 | 868 | break; |
| 899 | 869 | case 3: |
| 900 | | if(!wd17xx_state.drq && !wd17xx_state.intrq) |
| 901 | | { |
| 902 | | LOG(("lx390_fdc_w, WD17xx data3, ready: %02x\n", d)); |
| 903 | | wd17xx_data_w(device, 0, d); |
| 904 | | } |
| 905 | | else |
| 906 | | { |
| 907 | | LOG(("lx390_fdc_w, WD17xx data3, busy: %02x\n", d)); |
| 908 | | } |
| 870 | wd17xx_data_w(device, 0, d); |
| 871 | LOG(("lx390_fdc_w, WD17xx data3: %02x\n", d)); |
| 909 | 872 | break; |
| 910 | 873 | case 6: |
| 911 | 874 | LOG(("lx390_fdc_w, motor_w: %02x\n", d)); |