trunk/src/emu/bus/isa/hdc.c
r241505 | r241506 | |
426 | 426 | |
427 | 427 | |
428 | 428 | |
| 429 | void isa8_hdc_device::pc_hdc_dack_ws(int data) |
| 430 | { |
| 431 | *(hdcdma_dst++) = data; |
| 432 | |
| 433 | if( --hdcdma_write == 0 ) |
| 434 | { |
| 435 | hdcdma_write = 512; |
| 436 | hdcdma_size -= 512; |
| 437 | hdcdma_dst = hdcdma_data; |
| 438 | } |
| 439 | |
| 440 | if (!no_dma()) |
| 441 | { |
| 442 | m_isa->drq3_w(hdcdma_size ? 1 : 0); |
| 443 | if(!hdcdma_size) pc_hdc_result(1); |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | |
| 448 | |
429 | 449 | void isa8_hdc_device::execute_read() |
430 | 450 | { |
431 | 451 | hard_disk_file *disk = NULL; |
r241505 | r241506 | |
485 | 505 | |
486 | 506 | |
487 | 507 | |
| 508 | void isa8_hdc_device::execute_writesbuff() |
| 509 | { |
| 510 | hdcdma_dst = hdcdma_data; |
| 511 | hdcdma_write = 512; |
| 512 | hdcdma_size = 512; |
| 513 | |
| 514 | if (no_dma()) |
| 515 | { |
| 516 | do |
| 517 | { |
| 518 | pc_hdc_dack_ws(buffer[data_cnt++]); |
| 519 | } |
| 520 | while (hdcdma_write || hdcdma_size); |
| 521 | } |
| 522 | else |
| 523 | { |
| 524 | m_isa->drq3_w(1); |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | |
| 529 | |
488 | 530 | void isa8_hdc_device::get_drive() |
489 | 531 | { |
490 | 532 | drv = (buffer[1] >> 5) & 1; |
r241505 | r241506 | |
595 | 637 | execute_write(); |
596 | 638 | break; |
597 | 639 | |
| 640 | case CMD_WRITESBUFF: |
| 641 | if (LOG_HDC_STATUS) |
| 642 | { |
| 643 | logerror("%s hdc write sector buffer\n", machine().describe_context()); |
| 644 | } |
| 645 | |
| 646 | execute_writesbuff(); |
| 647 | break; |
| 648 | |
598 | 649 | case CMD_SETPARAM: |
599 | 650 | get_chsn(); |
600 | 651 | cylinders[drv] = ((buffer[6]&3)<<8) | buffer[7]; |
r241505 | r241506 | |
609 | 660 | break; |
610 | 661 | |
611 | 662 | case CMD_READSBUFF: |
612 | | case CMD_WRITESBUFF: |
613 | 663 | case CMD_RAMDIAG: |
614 | 664 | case CMD_INTERNDIAG: |
615 | 665 | break; |
r241505 | r241506 | |
852 | 902 | |
853 | 903 | void isa8_hdc_device::dack_w(int line,UINT8 data) |
854 | 904 | { |
855 | | pc_hdc_dack_w(data); |
| 905 | if (buffer[0] == CMD_WRITESBUFF) |
| 906 | pc_hdc_dack_ws(data); |
| 907 | else |
| 908 | pc_hdc_dack_w(data); |
856 | 909 | } |