Fixed bug in XTA driver.
Fixed string-loading issue. Fixes for handling file dialog, filters, etc. Changed the return value of dlg_file so we can use its RO flag. Removed the additional _WP statusbar menu items (no longer needed with new RO handling.)
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Application resource script for Windows.
|
||||
*
|
||||
* Version: @(#)VARCem.rc 1.0.27 2018/05/10
|
||||
* Version: @(#)VARCem.rc 1.0.28 2018/05/11
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -954,7 +954,7 @@ BEGIN
|
||||
IDS_2072 "Hard disks"
|
||||
IDS_2073 "Floppy drives"
|
||||
IDS_2074 "Other removable devices"
|
||||
IDS_2075 "CD-ROM images (*.ISO;*.CUE)\0*.ISO;*.CUE\0All files (*.*)\0*.*\0"
|
||||
IDS_2075 "CD-ROM images\0*.iso;*.cue\0All files (*.*)\0*.*\0"
|
||||
IDS_2076 "Host CD/DVD Drive (%c:)"
|
||||
IDS_2077 "Click to capture mouse"
|
||||
IDS_2078 "Press F8+F12 to release mouse"
|
||||
@@ -1032,24 +1032,24 @@ BEGIN
|
||||
IDS_2156 "%" PRIu64
|
||||
IDS_2157 "%" PRIu64 " MB (CHS: %u, %u, %u)"
|
||||
IDS_2158 "Floppy %i (%s): %ls"
|
||||
IDS_2159 "All images (*.0??;*.1??;*.360;*.720;*.86F;*.BIN;*.CQ?;*.DSK;*.FLP;*.HDM;*.IM?;*.JSON;*.TD0;*.*FD?;*.XDF)\0*.0??;*.1??;*.360;*.720;*.86F;*.BIN;*.CQ?;*.DSK;*.FLP;*.HDM;*.IM?;*.JSON;*.TD0;*.*FD?;*.XDF\0Advanced sector images (*.IMD;*.JSON;*.TD0)\0*.IMD;*.JSON;*.TD0\0Basic sector images (*.0??;*.1??;*.360;*.720;*.BIN;*.CQ?;*.DSK;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?)\0*.0??;*.1??;*.360;*.720;*.BIN;*.CQ?;*.DSK;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?\0Flux images (*.FDI)\0*.FDI\0Surface images (*.86F)\0*.86F\0All files (*.*)\0*.*\0"
|
||||
IDS_2160 "Configuration files (*.VARC)\0*.VARC\0All files (*.*)\0*.*\0"
|
||||
IDS_2159 "All images\0*.0??;*.1??;*.360;*.720;*.86f;*.bin;*.cq?;*.dsk;*.flp;*.hdm;*.ima;*.json;*.td0;*.*fd?;*.xdf\0Advanced sector images\0*.imd;*.json;*.td0\0Basic sector images\0*.0??;*.1??;*.360;*.720;*.bin;*.cq?;*.dsk;*.flp;*.hdm;*.im?;*.xdf;*.*fd?\0Flux images\0*.fdi\0Surface images\0*.86f\0All files\0*.*\0"
|
||||
IDS_2160 "Configuration files\0*.varc\0All files\0*.*\0"
|
||||
IDS_2161 "&New image..."
|
||||
IDS_2162 "&Existing image..."
|
||||
IDS_2163 "Existing image (&Write-protected)..."
|
||||
IDS_2163 " [Write Protected]"
|
||||
IDS_2164 "E&ject"
|
||||
IDS_2165 "&Mute"
|
||||
IDS_2166 "E&mpty"
|
||||
IDS_2167 "&Reload previous image"
|
||||
IDS_2168 "&Image..."
|
||||
IDS_2169 "Image (&Write-protected)..."
|
||||
/* 2169 available */
|
||||
IDS_2170 "Check BPB"
|
||||
IDS_2171 "Unable to initialize FluidSynth, make sure you have the following library\nin your program folder:\n\nlibfluidsynth.dll"
|
||||
IDS_2172 "E&xport to 86F..."
|
||||
IDS_2173 "Surface images (*.86F)\0*.86F\0"
|
||||
IDS_2174 "All images (*.86F;*.DSK;*.FLP;*.IM?;*.*FD?)\0*.86F;*.DSK;*.FLP;*.IM?;*.*FD?\0Basic sector images (*.DSK;*.FLP;*.IM?;*.*FD?)\0*.DSK;*.FLP;*.IM?;*.IMG;*.*FD?\0Surface images (*.86F)\0*.86F\0"
|
||||
IDS_2175 "ZIP images (*.IM?;*.ZDI)\0*.IM?;*.ZDI\0All files (*.*)\0*.*\0"
|
||||
IDS_2176 "ZIP images (*.IM?;*.ZDI)\0*.IM?;*.ZDI\0"
|
||||
IDS_2173 "Surface images\0*.86f\0"
|
||||
IDS_2174 "All images\0*.86f;*.dsk;*.flp;*.im?;*.*fd?\0Basic sector images\0*.dsk;*.flp;*.im?;*.img;*.*fd?\0Surface images\0*.86f\0"
|
||||
IDS_2175 "ZIP images\0*.im?;*.zdi\0All files\0*.*\0"
|
||||
IDS_2176 "ZIP images\0*.im?;*.zdi\0"
|
||||
IDS_2177 "ZIP %i (%03i): %ls"
|
||||
IDS_2178 "Unable to initialize OpenAL, make sure you have the following library\nin your program folder:\n\nlibopenal-1.dll"
|
||||
IDS_2179 "Speed:"
|
||||
@@ -1067,7 +1067,7 @@ BEGIN
|
||||
IDS_4103 "Add Existing Hard Disk"
|
||||
IDS_4104 "Attempting to create a HDI image larger than 4 GB"
|
||||
IDS_4105 "Attempting to create a spuriously large hard disk image"
|
||||
IDS_4106 "Hard disk images (*.HD?;*.IM?;*.VHD)\0*.HD?;*.IM?;*.VHD\0All files (*.*)\0*.*\0"
|
||||
IDS_4106 "Hard disk images\0*.hd?;*.im?;*.vhd\0All files\0*.*\0"
|
||||
IDS_4107 "Unable to open the file for read"
|
||||
IDS_4108 "Unable to open the file for write"
|
||||
IDS_4109 "HDI or HDX image with a sector size that is not 512 are not supported"
|
||||
|
||||
@@ -253,7 +253,7 @@ OPTS := $(EXTRAS) $(STUFF) $(VCOPTS) \
|
||||
-D_CRT_SECURE_NO_WARNINGS \
|
||||
$(WPCAPINC) $(SYSINC)
|
||||
AFLAGS := /arch:SSE2
|
||||
RFLAGS :=
|
||||
RFLAGS := /n
|
||||
COPTS := -W3
|
||||
CXXOPTS := -EHsc
|
||||
DOPTS :=
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Platform main support module for Windows.
|
||||
*
|
||||
* Version: @(#)win.c 1.0.12 2018/05/10
|
||||
* Version: @(#)win.c 1.0.13 2018/05/11
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -139,7 +139,8 @@ LoadCommonStrings(void)
|
||||
|
||||
tbl->id = i;
|
||||
str = (wchar_t *)malloc((c + 1) * sizeof(wchar_t));
|
||||
wcscpy(str, temp);
|
||||
memset(str, 0x00, (c + 1) * sizeof(wchar_t));
|
||||
memcpy(str, temp, c * sizeof(wchar_t));
|
||||
tbl->str = str;
|
||||
|
||||
tbl++;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* and builds a complete Win32 DIALOG resource block in a
|
||||
* buffer in memory, and then passes that to the API handler.
|
||||
*
|
||||
* Version: @(#)win_devconf.c 1.0.16 2018/05/04
|
||||
* Version: @(#)win_devconf.c 1.0.17 2018/05/11
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -425,7 +425,7 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
if (ws[c] == L'|')
|
||||
ws[c] = 0;
|
||||
|
||||
if (! dlg_file_ex(hdlg, ws, NULL, temp, 0))
|
||||
if (dlg_file_ex(hdlg, ws, NULL, temp, DLG_FILE_LOAD))
|
||||
SendMessage(h, WM_SETTEXT, 0, (LPARAM)temp);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -191,12 +191,13 @@ dlg_file_hook(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
/* Implement the main GetFileName dialog. */
|
||||
int
|
||||
dlg_file_ex(HWND hwnd, const wchar_t *filt, const wchar_t *ifn, wchar_t *fn, int save)
|
||||
dlg_file_ex(HWND h, const wchar_t *f, const wchar_t *ifn, wchar_t *fn, int fl)
|
||||
{
|
||||
wchar_t temp[512];
|
||||
OPENFILENAME ofn;
|
||||
BOOL r;
|
||||
DWORD err;
|
||||
BOOL r;
|
||||
int ret;
|
||||
|
||||
/* Clear the temp path. */
|
||||
memset(temp, 0x00, sizeof(temp));
|
||||
@@ -204,7 +205,7 @@ dlg_file_ex(HWND hwnd, const wchar_t *filt, const wchar_t *ifn, wchar_t *fn, int
|
||||
/* Initialize OPENFILENAME. */
|
||||
memset(&ofn, 0x00, sizeof(OPENFILENAME));
|
||||
ofn.lStructSize = sizeof(ofn);
|
||||
ofn.hwndOwner = hwnd;
|
||||
ofn.hwndOwner = h;
|
||||
ofn.lpfnHook = dlg_file_hook;
|
||||
|
||||
/* This is the buffer in which to place the resulting filename. */
|
||||
@@ -212,7 +213,7 @@ dlg_file_ex(HWND hwnd, const wchar_t *filt, const wchar_t *ifn, wchar_t *fn, int
|
||||
ofn.nMaxFile = sizeof_w(temp);
|
||||
|
||||
/* Set up the "file types" filter. */
|
||||
ofn.lpstrFilter = filt;
|
||||
ofn.lpstrFilter = f;
|
||||
ofn.nFilterIndex = 1;
|
||||
ofn.lpstrFileTitle = NULL;
|
||||
ofn.nMaxFileTitle = 0;
|
||||
@@ -221,20 +222,20 @@ dlg_file_ex(HWND hwnd, const wchar_t *filt, const wchar_t *ifn, wchar_t *fn, int
|
||||
if (ifn == NULL)
|
||||
ifn = usr_path;
|
||||
ofn.lpstrInitialDir = ifn;
|
||||
wcscpy(fn, ifn);
|
||||
|
||||
/* Set up the flags for this dialog. */
|
||||
r = (save & 0x80) ? TRUE : FALSE;
|
||||
save &= 0x7f;
|
||||
r = (fl & DLG_FILE_RO) ? TRUE : FALSE;
|
||||
ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER | OFN_PATHMUSTEXIST;
|
||||
|
||||
if (! save) {
|
||||
if (! (fl & DLG_FILE_SAVE)) {
|
||||
ofn.Flags |= OFN_FILEMUSTEXIST;
|
||||
if (r == TRUE)
|
||||
ofn.Flags |= OFN_READONLY;
|
||||
}
|
||||
|
||||
/* Display the Open dialog box. */
|
||||
if (save)
|
||||
if (fl & DLG_FILE_SAVE)
|
||||
r = GetSaveFileName(&ofn);
|
||||
else
|
||||
r = GetOpenFileName(&ofn);
|
||||
@@ -249,23 +250,28 @@ dlg_file_ex(HWND hwnd, const wchar_t *filt, const wchar_t *ifn, wchar_t *fn, int
|
||||
/* Remember the file type for next time. */
|
||||
filterindex = ofn.nFilterIndex;
|
||||
|
||||
return(0);
|
||||
ret = 1;
|
||||
if (ofn.Flags & OFN_READONLY)
|
||||
ret |= DLG_FILE_RO;
|
||||
} else {
|
||||
/* If an error occurred, log this. */
|
||||
if ((err = CommDlgExtendedError()) != NO_ERROR) {
|
||||
sprintf((char *)temp,
|
||||
"%sFile(%ls, %02x):\n\n error 0x%08lx",
|
||||
(fl & DLG_FILE_SAVE)?"Save":"Open", ifn, fl, err);
|
||||
pclog("%s\n", (char *)temp);
|
||||
(void)ui_msgbox(MBX_ERROR|MBX_ANSI, (char *)temp);
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
/* If an error occurred, log this. */
|
||||
if ((err = CommDlgExtendedError()) != NO_ERROR) {
|
||||
sprintf((char *)temp,
|
||||
"OpenFile(%ls, %d):\n\n error 0x%08lx", ifn, save, err);
|
||||
pclog("%s\n", (char *)temp);
|
||||
(void)ui_msgbox(MBX_ERROR|MBX_ANSI, (char *)temp);
|
||||
}
|
||||
|
||||
return(1);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
dlg_file(const wchar_t *filt, const wchar_t *ifn, wchar_t *ofn, int save)
|
||||
dlg_file(const wchar_t *filt, const wchar_t *ifn, wchar_t *ofn, int flags)
|
||||
{
|
||||
return(dlg_file_ex(hwndMain, filt, ifn, ofn, save));
|
||||
return(dlg_file_ex(hwndMain, filt, ifn, ofn, flags));
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the New Floppy Image dialog.
|
||||
*
|
||||
* Version: @(#)win_new_floppy.c 1.0.14 2018/05/09
|
||||
* Version: @(#)win_new_floppy.c 1.0.15 2018/05/11
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -181,7 +181,7 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
return TRUE;
|
||||
|
||||
case IDC_CFILE:
|
||||
if (! dlg_file_ex(hdlg, get_string(is_zip ? IDS_2176 : IDS_2174), NULL, temp_path, 1)) {
|
||||
if (dlg_file_ex(hdlg, get_string(is_zip ? IDS_2176 : IDS_2174), NULL, temp_path, DLG_FILE_SAVE)) {
|
||||
if (! wcschr(temp_path, L'.')) {
|
||||
if (wcslen(temp_path) && (wcslen(temp_path) <= 256)) {
|
||||
twcs = &temp_path[wcslen(temp_path)];
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the Settings dialog.
|
||||
*
|
||||
* Version: @(#)win_settings_disk.h 1.0.8 2018/05/09
|
||||
* Version: @(#)win_settings_disk.h 1.0.9 2018/05/11
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -1065,7 +1065,8 @@ hd_add_ok_common:
|
||||
return TRUE;
|
||||
|
||||
case IDC_CFILE:
|
||||
if (! dlg_file_ex(hdlg, get_string(IDS_4106), NULL, temp_path, !(existing & 1))) {
|
||||
b = (existing&1)?DLG_FILE_LOAD:DLG_FILE_SAVE;
|
||||
if (dlg_file_ex(hdlg, get_string(IDS_4106), NULL, temp_path, b)) {
|
||||
if (! wcschr(temp_path, L'.')) {
|
||||
if (wcslen(temp_path) && (wcslen(temp_path) <= 256)) {
|
||||
twcs = &temp_path[wcslen(temp_path)];
|
||||
@@ -1076,7 +1077,7 @@ hd_add_ok_common:
|
||||
}
|
||||
}
|
||||
|
||||
if (!(existing & 1)) {
|
||||
if (! (existing & 1)) {
|
||||
f = _wfopen(temp_path, L"rb");
|
||||
if (f != NULL) {
|
||||
fclose(f);
|
||||
|
||||
Reference in New Issue
Block a user