Fixed a compile-breaking error;

Added the ability to set each floppy drive to turbo speed which will make it opperate at an effective 8000 kbps @ 300 rpm, for those who want faster but less accurate floppy timings.
This commit is contained in:
OBattler
2017-06-04 02:14:27 +02:00
parent 224368b791
commit fa174b79b2
11 changed files with 135 additions and 13 deletions

View File

@@ -74,6 +74,7 @@ static hard_disk_t temp_hdc[HDC_NUM];
/* Removable devices category */
static int temp_fdd_types[FDD_NUM];
static int temp_fdd_turbo[FDD_NUM];
static cdrom_drive_t temp_cdrom_drives[CDROM_NUM];
static HWND hwndParentDialog, hwndChildDialog;
@@ -149,6 +150,7 @@ static void win_settings_init(void)
for (i = 0; i < FDD_NUM; i++)
{
temp_fdd_types[i] = fdd_get_type(i);
temp_fdd_turbo[i] = fdd_get_turbo(i);
}
memcpy(temp_cdrom_drives, cdrom_drives, CDROM_NUM * sizeof(cdrom_drive_t));
}
@@ -212,6 +214,7 @@ static int win_settings_changed(void)
for (j = 0; j < FDD_NUM; j++)
{
i = i || (temp_fdd_types[j] != fdd_get_type(j));
i = i || (temp_fdd_turbo[j] != fdd_get_turbo(j));
}
i = i || memcmp(cdrom_drives, temp_cdrom_drives, CDROM_NUM * sizeof(cdrom_drive_t));
@@ -309,6 +312,7 @@ static void win_settings_save(void)
for (i = 0; i < FDD_NUM; i++)
{
fdd_set_type(i, temp_fdd_types[i]);
fdd_set_turbo(i, temp_fdd_turbo[i]);
}
memcpy(cdrom_drives, temp_cdrom_drives, CDROM_NUM * sizeof(cdrom_drive_t));
@@ -3454,6 +3458,16 @@ static BOOL win_settings_floppy_drives_recalc_list(HWND hwndList)
if (ListView_InsertItem(hwndList, &lvI) == -1)
return FALSE;
lvI.iSubItem = 1;
lvI.pszText = win_language_get_string_from_id(temp_fdd_turbo[i] ? 2222 : 2223);
lvI.iItem = i;
lvI.iImage = 0;
if (ListView_SetItem(hwndList, &lvI) == -1)
{
return FALSE;
}
}
return TRUE;
@@ -3515,7 +3529,7 @@ static BOOL win_settings_floppy_drives_init_columns(HWND hwndList)
lvc.iSubItem = 0;
lvc.pszText = win_language_get_string_from_id(2188);
lvc.cx = 392;
lvc.cx = 292;
lvc.fmt = LVCFMT_LEFT;
if (ListView_InsertColumn(hwndList, 0, &lvc) == -1)
@@ -3523,6 +3537,17 @@ static BOOL win_settings_floppy_drives_init_columns(HWND hwndList)
return FALSE;
}
lvc.iSubItem = 1;
lvc.pszText = win_language_get_string_from_id(2221);
lvc.cx = 100;
lvc.fmt = LVCFMT_LEFT;
if (ListView_InsertColumn(hwndList, 1, &lvc) == -1)
{
return FALSE;
}
return TRUE;
}
@@ -3612,6 +3637,16 @@ static void win_settings_floppy_drives_update_item(HWND hwndList, int i)
{
return;
}
lvI.iSubItem = 1;
lvI.pszText = win_language_get_string_from_id(temp_fdd_turbo[i] ? 2222 : 2223);
lvI.iItem = i;
lvI.iImage = 0;
if (ListView_SetItem(hwndList, &lvI) == -1)
{
return;
}
}
static void win_settings_cdrom_drives_update_item(HWND hwndList, int i)
@@ -3796,6 +3831,9 @@ static BOOL CALLBACK win_settings_removable_devices_proc(HWND hdlg, UINT message
}
SendMessage(h, CB_SETCURSEL, temp_fdd_types[fdlv_current_sel], 0);
h = GetDlgItem(hdlg, IDC_CHECKTURBO);
SendMessage(h, BM_SETCHECK, temp_fdd_turbo[fdlv_current_sel], 0);
cdlv_current_sel = 0;
h = GetDlgItem(hdlg, IDC_LIST_CDROM_DRIVES);
win_settings_cdrom_drives_init_columns(h);
@@ -3855,6 +3893,8 @@ static BOOL CALLBACK win_settings_removable_devices_proc(HWND hdlg, UINT message
rd_ignore_change = 1;
h = GetDlgItem(hdlg, IDC_COMBO_FD_TYPE);
SendMessage(h, CB_SETCURSEL, temp_fdd_types[fdlv_current_sel], 0);
h = GetDlgItem(hdlg, IDC_CHECKTURBO);
SendMessage(h, BM_SETCHECK, temp_fdd_turbo[fdlv_current_sel], 0);
rd_ignore_change = 0;
}
else if ((((LPNMHDR)lParam)->code == LVN_ITEMCHANGED) && (((LPNMHDR)lParam)->idFrom == IDC_LIST_CDROM_DRIVES))
@@ -3918,6 +3958,20 @@ static BOOL CALLBACK win_settings_removable_devices_proc(HWND hdlg, UINT message
rd_ignore_change = 0;
return FALSE;
case IDC_CHECKTURBO:
if (rd_ignore_change)
{
return FALSE;
}
rd_ignore_change = 1;
h = GetDlgItem(hdlg, IDC_CHECKTURBO);
temp_fdd_turbo[fdlv_current_sel] = SendMessage(h, BM_GETCHECK, 0, 0);
h = GetDlgItem(hdlg, IDC_LIST_FLOPPY_DRIVES);
win_settings_floppy_drives_update_item(h, fdlv_current_sel);
rd_ignore_change = 0;
return FALSE;
case IDC_COMBO_CD_BUS:
if (rd_ignore_change)
{