trunk/src/mame/machine/gdrom.c
| r18439 | r18440 | |
| 103 | 103 | |
| 104 | 104 | void gdrom_device::ExecCommand( int *transferLength ) |
| 105 | 105 | { |
| 106 | | UINT8 *command; |
| 107 | | int commandLength; |
| 108 | | |
| 109 | 106 | device_t *cdda; |
| 110 | 107 | int trk; |
| 111 | 108 | |
| 112 | | GetCommand( &command, &commandLength ); |
| 113 | | |
| 114 | 109 | switch ( command[0] ) |
| 115 | 110 | { |
| 116 | 111 | case 0x03: // REQUEST SENSE |
| r18439 | r18440 | |
| 445 | 440 | |
| 446 | 441 | void gdrom_device::ReadData( UINT8 *data, int dataLength ) |
| 447 | 442 | { |
| 448 | | UINT8 *command; |
| 449 | | int commandLength; |
| 450 | | |
| 451 | 443 | int i; |
| 452 | 444 | UINT32 last_phys_frame; |
| 453 | 445 | UINT32 temp; |
| 454 | 446 | UINT8 tmp_buffer[2048]; |
| 455 | 447 | device_t *cdda; |
| 456 | 448 | |
| 457 | | GetCommand( &command, &commandLength ); |
| 458 | | |
| 459 | 449 | switch ( command[0] ) |
| 460 | 450 | { |
| 461 | 451 | case 0x03: // REQUEST SENSE |
| r18439 | r18440 | |
| 797 | 787 | |
| 798 | 788 | void gdrom_device::WriteData( UINT8 *data, int dataLength ) |
| 799 | 789 | { |
| 800 | | UINT8 *command; |
| 801 | | int commandLength; |
| 802 | | GetCommand( &command, &commandLength ); |
| 803 | | |
| 804 | 790 | switch (command[ 0 ]) |
| 805 | 791 | { |
| 806 | 792 | case 0x15: // MODE SELECT(6) |
trunk/src/emu/machine/scsihd.c
| r18439 | r18440 | |
| 87 | 87 | // scsihd_exec_command |
| 88 | 88 | void scsihd_device::ExecCommand( int *transferLength ) |
| 89 | 89 | { |
| 90 | | UINT8 *command; |
| 91 | | int commandLength; |
| 92 | | GetCommand( &command, &commandLength ); |
| 93 | | |
| 94 | 90 | switch ( command[0] ) |
| 95 | 91 | { |
| 96 | 92 | case 0x03: // REQUEST SENSE |
| r18439 | r18440 | |
| 184 | 180 | void scsihd_device::ReadData( UINT8 *data, int dataLength ) |
| 185 | 181 | { |
| 186 | 182 | int i; |
| 187 | | UINT8 *command; |
| 188 | | int commandLength; |
| 189 | | GetCommand( &command, &commandLength ); |
| 190 | 183 | |
| 191 | 184 | // if we're a drive without a disk, return all zeroes |
| 192 | 185 | if (!disk) |
| r18439 | r18440 | |
| 281 | 274 | |
| 282 | 275 | void scsihd_device::WriteData( UINT8 *data, int dataLength ) |
| 283 | 276 | { |
| 284 | | UINT8 *command; |
| 285 | | int commandLength; |
| 286 | | GetCommand( &command, &commandLength ); |
| 287 | | |
| 288 | 277 | if (!disk) |
| 289 | 278 | { |
| 290 | 279 | return; |
trunk/src/emu/machine/scsicd.c
| r18439 | r18440 | |
| 104 | 104 | |
| 105 | 105 | void scsicd_device::ExecCommand( int *transferLength ) |
| 106 | 106 | { |
| 107 | | UINT8 *command; |
| 108 | | int commandLength; |
| 109 | 107 | device_t *cdda; |
| 110 | 108 | int trk; |
| 111 | 109 | |
| 112 | | GetCommand( &command, &commandLength ); |
| 113 | | |
| 114 | 110 | switch ( command[0] ) |
| 115 | 111 | { |
| 116 | 112 | case 0x03: // REQUEST SENSE |
| r18439 | r18440 | |
| 387 | 383 | |
| 388 | 384 | void scsicd_device::ReadData( UINT8 *data, int dataLength ) |
| 389 | 385 | { |
| 390 | | UINT8 *command; |
| 391 | | int commandLength; |
| 392 | | |
| 393 | 386 | int i; |
| 394 | 387 | UINT32 last_phys_frame; |
| 395 | 388 | UINT32 temp; |
| 396 | 389 | UINT8 tmp_buffer[2048]; |
| 397 | 390 | device_t *cdda; |
| 398 | 391 | |
| 399 | | GetCommand( &command, &commandLength ); |
| 400 | | |
| 401 | 392 | switch ( command[0] ) |
| 402 | 393 | { |
| 403 | 394 | case 0x03: // REQUEST SENSE |
| r18439 | r18440 | |
| 724 | 715 | |
| 725 | 716 | void scsicd_device::WriteData( UINT8 *data, int dataLength ) |
| 726 | 717 | { |
| 727 | | UINT8 *command; |
| 728 | | int commandLength; |
| 729 | | GetCommand( &command, &commandLength ); |
| 730 | | |
| 731 | 718 | switch (command[ 0 ]) |
| 732 | 719 | { |
| 733 | 720 | case 0x15: // MODE SELECT(6) |
trunk/src/emu/machine/cr589.c
| r18439 | r18440 | |
| 31 | 31 | |
| 32 | 32 | void cr589_device::ExecCommand( int *transferLength ) |
| 33 | 33 | { |
| 34 | | UINT8 *command; |
| 35 | | int commandLength; |
| 36 | | GetCommand( &command, &commandLength ); |
| 37 | | |
| 38 | 34 | switch( command[ 0 ] ) |
| 39 | 35 | { |
| 40 | 36 | case 0x3b: // WRITE BUFFER |
| r18439 | r18440 | |
| 61 | 57 | |
| 62 | 58 | void cr589_device::ReadData( UINT8 *data, int dataLength ) |
| 63 | 59 | { |
| 64 | | UINT8 *command; |
| 65 | | int commandLength; |
| 66 | | GetCommand( &command, &commandLength ); |
| 67 | | |
| 68 | 60 | switch( command[ 0 ] ) |
| 69 | 61 | { |
| 70 | 62 | case 0x12: // INQUIRY |
| r18439 | r18440 | |
| 93 | 85 | |
| 94 | 86 | void cr589_device::WriteData( UINT8 *data, int dataLength ) |
| 95 | 87 | { |
| 96 | | UINT8 *command; |
| 97 | | int commandLength; |
| 98 | | GetCommand( &command, &commandLength ); |
| 99 | | |
| 100 | 88 | switch( command[ 0 ] ) |
| 101 | 89 | { |
| 102 | 90 | case 0x3b: // WRITE BUFFER |
trunk/src/emu/machine/scsihle.c
| r18439 | r18440 | |
| 33 | 33 | |
| 34 | 34 | void scsihle_device::ExecCommand( int *transferLength ) |
| 35 | 35 | { |
| 36 | | UINT8 *command; |
| 37 | | int commandLength; |
| 38 | | GetCommand( &command, &commandLength ); |
| 39 | | |
| 40 | 36 | switch( command[ 0 ] ) |
| 41 | 37 | { |
| 42 | 38 | case SCSI_CMD_TEST_UNIT_READY: |
| r18439 | r18440 | |
| 68 | 64 | |
| 69 | 65 | void scsihle_device::ReadData( UINT8 *data, int dataLength ) |
| 70 | 66 | { |
| 71 | | UINT8 *command; |
| 72 | | int commandLength; |
| 73 | | GetCommand( &command, &commandLength ); |
| 74 | | |
| 75 | 67 | switch( command[ 0 ] ) |
| 76 | 68 | { |
| 77 | 69 | case SCSI_CMD_REQUEST_SENSE: |
| r18439 | r18440 | |
| 88 | 80 | |
| 89 | 81 | void scsihle_device::WriteData( UINT8 *data, int dataLength ) |
| 90 | 82 | { |
| 91 | | UINT8 *command; |
| 92 | | int commandLength; |
| 93 | | GetCommand( &command, &commandLength ); |
| 94 | | |
| 95 | 83 | switch( command[ 0 ] ) |
| 96 | 84 | { |
| 97 | 85 | case SCSI_CMD_SEND_DIAGNOSTIC: |
| r18439 | r18440 | |
| 127 | 115 | SetPhase( SCSI_PHASE_COMMAND ); |
| 128 | 116 | } |
| 129 | 117 | |
| 130 | | void scsihle_device::GetCommand( UINT8 **_command, int *_commandLength ) |
| 131 | | { |
| 132 | | *_command = command; |
| 133 | | *_commandLength = commandLength; |
| 134 | | } |
| 135 | | |
| 136 | 118 | int scsihle_device::GetDeviceID() |
| 137 | 119 | { |
| 138 | 120 | return scsiID; |
trunk/src/emu/machine/scsihle.h
| r18439 | r18440 | |
| 21 | 21 | virtual void SetDevice( void *device ) = 0; |
| 22 | 22 | virtual void GetDevice( void **device ) = 0; |
| 23 | 23 | virtual void SetCommand( UINT8 *command, int commandLength ); |
| 24 | | virtual void GetCommand( UINT8 **command, int *commandLength ); |
| 25 | 24 | virtual void ExecCommand( int *transferLength ); |
| 26 | 25 | virtual void WriteData( UINT8 *data, int dataLength ); |
| 27 | 26 | virtual void ReadData( UINT8 *data, int dataLength ); |
| r18439 | r18440 | |
| 40 | 39 | virtual void device_start(); |
| 41 | 40 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 42 | 41 | |
| 42 | UINT8 command[ 32 ]; |
| 43 | int commandLength; |
| 44 | |
| 43 | 45 | private: |
| 44 | 46 | void scsi_out_req_delay(UINT8 state); |
| 45 | 47 | void scsi_change_phase(UINT8 newphase); |
| r18439 | r18440 | |
| 57 | 59 | emu_timer *sel_timer; |
| 58 | 60 | emu_timer *dataout_timer; |
| 59 | 61 | |
| 60 | | UINT8 command[ 32 ]; |
| 61 | 62 | UINT8 cmd_idx; |
| 62 | 63 | UINT8 is_linked; |
| 63 | 64 | |
| r18439 | r18440 | |
| 67 | 68 | int data_last; |
| 68 | 69 | int sectorbytes; |
| 69 | 70 | |
| 70 | | int commandLength; |
| 71 | 71 | int phase; |
| 72 | 72 | int scsiID; |
| 73 | 73 | }; |