hardfile_testrdb (f);
}
-static void volumeselectfile (HWND hDlg)
+static void volumeselectfile (HWND hDlg, int setout)
{
TCHAR directory_path[MAX_DPATH];
_tcscpy (directory_path, current_fsvdlg.ci.rootdir);
regsetstr (NULL, _T("FilesystemFilePath"), directory_path);
p[1] = t;
}
+ if (setout)
+ _tcscpy (current_fsvdlg.ci.rootdir, directory_path);
}
}
-static void volumeselectdir (HWND hDlg, int newdir)
+static void volumeselectdir (HWND hDlg, int newdir, int setout)
{
const GUID volumeguid = { 0x1df05121, 0xcc08, 0x46ea, { 0x80, 0x3f, 0x98, 0x3c, 0x54, 0x88, 0x53, 0x76 } };
TCHAR szTitle[MAX_DPATH];
SetDlgItemText (hDlg, IDC_PATH_NAME, directory_path);
ew (hDlg, IDC_FS_RW, TRUE);
archivehd = 0;
+ if (setout)
+ _tcscpy(current_fsvdlg.ci.rootdir, directory_path);
}
}
if (s) {
_tcscpy (current_fsvdlg.ci.rootdir, s);
xfree (s);
- volumeselectfile (hDlg);
+ volumeselectfile (hDlg, 0);
}
} else if (GetDlgCtrlID ((HWND)wParam) == IDC_FS_SELECT_DIR) {
TCHAR *s = favoritepopup (hDlg);
if (s) {
_tcscpy (current_fsvdlg.ci.rootdir, s);
xfree (s);
- volumeselectdir (hDlg, 1);
+ volumeselectdir (hDlg, 1, 0);
}
}
break;
archivehd = -1;
break;
case IDC_FS_SELECT_FILE:
- volumeselectfile (hDlg);
- getcomboboxtext(hDlg, IDC_PATH_NAME, current_fsvdlg.ci.rootdir, sizeof current_fsvdlg.ci.rootdir / sizeof(TCHAR));
+ volumeselectfile (hDlg, 1);
break;
case IDC_FS_SELECT_DIR:
- volumeselectdir (hDlg, 0);
- getcomboboxtext(hDlg, IDC_PATH_NAME, current_fsvdlg.ci.rootdir, sizeof current_fsvdlg.ci.rootdir / sizeof(TCHAR));
+ volumeselectdir (hDlg, 0, 1);
break;
case IDOK:
EndDialog (hDlg, 1);
static void sethardfile (HWND hDlg)
{
+ bool ide = current_hfdlg.ci.controller_type >= HD_CONTROLLER_TYPE_IDE_FIRST && current_hfdlg.ci.controller_type <= HD_CONTROLLER_TYPE_IDE_LAST;
+ bool scsi = current_hfdlg.ci.controller_type >= HD_CONTROLLER_TYPE_SCSI_FIRST && current_hfdlg.ci.controller_type <= HD_CONTROLLER_TYPE_SCSI_LAST;
bool rdb = is_hdf_rdb ();
bool physgeo = rdb && ischecked(hDlg, IDC_HDF_PHYSGEOMETRY);
bool enablegeo = !rdb || physgeo;
bool disables = !rdb || (rdb && current_hfdlg.ci.controller_type == HD_CONTROLLER_TYPE_UAE);
- bool ide = current_hfdlg.ci.controller_type >= HD_CONTROLLER_TYPE_IDE_FIRST && current_hfdlg.ci.controller_type <= HD_CONTROLLER_TYPE_IDE_LAST;
- bool scsi = current_hfdlg.ci.controller_type >= HD_CONTROLLER_TYPE_SCSI_FIRST && current_hfdlg.ci.controller_type <= HD_CONTROLLER_TYPE_SCSI_LAST;
const struct expansionromtype *ert = get_unit_expansion_rom(current_hfdlg.ci.controller_type);
if (ert && current_hfdlg.ci.controller_unit >= 8) {
}
}
-static void hardfileselecthdf (HWND hDlg, TCHAR *newpath, bool ask)
+static void hardfileselecthdf (HWND hDlg, TCHAR *newpath, bool ask, bool newhd)
{
if (ask) {
DiskSelection (hDlg, IDC_PATH_NAME, 2, &workprefs, newpath);
DISK_history_add(current_hfdlg.ci.rootdir, -1, HISTORY_HDF, 1);
}
fullpath (current_hfdlg.ci.rootdir, sizeof current_hfdlg.ci.rootdir / sizeof (TCHAR));
+ if (newhd) {
+ // Set RDB mode if IDE or SCSI
+ if (current_hfdlg.ci.controller_type > 0) {
+ current_hfdlg.ci.sectors = current_hfdlg.ci.reserved = current_hfdlg.ci.surfaces = 0;
+ }
+ }
inithardfile (hDlg);
hardfile_testrdb (¤t_hfdlg);
updatehdfinfo (hDlg, true, true);
dst->readonly = src->readonly;
dst->physical_geometry = src->physical_geometry;
if (src->physical_geometry) {
+ dst->cyls = dst->sectors = dst->surfaces = dst->reserved = 0;
dst->pcyls = src->pcyls;
dst->pheads = src->pheads;
dst->psecs = src->psecs;
TCHAR path[MAX_DPATH];
_tcscpy (path, s);
xfree (s);
- hardfileselecthdf (hDlg, path, true);
+ hardfileselecthdf (hDlg, path, true, false);
}
} else if (GetDlgCtrlID ((HWND)wParam) == IDC_FILESYS_SELECTOR) {
TCHAR *s = favoritepopup (hDlg);
if (_tcscmp (tmp, current_hfdlg.ci.rootdir)) {
_tcscpy (current_hfdlg.ci.rootdir, tmp);
recursive++;
- hardfileselecthdf (hDlg, NULL, false);
+ hardfileselecthdf (hDlg, NULL, false, false);
recursive--;
}
}
break;
case IDC_SELECTOR:
{
+ bool newhd = current_hfdlg.ci.rootdir[0] == 0;
struct uaedev_config_info citmp;
memcpy(&citmp, ¤t_hfdlg.ci, sizeof citmp);
default_hfdlg (¤t_hfdlg, false);
restore_hd_geom(¤t_hfdlg.ci, &citmp);
- hardfileselecthdf (hDlg, NULL, true);
+ hardfileselecthdf (hDlg, NULL, true, newhd);
}
break;
case IDC_FILESYS_SELECTOR: