src/mess/machine/99_dsk.c
| r1955 | r1956 | |
| 72 | 72 | Emulation is faulty because the CPU is actually stopped in the midst of |
| 73 | 73 | instruction, at the end of the memory access |
| 74 | 74 | */ |
| 75 | | static void fdc_handle_hold(void) |
| 75 | static void fdc_handle_hold(running_machine *machine) |
| 76 | 76 | { |
| 77 | 77 | if (DSKhold && (!DRQ_IRQ_status) && DVENA) |
| 78 | | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, ASSERT_LINE); |
| 78 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, ASSERT_LINE); |
| 79 | 79 | else |
| 80 | | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, CLEAR_LINE); |
| 80 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, CLEAR_LINE); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /* |
| r1955 | r1956 | |
| 86 | 86 | static TIMER_CALLBACK(motor_on_timer_callback) |
| 87 | 87 | { |
| 88 | 88 | DVENA = 0; |
| 89 | | fdc_handle_hold(); |
| 89 | fdc_handle_hold(machine); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | typedef struct ti99_geometry |
| r1955 | r1956 | |
| 388 | 388 | break; |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | | fdc_handle_hold(); |
| 391 | fdc_handle_hold(Machine); |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | /* |
| r1955 | r1956 | |
| 507 | 507 | if (data && !motor_on) |
| 508 | 508 | { /* on rising edge, set DVENA for 4.23s */ |
| 509 | 509 | DVENA = 1; |
| 510 | | fdc_handle_hold(); |
| 510 | fdc_handle_hold(machine); |
| 511 | 511 | timer_adjust_oneshot(motor_on_timer, ATTOTIME_IN_MSEC(4230), 0); |
| 512 | 512 | } |
| 513 | 513 | motor_on = data; |
| r1955 | r1956 | |
| 520 | 520 | for 4.23s after write to revelant CRU bit, this is not emulated and could cause |
| 521 | 521 | the TI99 to lock...) */ |
| 522 | 522 | DSKhold = data; |
| 523 | | fdc_handle_hold(); |
| 523 | fdc_handle_hold(machine); |
| 524 | 524 | break; |
| 525 | 525 | |
| 526 | 526 | case 3: |
| r1955 | r1956 | |
| 697 | 697 | /* |
| 698 | 698 | Write disk CRU interface |
| 699 | 699 | */ |
| 700 | | static void ccfdc_cru_w(int offset, int data) |
| 700 | static void ccfdc_cru_w(running_machine *machine, int offset, int data) |
| 701 | 701 | { |
| 702 | 702 | switch (offset) |
| 703 | 703 | { |
| r1955 | r1956 | |
| 711 | 711 | if (data && !motor_on) |
| 712 | 712 | { /* on rising edge, set DVENA for 4.23s */ |
| 713 | 713 | DVENA = 1; |
| 714 | | fdc_handle_hold(); |
| 714 | fdc_handle_hold(machine); |
| 715 | 715 | timer_adjust_oneshot(motor_on_timer, ATTOTIME_IN_MSEC(4230), 0); |
| 716 | 716 | } |
| 717 | 717 | motor_on = data; |
| r1955 | r1956 | |
| 724 | 724 | for 4.23s after write to revelant CRU bit, this is not emulated and could cause |
| 725 | 725 | the TI99 to lock...) */ |
| 726 | 726 | DSKhold = data; |
| 727 | | fdc_handle_hold(); |
| 727 | fdc_handle_hold(machine); |
| 728 | 728 | break; |
| 729 | 729 | |
| 730 | 730 | case 4: |
| r1955 | r1956 | |
| 925 | 925 | if (data && !motor_on) |
| 926 | 926 | { /* on rising edge, set DVENA for 4.23s */ |
| 927 | 927 | DVENA = 1; |
| 928 | | fdc_handle_hold(); |
| 928 | fdc_handle_hold(machine); |
| 929 | 929 | timer_adjust_oneshot(motor_on_timer, ATTOTIME_IN_MSEC(4230), 0); |
| 930 | 930 | } |
| 931 | 931 | motor_on = data; |
| r1955 | r1956 | |
| 938 | 938 | for 4.23s after write to revelant CRU bit, this is not emulated and could cause |
| 939 | 939 | the TI99 to lock...) */ |
| 940 | 940 | DSKhold = data; |
| 941 | | fdc_handle_hold(); |
| 941 | fdc_handle_hold(machine); |
| 942 | 942 | break; |
| 943 | 943 | |
| 944 | 944 | case 4: |
| r1955 | r1956 | |
| 1317 | 1317 | if (data && !motor_on) |
| 1318 | 1318 | { |
| 1319 | 1319 | DVENA = 1; |
| 1320 | | fdc_handle_hold(); |
| 1320 | fdc_handle_hold(machine); |
| 1321 | 1321 | timer_adjust_oneshot(motor_on_timer, ATTOTIME_IN_MSEC(4230), 0); |
| 1322 | 1322 | } |
| 1323 | 1323 | motor_on = data; |