static void enable_controls_for_drive_settings(HWND hwnd, int type) { int drive_type = 0; switch (type) { case IDC_SELECT_DRIVE_TYPE_1541: drive_type = DRIVE_TYPE_1541; break; case IDC_SELECT_DRIVE_TYPE_1541II: drive_type = DRIVE_TYPE_1541II; break; case IDC_SELECT_DRIVE_TYPE_1551: drive_type = DRIVE_TYPE_1551; break; case IDC_SELECT_DRIVE_TYPE_1570: drive_type = DRIVE_TYPE_1570; break; case IDC_SELECT_DRIVE_TYPE_1571: drive_type = DRIVE_TYPE_1571; break; case IDC_SELECT_DRIVE_TYPE_1581: drive_type = DRIVE_TYPE_1581; break; } EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_EXTEND_NEVER), drive_check_extend_policy(drive_type)); EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_EXTEND_ASK), drive_check_extend_policy(drive_type)); EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_EXTEND_ACCESS), drive_check_extend_policy(drive_type)); EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_IDLE_NO_IDLE), drive_check_idle_method(drive_type)); EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_IDLE_TRAP_IDLE), drive_check_idle_method(drive_type)); EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_IDLE_SKIP_CYCLES), drive_check_idle_method(drive_type)); EnableWindow(GetDlgItem(hwnd, IDC_TOGGLE_DRIVE_PARALLEL_CABLE), drive_check_parallel_cable(drive_type)); EnableWindow(GetDlgItem(hwnd, IDC_TOGGLE_DRIVE_EXPANSION_2000), drive_check_expansion2000(drive_type)); EnableWindow(GetDlgItem(hwnd, IDC_TOGGLE_DRIVE_EXPANSION_4000), drive_check_expansion4000(drive_type)); EnableWindow(GetDlgItem(hwnd, IDC_TOGGLE_DRIVE_EXPANSION_6000), drive_check_expansion6000(drive_type)); EnableWindow(GetDlgItem(hwnd, IDC_TOGGLE_DRIVE_EXPANSION_8000), drive_check_expansion8000(drive_type)); EnableWindow(GetDlgItem(hwnd, IDC_TOGGLE_DRIVE_EXPANSION_A000), drive_check_expansionA000(drive_type)); }
static TUI_MENU_CALLBACK(current_idle_string_callback) { int drive = (int)param; int type = get_drive_type(drive); int idle_support = drive_check_idle_method(type); int res_value; char *s; if (!idle_support) { return "N/A"; } resources_get_int_sprintf("Drive%iIdleMethod", &res_value, drive); switch (res_value) { default: case DRIVE_IDLE_NO_IDLE: s = "None"; break; case DRIVE_IDLE_SKIP_CYCLES: s = "Skip cycles"; break; case DRIVE_IDLE_TRAP_IDLE: s = "Trap idle"; break; } return s; }
static TUI_MENU_CALLBACK(radio_idle_check_callback) { int drive = (int)param >> 16; int value = (int)param & 0xffff; int type = get_drive_type(drive); int idle_support = drive_check_idle_method(type); int res_value; if (!idle_support) { return "N/A"; } if (been_activated) { resources_set_int_sprintf("Drive%iIdleMethod", value, drive); *become_default = 1; ui_update_menus(); } else { resources_get_int_sprintf("Drive%iIdleMethod", &res_value, drive); if (res_value == value) { *become_default = 1; } } }