Previous 199869 Revisions Next

r18440 Thursday 11th October, 2012 at 08:39:37 UTC by smf
removed GetCommand() and made command and commandLength protected (nw)
[src/emu/machine]cr589.c scsicd.c scsihd.c scsihle.c scsihle.h
[src/mame/machine]gdrom.c
[src/mess/machine]acb4070.c d9060hd.c s1410.c

trunk/src/mame/machine/gdrom.c
r18439r18440
103103
104104void gdrom_device::ExecCommand( int *transferLength )
105105{
106   UINT8 *command;
107   int commandLength;
108
109106   device_t *cdda;
110107   int trk;
111108
112   GetCommand( &command, &commandLength );
113
114109   switch ( command[0] )
115110   {
116111      case 0x03: // REQUEST SENSE
r18439r18440
445440
446441void gdrom_device::ReadData( UINT8 *data, int dataLength )
447442{
448   UINT8 *command;
449   int commandLength;
450
451443   int i;
452444   UINT32 last_phys_frame;
453445   UINT32 temp;
454446   UINT8 tmp_buffer[2048];
455447   device_t *cdda;
456448
457   GetCommand( &command, &commandLength );
458
459449   switch ( command[0] )
460450   {
461451      case 0x03: // REQUEST SENSE
r18439r18440
797787
798788void gdrom_device::WriteData( UINT8 *data, int dataLength )
799789{
800   UINT8 *command;
801   int commandLength;
802   GetCommand( &command, &commandLength );
803
804790   switch (command[ 0 ])
805791   {
806792      case 0x15: // MODE SELECT(6)
trunk/src/emu/machine/scsihd.c
r18439r18440
8787// scsihd_exec_command
8888void scsihd_device::ExecCommand( int *transferLength )
8989{
90   UINT8 *command;
91   int commandLength;
92   GetCommand( &command, &commandLength );
93
9490   switch ( command[0] )
9591   {
9692      case 0x03: // REQUEST SENSE
r18439r18440
184180void scsihd_device::ReadData( UINT8 *data, int dataLength )
185181{
186182   int i;
187   UINT8 *command;
188   int commandLength;
189   GetCommand( &command, &commandLength );
190183
191184   // if we're a drive without a disk, return all zeroes
192185   if (!disk)
r18439r18440
281274
282275void scsihd_device::WriteData( UINT8 *data, int dataLength )
283276{
284   UINT8 *command;
285   int commandLength;
286   GetCommand( &command, &commandLength );
287
288277   if (!disk)
289278   {
290279      return;
trunk/src/emu/machine/scsicd.c
r18439r18440
104104
105105void scsicd_device::ExecCommand( int *transferLength )
106106{
107   UINT8 *command;
108   int commandLength;
109107   device_t *cdda;
110108   int trk;
111109
112   GetCommand( &command, &commandLength );
113
114110   switch ( command[0] )
115111   {
116112      case 0x03: // REQUEST SENSE
r18439r18440
387383
388384void scsicd_device::ReadData( UINT8 *data, int dataLength )
389385{
390   UINT8 *command;
391   int commandLength;
392
393386   int i;
394387   UINT32 last_phys_frame;
395388   UINT32 temp;
396389   UINT8 tmp_buffer[2048];
397390   device_t *cdda;
398391
399   GetCommand( &command, &commandLength );
400
401392   switch ( command[0] )
402393   {
403394      case 0x03: // REQUEST SENSE
r18439r18440
724715
725716void scsicd_device::WriteData( UINT8 *data, int dataLength )
726717{
727   UINT8 *command;
728   int commandLength;
729   GetCommand( &command, &commandLength );
730
731718   switch (command[ 0 ])
732719   {
733720      case 0x15: // MODE SELECT(6)
trunk/src/emu/machine/cr589.c
r18439r18440
3131
3232void cr589_device::ExecCommand( int *transferLength )
3333{
34   UINT8 *command;
35   int commandLength;
36   GetCommand( &command, &commandLength );
37
3834   switch( command[ 0 ] )
3935   {
4036      case 0x3b: // WRITE BUFFER
r18439r18440
6157
6258void cr589_device::ReadData( UINT8 *data, int dataLength )
6359{
64   UINT8 *command;
65   int commandLength;
66   GetCommand( &command, &commandLength );
67
6860   switch( command[ 0 ] )
6961   {
7062      case 0x12: // INQUIRY
r18439r18440
9385
9486void cr589_device::WriteData( UINT8 *data, int dataLength )
9587{
96   UINT8 *command;
97   int commandLength;
98   GetCommand( &command, &commandLength );
99
10088   switch( command[ 0 ] )
10189   {
10290      case 0x3b: // WRITE BUFFER
trunk/src/emu/machine/scsihle.c
r18439r18440
3333
3434void scsihle_device::ExecCommand( int *transferLength )
3535{
36   UINT8 *command;
37   int commandLength;
38   GetCommand( &command, &commandLength );
39
4036   switch( command[ 0 ] )
4137   {
4238   case SCSI_CMD_TEST_UNIT_READY:
r18439r18440
6864
6965void scsihle_device::ReadData( UINT8 *data, int dataLength )
7066{
71   UINT8 *command;
72   int commandLength;
73   GetCommand( &command, &commandLength );
74
7567   switch( command[ 0 ] )
7668   {
7769   case SCSI_CMD_REQUEST_SENSE:
r18439r18440
8880
8981void scsihle_device::WriteData( UINT8 *data, int dataLength )
9082{
91   UINT8 *command;
92   int commandLength;
93   GetCommand( &command, &commandLength );
94
9583   switch( command[ 0 ] )
9684   {
9785   case SCSI_CMD_SEND_DIAGNOSTIC:
r18439r18440
127115   SetPhase( SCSI_PHASE_COMMAND );
128116}
129117
130void scsihle_device::GetCommand( UINT8 **_command, int *_commandLength )
131{
132   *_command = command;
133   *_commandLength = commandLength;
134}
135
136118int scsihle_device::GetDeviceID()
137119{
138120   return scsiID;
trunk/src/emu/machine/scsihle.h
r18439r18440
2121   virtual void SetDevice( void *device ) = 0;
2222   virtual void GetDevice( void **device ) = 0;
2323   virtual void SetCommand( UINT8 *command, int commandLength );
24   virtual void GetCommand( UINT8 **command, int *commandLength );
2524   virtual void ExecCommand( int *transferLength );
2625   virtual void WriteData( UINT8 *data, int dataLength );
2726   virtual void ReadData( UINT8 *data, int dataLength );
r18439r18440
4039   virtual void device_start();
4140   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
4241
42   UINT8 command[ 32 ];
43   int commandLength;
44
4345private:
4446   void scsi_out_req_delay(UINT8 state);
4547   void scsi_change_phase(UINT8 newphase);
r18439r18440
5759   emu_timer *sel_timer;
5860   emu_timer *dataout_timer;
5961
60   UINT8 command[ 32 ];
6162   UINT8 cmd_idx;
6263   UINT8 is_linked;
6364
r18439r18440
6768   int data_last;
6869   int sectorbytes;
6970
70   int commandLength;
7171   int phase;
7272   int scsiID;
7373};
trunk/src/mess/machine/acb4070.c
r18439r18440
2121
2222void acb4070_device::ExecCommand( int *transferLength )
2323{
24   UINT8 *command;
25   int commandLength;
26   GetCommand( &command, &commandLength );
27
2824   switch( command[ 0 ] )
2925   {
3026   case ACB4070_CMD_WRITE_DATA_BUFFER:
trunk/src/mess/machine/d9060hd.c
r18439r18440
1919
2020void d9060hd_device::ExecCommand( int *transferLength )
2121{
22   UINT8 *command;
23   int commandLength;
24   GetCommand( &command, &commandLength );
25
2622   switch( command[ 0 ] )
2723   {
2824   case D9060HD_CMD_PHYSICAL_DEVICE_ID:
trunk/src/mess/machine/s1410.c
r18439r18440
224224
225225void s1410_device::ExecCommand( int *transferLength )
226226{
227   UINT8 *command;
228   int commandLength;
229   GetCommand( &command, &commandLength );
230
231227   switch( command[ 0 ] )
232228   {
233229   case S1410_CMD_INIT_DRIVE_PARAMS:
r18439r18440
266262
267263void s1410_device::WriteData( UINT8 *data, int dataLength )
268264{
269   UINT8 *command;
270   int commandLength;
271   GetCommand( &command, &commandLength );
272
273265   switch( command[ 0 ] )
274266   {
275267   case S1410_CMD_INIT_DRIVE_PARAMS:

Previous 199869 Revisions Next


© 1997-2024 The MAME Team