Added support for up to four SCSI controllers, closes #343.

This commit is contained in:
OBattler
2021-07-22 20:13:44 +02:00
parent f31e8b27d5
commit 729b6d5069
25 changed files with 665 additions and 313 deletions

View File

@@ -19,7 +19,7 @@
# define EMU_HDD_H
#define HDD_NUM 40 /* total of 40 images supported */
#define HDD_NUM 88 /* total of 88 images supported */
/* Hard Disk bus types. */

View File

@@ -161,6 +161,7 @@
#define IDS_4132 4132 // "This could mean that the parent..."
#define IDS_4133 4133 // "Parent and child disk timestamps..."
#define IDS_4134 4134 // "Could not fix VHD timestamp."
#define IDS_4135 4135 // "%01i:%02i"
#define IDS_4352 4352 // "MFM/RLL"
#define IDS_4353 4353 // "XT IDE"
@@ -230,7 +231,7 @@
#define STR_NUM_2048 100
#define STR_NUM_3072 11
#define STR_NUM_4096 39
#define STR_NUM_4096 40
#define STR_NUM_4352 6
#define STR_NUM_4608 6
#define STR_NUM_5120 1

View File

@@ -188,70 +188,79 @@
#define IDC_BUTTON_IDE_TER 1086
#define IDC_CHECK_IDE_QUA 1087
#define IDC_BUTTON_IDE_QUA 1088
#define IDC_GROUP_SCSI 1089
#define IDC_COMBO_SCSI_1 1090
#define IDC_COMBO_SCSI_2 1091
#define IDC_COMBO_SCSI_3 1092
#define IDC_COMBO_SCSI_4 1093
#define IDC_CONFIGURE_SCSI_1 1094
#define IDC_CONFIGURE_SCSI_2 1095
#define IDC_CONFIGURE_SCSI_3 1096
#define IDC_CONFIGURE_SCSI_4 1097
#define IDC_HARD_DISKS 1090 /* hard disks config */
#define IDC_LIST_HARD_DISKS 1091
#define IDC_BUTTON_HDD_ADD_NEW 1092
#define IDC_BUTTON_HDD_ADD 1093
#define IDC_BUTTON_HDD_REMOVE 1094
#define IDC_COMBO_HD_BUS 1095
#define IDC_COMBO_HD_CHANNEL 1096
#define IDC_COMBO_HD_ID 1097
#define IDC_COMBO_HD_LUN 1098
#define IDC_COMBO_HD_CHANNEL_IDE 1099
#define IDC_HARD_DISKS 1100 /* hard disks config */
#define IDC_LIST_HARD_DISKS 1101
#define IDC_BUTTON_HDD_ADD_NEW 1102
#define IDC_BUTTON_HDD_ADD 1103
#define IDC_BUTTON_HDD_REMOVE 1104
#define IDC_COMBO_HD_BUS 1105
#define IDC_COMBO_HD_CHANNEL 1106
#define IDC_COMBO_HD_ID 1107
#define IDC_COMBO_HD_LUN 1108
#define IDC_COMBO_HD_CHANNEL_IDE 1109
#define IDC_EDIT_HD_FILE_NAME 1100 /* add hard disk dialog */
#define IDC_EDIT_HD_SPT 1101
#define IDC_EDIT_HD_HPC 1102
#define IDC_EDIT_HD_CYL 1103
#define IDC_EDIT_HD_SIZE 1104
#define IDC_COMBO_HD_TYPE 1105
#define IDC_PBAR_IMG_CREATE 1106
#define IDC_COMBO_HD_IMG_FORMAT 1107
#define IDC_COMBO_HD_BLOCK_SIZE 1108
#define IDC_EDIT_HD_FILE_NAME 1110 /* add hard disk dialog */
#define IDC_EDIT_HD_SPT 1111
#define IDC_EDIT_HD_HPC 1112
#define IDC_EDIT_HD_CYL 1113
#define IDC_EDIT_HD_SIZE 1114
#define IDC_COMBO_HD_TYPE 1115
#define IDC_PBAR_IMG_CREATE 1116
#define IDC_COMBO_HD_IMG_FORMAT 1117
#define IDC_COMBO_HD_BLOCK_SIZE 1118
#define IDC_REMOV_DEVICES 1110 /* floppy and cd-rom drives config */
#define IDC_LIST_FLOPPY_DRIVES 1111
#define IDC_COMBO_FD_TYPE 1112
#define IDC_CHECKTURBO 1113
#define IDC_CHECKBPB 1114
#define IDC_LIST_CDROM_DRIVES 1115
#define IDC_COMBO_CD_BUS 1116
#define IDC_COMBO_CD_ID 1117
#define IDC_COMBO_CD_LUN 1118
#define IDC_COMBO_CD_CHANNEL_IDE 1119
#define IDC_REMOV_DEVICES 1120 /* floppy and cd-rom drives config */
#define IDC_LIST_FLOPPY_DRIVES 1121
#define IDC_COMBO_FD_TYPE 1122
#define IDC_CHECKTURBO 1123
#define IDC_CHECKBPB 1124
#define IDC_LIST_CDROM_DRIVES 1125
#define IDC_COMBO_CD_BUS 1126
#define IDC_COMBO_CD_ID 1127
#define IDC_COMBO_CD_LUN 1128
#define IDC_COMBO_CD_CHANNEL_IDE 1129
#define IDC_LIST_ZIP_DRIVES 1120 /* other removable devices config */
#define IDC_COMBO_ZIP_BUS 1121
#define IDC_COMBO_ZIP_ID 1122
#define IDC_COMBO_ZIP_LUN 1123
#define IDC_COMBO_ZIP_CHANNEL_IDE 1124
#define IDC_CHECK250 1125
#define IDC_COMBO_CD_SPEED 1126
#define IDC_LIST_MO_DRIVES 1127
#define IDC_COMBO_MO_BUS 1128
#define IDC_COMBO_MO_ID 1129
#define IDC_COMBO_MO_LUN 1130
#define IDC_COMBO_MO_CHANNEL_IDE 1131
#define IDC_COMBO_MO_TYPE 1132
#define IDC_LIST_ZIP_DRIVES 1130 /* other removable devices config */
#define IDC_COMBO_ZIP_BUS 1131
#define IDC_COMBO_ZIP_ID 1132
#define IDC_COMBO_ZIP_LUN 1133
#define IDC_COMBO_ZIP_CHANNEL_IDE 1134
#define IDC_CHECK250 1135
#define IDC_COMBO_CD_SPEED 1136
#define IDC_LIST_MO_DRIVES 1137
#define IDC_COMBO_MO_BUS 1138
#define IDC_COMBO_MO_ID 1139
#define IDC_COMBO_MO_LUN 1140
#define IDC_COMBO_MO_CHANNEL_IDE 1141
#define IDC_COMBO_MO_TYPE 1142
#define IDC_CHECK_BUGGER 1140 /* other periph config */
#define IDC_CHECK_POSTCARD 1141
#define IDC_COMBO_ISARTC 1142
#define IDC_CONFIGURE_ISARTC 1143
#define IDC_COMBO_FDC 1144
#define IDC_CONFIGURE_FDC 1145
#define IDC_GROUP_ISAMEM 1146
#define IDC_COMBO_ISAMEM_1 1147
#define IDC_COMBO_ISAMEM_2 1148
#define IDC_COMBO_ISAMEM_3 1149
#define IDC_COMBO_ISAMEM_4 1150
#define IDC_CONFIGURE_ISAMEM_1 1151
#define IDC_CONFIGURE_ISAMEM_2 1152
#define IDC_CONFIGURE_ISAMEM_3 1153
#define IDC_CONFIGURE_ISAMEM_4 1154
#define IDC_CHECK_BUGGER 1150 /* other periph config */
#define IDC_CHECK_POSTCARD 1151
#define IDC_COMBO_ISARTC 1152
#define IDC_CONFIGURE_ISARTC 1153
#define IDC_COMBO_FDC 1154
#define IDC_CONFIGURE_FDC 1155
#define IDC_GROUP_ISAMEM 1156
#define IDC_COMBO_ISAMEM_1 1157
#define IDC_COMBO_ISAMEM_2 1158
#define IDC_COMBO_ISAMEM_3 1159
#define IDC_COMBO_ISAMEM_4 1160
#define IDC_CONFIGURE_ISAMEM_1 1161
#define IDC_CONFIGURE_ISAMEM_2 1162
#define IDC_CONFIGURE_ISAMEM_3 1163
#define IDC_CONFIGURE_ISAMEM_4 1164
#define IDC_SLIDER_GAIN 1160 /* sound gain dialog */
#define IDC_SLIDER_GAIN 1170 /* sound gain dialog */
#define IDC_EDIT_FILE_NAME 1200 /* new floppy image dialog */
#define IDC_COMBO_DISK_SIZE 1201

