SCSI now supports 7 devices.
Reworked hard drive / CD-ROM / Zip configuration functions a bit.
This commit is contained in:
parent
c298e706a4
commit
0d36eeaabe
13 changed files with 4555 additions and 3951 deletions
52
src/hdd.c
52
src/hdd.c
|
|
@ -24,23 +24,24 @@ static struct
|
|||
device_t *device;
|
||||
int is_mfm;
|
||||
int is_ide;
|
||||
int is_scsi;
|
||||
} hdd_controllers[] =
|
||||
{
|
||||
{"None", "none", &null_hdd_device, 0, 0},
|
||||
{"[MFM] AT Fixed Disk Adapter", "mfm_at", &mfm_at_device, 1, 0},
|
||||
{"[MFM] DTC 5150X", "dtc5150x", &dtc_5150x_device, 1, 0},
|
||||
{"[MFM] Fixed Disk Adapter (Xebec)", "mfm_xebec", &mfm_xebec_device, 1, 0},
|
||||
{"[ESDI] IBM ESDI Fixed Disk Controller", "esdi_mca", &hdd_esdi_device, 1, 0},
|
||||
{"[ESDI] Western Digital WD1007V-SE1", "wd1007vse1", &wd1007vse1_device, 0, 0},
|
||||
{"[IDE] Standard IDE", "ide", &ide_device, 0, 1},
|
||||
{"[IDE] XTIDE", "xtide", &xtide_device, 0, 1},
|
||||
{"[IDE] XTIDE (AT)", "xtide_at", &xtide_at_device, 0, 1},
|
||||
{"[IDE] XTIDE (PS/1)", "xtide_ps1", &xtide_ps1_device, 0, 1},
|
||||
{"[SCSI] Adaptec AHA-1542C", "aha1542c", &scsi_aha1542c_device, 0, 0},
|
||||
{"[SCSI] BusLogic BT-545S", "bt545s", &scsi_bt545s_device, 0, 0},
|
||||
{"[SCSI] Longshine LCS-6821N", "lcs6821n", &scsi_lcs6821n_device, 0, 0},
|
||||
{"[SCSI] Rancho RT1000B", "rt1000b", &scsi_rt1000b_device, 0, 0},
|
||||
{"[SCSI] Trantor T130B", "t130b", &scsi_t130b_device, 0, 0},
|
||||
{"None", "none", &null_hdd_device, 0, 0, 0},
|
||||
{"[MFM] AT Fixed Disk Adapter", "mfm_at", &mfm_at_device, 1, 0, 0},
|
||||
{"[MFM] DTC 5150X", "dtc5150x", &dtc_5150x_device, 1, 0, 0},
|
||||
{"[MFM] Fixed Disk Adapter (Xebec)", "mfm_xebec", &mfm_xebec_device, 1, 0, 0},
|
||||
{"[ESDI] IBM ESDI Fixed Disk Controller", "esdi_mca", &hdd_esdi_device, 1, 0, 0},
|
||||
{"[ESDI] Western Digital WD1007V-SE1", "wd1007vse1", &wd1007vse1_device, 0, 0, 0},
|
||||
{"[IDE] Standard IDE", "ide", &ide_device, 0, 1, 0},
|
||||
{"[IDE] XTIDE", "xtide", &xtide_device, 0, 1, 0},
|
||||
{"[IDE] XTIDE (AT)", "xtide_at", &xtide_at_device, 0, 1, 0},
|
||||
{"[IDE] XTIDE (PS/1)", "xtide_ps1", &xtide_ps1_device, 0, 1, 0},
|
||||
{"[SCSI] Adaptec AHA-1542C", "aha1542c", &scsi_aha1542c_device, 0, 0, 1},
|
||||
{"[SCSI] BusLogic BT-545S", "bt545s", &scsi_bt545s_device, 0, 0, 1},
|
||||
{"[SCSI] Longshine LCS-6821N", "lcs6821n", &scsi_lcs6821n_device, 0, 0, 1},
|
||||
{"[SCSI] Rancho RT1000B", "rt1000b", &scsi_rt1000b_device, 0, 0, 1},
|
||||
{"[SCSI] Trantor T130B", "t130b", &scsi_t130b_device, 0, 0, 1},
|
||||
{"", "", NULL, 0, 0}
|
||||
};
|
||||
|
||||
|
|
@ -98,6 +99,23 @@ int hdd_controller_is_ide(char *internal_name)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int hdd_controller_is_scsi(char *internal_name)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
while (hdd_controllers[c].device)
|
||||
{
|
||||
if (!strcmp(internal_name, hdd_controllers[c].internal_name))
|
||||
{
|
||||
hdd_controller_current = c;
|
||||
if (strcmp(internal_name, "none"))
|
||||
return hdd_controllers[c].is_scsi;
|
||||
}
|
||||
c++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
int hdd_controller_has_config(char *internal_name)
|
||||
{
|
||||
int c = 0;
|
||||
|
|
@ -142,6 +160,10 @@ int hdd_controller_current_is_ide()
|
|||
{
|
||||
return hdd_controller_is_ide(hdd_controller_name);
|
||||
}
|
||||
int hdd_controller_current_is_scsi()
|
||||
{
|
||||
return hdd_controller_is_scsi(hdd_controller_name);
|
||||
}
|
||||
|
||||
void hdd_controller_init(char *internal_name)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,10 +5,13 @@ char *hdd_controller_get_internal_name(int hdd);
|
|||
int hdd_controller_get_flags(int hdd);
|
||||
int hdd_controller_available(int hdd);
|
||||
int hdd_controller_is_mfm(char* internal_name);
|
||||
int hdd_controller_is_ide(char *internal_name);
|
||||
int hdd_controller_is_scsi(char *internal_name);
|
||||
int hdd_controller_has_config(char *internal_name);
|
||||
device_t *hdd_controller_get_device(char *internal_name);
|
||||
int hdd_controller_current_is_mfm();
|
||||
int hdd_controller_current_is_ide();
|
||||
int hdd_controller_current_is_scsi();
|
||||
void hdd_controller_init(char *internal_name);
|
||||
|
||||
extern char hdd_controller_name[16];
|
||||
|
|
|
|||
|
|
@ -548,7 +548,7 @@ typedef struct
|
|||
int tracks;
|
||||
} PcemHDC;
|
||||
|
||||
PcemHDC hdc[4];
|
||||
PcemHDC hdc[7];
|
||||
|
||||
/*Keyboard*/
|
||||
int keybsenddelay;
|
||||
|
|
|
|||
|
|
@ -87,11 +87,11 @@ typedef struct IDE
|
|||
int cdrom_channel = 2;
|
||||
int zip_channel = -1;
|
||||
|
||||
IDE ide_drives[4];
|
||||
IDE ide_drives[7];
|
||||
|
||||
IDE *ext_ide;
|
||||
|
||||
char ide_fn[4][512];
|
||||
char ide_fn[7][512];
|
||||
|
||||
int (*ide_bus_master_read_sector)(int channel, uint8_t *data);
|
||||
int (*ide_bus_master_write_sector)(int channel, uint8_t *data);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ extern int ideboard;
|
|||
|
||||
extern int idecallback[2];
|
||||
|
||||
extern char ide_fn[4][512];
|
||||
extern char ide_fn[7][512];
|
||||
|
||||
extern int cdrom_channel, zip_channel;
|
||||
|
||||
|
|
|
|||
30
src/pc.c
30
src/pc.c
|
|
@ -757,6 +757,24 @@ void loadconfig(char *fn)
|
|||
p = (char *)config_get_string(CFG_MACHINE, NULL, "hdf_fn", "");
|
||||
if (p) strcpy(ide_fn[3], p);
|
||||
else strcpy(ide_fn[3], "");
|
||||
hdc[4].spt = config_get_int(CFG_MACHINE, NULL, "hdg_sectors", 0);
|
||||
hdc[4].hpc = config_get_int(CFG_MACHINE, NULL, "hdg_heads", 0);
|
||||
hdc[4].tracks = config_get_int(CFG_MACHINE, NULL, "hdg_cylinders", 0);
|
||||
p = (char *)config_get_string(CFG_MACHINE, NULL, "hdg_fn", "");
|
||||
if (p) strcpy(ide_fn[4], p);
|
||||
else strcpy(ide_fn[4], "");
|
||||
hdc[5].spt = config_get_int(CFG_MACHINE, NULL, "hdh_sectors", 0);
|
||||
hdc[5].hpc = config_get_int(CFG_MACHINE, NULL, "hdh_heads", 0);
|
||||
hdc[5].tracks = config_get_int(CFG_MACHINE, NULL, "hdh_cylinders", 0);
|
||||
p = (char *)config_get_string(CFG_MACHINE, NULL, "hdh_fn", "");
|
||||
if (p) strcpy(ide_fn[5], p);
|
||||
else strcpy(ide_fn[5], "");
|
||||
hdc[6].spt = config_get_int(CFG_MACHINE, NULL, "hdi_sectors", 0);
|
||||
hdc[6].hpc = config_get_int(CFG_MACHINE, NULL, "hdi_heads", 0);
|
||||
hdc[6].tracks = config_get_int(CFG_MACHINE, NULL, "hdi_cylinders", 0);
|
||||
p = (char *)config_get_string(CFG_MACHINE, NULL, "hdi_fn", "");
|
||||
if (p) strcpy(ide_fn[6], p);
|
||||
else strcpy(ide_fn[6], "");
|
||||
|
||||
fdd_set_type(0, config_get_int(CFG_MACHINE, NULL, "drive_a_type", 7));
|
||||
fdd_set_type(1, config_get_int(CFG_MACHINE, NULL, "drive_b_type", 7));
|
||||
|
|
@ -890,6 +908,18 @@ void saveconfig(char *fn)
|
|||
config_set_int(CFG_MACHINE, NULL, "hdf_heads", hdc[3].hpc);
|
||||
config_set_int(CFG_MACHINE, NULL, "hdf_cylinders", hdc[3].tracks);
|
||||
config_set_string(CFG_MACHINE, NULL, "hdf_fn", ide_fn[3]);
|
||||
config_set_int(CFG_MACHINE, NULL, "hdg_sectors", hdc[4].spt);
|
||||
config_set_int(CFG_MACHINE, NULL, "hdg_heads", hdc[4].hpc);
|
||||
config_set_int(CFG_MACHINE, NULL, "hdg_cylinders", hdc[4].tracks);
|
||||
config_set_string(CFG_MACHINE, NULL, "hdg_fn", ide_fn[4]);
|
||||
config_set_int(CFG_MACHINE, NULL, "hdh_sectors", hdc[5].spt);
|
||||
config_set_int(CFG_MACHINE, NULL, "hdh_heads", hdc[5].hpc);
|
||||
config_set_int(CFG_MACHINE, NULL, "hdh_cylinders", hdc[5].tracks);
|
||||
config_set_string(CFG_MACHINE, NULL, "hdh_fn", ide_fn[5]);
|
||||
config_set_int(CFG_MACHINE, NULL, "hdi_sectors", hdc[6].spt);
|
||||
config_set_int(CFG_MACHINE, NULL, "hdi_heads", hdc[6].hpc);
|
||||
config_set_int(CFG_MACHINE, NULL, "hdi_cylinders", hdc[6].tracks);
|
||||
config_set_string(CFG_MACHINE, NULL, "hdi_fn", ide_fn[6]);
|
||||
|
||||
config_set_int(CFG_MACHINE, NULL, "drive_a_type", fdd_get_type(0));
|
||||
config_set_int(CFG_MACHINE, NULL, "drive_b_type", fdd_get_type(1));
|
||||
|
|
|
|||
2091
src/pc.xrc
2091
src/pc.xrc
File diff suppressed because it is too large
Load diff
|
|
@ -343,7 +343,7 @@ void scsi_bus_init(scsi_bus_t *bus)
|
|||
memset(bus->devices, 0, sizeof(bus->devices));
|
||||
memset(bus->device_data, 0, sizeof(bus->device_data));
|
||||
|
||||
for (c = 0; c < 4; c++)
|
||||
for (c = 0; c < 7; c++)
|
||||
{
|
||||
if (cdrom_channel == c)
|
||||
bus->devices[c] = &scsi_cd;
|
||||
|
|
|
|||
1000
src/wx-config.c
1000
src/wx-config.c
File diff suppressed because it is too large
Load diff
4741
src/wx-resources.cpp
4741
src/wx-resources.cpp
File diff suppressed because it is too large
Load diff
|
|
@ -57,7 +57,7 @@ drive_info_t* get_machine_info(char* s, int* num_drive_info) {
|
|||
pos++;
|
||||
}
|
||||
}
|
||||
int num_hdds = hdd_controller_current_is_mfm() ? 2 : 4;
|
||||
int num_hdds = hdd_controller_current_is_mfm() ? 2 : (hdd_controller_current_is_scsi() ? 7 : 4);
|
||||
for (i = 0; i < num_hdds; ++i)
|
||||
{
|
||||
drive = 'C'+i;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include <wx/fileconf.h>
|
||||
#include <wx/wfstream.h>
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/choicebk.h>
|
||||
|
||||
#include "wx-dialogbox.h"
|
||||
#include "wx-app.h"
|
||||
|
|
@ -376,6 +377,30 @@ int wx_sendmessage(void* window, int type, INT_PARAM param1, LONG_PARAM param2)
|
|||
((wxListBox*) window)->Clear();
|
||||
break;
|
||||
}
|
||||
case WX_CHB_SETPAGETEXT:
|
||||
{
|
||||
((wxChoicebook*)window)->SetPageText(param1, (char *)param2);
|
||||
break;
|
||||
}
|
||||
case WX_CHB_ADDPAGE:
|
||||
{
|
||||
((wxChoicebook*)window)->AddPage((wxWindow *)param1, (char *)param2);
|
||||
break;
|
||||
}
|
||||
case WX_CHB_REMOVEPAGE:
|
||||
{
|
||||
((wxChoicebook*)window)->RemovePage(param1);
|
||||
break;
|
||||
}
|
||||
case WX_CHB_GETPAGECOUNT:
|
||||
{
|
||||
return ((wxChoicebook*)window)->GetPageCount();
|
||||
}
|
||||
case WX_REPARENT:
|
||||
{
|
||||
((wxWindow *)window)->Reparent((wxWindow *)param1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
((wxWindow*)window)->Fit();
|
||||
|
|
|
|||
|
|
@ -145,6 +145,14 @@ extern void (*wx_idle_func)(void* window, void* event);
|
|||
#define WX_LB_SETCURSEL 66
|
||||
#define WX_LBN_DBLCLK 67
|
||||
|
||||
#define WX_CHB_SETPAGETEXT 68
|
||||
#define WX_CHB_ADDPAGE 69
|
||||
#define WX_CHB_REMOVEPAGE 70
|
||||
#define WX_CHB_GETPAGECOUNT 71
|
||||
|
||||
#define WX_REPARENT 72
|
||||
|
||||
|
||||
#define WX_MB_OK wxOK
|
||||
#define WX_MB_OKCANCEL wxOK|wxCANCEL
|
||||
#define WX_IDOK wxOK
|
||||
|
|
|
|||
Loading…
Reference in a new issue