SCSI controller model is now switchable between Adaptec AHA-154x and the BusLogic BT-542B.

This commit is contained in:
OBattler
2017-01-03 02:35:24 +01:00
parent c00be1085d
commit 391855860c
5 changed files with 72 additions and 16 deletions

View File

@@ -708,6 +708,22 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
if (buslogic_enabled)
CheckMenuItem(menu, IDM_SCSI_ENABLED, MF_CHECKED);
CheckMenuItem(menu, IDM_SCSI_MODEL0, MF_UNCHECKED);
CheckMenuItem(menu, IDM_SCSI_MODEL1, MF_UNCHECKED);
if (scsi_model == 0)
{
CheckMenuItem(menu, IDM_SCSI_MODEL0, MF_CHECKED);
}
else if (scsi_model == 1)
{
CheckMenuItem(menu, IDM_SCSI_MODEL1, MF_CHECKED);
}
else
{
fatal("Unrecognized SCSI model\n");
}
CheckMenuItem(menu, IDM_SCSI_BASE130, MF_UNCHECKED);
CheckMenuItem(menu, IDM_SCSI_BASE134, MF_UNCHECKED);
CheckMenuItem(menu, IDM_SCSI_BASE230, MF_UNCHECKED);
@@ -1192,6 +1208,28 @@ int ide_qua_set_irq(HMENU hmenu, int irq, int id)
return 1;
}
int scsi_set_model(HMENU hmenu, int model, int id)
{
if (scsi_model == model)
{
return 0;
}
if (MessageBox(NULL,"This will reset 86Box!\nOkay to continue?","86Box",MB_OKCANCEL) != IDOK)
{
return 0;
}
pause = 1;
Sleep(100);
scsi_model = model;
CheckMenuItem(hmenu, IDM_SCSI_MODEL0, MF_UNCHECKED);
CheckMenuItem(hmenu, IDM_SCSI_MODEL1, MF_UNCHECKED);
CheckMenuItem(hmenu, id, MF_CHECKED);
saveconfig();
resetpchard();
pause = 0;
return 1;
}
int scsi_set_base(HMENU hmenu, int base, int id)
{
if (scsi_base == base)
@@ -1643,6 +1681,14 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
pause = 0;
break;
case IDM_SCSI_MODEL0:
scsi_set_base(hmenu, 0, IDM_SCSI_MODEL0);
break;
case IDM_SCSI_MODEL1:
scsi_set_base(hmenu, 1, IDM_SCSI_MODEL1);
break;
case IDM_SCSI_BASE130:
scsi_set_base(hmenu, 0x130, IDM_SCSI_BASE130);
break;