src/mess/machine/nec765.c
| r5075 | r5076 | |
| 1847 | 1847 | |
| 1848 | 1848 | fdc->nec765_status[3] = fdc->drive | (fdc->side<<2); |
| 1849 | 1849 | |
| 1850 | | if (floppy_drive_get_flag_state(img, FLOPPY_DRIVE_DISK_WRITE_PROTECTED)) |
| 1850 | if (img) |
| 1851 | 1851 | { |
| 1852 | | fdc->nec765_status[3] |= 0x40; |
| 1853 | | } |
| 1852 | if (floppy_drive_get_flag_state(img, FLOPPY_DRIVE_DISK_WRITE_PROTECTED)) |
| 1853 | { |
| 1854 | fdc->nec765_status[3] |= 0x40; |
| 1855 | } |
| 1854 | 1856 | |
| 1855 | | if (floppy_drive_get_flag_state(img, FLOPPY_DRIVE_READY)) |
| 1856 | | { |
| 1857 | | fdc->nec765_status[3] |= 0x20; |
| 1858 | | } |
| 1857 | if (floppy_drive_get_flag_state(img, FLOPPY_DRIVE_READY)) |
| 1858 | { |
| 1859 | fdc->nec765_status[3] |= 0x20; |
| 1860 | } |
| 1859 | 1861 | |
| 1860 | | if (floppy_drive_get_flag_state(img, FLOPPY_DRIVE_HEAD_AT_TRACK_0)) |
| 1861 | | { |
| 1862 | | fdc->nec765_status[3] |= 0x10; |
| 1862 | if (floppy_drive_get_flag_state(img, FLOPPY_DRIVE_HEAD_AT_TRACK_0)) |
| 1863 | { |
| 1864 | fdc->nec765_status[3] |= 0x10; |
| 1865 | } |
| 1863 | 1866 | } |
| 1864 | 1867 | |
| 1865 | 1868 | fdc->nec765_status[3] |= 0x08; |
src/mess/drivers/bw12.c
| r5075 | r5076 | |
| 40 | 40 | |
| 41 | 41 | TODO:
|
| 42 | 42 | |
| 43 | | - nec765 access violation
|
| 44 | 43 | - keyboard
|
| 44 | - floppy motor off timer
|
| 45 | 45 | |
| 46 | 46 | */
|
| 47 | 47 | |
| r5075 | r5076 | |
| 88 | 88 | |
| 89 | 89 | floppy_drive_set_motor_state(get_floppy_image(machine, 0), 0);
|
| 90 | 90 | floppy_drive_set_motor_state(get_floppy_image(machine, 1), 0);
|
| 91 | | floppy_drive_set_ready_state(get_floppy_image(machine, 0), 0, 1);
|
| 92 | | floppy_drive_set_ready_state(get_floppy_image(machine, 1), 0, 1);
|
| 91 | floppy_drive_set_ready_state(get_floppy_image(machine, 0), 0, 0);
|
| 92 | floppy_drive_set_ready_state(get_floppy_image(machine, 1), 0, 0);
|
| 93 | 93 | |
| 94 | 94 | state->motor_on = 0;
|
| 95 | 95 | }
|
| r5075 | r5076 | |
| 101 | 101 | if (state->motor0 || state->motor1)
|
| 102 | 102 | {
|
| 103 | 103 | /* trigger floppy motor off NE556 timer */
|
| 104 | | int t = 1100 * RES_K(100) * CAP_U(4.7); // t = 1.1 * R18 * C11
|
| 104 | // int t = 1100 * RES_K(100) * CAP_U(4.7); // t = 1.1 * R18 * C11
|
| 105 | 105 | |
| 106 | | timer_adjust_oneshot(state->floppy_motor_off_timer, ATTOTIME_IN_MSEC(t), 0);
|
| 106 | // timer_adjust_oneshot(state->floppy_motor_off_timer, ATTOTIME_IN_MSEC(t), 0);
|
| 107 | 107 | |
| 108 | 108 | state->motor_on = 1;
|
| 109 | 109 | }
|
| r5075 | r5076 | |
| 141 | 141 | if (data)
|
| 142 | 142 | {
|
| 143 | 143 | floppy_drive_set_motor_state(get_floppy_image(machine, 0), 1);
|
| 144 | | floppy_drive_set_ready_state(get_floppy_image(machine, 0), 1, 1);
|
| 144 | floppy_drive_set_ready_state(get_floppy_image(machine, 0), 1, 0);
|
| 145 | 145 | }
|
| 146 | 146 | |
| 147 | 147 | bw12_set_floppy_motor_off_timer(machine);
|
| r5075 | r5076 | |
| 153 | 153 | if (data)
|
| 154 | 154 | {
|
| 155 | 155 | floppy_drive_set_motor_state(get_floppy_image(machine, 1), 1);
|
| 156 | | floppy_drive_set_ready_state(get_floppy_image(machine, 1), 1, 1);
|
| 156 | floppy_drive_set_ready_state(get_floppy_image(machine, 1), 1, 0);
|
| 157 | 157 | }
|
| 158 | 158 | |
| 159 | 159 | bw12_set_floppy_motor_off_timer(machine);
|
| r5075 | r5076 | |
| 316 | 316 | driver_state->fdcint = state;
|
| 317 | 317 | }
|
| 318 | 318 | |
| 319 | | static const nec765_interface bw12_nec765_interface =
|
| 319 | static NEC765_GET_IMAGE( bw12_nec765_get_image )
|
| 320 | 320 | {
|
| 321 | switch (floppy_index)
|
| 322 | {
|
| 323 | case 1: /* drive A */
|
| 324 | return get_floppy_image(device->machine, 0);
|
| 325 | |
| 326 | case 2: /* drive B */
|
| 327 | return get_floppy_image(device->machine, 1);
|
| 328 | |
| 329 | default:
|
| 330 | return NULL;
|
| 331 | }
|
| 332 | }
|
| 333 | |
| 334 | static const struct nec765_interface bw12_nec765_interface =
|
| 335 | {
|
| 321 | 336 | bw12_nec765_interrupt, /* interrupt */
|
| 322 | 337 | NULL, /* DMA request */
|
| 323 | | NULL, /* image lookup */
|
| 338 | bw12_nec765_get_image, /* image lookup */
|
| 324 | 339 | NEC765_RDY_PIN_CONNECTED /* ready pin */
|
| 325 | 340 | };
|
| 326 | 341 | |