--- np2/win9x/dialog/d_disk.cpp 2004/02/13 20:31:55 1.9 +++ np2/win9x/dialog/d_disk.cpp 2005/02/07 15:39:27 1.11 @@ -25,7 +25,11 @@ static const char fddui_filter[] = "All files (*.*)\0*.*\0"; static const FILESEL fddui = {fddui_title, str_d88, fddui_filter, 3}; +#if defined(SUPPORT_SASI) static const char sasiui_title[] = "Select SASI/IDE HDD image"; +#else +static const char sasiui_title[] = "Select HDD image"; +#endif static const char sasiui_filter[] = \ "Anex86 harddisk image files (*.HDI)\0" \ "*.hdi\0" \ @@ -37,16 +41,19 @@ static const char sasiui_filter[] = "*.thd;*.nhd;*.hdi\0"; static const FILESEL sasiui = {sasiui_title, str_thd, sasiui_filter, 4}; +#if defined(SUPPORT_SCSI) static const char scsiui_title[] = "Select SCSI HDD image"; static const char scsiui_filter[] = \ "Virtual98 harddisk image files (*.HDD)\0" \ "*.hdd\0"; static const FILESEL scsiui = {scsiui_title, str_hdd, scsiui_filter, 1}; +#endif static const char newdisk_title[] = "Create disk image"; +#if defined(SUPPORT_SCSI) static const char newdisk_filter[] = \ "D88 image files (*.D88;*.88D)\0" \ - "*.d88;*.88d\0" \ + "*.d88;*.88d;*.d98;*.98d\0" \ "Anex86 harddisk image files (*.HDI)\0" \ "*.hdi\0" \ "T98 harddisk image files (*.THD)\0" \ @@ -55,6 +62,17 @@ static const char newdisk_filter[] = "*.nhd\0" \ "Virtual98 harddisk image files (*.HDD)\0" \ "*.hdd\0"; +#else +static const char newdisk_filter[] = \ + "D88 image files (*.D88;*.88D)\0" \ + "*.d88;*.88d;*.d98;*.98d\0" \ + "Anex86 harddisk image files (*.HDI)\0" \ + "*.hdi\0" \ + "T98 harddisk image files (*.THD)\0" \ + "*.thd\0" \ + "T98-Next harddisk image files (*.NHD)\0" \ + "*.nhd\0"; +#endif static const FILESEL newdiskui = {newdisk_title, str_d88, newdisk_filter, 1}; @@ -85,25 +103,30 @@ void dialog_changehdd(HWND hWnd, REG8 dr UINT num; const char *p; - char path[MAX_PATH]; const FILESEL *hddui; + char path[MAX_PATH]; num = drv & 0x0f; + p = NULL; + hddui = NULL; if (!(drv & 0x20)) { // SASI/IDE - if (num >= 2) { - return; + if (num < 2) { + p = np2cfg.sasihdd[num]; + hddui = &sasiui; } - p = np2cfg.sasihdd[num]; - hddui = &sasiui; } +#if defined(SUPPORT_SCSI) else { // SCSI - if (num >= 4) { - return; + if (num < 4) { + p = np2cfg.scsihdd[num]; + hddui = &scsiui; } - p = np2cfg.scsihdd[num]; - hddui = &scsiui; } - if ((p == NULL) || (p[0] == '\0')) { +#endif + if (hddui == NULL) { + return; + } + if (p[0] == '\0') { p = hddfolder; } file_cpyname(path, p, sizeof(path)); @@ -125,7 +148,7 @@ static const UINT16 sasires[6] = { IDC_NEWSASI15MB, IDC_NEWSASI20MB, IDC_NEWSASI30MB, IDC_NEWSASI40MB}; -static BYTE makefdtype = DISKTYPE_2HD << 4; +static UINT8 makefdtype = DISKTYPE_2HD << 4; static char disklabel[16+1]; static UINT hddsize; static UINT hddminsize; @@ -146,7 +169,7 @@ static LRESULT CALLBACK NewHddDlgProc(HW return(FALSE); case WM_COMMAND: - switch (LOWORD(wp)) { + switch(LOWORD(wp)) { case IDOK: GetWindowText(GetDlgItem(hWnd, IDC_HDDSIZE), work, sizeof(work)); @@ -191,7 +214,7 @@ static LRESULT CALLBACK NewSASIDlgProc(H return(FALSE); case WM_COMMAND: - switch (LOWORD(wp)) { + switch(LOWORD(wp)) { case IDOK: for (val=0; val<6; val++) { if (GetDlgItemCheck(hWnd, sasires[val])) { @@ -227,7 +250,7 @@ static LRESULT CALLBACK NewSASIDlgProc(H static LRESULT CALLBACK NewdiskDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { - WORD res; + UINT16 res; switch (msg) { case WM_INITDIALOG: @@ -249,7 +272,7 @@ static LRESULT CALLBACK NewdiskDlgProc(H return(FALSE); case WM_COMMAND: - switch (LOWORD(wp)) { + switch(LOWORD(wp)) { case IDOK: GetWindowText(GetDlgItem(hWnd, IDC_DISKLABEL), disklabel, sizeof(disklabel)); @@ -327,6 +350,7 @@ const char *ext; newdisk_hdi(path, hddsize); } } +#if defined(SUPPORT_SCSI) else if (!file_cmpname(ext, str_hdd)) { hddsize = 0; hddminsize = 2; @@ -336,7 +360,11 @@ const char *ext; newdisk_vhd(path, hddsize); } } - else { +#endif + else if ((!file_cmpname(ext, str_d88)) || + (!file_cmpname(ext, str_d98)) || + (!file_cmpname(ext, str_88d)) || + (!file_cmpname(ext, str_98d))) { if (DialogBox(hinst, MAKEINTRESOURCE((np2cfg.usefd144)?IDD_NEWDISK2:IDD_NEWDISK), hWnd, (DLGPROC)NewdiskDlgProc) == IDOK) {