Previous 15994 Revisions Next

r6202 Wednesday 28th October, 2009 at 03:52:31 UTC by R. Belmont
NCR5380: drop /REQ briefly each 512 bytes of a transfer. Required by MacOS.
[src/mess/machine]ncr5380.c

src/mess/machine/ncr5380.c
r6201r6202
5555static UINT8 n5380_Registers[8];
5656static UINT8 last_id;
5757static UINT8 n5380_Command[32];
58static INT32 cmd_ptr, d_ptr, d_limit;
58static INT32 cmd_ptr, d_ptr, d_limit, next_req_flag;
5959static UINT8 n5380_Data[512];
6060
6161#if NCR5380_DEVICE_CONVERSION
r6201r6202
181181               if (get_cmd_len(n5380_Command[0]) == cmd_ptr)
182182               {
183183                  if (VERBOSE)
184                     logerror("NCR5380: Command (to ID %d): %x %x %x %x %x %x\n", last_id, n5380_Command[0], n5380_Command[1], n5380_Command[2], n5380_Command[3], n5380_Command[4], n5380_Command[5]);
184                     logerror("NCR5380: Command (to ID %d): %x %x %x %x %x %x %x %x %x %x (PC %x)\n", last_id, n5380_Command[0], n5380_Command[1], n5380_Command[2], n5380_Command[3], n5380_Command[4], n5380_Command[5], n5380_Command[6], n5380_Command[7], n5380_Command[8], n5380_Command[9], cpu_get_pc(space->cpu));
185185
186186                  SCSISetCommand(devices[last_id], &n5380_Command[0], 16);
187187                  SCSIExecCommand(devices[last_id], &d_limit);
r6201r6202
329329                  d_limit -= 512;
330330                  d_ptr = 0;
331331
332                  next_req_flag = 1;
333
332334                  // don't issue a "false" read
333335                  if (d_limit > 0)
334336                  {
r6201r6202
341343                     {
342344                        n5380_Registers[R5380_BUSSTATUS] |= 0x80;
343345                     }
346
347                     // drop /REQ
348                     n5380_Registers[R5380_BUSSTATUS] &= ~0x20;
349
350                     // clear phase match
351                     n5380_Registers[R5380_BUSANDSTAT] &= ~0x08;
344352                  }
345353               }
346354            }
r6201r6202
350358
351359      default:
352360         rv = n5380_Registers[reg];
361
362         // temporarily drop /REQ
363         if ((reg == R5380_BUSSTATUS) && (next_req_flag))
364         {
365            rv &= ~0x20;
366            next_req_flag = 0;
367         }
353368         break;
354369   }
355370
r6201r6202
369384   memset(n5380_Registers, 0, sizeof(n5380_Registers));
370385   memset(devices, 0, sizeof(devices));
371386
387   next_req_flag = 0;
388
372389   // try to open the devices
373390   for (i = 0; i < interface->scsidevs->devs_present; i++)
374391   {
r6201r6202
382399   state_save_register_item(machine, "ncr5380", NULL, 0, cmd_ptr);
383400   state_save_register_item(machine, "ncr5380", NULL, 0, d_ptr);
384401   state_save_register_item(machine, "ncr5380", NULL, 0, d_limit);
402   state_save_register_item(machine, "ncr5380", NULL, 0, next_req_flag);
385403}
386404
387405void ncr5380_exit( const struct NCR5380interface *interface )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team