Extensive rework of SCSI and ATAPI devices and numerous bug fixes and cleanups;

Extensive rework of CD-ROM image handling;
The settings save code now forces some devices' (SCSI disk, CD-ROM, etc.) pointers to NULL before resetting the machine - fixes segmentation faults after changing settings;
Added the NCR 53c825A and 53c875 SCSI controllers;
Fixed IDE/ATAPI DMA;
Slight changed to PCI IDE bus master operation.
This commit is contained in:
OBattler
2018-10-30 13:32:25 +01:00
parent 6410e0ac75
commit 3a8bd15b9d
31 changed files with 3116 additions and 3370 deletions

View File

@@ -8,7 +8,7 @@
*
* Handling of the SCSI controllers.
*
* Version: @(#)scsi.c 1.0.22 2018/10/10
* Version: @(#)scsi.c 1.0.24 2018/10/30
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -37,7 +37,7 @@
#include "scsi_aha154x.h"
#include "scsi_buslogic.h"
#include "scsi_ncr5380.h"
#include "scsi_ncr53c810.h"
#include "scsi_ncr53c8xx.h"
#ifdef WALTJE
# include "scsi_wd33c93.h"
#endif
@@ -55,25 +55,27 @@ typedef const struct {
static SCSI_CARD scsi_cards[] = {
{ "None", "none", NULL, },
{ "[ISA] Adaptec AHA-1540B","aha1540b", &aha1540b_device, },
{ "[ISA] Adaptec AHA-1542C","aha1542c", &aha1542c_device, },
{ "[ISA] Adaptec AHA-1542CF","aha1542cf", &aha1542cf_device, },
{ "[ISA] BusLogic BT-542BH","bt542bh", &buslogic_device, },
{ "[ISA] BusLogic BT-545S", "bt545s", &buslogic_545s_device,},
{ "[ISA] Longshine LCS-6821N","lcs6821n", &scsi_lcs6821n_device,},
{ "[ISA] Ranco RT1000B", "rt1000b", &scsi_rt1000b_device, },
{ "[ISA] Trantor T130B", "t130b", &scsi_t130b_device, },
{ "[ISA] Sumo SCSI-AT", "scsiat", &scsi_scsiat_device, },
{ "None", "none", NULL, },
{ "[ISA] Adaptec AHA-1540B","aha1540b", &aha1540b_device, },
{ "[ISA] Adaptec AHA-1542C","aha1542c", &aha1542c_device, },
{ "[ISA] Adaptec AHA-1542CF","aha1542cf", &aha1542cf_device, },
{ "[ISA] BusLogic BT-542BH","bt542bh", &buslogic_device, },
{ "[ISA] BusLogic BT-545S", "bt545s", &buslogic_545s_device, },
{ "[ISA] Longshine LCS-6821N","lcs6821n", &scsi_lcs6821n_device, },
{ "[ISA] Ranco RT1000B", "rt1000b", &scsi_rt1000b_device, },
{ "[ISA] Trantor T130B", "t130b", &scsi_t130b_device, },
{ "[ISA] Sumo SCSI-AT", "scsiat", &scsi_scsiat_device, },
#ifdef WALTJE
{ "[ISA] Generic WDC33C93", "wd33c93", &scsi_wd33c93_device, },
{ "[ISA] Generic WDC33C93", "wd33c93", &scsi_wd33c93_device, },
#endif
{ "[MCA] Adaptec AHA-1640", "aha1640", &aha1640_device, },
{ "[MCA] BusLogic BT-640A", "bt640a", &buslogic_640a_device,},
{ "[PCI] BusLogic BT-958D", "bt958d", &buslogic_pci_device, },
{ "[PCI] NCR 53C810", "ncr53c810", &ncr53c810_pci_device,},
{ "[VLB] BusLogic BT-445S", "bt445s", &buslogic_445s_device,},
{ "", "", NULL, },
{ "[MCA] Adaptec AHA-1640", "aha1640", &aha1640_device, },
{ "[MCA] BusLogic BT-640A", "bt640a", &buslogic_640a_device, },
{ "[PCI] BusLogic BT-958D", "bt958d", &buslogic_pci_device, },
{ "[PCI] NCR 53C810", "ncr53c810", &ncr53c810_pci_device, },
{ "[PCI] NCR 53C825A", "ncr53c825a", &ncr53c825a_pci_device, },
{ "[PCI] NCR 53C875", "ncr53c875", &ncr53c875_pci_device, },
{ "[VLB] BusLogic BT-445S", "bt445s", &buslogic_445s_device, },
{ "", "", NULL, },
};
@@ -129,17 +131,16 @@ int scsi_card_get_from_internal_name(char *s)
void scsi_card_init(void)
{
int i;
scsi_device_t *dev;
if (!scsi_cards[scsi_card_current].device)
return;
for (i = 0; i < SCSI_ID_MAX; i++) {
if (scsi_devices[i].cmd_buffer)
free(scsi_devices[i].cmd_buffer);
scsi_devices[i].cmd_buffer = NULL;
dev = &(scsi_devices[i]);
memset(&scsi_devices[i], 0, sizeof(scsi_device_t));
scsi_devices[i].type = SCSI_NONE;
memset(dev, 0, sizeof(scsi_device_t));
dev->type = SCSI_NONE;
}
device_add(scsi_cards[scsi_card_current].device);