| version 1.1, 2003/11/28 08:01:32 | version 1.4, 2004/01/27 07:51:48 | 
| Line 129  static FLIST getflist(int pos) { | Line 129  static FLIST getflist(int pos) { | 
 | return(ret); | return(ret); | 
 | } | } | 
 |  |  | 
| static BOOL fappend(LISTARRAY flist, FILEFINDT *fft) { | static BOOL fappend(LISTARRAY flist, FLINFO *fli) { | 
 |  |  | 
 | FLIST   fl; | FLIST   fl; | 
 | FLIST   *st; | FLIST   *st; | 
| Line 139  static BOOL fappend(LISTARRAY flist, FIL | Line 139  static BOOL fappend(LISTARRAY flist, FIL | 
 | if (fl == NULL) { | if (fl == NULL) { | 
 | return(FAILURE); | return(FAILURE); | 
 | } | } | 
| fl->isdir = (fft->attr & 0x10)?1:0; | fl->isdir = (fli->attr & 0x10)?1:0; | 
| file_cpyname(fl->name, fft->path, sizeof(fl->name)); | file_cpyname(fl->name, fli->path, sizeof(fl->name)); | 
 | st = &filesel.fbase; | st = &filesel.fbase; | 
 | while(1) { | while(1) { | 
 | cur = *st; | cur = *st; | 
| Line 181  const char *p; | Line 181  const char *p; | 
 | static void dlgsetlist(void) { | static void dlgsetlist(void) { | 
 |  |  | 
 | LISTARRAY       flist; | LISTARRAY       flist; | 
| FILEFINDH       ffh; | FLISTH          flh; | 
| FILEFINDT       fft; | FLINFO          fli; | 
 | BOOL            append; | BOOL            append; | 
 | FLIST           fl; | FLIST           fl; | 
 | ITEMEXPRM       prm; | ITEMEXPRM       prm; | 
| Line 203  static void dlgsetlist(void) { | Line 203  static void dlgsetlist(void) { | 
 | flist = listarray_new(sizeof(_FLIST), 64); | flist = listarray_new(sizeof(_FLIST), 64); | 
 | filesel.flist = flist; | filesel.flist = flist; | 
 | filesel.fbase = NULL; | filesel.fbase = NULL; | 
| ffh = file_find1st(filesel.path, &fft); | flh = file_list1st(filesel.path, &fli); | 
| if (ffh != FILEFINDH_INVALID) { | if (flh != FLISTH_INVALID) { | 
 | do { | do { | 
 | append = FALSE; | append = FALSE; | 
| if (fft.attr & 0x10) { | if (fli.attr & 0x10) { | 
 | #if defined(WIN32) && !defined(_WIN32_WCE) | #if defined(WIN32) && !defined(_WIN32_WCE) | 
| if ((file_cmpname(fft.path, ".")) && | if ((file_cmpname(fli.path, ".")) && | 
| (file_cmpname(fft.path, ".."))) { | (file_cmpname(fli.path, ".."))) { | 
 | append = TRUE; | append = TRUE; | 
 | } | } | 
 | #else | #else | 
 | append = TRUE; | append = TRUE; | 
 | #endif | #endif | 
 | } | } | 
| else if (!(fft.attr & 0x08)) { | else if (!(fli.attr & 0x08)) { | 
| append = checkext(fft.path, filesel.ext); | append = checkext(fli.path, filesel.ext); | 
 | } | } | 
 | if (append) { | if (append) { | 
| if (fappend(flist, &fft) != SUCCESS) { | if (fappend(flist, &fli) != SUCCESS) { | 
 | break; | break; | 
 | } | } | 
 | } | } | 
| } while(file_findnext(ffh, &fft) == SUCCESS); | } while(file_listnext(flh, &fli) == SUCCESS); | 
| file_findclose(ffh); | file_listclose(flh); | 
 | } | } | 
 | prm.pos = 0; | prm.pos = 0; | 
 | fl = filesel.fbase; | fl = filesel.fbase; | 
| Line 390  static const char diskfilter[] = "All su | Line 390  static const char diskfilter[] = "All su | 
 | static const char fddtitle[] = "Select floppy image"; | static const char fddtitle[] = "Select floppy image"; | 
 | static const char fddext[] = "d88\088d\0d98\098d\0xdf\0hdm\0dup\02hd\0tfd\0"; | static const char fddext[] = "d88\088d\0d98\098d\0xdf\0hdm\0dup\02hd\0tfd\0"; | 
 | static const char hddtitle[] = "Select HDD image"; | static const char hddtitle[] = "Select HDD image"; | 
| static const char hddext[] = "thd\0hdi\0"; | static const char sasiext[] = "thd\0nhd\0hdi\0"; | 
|  | static const char scsiext[] = "hdd\0"; | 
 |  |  | 
 | static const FSELPRM fddprm = {fddtitle, diskfilter, fddext}; | static const FSELPRM fddprm = {fddtitle, diskfilter, fddext}; | 
| static const FSELPRM hddprm = {hddtitle, diskfilter, hddext}; | static const FSELPRM sasiprm = {hddtitle, diskfilter, sasiext}; | 
|  | static const FSELPRM scsiprm = {hddtitle, diskfilter, scsiext}; | 
 |  |  | 
| void filesel_fdd(BYTE drv) { | void filesel_fdd(REG8 drv) { | 
 |  |  | 
 | char    path[MAX_PATH]; | char    path[MAX_PATH]; | 
 |  |  | 
| Line 406  void filesel_fdd(BYTE drv) { | Line 408  void filesel_fdd(BYTE drv) { | 
 | } | } | 
 | } | } | 
 |  |  | 
| void filesel_sasi(BYTE drv) { | void filesel_hdd(REG8 drv) { | 
 |  |  | 
| char    path[MAX_PATH]; | UINT            num; | 
|  | char            path[MAX_PATH]; | 
| if (drv < 2) { | char            *p; | 
| if (selectfile(&hddprm, path, sizeof(path), np2cfg.hddfile[drv])) { | const FSELPRM   *prm; | 
| diskdrv_sethdd(drv, path); |  | 
|  | num = drv & 0x0f; | 
|  | if (!(drv & 0x20)) {            // SASI/IDE | 
|  | if (num >= 2) { | 
|  | return; | 
 | } | } | 
 |  | p = np2cfg.sasihdd[num]; | 
 |  | prm = &sasiprm; | 
 |  | } | 
 |  | else {                                          // SCSI | 
 |  | if (num >= 4) { | 
 |  | return; | 
 |  | } | 
 |  | p = np2cfg.scsihdd[num]; | 
 |  | prm = &scsiprm; | 
 |  | } | 
 |  | if (selectfile(prm, path, sizeof(path), p)) { | 
 |  | diskdrv_sethdd(drv, path); | 
 | } | } | 
 | } | } | 
 |  |  |