| version 1.8, 2004/01/27 10:55:47 | version 1.10, 2004/02/14 07:56:51 | 
| Line 25  static const char fddui_filter[] = | Line 25  static const char fddui_filter[] = | 
 | "All files (*.*)\0*.*\0"; | "All files (*.*)\0*.*\0"; | 
 | static const FILESEL fddui = {fddui_title, str_d88, fddui_filter, 3}; | 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"; | 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[] =                                                                             \ | static const char sasiui_filter[] =                                                                             \ | 
 | "Anex86 harddisk image files (*.HDI)\0"                         \ | "Anex86 harddisk image files (*.HDI)\0"                         \ | 
 | "*.hdi\0"                                                       \ | "*.hdi\0"                                                       \ | 
| Line 37  static const char sasiui_filter[] = | Line 41  static const char sasiui_filter[] = | 
 | "*.thd;*.nhd;*.hdi\0"; | "*.thd;*.nhd;*.hdi\0"; | 
 | static const FILESEL sasiui = {sasiui_title, str_thd, sasiui_filter, 4}; | 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_title[] = "Select SCSI HDD image"; | 
 | static const char scsiui_filter[] =                                                                             \ | static const char scsiui_filter[] =                                                                             \ | 
 | "Virtual98 harddisk image files (*.HDD)\0"                      \ | "Virtual98 harddisk image files (*.HDD)\0"                      \ | 
 | "*.hdd\0"; | "*.hdd\0"; | 
 | static const FILESEL scsiui = {scsiui_title, str_hdd, scsiui_filter, 1}; | static const FILESEL scsiui = {scsiui_title, str_hdd, scsiui_filter, 1}; | 
 |  | #endif | 
 |  |  | 
 | static const char newdisk_title[] = "Create disk image"; | static const char newdisk_title[] = "Create disk image"; | 
 |  | #if defined(SUPPORT_SCSI) | 
 | static const char newdisk_filter[] =                                                                    \ | static const char newdisk_filter[] =                                                                    \ | 
 | "D88 image files (*.D88;*.88D)\0"                                       \ | "D88 image files (*.D88;*.88D)\0"                                       \ | 
| "*.d88;*.88d\0"                                         \ | "*.d88;*.88d;*.d98;*.98d\0"                     \ | 
 | "Anex86 harddisk image files (*.HDI)\0"                         \ | "Anex86 harddisk image files (*.HDI)\0"                         \ | 
 | "*.hdi\0"                                                       \ | "*.hdi\0"                                                       \ | 
 | "T98 harddisk image files (*.THD)\0"                            \ | "T98 harddisk image files (*.THD)\0"                            \ | 
| Line 55  static const char newdisk_filter[] = | Line 62  static const char newdisk_filter[] = | 
 | "*.nhd\0"                                                       \ | "*.nhd\0"                                                       \ | 
 | "Virtual98 harddisk image files (*.HDD)\0"                      \ | "Virtual98 harddisk image files (*.HDD)\0"                      \ | 
 | "*.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}; | static const FILESEL newdiskui = {newdisk_title, str_d88, newdisk_filter, 1}; | 
 |  |  | 
 |  |  | 
