2016-12-23 17:11:59 +01:00
|
|
|
/* Copyright holders: SA1988, Tenshi
|
2016-11-12 15:06:38 +01:00
|
|
|
see COPYING for more details
|
|
|
|
|
*/
|
|
|
|
|
/*SCSI layer emulation*/
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include "86box.h"
|
|
|
|
|
#include "ibm.h"
|
|
|
|
|
#include "device.h"
|
|
|
|
|
|
|
|
|
|
#include "cdrom.h"
|
|
|
|
|
#include "scsi.h"
|
|
|
|
|
|
2016-12-23 17:11:59 +01:00
|
|
|
#include "timer.h"
|
|
|
|
|
|
2017-01-16 01:49:19 +01:00
|
|
|
uint8_t SCSIPhase = SCSI_PHASE_BUS_FREE;
|
|
|
|
|
uint8_t SCSIStatus = SCSI_STATUS_OK;
|
|
|
|
|
|
2016-11-12 15:06:38 +01:00
|
|
|
uint8_t scsi_cdrom_id = 3; /*common setting*/
|
|
|
|
|
|
2016-12-23 17:11:59 +01:00
|
|
|
//Initialization function for the SCSI layer
|
2017-01-18 21:51:03 +01:00
|
|
|
void SCSIReset(uint8_t id, uint8_t lun)
|
2016-12-23 17:11:59 +01:00
|
|
|
{
|
2017-01-18 21:51:03 +01:00
|
|
|
uint8_t cdrom_id = scsi_cdrom_drives[id][lun];
|
2016-12-30 00:42:54 +01:00
|
|
|
|
2017-01-18 21:51:03 +01:00
|
|
|
if (buslogic_scsi_drive_is_cdrom(id, lun))
|
2016-11-12 15:06:38 +01:00
|
|
|
{
|
2017-01-16 01:49:19 +01:00
|
|
|
cdrom_reset(cdrom_id);
|
2017-01-18 21:51:03 +01:00
|
|
|
SCSIDevices[id][lun].LunType = SCSI_CDROM;
|
2016-12-30 00:42:54 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2017-01-18 21:51:03 +01:00
|
|
|
SCSIDevices[id][lun].LunType = SCSI_NONE;
|
2016-12-23 17:11:59 +01:00
|
|
|
}
|
|
|
|
|
}
|