View File

@@ -21,7 +21,8 @@
#ifndef EMU_SCSI_H
#define EMU_SCSI_H
extern int scsi_card_current;
extern int scsi_card_current[4];
extern int scsi_card_current_legacy;
extern int scsi_card_available(int card);
#ifdef EMU_DEVICE_H

View File

@@ -21,6 +21,8 @@
/* Configuration. */
#define SCSI_BUS_MAX 4 /* currently we support up to 4 controllers */
#define SCSI_ID_MAX 16 /* 16 on wide buses */
#define SCSI_LUN_MAX 8 /* always 8 */
@@ -359,7 +361,7 @@ typedef struct {
#define SCSI_REMOVABLE_DISK 0x8000
#define SCSI_REMOVABLE_CDROM 0x8005
extern scsi_device_t scsi_devices[SCSI_ID_MAX];
extern scsi_device_t scsi_devices[SCSI_BUS_MAX][SCSI_ID_MAX];
extern int cdrom_add_error_and_subchannel(uint8_t *b, int real_sector_type);
@@ -384,4 +386,7 @@ extern void scsi_device_identify(scsi_device_t *dev, uint8_t lun);
extern void scsi_device_close_all(void);
extern void scsi_device_init(void);
extern void scsi_reset(void);
extern uint8_t scsi_get_bus(void);
#endif /*SCSI_DEVICE_H*/

View File

@@ -382,7 +382,7 @@ typedef struct {
uint8_t callback_phase :4,
callback_sub_phase :4,
scsi_cmd_phase, pad,
scsi_cmd_phase, bus,
sync,
parity, shram_mode,
Geometry, Control,
@@ -429,7 +429,7 @@ typedef struct {
PendingInterrupt, Lock,
target_data_len, pad0;
uint32_t Base, fdc_address, rom_addr, /* address of BIOS ROM */
uint32_t Base, fdc_address, rom_addr, /* address of BIOS ROM */
CmdParamLeft, Outgoing,
transfer_size;
@@ -441,7 +441,7 @@ typedef struct {
BIOSMailboxInit, BIOSMailboxCount,
BIOSMailboxOutAddr, BIOSMailboxOutPosCur,
BIOSMailboxReq,
Residue, bus; /* Basically a copy of device flags */
Residue, card_bus; /* Basically a copy of device flags */
/* 8 bytes */
uint64_t temp_period;