|
|
| version 1.2, 2003/10/23 12:58:44 | version 1.4, 2004/01/27 07:24:26 |
|---|---|
| Line 23 void dialog_changefdd(BYTE drv) { | Line 23 void dialog_changefdd(BYTE drv) { |
| void dialog_changehdd(BYTE drv) { | void dialog_changehdd(BYTE drv) { |
| UINT num; | |
| char fname[MAX_PATH]; | char fname[MAX_PATH]; |
| if (drv < 2) { | num = drv & 0x0f; |
| if (dlgs_selectfile(fname, sizeof(fname))) { | if (!(drv & 0x20)) { // SASI/IDE |
| diskdrv_sethdd(drv, fname); | if (num >= 2) { |
| return; | |
| } | } |
| } | } |
| else { // SCSI | |
| if (num >= 4) { | |
| return; | |
| } | |
| } | |
| if (dlgs_selectfile(fname, sizeof(fname))) { | |
| diskdrv_sethdd(drv, fname); | |
| } | |
| } | } |
| Line 42 typedef struct { | Line 52 typedef struct { |
| char label[16+1]; | char label[16+1]; |
| } NEWDISK; | } NEWDISK; |
| static int NewHddDlgProc(UINT *hddsize) { | static int NewHddDlgProc(UINT *hddsize, UINT hddminsize, UINT hddmaxsize) { |
| DialogPtr hDlg; | DialogPtr hDlg; |
| Str255 sizestr; | Str255 sizestr; |
| int done; | int done; |
| short item; | short item; |
| char work[16]; | char work[32]; |
| hDlg = GetNewDialog(IDD_NEWHDDDISK, NULL, (WindowPtr)-1); | hDlg = GetNewDialog(IDD_NEWHDDDISK, NULL, (WindowPtr)-1); |
| if (!hDlg) { | if (!hDlg) { |
| return(0); | return(IDCANCEL); |
| } | } |
| mkstr255(sizestr, "41"); | mkstr255(sizestr, "41"); |
| SetDialogItemText(GetDlgItem(hDlg, IDC_HDDSIZE), sizestr); | SetDialogItemText(GetDlgItem(hDlg, IDC_HDDSIZE), sizestr); |
| SelectDialogItemText(hDlg, IDC_HDDSIZE, 0x0000, 0x7fff); | SelectDialogItemText(hDlg, IDC_HDDSIZE, 0x0000, 0x7fff); |
| SPRINTF(work, "(%d-%dMB)", hddminsize, hddmaxsize); | |
| mkstr255(sizestr, work); | |
| SetDialogItemText(GetDlgItem(hDlg, IDC_HDDLIMIT), sizestr); | |
| SetDialogDefaultItem(hDlg, IDOK); | SetDialogDefaultItem(hDlg, IDOK); |
| SetDialogCancelItem(hDlg, IDCANCEL); | SetDialogCancelItem(hDlg, IDCANCEL); |
| Line 81 static int NewHddDlgProc(UINT *hddsize) | Line 94 static int NewHddDlgProc(UINT *hddsize) |
| return(done); | return(done); |
| } | } |
| static const short sasires[6] = | |
| {IDC_NEWSASI5MB, IDC_NEWSASI10MB, IDC_NEWSASI15MB, | |
| IDC_NEWSASI20MB, IDC_NEWSASI30MB, IDC_NEWSASI40MB}; | |
| static int NewSASIDlgProc(UINT *hddtype) { | |
| DialogPtr hDlg; | |
| int i; | |
| ControlHandle btn[6]; | |
| int done; | |
| short item; | |
| int type; | |
| hDlg = GetNewDialog(IDD_NEWSASIHDD, NULL, (WindowPtr)-1); | |
| if (!hDlg) { | |
| return(IDCANCEL); | |
| } | |
| for (i=0; i<6; i++) { | |
| btn[i] = (ControlHandle)GetDlgItem(hDlg, sasires[i]); | |
| SetControlValue(btn[i], 0); | |
| } | |
| SetDialogDefaultItem(hDlg, IDOK); | |
| SetDialogCancelItem(hDlg, IDCANCEL); | |
| done = 0; | |
| type = -1; | |
| while(!done) { | |
| ModalDialog(NULL, &item); | |
| switch(item) { | |
| case IDOK: | |
| if (type >= 0) { | |
| if (type > 3) { | |
| type++; | |
| } | |
| *hddtype = type; | |
| done = IDOK; | |
| } | |
| break; | |
| case IDCANCEL: | |
| done = IDCANCEL; | |
| break; | |
| case IDC_NEWSASI5MB: | |
| case IDC_NEWSASI10MB: | |
| case IDC_NEWSASI15MB: | |
| case IDC_NEWSASI20MB: | |
| case IDC_NEWSASI30MB: | |
| case IDC_NEWSASI40MB: | |
| for (i=0; i<6; i++) { | |
| if (item == sasires[i]) { | |
| SetControlValue(btn[i], 1); | |
| type = i; | |
| } | |
| else { | |
| SetControlValue(btn[i], 0); | |
| } | |
| } | |
| break; | |
| } | |
| } | |
| DisposeDialog(hDlg); | |
| return(done); | |
| } | |
| static int NewdiskDlgProc(NEWDISK *newdisk) { | static int NewdiskDlgProc(NEWDISK *newdisk) { |
| BOOL usefd144; | |
| DialogPtr hDlg; | DialogPtr hDlg; |
| int media; | int media; |
| int done; | int done; |
| short item; | short item; |
| Str255 disklabel; | Str255 disklabel; |
| ControlHandle btn[2]; | ControlHandle btn[3]; |
| hDlg = GetNewDialog(IDD_NEWFDDDISK, NULL, (WindowPtr)-1); | usefd144 = (np2cfg.usefd144)?TRUE:FALSE; |
| if (!usefd144) { | |
| hDlg = GetNewDialog(IDD_NEWFDDDISK, NULL, (WindowPtr)-1); | |
| } | |
| else { | |
| hDlg = GetNewDialog(IDD_NEWFDDDISK2, NULL, (WindowPtr)-1); | |
| } | |
| if (!hDlg) { | if (!hDlg) { |
| return(0); | return(IDCANCEL); |
| } | } |
| SelectDialogItemText(hDlg, IDC_DISKLABEL, 0x0000, 0x7fff); | SelectDialogItemText(hDlg, IDC_DISKLABEL, 0x0000, 0x7fff); |
| btn[0] = (ControlHandle)GetDlgItem(hDlg, IDC_MAKE2DD); | btn[0] = (ControlHandle)GetDlgItem(hDlg, IDC_MAKE2DD); |
| btn[1] = (ControlHandle)GetDlgItem(hDlg, IDC_MAKE2HD); | btn[1] = (ControlHandle)GetDlgItem(hDlg, IDC_MAKE2HD); |
| btn[2] = (ControlHandle)NULL; | |
| if (usefd144) { | |
| btn[2] = (ControlHandle)GetDlgItem(hDlg, IDC_MAKE144); | |
| } | |
| SetControlValue(btn[0], 0); | SetControlValue(btn[0], 0); |
| SetControlValue(btn[1], 1); | SetControlValue(btn[1], 1); |
| media = 1; | media = 1; |
| Line 133 static int NewdiskDlgProc(NEWDISK *newdi | Line 222 static int NewdiskDlgProc(NEWDISK *newdi |
| case IDC_MAKE2DD: | case IDC_MAKE2DD: |
| SetControlValue(btn[0], 1); | SetControlValue(btn[0], 1); |
| SetControlValue(btn[1], 0); | SetControlValue(btn[1], 0); |
| if (usefd144) { | |
| SetControlValue(btn[2], 0); | |
| } | |
| media = 0; | media = 0; |
| break; | break; |
| case IDC_MAKE2HD: | case IDC_MAKE2HD: |
| SetControlValue(btn[0], 0); | SetControlValue(btn[0], 0); |
| SetControlValue(btn[1], 1); | SetControlValue(btn[1], 1); |
| if (usefd144) { | |
| SetControlValue(btn[2], 0); | |
| } | |
| media = 1; | media = 1; |
| break; | break; |
| case IDC_MAKE144: | |
| if (usefd144) { | |
| SetControlValue(btn[0], 0); | |
| SetControlValue(btn[1], 0); | |
| SetControlValue(btn[2], 1); | |
| media = 2; | |
| } | |
| break; | |
| } | } |
| } | } |
| DisposeDialog(hDlg); | DisposeDialog(hDlg); |
| Line 150 static int NewdiskDlgProc(NEWDISK *newdi | Line 254 static int NewdiskDlgProc(NEWDISK *newdi |
| void dialog_newdisk(void) { | void dialog_newdisk(void) { |
| char path[MAX_PATH]; | char path[MAX_PATH]; |
| char *ext; | |
| UINT hddsize; | UINT hddsize; |
| NEWDISK disk; | NEWDISK disk; |
| if (!dlgs_selectwritefile(path, sizeof(path), str_newdisk)) { | if (!dlgs_selectwritefile(path, sizeof(path), str_newdisk)) { |
| return; | return; |
| } | } |
| if (!file_cmpname(file_getext(path), str_thd)) { | ext = file_getext(path); |
| if (!file_cmpname(ext, str_thd)) { | |
| hddsize = 0; | |
| if (NewHddDlgProc(&hddsize, 5, 256) == IDOK) { | |
| newdisk_thd(path, hddsize); | |
| } | |
| } | |
| else if (!file_cmpname(ext, str_nhd)) { | |
| hddsize = 0; | |
| if (NewHddDlgProc(&hddsize, 5, 512) == IDOK) { | |
| newdisk_vhd(path, hddsize); | |
| } | |
| } | |
| else if (!file_cmpname(ext, str_hdi)) { | |
| hddsize = 7; | |
| if (NewSASIDlgProc(&hddsize) == IDOK) { | |
| newdisk_hdi(path, hddsize); | |
| } | |
| } | |
| else if (!file_cmpname(ext, str_hdd)) { | |
| hddsize = 0; | hddsize = 0; |
| if (NewHddDlgProc(&hddsize) == IDOK) { | if (NewHddDlgProc(&hddsize, 2, 512) == IDOK) { |
| newdisk_hdd(path, hddsize); | newdisk_vhd(path, hddsize); |
| } | } |
| } | } |
| else { | else { |