Add dialog to create new magneto-optical image.

This commit is contained in:
2020-03-29 04:41:21 +01:00
parent 37780f1741
commit d9e2f8ab32
26 changed files with 48 additions and 11 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -309,6 +309,9 @@ STRTBL( IDS_3951, STR_3951 )
STRTBL( IDS_3952, STR_3952 )
STRTBL( IDS_3960, STR_3960 )
STRTBL( IDS_3970, STR_3970 )
STRTBL( IDS_3980, STR_3980 )
STRTBL( IDS_3981, STR_3981 )
STRTBL( IDS_3982, STR_3982 )
/* UI menu: Action (4000.) */
STRTBL( IDS_ACTION, STR_ACTION )
@@ -379,6 +382,13 @@ STRTBL( IDS_4088, STR_4088 )
/* UI menu: Help (4090.) */
STRTBL( IDS_HELP, STR_HELP )
STRTBL( IDS_4091, STR_4091 )
/* Status bar for magneto-optical (4100.) */
STRTBL ( IDS_4100, STR_4100 )
STRTBL ( IDS_4101, STR_4101 )
STRTBL ( IDS_4102, STR_4102 )
STRTBL ( IDS_4103, STR_4103 )
STRTBL ( IDS_4104, STR_4104 )

View File

@@ -406,5 +406,11 @@
#define STR_HELP "&Help"
#define STR_4091 "&About VARCem"
/* Status bar for magneto-optical (4100.) */
#define STR_4100 "3.5\x22 128Mb M.O. (ISO 10090)"
#define STR_4101 "3.5\x22 230Mb M.O. (ISO 13963)"
#define STR_4102 "3.5\x22 640Mb M.O. (ISO 15498)"
#define STR_4103 "3.5\x22 1.3Gb M.O. (GigaMO)"
#define STR_4104 "3.5\x22 2.3Gb M.O. (GigaMO 2)"
/* End of file. */

View File

@@ -192,7 +192,7 @@ extern void sb_menu_set_item(int part, int idm, int val);
extern void dlg_about(void);
extern void dlg_localize(void);
extern int dlg_settings(int ask);
extern void dlg_new_image(int drive, int part, int is_zip);
extern void dlg_new_image(int drive, int part, int is_zip, int is_mo);
extern void dlg_sound_gain(void);
extern int dlg_file(const wchar_t *filt, const wchar_t *ifn,
wchar_t *fn, int save);

View File

@@ -598,8 +598,15 @@
#define IDS_HELP 4090 /* "&Help" */
#define IDS_4091 4091 /* "&About VARCem" */
/* UI dialog: New Image for M.O. (4100.) */
#define IDS_4100 4100 /* "3.5\x22 128Mb M.O. (ISO 10090)" */
#define IDS_4101 4101 /* "3.5\x22 230Mb M.O. (ISO 13963)" */
#define IDS_4102 4102 /* "3.5\x22 640Mb M.O. (ISO 15498)" */
#define IDS_4103 4103 /* "3.5\x22 1.3Gb M.O. (GigaMO)" */
#define IDS_4104 4104 /* "3.5\x22 2.3Gb M.O. (GigaMO 2)" */
#define IDS_END 4100 /* end of string IDs */
#define IDS_END 4200 /* end of string IDs */
#endif /*EMU_UI_RESOURCE_H*/

View File

@@ -865,7 +865,7 @@ ui_sb_menu_command(int idm, uint8_t tag)
part = find_tag(SB_FLOPPY | drive);
if (part == -1) break;
dlg_new_image(drive, part, 0);
dlg_new_image(drive, part, 0, 0);
break;
case IDM_FLOPPY_IMAGE_EXIST:
@@ -1050,7 +1050,7 @@ ui_sb_menu_command(int idm, uint8_t tag)
part = find_tag(SB_ZIP | drive);
if (part == -1) break;
dlg_new_image(drive, part, 1);
dlg_new_image(drive, part, 1, 0);
break;
case IDM_ZIP_IMAGE_EXIST:
@@ -1081,7 +1081,7 @@ ui_sb_menu_command(int idm, uint8_t tag)
part = find_tag(SB_MO | drive);
if (part == -1) break;
dlg_new_image(drive, part, 0);
dlg_new_image(drive, part, 0, 1);
break;
case IDM_MO_IMAGE_EXIST:
@@ -1119,7 +1119,7 @@ ui_sb_menu_command(int idm, uint8_t tag)
part = find_tag(SB_DISK | drive);
if (part == -1) break;
dlg_new_image(drive, part, 1);
dlg_new_image(drive, part, 1, 0);
break;
case IDM_DISK_IMAGE_EXIST:

View File

@@ -238,7 +238,7 @@ BEGIN
PUSHBUTTON STR_BROWSE,IDC_CFILE,160,19,60,14
LTEXT STR_3276,IDT_1750,7,38,70,12,SS_CENTERIMAGE
COMBOBOX IDC_COMBO_DISK_SIZE,7,52,90,120,
COMBOBOX IDC_COMBO_DISK_SIZE,7,52,100,120,
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT STR_3277,IDT_1751,110,38,70,12,SS_CENTERIMAGE

View File

@@ -55,6 +55,7 @@
static wchar_t fd_file_name[512];
static int is_zip;
static int is_mo;
static int drive_id, sb_part;
static int file_type = 0; /* 0 = IMG, 1 = Japanese FDI, 2 = 86F */
@@ -82,12 +83,18 @@ dlg_init(HWND hdlg)
{
int i, zip_types;
HWND h;
// TODO: MO types as a list in mo.c
int mo_types = 5;
h = GetDlgItem(hdlg, IDC_COMBO_DISK_SIZE);
if (is_zip) {
zip_types = zip_drives[drive_id].is_250 ? 2 : 1;
for (i = 0; i < zip_types; i++)
SendMessage(h, CB_ADDSTRING, 0, win_string(IDS_3282 + 12 + i));
}
else if (is_mo) {
for (i = 0; i < mo_types; i++)
SendMessage(h, CB_ADDSTRING, 0, win_string(IDS_4100 + i));
} else {
for (i = 0; i < 12; i++)
SendMessage(h, CB_ADDSTRING, 0, win_string(IDS_3282 + i));
@@ -158,12 +165,16 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
} else {
if (is_zip)
ret = zip_create_image(fd_file_name, disk_size, file_type);
//else if (is_mo)
// ret = mo_create_image(fd_file_name, disk_size);
else
ret = floppy_create_image(fd_file_name, disk_size, file_type);
}
if (ret) {
if (is_zip)
ui_zip_mount(drive_id, sb_part, 0, fd_file_name);
else if (is_mo)
ui_mo_mount(drive_id, sb_part, 0, fd_file_name);
else
ui_floppy_mount(drive_id, sb_part, 0, fd_file_name);
} else {
@@ -178,12 +189,12 @@ 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_3952 : IDS_3912), NULL, temp_path, DLG_FILE_SAVE)) {
if (dlg_file_ex(hdlg, get_string(is_zip ? IDS_3952 : is_mo ? IDS_3982 : IDS_3912), 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)];
twcs[0] = L'.';
if (is_zip) {
if (is_zip || is_mo) {
twcs[1] = L'i';
twcs[2] = L'm';
twcs[3] = L'g';
@@ -221,7 +232,9 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
file_type = 1;
else
file_type = 0;
} else {
}
else if (is_mo) file_type = 0;
else {
if (((wcs_len >= 4) && !wcsicmp(ext, L".FDI")))
file_type = 1;
else if ((((wcs_len >= 4) && !wcsicmp(ext, L".86F")) || (filterindex == 3)))
@@ -263,9 +276,10 @@ break;
void
dlg_new_image(int drive, int part, int zip)
dlg_new_image(int drive, int part, int zip, int mo)
{
is_zip = zip;
is_mo = mo;
drive_id = drive;
sb_part = part;