src/mess/machine/coco.c
| r7209 | r7210 | |
| 1747 | 1747 | { |
| 1748 | 1748 | if (pia6821_get_output_ca2_z(cstate->pia_2)) |
| 1749 | 1749 | cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE); |
| 1750 | | } |
| 1750 | } |
| 1751 | 1751 | } |
| 1752 | 1752 | else |
| 1753 | | { |
| 1754 | 1753 | cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE); |
| 1755 | | } |
| 1756 | 1754 | } |
| 1757 | 1755 | |
| 1758 | 1756 | /* The DRQ line goes through pia2 cb1, in exactly the same way as DRQ from DragonDos does */ |
| r7209 | r7210 | |
| 1805 | 1803 | wd17xx_track_w(fdc, 0, data); |
| 1806 | 1804 | break; |
| 1807 | 1805 | case 3: |
| 1808 | | wd17xx_command_w(fdc, 0, data); |
| 1806 | wd17xx_command_w(fdc, 0, data); |
| 1809 | 1807 | |
| 1810 | 1808 | /* disk head is encoded in the command byte */ |
| 1811 | 1809 | wd17xx_set_side(fdc,(data & 0x02) ? 1 : 0); |
| r7209 | r7210 | |
| 2895 | 2893 | init.printer_out_ = printer_out_dragon; |
| 2896 | 2894 | |
| 2897 | 2895 | generic_coco12_dragon_init(machine, &init); |
| 2896 | } |
| 2898 | 2897 | |
| 2899 | | /* dgnalpha_just_reset, is here to flag that we should ignore the first irq generated */ |
| 2898 | MACHINE_RESET( dgnalpha ) |
| 2899 | { |
| 2900 | running_device *fdc = devtag_get_device(machine, "wd2797"); |
| 2901 | wd17xx_set_complete_command_delay(fdc,20); |
| 2902 | |
| 2903 | /* dgnalpha_just_reset, is here to flag that we should ignore the first irq generated */ |
| 2900 | 2904 | /* by the WD2797, it is reset to 0 after the first inurrupt */ |
| 2901 | 2905 | dgnalpha_just_reset=1; |
| 2902 | 2906 | } |
src/mess/machine/wd17xx.c
| r7209 | r7210 | |
| 108 | 108 | - Modified what status flags are returned after a Forced Interrupt, |
| 109 | 109 | to allow Microbee to boot CP/M. |
| 110 | 110 | |
| 111 | 2010-Jan-31 Phill Harvey-Smith |
| 112 | - The above bugfixes for the Kaypro/Osborne1 have borked the booting on the Dragon |
| 113 | Alpha. The Alpha it seems needs a delay of ay least 17us or the NMI generated by |
| 114 | INTRQ happens too early and doen't break out of the read/write bytes loops. |
| 115 | |
| 116 | I have made the delay settable by calling wd17xx_set_complete_command_delay, and |
| 117 | let it default to 12us, as required above, so that the Dragon Alpha works again. |
| 118 | This hopefully should not break the other machines. |
| 119 | |
| 120 | This should probably be considdered a minor hack but it does seem to work ! |
| 121 | |
| 111 | 122 | TODO: |
| 112 | 123 | - Multiple record write |
| 113 | 124 | - What happens if a track is read that doesn't have any id's on it? |
| r7209 | r7210 | |
| 325 | 336 | |
| 326 | 337 | /* pause time when writing/reading sector */ |
| 327 | 338 | int pause_time; |
| 339 | |
| 340 | /* complete command delay */ |
| 341 | int complete_command_delay; |
| 328 | 342 | |
| 329 | 343 | /* Pointer to interface */ |
| 330 | 344 | const wd17xx_interface *intf; |
| r7209 | r7210 | |
| 912 | 926 | usecs *= delay; |
| 913 | 927 | #endif |
| 914 | 928 | |
| 915 | | usecs = 12; |
| 929 | //usecs = 12; |
| 930 | usecs = w->complete_command_delay; |
| 916 | 931 | |
| 917 | 932 | /* set new timer */ |
| 918 | 933 | timer_adjust_oneshot(w->timer_cmd, ATTOTIME_IN_USEC(usecs), 0); |
| r7209 | r7210 | |
| 1156 | 1171 | w->pause_time = usec; |
| 1157 | 1172 | } |
| 1158 | 1173 | |
| 1174 | void wd17xx_set_complete_command_delay(running_device *device, int usec) |
| 1175 | { |
| 1176 | wd1770_state *w = get_safe_token(device); |
| 1177 | w->complete_command_delay=usec; |
| 1178 | } |
| 1159 | 1179 | |
| 1180 | |
| 1160 | 1181 | /*************************************************************************** |
| 1161 | 1182 | DEVICE HANDLERS |
| 1162 | 1183 | ***************************************************************************/ |
| r7209 | r7210 | |
| 1807 | 1828 | w->status = STA_1_TRACK0; |
| 1808 | 1829 | w->density = DEN_MFM_LO; |
| 1809 | 1830 | w->pause_time = 40; |
| 1831 | w->complete_command_delay = 12; |
| 1810 | 1832 | |
| 1811 | 1833 | /* allocate timers */ |
| 1812 | 1834 | w->timer_cmd = timer_alloc(device->machine, wd17xx_command_callback, (void *)device); |
src/mess/machine/wd17xx.h
| r7209 | r7210 | |
| 73 | 73 | void wd17xx_set_side(running_device *device, UINT8); /* set side wd179x is accessing */ |
| 74 | 74 | void wd17xx_set_density(running_device *device, DENSITY); /* set density */ |
| 75 | 75 | |
| 76 | | void wd17xx_set_pause_time(running_device *device, int usec); /* default is 40 usec if not set */ |
| 76 | void wd17xx_set_pause_time(running_device *device, int usec); /* default is 40 usec if not set */ |
| 77 | void wd17xx_set_complete_command_delay(running_device *device, int usec); /* default is 12 usec if not set */ |
| 77 | 78 | |
| 78 | 79 | READ8_DEVICE_HANDLER( wd17xx_status_r ); |
| 79 | 80 | READ8_DEVICE_HANDLER( wd17xx_track_r ); |
src/mess/drivers/coco.c
| r7209 | r7210 | |
| 270 | 270 | AM_RANGE(0xff00, 0xff03) AM_DEVREADWRITE("pia_0", pia6821_r, pia6821_w) |
| 271 | 271 | AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE("acia", acia_6551_r, acia_6551_w) |
| 272 | 272 | AM_RANGE(0xff20, 0xff23) AM_DEVREADWRITE("pia_1", pia6821_r, coco_pia_1_w) |
| 273 | | AM_RANGE(0xff24, 0xff27) AM_DEVREADWRITE("pia_2", pia6821_r, pia6821_w) /* Third PIA on Dragon Alpha */ |
| 273 | AM_RANGE(0xff24, 0xff27) AM_DEVREADWRITE("pia_2", pia6821_r, pia6821_w) /* Third PIA on Dragon Alpha */ |
| 274 | 274 | AM_RANGE(0Xff28, 0xff2b) AM_READWRITE(dgnalpha_modem_r, dgnalpha_modem_w) /* Modem, dummy to stop eror log ! */ |
| 275 | | AM_RANGE(0xff2c, 0xff2f) AM_READWRITE(dgnalpha_wd2797_r, dgnalpha_wd2797_w) /* Alpha onboard disk interface */ |
| 275 | AM_RANGE(0xff2c, 0xff2f) AM_READWRITE(dgnalpha_wd2797_r, dgnalpha_wd2797_w) /* Alpha onboard disk interface */ |
| 276 | 276 | AM_RANGE(0xff40, 0xff7f) AM_DEVREADWRITE("coco_cartslot", coco_cartridge_r, coco_cartridge_w) |
| 277 | 277 | AM_RANGE(0xff90, 0xffbf) AM_NOP |
| 278 | 278 | AM_RANGE(0xffc0, 0xffdf) AM_DEVWRITE("sam", sam6883_w) |
| r7209 | r7210 | |
| 928 | 928 | |
| 929 | 929 | MDRV_MACHINE_START( dgnalpha ) |
| 930 | 930 | MDRV_DRIVER_DATA( coco_state ) |
| 931 | MDRV_MACHINE_RESET( dgnalpha ) |
| 931 | 932 | |
| 932 | 933 | /* video hardware */ |
| 933 | 934 | MDRV_SCREEN_ADD("screen", RASTER) |