| Line 85  void dialog_changehdd(HWND hWnd, REG8 dr | Line 103  void dialog_changehdd(HWND hWnd, REG8 dr | 
 |  |  | 
 | UINT            num; | UINT            num; | 
 | const char              *p; | const char              *p; | 
 | char            path[MAX_PATH]; |  | 
 | const FILESEL   *hddui; | const FILESEL   *hddui; | 
 |  | char            path[MAX_PATH]; | 
 |  |  | 
 | num = drv & 0x0f; | num = drv & 0x0f; | 
 |  | p = NULL; | 
 |  | hddui = NULL; | 
 | if (!(drv & 0x20)) {            // SASI/IDE | if (!(drv & 0x20)) {            // SASI/IDE | 
| if (num >= 2) { | if (num < 2) { | 
| return; | p = np2cfg.sasihdd[num]; | 
|  | hddui = &sasiui; | 
 | } | } | 
 | p = np2cfg.sasihdd[num]; |  | 
 | hddui = &sasiui; |  | 
 | } | } | 
 |  | #if defined(SUPPORT_SCSI) | 
 | else {                                          // SCSI | else {                                          // SCSI | 
| if (num >= 4) { | if (num < 4) { | 
| return; | 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; | p = hddfolder; | 
 | } | } | 
 | file_cpyname(path, p, sizeof(path)); | file_cpyname(path, p, sizeof(path)); | 
| Line 291  void dialog_newdisk(HWND hWnd) { | Line 314  void dialog_newdisk(HWND hWnd) { | 
 |  |  | 
 | char            path[MAX_PATH]; | char            path[MAX_PATH]; | 
 | HINSTANCE       hinst; | HINSTANCE       hinst; | 
 |  | const char              *ext; | 
 |  |  | 
 | file_cpyname(path, fddfolder, sizeof(path)); | file_cpyname(path, fddfolder, sizeof(path)); | 
 | file_cutname(path); | file_cutname(path); | 
| Line 300  void dialog_newdisk(HWND hWnd) { | Line 324  void dialog_newdisk(HWND hWnd) { | 
 | return; | return; | 
 | } | } | 
 | hinst = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE); | hinst = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE); | 
| if (!file_cmpname(file_getext(path), str_thd)) { | ext = file_getext(path); | 
|  | if (!file_cmpname(ext, str_thd)) { | 
 | hddsize = 0; | hddsize = 0; | 
 | hddminsize = 5; | hddminsize = 5; | 
 | hddmaxsize = 256; | hddmaxsize = 256; | 
| Line 309  void dialog_newdisk(HWND hWnd) { | Line 334  void dialog_newdisk(HWND hWnd) { | 
 | newdisk_thd(path, hddsize); | newdisk_thd(path, hddsize); | 
 | } | } | 
 | } | } | 
| else if (!file_cmpname(file_getext(path), str_nhd)) { | else if (!file_cmpname(ext, str_nhd)) { | 
 | hddsize = 0; | hddsize = 0; | 
 | hddminsize = 5; | hddminsize = 5; | 
 | hddmaxsize = 512; | hddmaxsize = 512; | 
| Line 318  void dialog_newdisk(HWND hWnd) { | Line 343  void dialog_newdisk(HWND hWnd) { | 
 | newdisk_nhd(path, hddsize); | newdisk_nhd(path, hddsize); | 
 | } | } | 
 | } | } | 
| else if (!file_cmpname(file_getext(path), str_hdi)) { | else if (!file_cmpname(ext, str_hdi)) { | 
 | hddsize = 7; | hddsize = 7; | 
 | if (DialogBox(hinst, MAKEINTRESOURCE(IDD_NEWSASI), | if (DialogBox(hinst, MAKEINTRESOURCE(IDD_NEWSASI), | 
 | hWnd, (DLGPROC)NewSASIDlgProc) == IDOK) { | hWnd, (DLGPROC)NewSASIDlgProc) == IDOK) { | 
 | newdisk_hdi(path, hddsize); | newdisk_hdi(path, hddsize); | 
 | } | } | 
 | } | } | 
| else if (!file_cmpname(file_getext(path), str_hdd)) { | #if defined(SUPPORT_SCSI) | 
|  | else if (!file_cmpname(ext, str_hdd)) { | 
 | hddsize = 0; | hddsize = 0; | 
 | hddminsize = 2; | hddminsize = 2; | 
 | hddmaxsize = 512; | hddmaxsize = 512; | 
| Line 334  void dialog_newdisk(HWND hWnd) { | Line 360  void dialog_newdisk(HWND hWnd) { | 
 | newdisk_vhd(path, hddsize); | 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, | if (DialogBox(hinst, | 
 | MAKEINTRESOURCE((np2cfg.usefd144)?IDD_NEWDISK2:IDD_NEWDISK), | MAKEINTRESOURCE((np2cfg.usefd144)?IDD_NEWDISK2:IDD_NEWDISK), | 
 | hWnd, (DLGPROC)NewdiskDlgProc) == IDOK) { | hWnd, (DLGPROC)NewdiskDlgProc) == IDOK) { |