Changed the MO icons to proper ones, added cassette icons, merged the Floppy drives and CD-ROM drives section of the Settings dialog into one, and changed the configuration file format accordingly with a backward compatibility measure added to correctly load older configuration files.

This commit is contained in:
OBattler
2020-07-19 06:07:58 +02:00
parent 6ba0d715cc
commit 5aec4ef147
22 changed files with 545 additions and 284 deletions

View File

@@ -111,6 +111,9 @@ typedef struct {
static list_t config_head; static list_t config_head;
/* TODO: Backwards compatibility, get rid of this when enough time has passed. */
static int backwards_compat = 0;
#ifdef ENABLE_CONFIG_LOG #ifdef ENABLE_CONFIG_LOG
int config_do_log = ENABLE_CONFIG_LOG; int config_do_log = ENABLE_CONFIG_LOG;
@@ -1003,6 +1006,7 @@ load_hard_disks(void)
} }
/* TODO: Backwards compatibility, get rid of this when enough time has passed. */
/* Load "Floppy Drives" section. */ /* Load "Floppy Drives" section. */
static void static void
load_floppy_drives(void) load_floppy_drives(void)
@@ -1012,6 +1016,72 @@ load_floppy_drives(void)
wchar_t *wp; wchar_t *wp;
int c; int c;
if (!backwards_compat)
return;
for (c=0; c<FDD_NUM; c++) {
sprintf(temp, "fdd_%02i_type", c+1);
p = config_get_string(cat, temp, (c < 2) ? "525_2dd" : "none");
fdd_set_type(c, fdd_get_from_internal_name(p));
if (fdd_get_type(c) > 13)
fdd_set_type(c, 13);
config_delete_var(cat, temp);
sprintf(temp, "fdd_%02i_fn", c + 1);
wp = config_get_wstring(cat, temp, L"");
config_delete_var(cat, temp);
#if 0
/*
* NOTE:
* Temporary hack to remove the absolute
* path currently saved in most config
* files. We should remove this before
* finalizing this release! --FvK
*/
if (! wcsnicmp(wp, usr_path, wcslen(usr_path))) {
/*
* Yep, its absolute and prefixed
* with the EXE path. Just strip
* that off for now...
*/
wcsncpy(floppyfns[c], &wp[wcslen(usr_path)], sizeof_w(floppyfns[c]));
} else
#endif
wcsncpy(floppyfns[c], wp, sizeof_w(floppyfns[c]));
/* if (*wp != L'\0')
config_log("Floppy%d: %ls\n", c, floppyfns[c]); */
sprintf(temp, "fdd_%02i_writeprot", c+1);
ui_writeprot[c] = !!config_get_int(cat, temp, 0);
config_delete_var(cat, temp);
sprintf(temp, "fdd_%02i_turbo", c + 1);
fdd_set_turbo(c, !!config_get_int(cat, temp, 0));
config_delete_var(cat, temp);
sprintf(temp, "fdd_%02i_check_bpb", c+1);
fdd_set_check_bpb(c, !!config_get_int(cat, temp, 1));
config_delete_var(cat, temp);
}
delete_section_if_empty(cat);
}
/* Load "Floppy and CD-ROM Drives" section. */
static void
load_floppy_and_cdrom_drives(void)
{
char *cat = "Floppy and CD-ROM drives";
char temp[512], tmp2[512], *p;
char s[512];
unsigned int board = 0, dev = 0;
wchar_t *wp;
int c, d = 0;
/* TODO: Backwards compatibility, get rid of this when enough time has passed. */
backwards_compat = (find_section(cat) == NULL);
memset(temp, 0x00, sizeof(temp));
for (c=0; c<FDD_NUM; c++) { for (c=0; c<FDD_NUM; c++) {
sprintf(temp, "fdd_%02i_type", c+1); sprintf(temp, "fdd_%02i_type", c+1);
p = config_get_string(cat, temp, (c < 2) ? "525_2dd" : "none"); p = config_get_string(cat, temp, (c < 2) ? "525_2dd" : "none");
@@ -1072,19 +1142,6 @@ load_floppy_drives(void)
config_delete_var(cat, temp); config_delete_var(cat, temp);
} }
} }
}
/* Load "Other Removable Devices" section. */
static void
load_other_removable_devices(void)
{
char *cat = "Other removable devices";
char temp[512], tmp2[512], *p;
char s[512];
unsigned int board = 0, dev = 0;
wchar_t *wp;
int c, d = 0;
memset(temp, 0x00, sizeof(temp)); memset(temp, 0x00, sizeof(temp));
for (c=0; c<CDROM_NUM; c++) { for (c=0; c<CDROM_NUM; c++) {
@@ -1179,6 +1236,102 @@ load_other_removable_devices(void)
sprintf(temp, "cdrom_%02i_iso_path", c+1); sprintf(temp, "cdrom_%02i_iso_path", c+1);
config_delete_var(cat, temp); config_delete_var(cat, temp);
} }
}
/* Load "Other Removable Devices" section. */
static void
load_other_removable_devices(void)
{
char *cat = "Other removable devices";
char temp[512], tmp2[512], *p;
char s[512];
unsigned int board = 0, dev = 0;
wchar_t *wp;
int c, d = 0;
/* TODO: Backwards compatibility, get rid of this when enough time has passed. */
if (backwards_compat) {
memset(temp, 0x00, sizeof(temp));
for (c=0; c<CDROM_NUM; c++) {
sprintf(temp, "cdrom_%02i_host_drive", c+1);
cdrom[c].host_drive = config_get_int(cat, temp, 0);
cdrom[c].prev_host_drive = cdrom[c].host_drive;
config_delete_var(cat, temp);
sprintf(temp, "cdrom_%02i_parameters", c+1);
p = config_get_string(cat, temp, NULL);
if (p != NULL)
sscanf(p, "%01u, %s", &d, s);
else
sscanf("0, none", "%01u, %s", &d, s);
cdrom[c].sound_on = d;
cdrom[c].bus_type = hdd_string_to_bus(s, 1);
config_delete_var(cat, temp);
sprintf(temp, "cdrom_%02i_speed", c+1);
cdrom[c].speed = config_get_int(cat, temp, 8);
config_delete_var(cat, temp);
/* Default values, needed for proper operation of the Settings dialog. */
cdrom[c].ide_channel = cdrom[c].scsi_device_id = c + 2;
config_delete_var(cat, temp);
sprintf(temp, "cdrom_%02i_ide_channel", c+1);
if (cdrom[c].bus_type == CDROM_BUS_ATAPI) {
sprintf(tmp2, "%01u:%01u", (c+2)>>1, (c+2)&1);
p = config_get_string(cat, temp, tmp2);
sscanf(p, "%01u:%01u", &board, &dev);
board &= 3;
dev &= 1;
cdrom[c].ide_channel = (board<<1)+dev;
if (cdrom[c].ide_channel > 7)
cdrom[c].ide_channel = 7;
} else {
sprintf(temp, "cdrom_%02i_scsi_id", c+1);
if (cdrom[c].bus_type == CDROM_BUS_SCSI) {
cdrom[c].scsi_device_id = config_get_int(cat, temp, c+2);
if (cdrom[c].scsi_device_id > 15)
cdrom[c].scsi_device_id = 15;
} else
config_delete_var(cat, temp);
}
config_delete_var(cat, temp);
sprintf(temp, "cdrom_%02i_image_path", c+1);
wp = config_get_wstring(cat, temp, L"");
config_delete_var(cat, temp);
#if 0
/*
* NOTE:
* Temporary hack to remove the absolute
* path currently saved in most config
* files. We should remove this before
* finalizing this release! --FvK
*/
if (! wcsnicmp(wp, usr_path, wcslen(usr_path))) {
/*
* Yep, its absolute and prefixed
* with the EXE path. Just strip
* that off for now...
*/
wcsncpy(cdrom[c].image_path, &wp[wcslen(usr_path)], sizeof_w(cdrom[c].image_path));
} else
#endif
wcsncpy(cdrom[c].image_path, wp, sizeof_w(cdrom[c].image_path));
if (cdrom[c].host_drive && (cdrom[c].host_drive != 200))
cdrom[c].host_drive = 0;
if ((cdrom[c].host_drive == 0x200) &&
(wcslen(cdrom[c].image_path) == 0))
cdrom[c].host_drive = 0;
}
}
backwards_compat = 0;
memset(temp, 0x00, sizeof(temp)); memset(temp, 0x00, sizeof(temp));
for (c=0; c<ZIP_NUM; c++) { for (c=0; c<ZIP_NUM; c++) {
@@ -1386,6 +1539,8 @@ config_load(void)
load_ports(); /* Ports (COM & LPT) */ load_ports(); /* Ports (COM & LPT) */
load_other_peripherals(); /* Other peripherals */ load_other_peripherals(); /* Other peripherals */
load_hard_disks(); /* Hard disks */ load_hard_disks(); /* Hard disks */
load_floppy_and_cdrom_drives(); /* Floppy and CD-ROM drives */
/* TODO: Backwards compatibility, get rid of this when enough time has passed. */
load_floppy_drives(); /* Floppy drives */ load_floppy_drives(); /* Floppy drives */
load_other_removable_devices(); /* Other removable devices */ load_other_removable_devices(); /* Other removable devices */
@@ -1872,10 +2027,10 @@ save_hard_disks(void)
/* Save "Floppy Drives" section. */ /* Save "Floppy Drives" section. */
static void static void
save_floppy_drives(void) save_floppy_and_cdrom_drives(void)
{ {
char *cat = "Floppy drives"; char *cat = "Floppy and CD-ROM drives";
char temp[512]; char temp[512], tmp2[512];
int c; int c;
for (c=0; c<FDD_NUM; c++) { for (c=0; c<FDD_NUM; c++) {
@@ -1917,18 +2072,6 @@ save_floppy_drives(void)
config_set_int(cat, temp, fdd_get_check_bpb(c)); config_set_int(cat, temp, fdd_get_check_bpb(c));
} }
delete_section_if_empty(cat);
}
/* Save "Other Removable Devices" section. */
static void
save_other_removable_devices(void)
{
char *cat = "Other removable devices";
char temp[512], tmp2[512];
int c;
for (c=0; c<CDROM_NUM; c++) { for (c=0; c<CDROM_NUM; c++) {
sprintf(temp, "cdrom_%02i_host_drive", c+1); sprintf(temp, "cdrom_%02i_host_drive", c+1);
if ((cdrom[c].bus_type == 0) || (cdrom[c].host_drive != 200)) { if ((cdrom[c].bus_type == 0) || (cdrom[c].host_drive != 200)) {
@@ -1978,6 +2121,18 @@ save_other_removable_devices(void)
} }
} }
delete_section_if_empty(cat);
}
/* Save "Other Removable Devices" section. */
static void
save_other_removable_devices(void)
{
char *cat = "Other removable devices";
char temp[512], tmp2[512];
int c;
for (c=0; c<ZIP_NUM; c++) { for (c=0; c<ZIP_NUM; c++) {
sprintf(temp, "zip_%02i_parameters", c+1); sprintf(temp, "zip_%02i_parameters", c+1);
if (zip_drives[c].bus_type == 0) { if (zip_drives[c].bus_type == 0) {
@@ -2064,7 +2219,7 @@ config_save(void)
save_ports(); /* Ports (COM & LPT) */ save_ports(); /* Ports (COM & LPT) */
save_other_peripherals(); /* Other peripherals */ save_other_peripherals(); /* Other peripherals */
save_hard_disks(); /* Hard disks */ save_hard_disks(); /* Hard disks */
save_floppy_drives(); /* Floppy drives */ save_floppy_and_cdrom_drives(); /* Floppy and CD-ROM drives */
save_other_removable_devices(); /* Other removable devices */ save_other_removable_devices(); /* Other removable devices */
config_write(cfg_path); config_write(cfg_path);

View File

@@ -46,7 +46,7 @@
#define IDS_2070 2070 // "Ports (COM & LPT)" #define IDS_2070 2070 // "Ports (COM & LPT)"
#define IDS_2071 2071 // "Other peripherals" #define IDS_2071 2071 // "Other peripherals"
#define IDS_2072 2072 // "Hard disks" #define IDS_2072 2072 // "Hard disks"
#define IDS_2073 2073 // "Floppy drives" #define IDS_2073 2073 // "Floppy and CD-ROM drives"
#define IDS_2074 2074 // "Other removable devices" #define IDS_2074 2074 // "Other removable devices"
#define IDS_2075 2075 // "CD-ROM images (*.ISO;*.CU.." #define IDS_2075 2075 // "CD-ROM images (*.ISO;*.CU.."
#define IDS_2076 2076 // "Surface-based images (*.8.." #define IDS_2076 2076 // "Surface-based images (*.8.."
@@ -112,7 +112,6 @@
#define IDS_2136 2136 // "Don't Exit" #define IDS_2136 2136 // "Don't Exit"
#define IDS_2137 2137 // "Reset" #define IDS_2137 2137 // "Reset"
#define IDS_2138 2138 // "Don't Reset" #define IDS_2138 2138 // "Don't Reset"
#define IDS_2139 2139 // "CD-ROM drives"
#define IDS_4096 4096 // "Hard disk (%s)" #define IDS_4096 4096 // "Hard disk (%s)"
#define IDS_4097 4097 // "%01i:%01i" #define IDS_4097 4097 // "%01i:%01i"
@@ -189,6 +188,16 @@
#define IDS_5899 5899 // "2.88 MB" #define IDS_5899 5899 // "2.88 MB"
#define IDS_5900 5900 // "ZIP 100" #define IDS_5900 5900 // "ZIP 100"
#define IDS_5901 5901 // "ZIP 250" #define IDS_5901 5901 // "ZIP 250"
#define IDS_5902 5902 // "3.5\" 128Mb M.O. (ISO 10090)"
#define IDS_5903 5903 // "3.5\" 230Mb M.O. (ISO 13963)"
#define IDS_5904 5904 // "3.5\" 540Mb M.O. (ISO 15498)"
#define IDS_5905 5905 // "3.5\" 640Mb M.O. (ISO 15498)"
#define IDS_5906 5906 // "3.5\" 1.3Gb M.O. (GigaMO)"
#define IDS_5907 5907 // "3.5\" 2.3Gb M.O. (GigaMO 2)"
#define IDS_5908 5908 // "5.25\" 600Mb M.O."
#define IDS_5909 5909 // "5.25\" 650Mb M.O."
#define IDS_5910 5910 // "5.25\" 1Gb M.O."
#define IDS_5911 5911 // "5.25\" 1.3Gb M.O."
#define IDS_6144 6144 // "Perfect RPM" #define IDS_6144 6144 // "Perfect RPM"
#define IDS_6145 6145 // "1%% below perfect RPM" #define IDS_6145 6145 // "1%% below perfect RPM"
@@ -199,7 +208,7 @@
#define IDS_LANG_ENUS IDS_7168 #define IDS_LANG_ENUS IDS_7168
#define STR_NUM_2048 92 #define STR_NUM_2048 91
#define STR_NUM_3072 11 #define STR_NUM_3072 11
#define STR_NUM_4096 18 #define STR_NUM_4096 18
#define STR_NUM_4352 7 #define STR_NUM_4352 7
@@ -207,7 +216,7 @@
#define STR_NUM_5120 1 #define STR_NUM_5120 1
#define STR_NUM_5376 7 #define STR_NUM_5376 7
#define STR_NUM_5632 7 #define STR_NUM_5632 7
#define STR_NUM_5888 14 #define STR_NUM_5888 24
#define STR_NUM_6144 4 #define STR_NUM_6144 4
#define STR_NUM_7168 1 #define STR_NUM_7168 1

View File

@@ -104,17 +104,16 @@ typedef struct {
media status. */ media status. */
pad, pad0; pad, pad0;
uint32_t medium_size,
base;
uint16_t sector_size;
uint8_t type;
void *priv;
FILE *f; FILE *f;
void *priv;
wchar_t image_path[1024], wchar_t image_path[1024],
prev_image_path[1024]; prev_image_path[1024];
uint32_t type, medium_size,
base;
uint16_t sector_size;
} mo_drive_t; } mo_drive_t;
typedef struct { typedef struct {
@@ -135,9 +134,9 @@ typedef struct {
uint16_t request_length, max_transfer_len; uint16_t request_length, max_transfer_len;
int requested_blocks, packet_status, int requested_blocks, packet_status,
total_length, do_page_save, total_length, do_page_save,
unit_attention, request_pos, unit_attention, request_pos,
old_len, pad3; old_len, pad3;
uint32_t sector_pos, sector_len, uint32_t sector_pos, sector_len,
packet_len, pos; packet_len, pos;

View File

@@ -38,9 +38,8 @@
#define DLG_CFG_PERIPHERALS 117 /* sub-dialog of config */ #define DLG_CFG_PERIPHERALS 117 /* sub-dialog of config */
#define DLG_CFG_HARD_DISKS 118 /* sub-dialog of config */ #define DLG_CFG_HARD_DISKS 118 /* sub-dialog of config */
#define DLG_CFG_HARD_DISKS_ADD 119 /* sub-dialog of config */ #define DLG_CFG_HARD_DISKS_ADD 119 /* sub-dialog of config */
#define DLG_CFG_FLOPPY_DRIVES 120 /* sub-dialog of config */ #define DLG_CFG_FLOPPY_AND_CDROM_DRIVES 120 /* sub-dialog of config */
#define DLG_CFG_CDROM_DRIVES 121 /* sub-dialog of config */ #define DLG_CFG_OTHER_REMOVABLE_DEVICES 121 /* sub-dialog of config */
#define DLG_CFG_OTHER_REMOVABLE_DEVICES 122 /* sub-dialog of config */
/* Static text label IDs. */ /* Static text label IDs. */
#define IDT_1700 1700 /* Language: */ #define IDT_1700 1700 /* Language: */
@@ -101,11 +100,11 @@
#define IDT_1766 1766 /* Board #4: */ #define IDT_1766 1766 /* Board #4: */
#define IDT_1767 1767 /* ISA RTC: */ #define IDT_1767 1767 /* ISA RTC: */
#define IDT_1768 1768 /* Ext FD Controller: */ #define IDT_1768 1768 /* Ext FD Controller: */
#define IDT_1769 1769 /* MO drives: */ #define IDT_1769 1769 /* MO drives: */
#define IDT_1770 1770 /* Bus: */ #define IDT_1770 1770 /* Bus: */
#define IDT_1771 1771 /* ID: */ #define IDT_1771 1771 /* ID: */
#define IDT_1772 1772 /* Channel */ #define IDT_1772 1772 /* Channel */
#define IDT_1773 1773 /* Type: */ #define IDT_1773 1773 /* Type: */
/* /*
@@ -201,7 +200,7 @@
#define IDC_CONFIGURE_ISAMEM_3 1147 #define IDC_CONFIGURE_ISAMEM_3 1147
#define IDC_CONFIGURE_ISAMEM_4 1148 #define IDC_CONFIGURE_ISAMEM_4 1148
#define IDC_HARD_DISKS 1150 /* hard disk config */ #define IDC_HARD_DISKS 1150 /* hard disks config */
#define IDC_LIST_HARD_DISKS 1151 #define IDC_LIST_HARD_DISKS 1151
#define IDC_BUTTON_HDD_ADD_NEW 1152 #define IDC_BUTTON_HDD_ADD_NEW 1152
#define IDC_BUTTON_HDD_ADD 1153 #define IDC_BUTTON_HDD_ADD 1153
@@ -220,7 +219,7 @@
#define IDC_COMBO_HD_TYPE 1165 #define IDC_COMBO_HD_TYPE 1165
#define IDC_PBAR_IMG_CREATE 1166 #define IDC_PBAR_IMG_CREATE 1166
#define IDC_REMOV_DEVICES 1170 /* removable dev config */ #define IDC_REMOV_DEVICES 1170 /* floppy and cd-rom drives config */
#define IDC_LIST_FLOPPY_DRIVES 1171 #define IDC_LIST_FLOPPY_DRIVES 1171
#define IDC_COMBO_FD_TYPE 1172 #define IDC_COMBO_FD_TYPE 1172
#define IDC_CHECKTURBO 1173 #define IDC_CHECKTURBO 1173
@@ -230,7 +229,8 @@
#define IDC_COMBO_CD_ID 1177 #define IDC_COMBO_CD_ID 1177
#define IDC_COMBO_CD_LUN 1178 #define IDC_COMBO_CD_LUN 1178
#define IDC_COMBO_CD_CHANNEL_IDE 1179 #define IDC_COMBO_CD_CHANNEL_IDE 1179
#define IDC_LIST_ZIP_DRIVES 1180
#define IDC_LIST_ZIP_DRIVES 1180 /* other removable devices config */
#define IDC_COMBO_ZIP_BUS 1181 #define IDC_COMBO_ZIP_BUS 1181
#define IDC_COMBO_ZIP_ID 1182 #define IDC_COMBO_ZIP_ID 1182
#define IDC_COMBO_ZIP_LUN 1183 #define IDC_COMBO_ZIP_LUN 1183
@@ -240,11 +240,11 @@
#define IDC_LIST_MO_DRIVES 1187 #define IDC_LIST_MO_DRIVES 1187
#define IDC_COMBO_MO_BUS 1188 #define IDC_COMBO_MO_BUS 1188
#define IDC_COMBO_MO_ID 1189 #define IDC_COMBO_MO_ID 1189
#define IDC_COMBO_MO_LUN 1191 #define IDC_COMBO_MO_LUN 1190
#define IDC_COMBO_MO_CHANNEL_IDE 1192 #define IDC_COMBO_MO_CHANNEL_IDE 1191
#define IDC_COMBO_MO_TYPE 1193 #define IDC_COMBO_MO_TYPE 1192
#define IDC_SLIDER_GAIN 1190 /* sound gain dialog */ #define IDC_SLIDER_GAIN 1193 /* sound gain dialog */
#define IDC_EDIT_FILE_NAME 1200 /* new floppy image dialog */ #define IDC_EDIT_FILE_NAME 1200 /* new floppy image dialog */
#define IDC_COMBO_DISK_SIZE 1201 #define IDC_COMBO_DISK_SIZE 1201

View File

@@ -163,9 +163,8 @@ extern void NewFloppyDialogCreate(HWND hwnd, int id, int part);
#define SETTINGS_PAGE_PORTS 5 #define SETTINGS_PAGE_PORTS 5
#define SETTINGS_PAGE_PERIPHERALS 6 #define SETTINGS_PAGE_PERIPHERALS 6
#define SETTINGS_PAGE_HARD_DISKS 7 #define SETTINGS_PAGE_HARD_DISKS 7
#define SETTINGS_PAGE_FLOPPY_DRIVES 8 #define SETTINGS_PAGE_FLOPPY_AND_CDROM_DRIVES 8
#define SETTINGS_PAGE_CDROM_DRIVES 9 #define SETTINGS_PAGE_OTHER_REMOVABLE_DEVICES 9
#define SETTINGS_PAGE_OTHER_REMOVABLE_DEVICES 10
extern void win_settings_open(HWND hwnd); extern void win_settings_open(HWND hwnd);
extern void win_settings_open_ex(HWND hwnd, int category); extern void win_settings_open_ex(HWND hwnd, int category);

View File

@@ -315,20 +315,20 @@ BEGIN
WS_BORDER,53,45,166,14 WS_BORDER,53,45,166,14
END END
DLG_CONFIG DIALOG DISCARDABLE 0, 0, 366, 251 DLG_CONFIG DIALOG DISCARDABLE 0, 0, 366, 256
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "86Box Settings" CAPTION "86Box Settings"
FONT 9, "Segoe UI" FONT 9, "Segoe UI"
BEGIN BEGIN
DEFPUSHBUTTON "OK",IDOK,246,230,50,14 DEFPUSHBUTTON "OK",IDOK,246,235,50,14
PUSHBUTTON "Cancel",IDCANCEL,307,230,50,14 PUSHBUTTON "Cancel",IDCANCEL,307,235,50,14
CONTROL "List2",IDC_SETTINGSCATLIST,"SysListView32",LVS_LIST | CONTROL "List2",IDC_SETTINGSCATLIST,"SysListView32",LVS_LIST |
LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,7,7,90,207 LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,7,7,90,212
CONTROL "",-1,"Static",SS_BLACKFRAME | SS_SUNKEN,1,221,363,1 CONTROL "",-1,"Static",SS_BLACKFRAME | SS_SUNKEN,1,226,363,1
/* Leave this commented out until we get into localization. */ /* Leave this commented out until we get into localization. */
#if 0 #if 0
LTEXT "Language:",IDT_1700,7,232,41,10 LTEXT "Language:",IDT_1700,7,237,41,10
COMBOBOX IDC_COMBO_LANG,48,231,108,120,CBS_DROPDOWN | WS_VSCROLL | COMBOBOX IDC_COMBO_LANG,48,236,108,120,CBS_DROPDOWN | WS_VSCROLL |
WS_TABSTOP WS_TABSTOP
#endif #endif
END END
@@ -594,7 +594,7 @@ BEGIN
LTEXT "Size (MB):",IDT_1729,7,54,33,8 LTEXT "Size (MB):",IDT_1729,7,54,33,8
LTEXT "Type:",IDT_1730,86,54,24,8 LTEXT "Type:",IDT_1730,86,54,24,8
LTEXT "File name:",IDT_1731,7,7,204,9 LTEXT "File name:",IDT_1731,7,7,204,9
COMBOBOX IDC_COMBO_HD_BUS,33,71,58,12,CBS_DROPDOWNLIST | COMBOBOX IDC_COMBO_HD_BUS,33,71,58,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP WS_VSCROLL | WS_TABSTOP
LTEXT "Bus:",IDT_1721,7,73,24,8 LTEXT "Bus:",IDT_1721,7,73,24,8
COMBOBOX IDC_COMBO_HD_CHANNEL,134,71,77,12,CBS_DROPDOWNLIST | COMBOBOX IDC_COMBO_HD_CHANNEL,134,71,77,12,CBS_DROPDOWNLIST |
@@ -610,7 +610,7 @@ BEGIN
WS_BORDER,7,16,204,12 WS_BORDER,7,16,204,12
END END
DLG_CFG_FLOPPY_DRIVES DIALOG DISCARDABLE 97, 0, 267, 103 DLG_CFG_FLOPPY_AND_CDROM_DRIVES DIALOG DISCARDABLE 97, 0, 267, 222
STYLE DS_CONTROL | WS_CHILD STYLE DS_CONTROL | WS_CHILD
FONT 9, "Segoe UI" FONT 9, "Segoe UI"
BEGIN BEGIN
@@ -625,38 +625,33 @@ BEGIN
BS_AUTOCHECKBOX | WS_TABSTOP,131,86,64,10 BS_AUTOCHECKBOX | WS_TABSTOP,131,86,64,10
CONTROL "Check BPB",IDC_CHECKBPB,"Button", CONTROL "Check BPB",IDC_CHECKBPB,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,196,86,64,10 BS_AUTOCHECKBOX | WS_TABSTOP,196,86,64,10
END
DLG_CFG_CDROM_DRIVES DIALOG DISCARDABLE 97, 0, 267, 150
STYLE DS_CONTROL | WS_CHILD
FONT 9, "Segoe UI"
BEGIN
CONTROL "List1",IDC_LIST_CDROM_DRIVES,"SysListView32",LVS_REPORT | CONTROL "List1",IDC_LIST_CDROM_DRIVES,"SysListView32",LVS_REPORT |
LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER |
WS_TABSTOP,7,18,253,60 WS_TABSTOP,7,117,253,60
LTEXT "CD-ROM drives:",IDT_1739,7,7,50,8 LTEXT "CD-ROM drives:",IDT_1739,7,107,50,8
COMBOBOX IDC_COMBO_CD_BUS,33,85,90,12,CBS_DROPDOWNLIST | COMBOBOX IDC_COMBO_CD_BUS,33,185,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP WS_VSCROLL | WS_TABSTOP
LTEXT "Bus:",IDT_1740,7,87,24,8 LTEXT "Bus:",IDT_1740,7,187,24,8
COMBOBOX IDC_COMBO_CD_ID,170,85,90,12,CBS_DROPDOWNLIST | COMBOBOX IDC_COMBO_CD_ID,170,185,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP WS_VSCROLL | WS_TABSTOP
LTEXT "ID:",IDT_1741,131,87,38,8 LTEXT "ID:",IDT_1741,131,187,38,8
COMBOBOX IDC_COMBO_CD_CHANNEL_IDE,170,85,90,12,CBS_DROPDOWNLIST | COMBOBOX IDC_COMBO_CD_CHANNEL_IDE,170,185,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP WS_VSCROLL | WS_TABSTOP
LTEXT "Channel:",IDT_1742,131,87,38,8 LTEXT "Channel:",IDT_1742,131,187,38,8
COMBOBOX IDC_COMBO_CD_SPEED,33,105,90,12,CBS_DROPDOWNLIST | COMBOBOX IDC_COMBO_CD_SPEED,33,205,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP WS_VSCROLL | WS_TABSTOP
LTEXT "Speed:",IDT_1758,7,107,24,8 LTEXT "Speed:",IDT_1758,7,207,24,8
END END
DLG_CFG_OTHER_REMOVABLE_DEVICES DIALOG DISCARDABLE 97, 0, 267, 221 DLG_CFG_OTHER_REMOVABLE_DEVICES DIALOG DISCARDABLE 97, 0, 267, 222
STYLE DS_CONTROL | WS_CHILD STYLE DS_CONTROL | WS_CHILD
FONT 9, "Segoe UI" FONT 9, "Segoe UI"
BEGIN BEGIN
CONTROL "List1",IDC_LIST_MO_DRIVES,"SysListView32",LVS_REPORT | CONTROL "List1",IDC_LIST_MO_DRIVES,"SysListView32",LVS_REPORT |
LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER |
WS_TABSTOP,7,18,253,60 WS_TABSTOP,7,17,253,60
LTEXT "MO drives:",IDT_1769,7,7,50,8 LTEXT "MO drives:",IDT_1769,7,7,50,8
COMBOBOX IDC_COMBO_MO_BUS,33,85,90,12,CBS_DROPDOWNLIST | COMBOBOX IDC_COMBO_MO_BUS,33,85,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP WS_VSCROLL | WS_TABSTOP
@@ -675,17 +670,17 @@ BEGIN
LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER |
WS_TABSTOP,7,137,253,60 WS_TABSTOP,7,137,253,60
LTEXT "ZIP drives:",IDT_1759,7,127,50,8 LTEXT "ZIP drives:",IDT_1759,7,127,50,8
COMBOBOX IDC_COMBO_ZIP_BUS,23,204,90,12,CBS_DROPDOWNLIST | COMBOBOX IDC_COMBO_ZIP_BUS,23,205,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP WS_VSCROLL | WS_TABSTOP
LTEXT "Bus:",IDT_1753,7,206,14,8 LTEXT "Bus:",IDT_1753,7,207,14,8
COMBOBOX IDC_COMBO_ZIP_ID,149,204,61,12,CBS_DROPDOWNLIST | COMBOBOX IDC_COMBO_ZIP_ID,149,205,61,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP WS_VSCROLL | WS_TABSTOP
LTEXT "ID:",IDT_1754,120,206,28,8 LTEXT "ID:",IDT_1754,120,207,28,8
COMBOBOX IDC_COMBO_ZIP_CHANNEL_IDE,149,204,61,12,CBS_DROPDOWNLIST | COMBOBOX IDC_COMBO_ZIP_CHANNEL_IDE,149,205,61,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP WS_VSCROLL | WS_TABSTOP
LTEXT "Channel:",IDT_1755,120,206,28,8 LTEXT "Channel:",IDT_1755,120,207,28,8
CONTROL "ZIP 250",IDC_CHECK250,"Button", CONTROL "ZIP 250",IDC_CHECK250,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,218,204,44,10 BS_AUTOCHECKBOX | WS_TABSTOP,218,205,44,10
END END
@@ -720,10 +715,12 @@ END
49 ICON DISCARDABLE "win/icons/zip_active.ico" 49 ICON DISCARDABLE "win/icons/zip_active.ico"
56 ICON DISCARDABLE "win/icons/mo.ico" 56 ICON DISCARDABLE "win/icons/mo.ico"
57 ICON DISCARDABLE "win/icons/mo_active.ico" 57 ICON DISCARDABLE "win/icons/mo_active.ico"
64 ICON DISCARDABLE "win/icons/hard_disk.ico" 64 ICON DISCARDABLE "win/icons/cassette.ico"
65 ICON DISCARDABLE "win/icons/hard_disk_active.ico" 65 ICON DISCARDABLE "win/icons/cassette_active.ico"
80 ICON DISCARDABLE "win/icons/network.ico" 80 ICON DISCARDABLE "win/icons/hard_disk.ico"
81 ICON DISCARDABLE "win/icons/network_active.ico" 81 ICON DISCARDABLE "win/icons/hard_disk_active.ico"
96 ICON DISCARDABLE "win/icons/network.ico"
97 ICON DISCARDABLE "win/icons/network_active.ico"
144 ICON DISCARDABLE "win/icons/floppy_525_empty.ico" 144 ICON DISCARDABLE "win/icons/floppy_525_empty.ico"
145 ICON DISCARDABLE "win/icons/floppy_525_empty_active.ico" 145 ICON DISCARDABLE "win/icons/floppy_525_empty_active.ico"
152 ICON DISCARDABLE "win/icons/floppy_35_empty.ico" 152 ICON DISCARDABLE "win/icons/floppy_35_empty.ico"
@@ -734,13 +731,15 @@ END
177 ICON DISCARDABLE "win/icons/zip_empty_active.ico" 177 ICON DISCARDABLE "win/icons/zip_empty_active.ico"
184 ICON DISCARDABLE "win/icons/mo_empty.ico" 184 ICON DISCARDABLE "win/icons/mo_empty.ico"
185 ICON DISCARDABLE "win/icons/mo_empty_active.ico" 185 ICON DISCARDABLE "win/icons/mo_empty_active.ico"
192 ICON DISCARDABLE "win/icons/cassette_empty.ico"
193 ICON DISCARDABLE "win/icons/cassette_empty_active.ico"
240 ICON DISCARDABLE "win/icons/machine.ico" 240 ICON DISCARDABLE "win/icons/machine.ico"
241 ICON DISCARDABLE "win/icons/display.ico" 241 ICON DISCARDABLE "win/icons/display.ico"
242 ICON DISCARDABLE "win/icons/input_devices.ico" 242 ICON DISCARDABLE "win/icons/input_devices.ico"
243 ICON DISCARDABLE "win/icons/sound.ico" 243 ICON DISCARDABLE "win/icons/sound.ico"
244 ICON DISCARDABLE "win/icons/ports.ico" 244 ICON DISCARDABLE "win/icons/ports.ico"
245 ICON DISCARDABLE "win/icons/other_peripherals.ico" 245 ICON DISCARDABLE "win/icons/other_peripherals.ico"
246 ICON DISCARDABLE "win/icons/floppy_drives.ico" 246 ICON DISCARDABLE "win/icons/floppy_and_cdrom_drives.ico"
247 ICON DISCARDABLE "win/icons/other_removable_devices.ico" 247 ICON DISCARDABLE "win/icons/other_removable_devices.ico"
248 ICON DISCARDABLE "win/icons/floppy_disabled.ico" 248 ICON DISCARDABLE "win/icons/floppy_disabled.ico"
249 ICON DISCARDABLE "win/icons/cdrom_disabled.ico" 249 ICON DISCARDABLE "win/icons/cdrom_disabled.ico"
@@ -933,7 +932,7 @@ BEGIN
IDS_2070 "Ports (COM & LPT)" IDS_2070 "Ports (COM & LPT)"
IDS_2071 "Other peripherals" IDS_2071 "Other peripherals"
IDS_2072 "Hard disks" IDS_2072 "Hard disks"
IDS_2073 "Floppy drives" IDS_2073 "Floppy & CD-ROM drives"
IDS_2074 "Other removable devices" IDS_2074 "Other removable devices"
IDS_2075 "CD-ROM images (*.ISO;*.CUE)\0*.ISO;*.CUE\0All files (*.*)\0*.*\0" IDS_2075 "CD-ROM images (*.ISO;*.CUE)\0*.ISO;*.CUE\0All files (*.*)\0*.*\0"
IDS_2076 "Surface images (*.86F)\0*.86F\0" IDS_2076 "Surface images (*.86F)\0*.86F\0"
@@ -1023,7 +1022,6 @@ BEGIN
IDS_2136 "Don't Exit" IDS_2136 "Don't Exit"
IDS_2137 "Reset" IDS_2137 "Reset"
IDS_2138 "Don't Reset" IDS_2138 "Don't Reset"
IDS_2139 "CD-ROM drives"
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
@@ -1093,6 +1091,16 @@ BEGIN
IDS_5899 "2.88 MB" IDS_5899 "2.88 MB"
IDS_5900 "ZIP 100" IDS_5900 "ZIP 100"
IDS_5901 "ZIP 250" IDS_5901 "ZIP 250"
IDS_5902 "3.5"" 128Mb M.O. (ISO 10090)"
IDS_5903 "3.5"" 230Mb M.O. (ISO 13963)"
IDS_5904 "3.5"" 540Mb M.O. (ISO 15498)"
IDS_5905 "3.5"" 640Mb M.O. (ISO 15498)"
IDS_5906 "3.5"" 1.3Gb M.O. (GigaMO)"
IDS_5907 "3.5"" 2.3Gb M.O. (GigaMO 2)"
IDS_5908 "5.25"" 600Mb M.O."
IDS_5909 "5.25"" 650Mb M.O."
IDS_5910 "5.25"" 1Gb M.O."
IDS_5911 "5.25"" 1.3Gb M.O."
IDS_6144 "Perfect RPM" IDS_6144 "Perfect RPM"
IDS_6145 "1%% below perfect RPM" IDS_6145 "1%% below perfect RPM"

BIN
src/win/icons/cassette.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -477,7 +477,7 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
break; break;
case IDM_MO_IMAGE_NEW: case IDM_MO_IMAGE_NEW:
NewFloppyDialogCreate(hwnd, id | 0x80, 0); /* NewZIPDialogCreate */ NewFloppyDialogCreate(hwnd, id | 0x100, 0); /* NewZIPDialogCreate */
break; break;
case IDM_MO_IMAGE_EXISTING_WP: case IDM_MO_IMAGE_EXISTING_WP:

View File

@@ -30,6 +30,7 @@
#include <86box/random.h> #include <86box/random.h>
#include <86box/ui.h> #include <86box/ui.h>
#include <86box/scsi_device.h> #include <86box/scsi_device.h>
#include <86box/mo.h>
#include <86box/zip.h> #include <86box/zip.h>
#include <86box/win.h> #include <86box/win.h>
@@ -173,6 +174,7 @@ create_86f(WCHAR *file_name, disk_size_t disk_size, uint8_t rpm_mode)
static int is_zip; static int is_zip;
static int is_mo;
static int static int
@@ -204,7 +206,7 @@ create_sector_image(WCHAR *file_name, disk_size_t disk_size, uint8_t is_fdi)
fat2_offs = fat1_offs + fat_size; fat2_offs = fat1_offs + fat_size;
zero_bytes = fat2_offs + fat_size + root_dir_bytes; zero_bytes = fat2_offs + fat_size + root_dir_bytes;
if (!is_zip && is_fdi) { if (!is_zip && !is_mo && is_fdi) {
empty = (unsigned char *) malloc(base); empty = (unsigned char *) malloc(base);
memset(empty, 0, base); memset(empty, 0, base);
@@ -222,7 +224,7 @@ create_sector_image(WCHAR *file_name, disk_size_t disk_size, uint8_t is_fdi)
empty = (unsigned char *) malloc(total_size); empty = (unsigned char *) malloc(total_size);
memset(empty, 0x00, zero_bytes); memset(empty, 0x00, zero_bytes);
if (!is_zip) { if (!is_zip && !is_mo) {
memset(empty + zero_bytes, 0xF6, total_size - zero_bytes); memset(empty + zero_bytes, 0xF6, total_size - zero_bytes);
empty[0x00] = 0xEB; /* Jump to make MS-DOS happy. */ empty[0x00] = 0xEB; /* Jump to make MS-DOS happy. */
@@ -352,10 +354,21 @@ create_zip_sector_image(WCHAR *file_name, disk_size_t disk_size, uint8_t is_zdi,
fwrite(empty, 1, 2048, f); fwrite(empty, 1, 2048, f);
SendMessage(h, PBM_SETPOS, (WPARAM) 1, (LPARAM) 0); SendMessage(h, PBM_SETPOS, (WPARAM) 1, (LPARAM) 0);
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE | PM_NOYIELD)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
fwrite(&empty[0x0800], 1, 2048, f); fwrite(&empty[0x0800], 1, 2048, f);
free(empty); free(empty);
SendMessage(h, PBM_SETPOS, (WPARAM) 2, (LPARAM) 0); SendMessage(h, PBM_SETPOS, (WPARAM) 2, (LPARAM) 0);
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE | PM_NOYIELD)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
pbar_max -= 2; pbar_max -= 2;
} }
@@ -507,6 +520,106 @@ create_zip_sector_image(WCHAR *file_name, disk_size_t disk_size, uint8_t is_zdi,
} }
static int
create_mo_sector_image(WCHAR *file_name, int8_t disk_size, uint8_t is_mdi, HWND hwnd)
{
HWND h;
FILE *f;
const mo_type_t *dp = &mo_types[disk_size];
uint8_t *empty;
uint32_t total_size = 0;
uint32_t total_sectors = 0;
uint32_t sector_bytes = 0;
uint16_t base = 0x1000;
uint32_t pbar_max = 0;
uint32_t i;
MSG msg;
f = plat_fopen(file_name, L"wb");
if (!f)
return 0;
sector_bytes = dp->bytes_per_sector;
total_sectors = dp->sectors;
total_size = total_sectors * sector_bytes;
pbar_max = dp->sectors >> 11;
if (is_mdi)
pbar_max += base;
pbar_max >>= 11;
pbar_max--;
h = GetDlgItem(hwnd, IDC_COMBO_RPM_MODE);
EnableWindow(h, FALSE);
ShowWindow(h, SW_HIDE);
h = GetDlgItem(hwnd, IDT_1751);
EnableWindow(h, FALSE);
ShowWindow(h, SW_HIDE);
h = GetDlgItem(hwnd, IDC_PBAR_IMG_CREATE);
SendMessage(h, PBM_SETRANGE32, (WPARAM) 0, (LPARAM) pbar_max);
SendMessage(h, PBM_SETPOS, (WPARAM) 0, (LPARAM) 0);
EnableWindow(h, TRUE);
ShowWindow(h, SW_SHOW);
h = GetDlgItem(hwnd, IDT_1757);
EnableWindow(h, TRUE);
ShowWindow(h, SW_SHOW);
h = GetDlgItem(hwnd, IDC_PBAR_IMG_CREATE);
pbar_max++;
if (is_mdi) {
empty = (unsigned char *) malloc(base);
memset(empty, 0, base);
*(uint32_t *) &(empty[0x08]) = (uint32_t) base;
*(uint32_t *) &(empty[0x0C]) = total_size;
*(uint16_t *) &(empty[0x10]) = (uint16_t) sector_bytes;
*(uint8_t *) &(empty[0x14]) = (uint8_t) 25;
*(uint8_t *) &(empty[0x18]) = (uint8_t) 64;
*(uint8_t *) &(empty[0x1C]) = (uint8_t) (dp->sectors / 64) / 25;
fwrite(empty, 1, 2048, f);
SendMessage(h, PBM_SETPOS, (WPARAM) 1, (LPARAM) 0);
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE | PM_NOYIELD)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
fwrite(&empty[0x0800], 1, 2048, f);
free(empty);
SendMessage(h, PBM_SETPOS, (WPARAM) 2, (LPARAM) 0);
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE | PM_NOYIELD)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
pbar_max -= 2;
}
empty = (unsigned char *) malloc(total_size);
memset(empty, 0x00, total_size);
for (i = 0; i < pbar_max; i++) {
fwrite(&empty[i << 11], 1, 2048, f);
SendMessage(h, PBM_SETPOS, (WPARAM) i + 2, (LPARAM) 0);
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE | PM_NOYIELD)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
free(empty);
fclose(f);
return 1;
}
static int fdd_id, sb_part; static int fdd_id, sb_part;
static int file_type = 0; /* 0 = IMG, 1 = Japanese FDI, 2 = 86F */ static int file_type = 0; /* 0 = IMG, 1 = Japanese FDI, 2 = 86F */
@@ -562,7 +675,7 @@ NewFloppyDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
uint8_t disk_size, rpm_mode; uint8_t disk_size, rpm_mode;
int ret; int ret;
FILE *f; FILE *f;
int zip_types; int zip_types, mo_types;
wchar_t *twcs; wchar_t *twcs;
switch (message) { switch (message) {
@@ -574,6 +687,11 @@ NewFloppyDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
zip_types = zip_drives[fdd_id].is_250 ? 2 : 1; zip_types = zip_drives[fdd_id].is_250 ? 2 : 1;
for (i = 0; i < zip_types; i++) for (i = 0; i < zip_types; i++)
SendMessage(h, CB_ADDSTRING, 0, win_get_string(IDS_5900 + i)); SendMessage(h, CB_ADDSTRING, 0, win_get_string(IDS_5900 + i));
} else if (is_mo) {
mo_types = 10;
/* TODO: Proper string ID's. */
for (i = 0; i < mo_types; i++)
SendMessage(h, CB_ADDSTRING, 0, win_get_string(IDS_5902 + i));
} else { } else {
for (i = 0; i < 12; i++) for (i = 0; i < 12; i++)
SendMessage(h, CB_ADDSTRING, 0, win_get_string(IDS_5888 + i)); SendMessage(h, CB_ADDSTRING, 0, win_get_string(IDS_5888 + i));
@@ -606,22 +724,24 @@ NewFloppyDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
disk_size = SendMessage(h, CB_GETCURSEL, 0, 0); disk_size = SendMessage(h, CB_GETCURSEL, 0, 0);
if (is_zip) if (is_zip)
disk_size += 12; disk_size += 12;
if (file_type == 2) { if (!is_zip && !is_mo && (file_type == 2)) {
h = GetDlgItem(hdlg, IDC_COMBO_RPM_MODE); h = GetDlgItem(hdlg, IDC_COMBO_RPM_MODE);
rpm_mode = SendMessage(h, CB_GETCURSEL, 0, 0); rpm_mode = SendMessage(h, CB_GETCURSEL, 0, 0);
ret = create_86f(fd_file_name, disk_sizes[disk_size], rpm_mode); ret = create_86f(fd_file_name, disk_sizes[disk_size], rpm_mode);
} else { } else {
if (is_zip) if (is_zip)
ret = create_zip_sector_image(fd_file_name, disk_sizes[disk_size], file_type, hdlg); ret = create_zip_sector_image(fd_file_name, disk_sizes[disk_size], file_type, hdlg);
if (is_mo)
ret = create_mo_sector_image(fd_file_name, disk_size, file_type, hdlg);
else else
ret = create_sector_image(fd_file_name, disk_sizes[disk_size], file_type); ret = create_sector_image(fd_file_name, disk_sizes[disk_size], file_type);
} }
if (ret) { if (ret) {
if (is_zip) if (is_zip)
//ui_sb_mount_zip_img(fdd_id, sb_part, 0, fd_file_name);
zip_mount(fdd_id, fd_file_name, 0); zip_mount(fdd_id, fd_file_name, 0);
else if (is_mo)
mo_mount(fdd_id, fd_file_name, 0);
else else
//ui_sb_mount_floppy_img(fdd_id, sb_part, 0, fd_file_name);
floppy_mount(fdd_id, fd_file_name, 0); floppy_mount(fdd_id, fd_file_name, 0);
} else { } else {
new_floppy_msgbox_header(hdlg, MBX_ERROR, (wchar_t *) IDS_4108, (wchar_t *) IDS_4115); new_floppy_msgbox_header(hdlg, MBX_ERROR, (wchar_t *) IDS_4108, (wchar_t *) IDS_4115);
@@ -639,7 +759,7 @@ NewFloppyDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
if (wcslen(wopenfilestring) && (wcslen(wopenfilestring) <= 256)) { if (wcslen(wopenfilestring) && (wcslen(wopenfilestring) <= 256)) {
twcs = &wopenfilestring[wcslen(wopenfilestring)]; twcs = &wopenfilestring[wcslen(wopenfilestring)];
twcs[0] = L'.'; twcs[0] = L'.';
if (!is_zip && (filterindex == 3)) { if (!is_zip && !is_mo && (filterindex == 3)) {
twcs[1] = L'8'; twcs[1] = L'8';
twcs[2] = L'6'; twcs[2] = L'6';
twcs[3] = L'f'; twcs[3] = L'f';
@@ -671,6 +791,11 @@ NewFloppyDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
file_type = 1; file_type = 1;
else else
file_type = 0; file_type = 0;
} else if (is_mo) {
if (((wcs_len >= 4) && !wcsicmp(ext, L".MDI")))
file_type = 1;
else
file_type = 0;
} else { } else {
if (((wcs_len >= 4) && !wcsicmp(ext, L".FDI"))) if (((wcs_len >= 4) && !wcsicmp(ext, L".FDI")))
file_type = 1; file_type = 1;
@@ -717,5 +842,10 @@ NewFloppyDialogCreate(HWND hwnd, int id, int part)
fdd_id = id & 0x7f; fdd_id = id & 0x7f;
sb_part = part; sb_part = part;
is_zip = !!(id & 0x80); is_zip = !!(id & 0x80);
is_mo = !!(id & 0x100);
if (is_zip && is_mo) {
fatal("Attempting to create a new image dialog that is for both ZIP and MO at the same time\n");
return;
}
DialogBox(hinstance, (LPCTSTR)DLG_NEW_FLOPPY, hwnd, NewFloppyDialogProcedure); DialogBox(hinstance, (LPCTSTR)DLG_NEW_FLOPPY, hwnd, NewFloppyDialogProcedure);
} }

View File

@@ -322,13 +322,13 @@ win_settings_init(void)
else if (zip_drives[i].bus_type == ZIP_BUS_SCSI) else if (zip_drives[i].bus_type == ZIP_BUS_SCSI)
scsi_tracking[zip_drives[i].scsi_device_id >> 3] |= (1 << ((zip_drives[i].scsi_device_id & 0x07) << 3)); scsi_tracking[zip_drives[i].scsi_device_id >> 3] |= (1 << ((zip_drives[i].scsi_device_id & 0x07) << 3));
} }
memcpy(temp_mo_drives, mo_drives, MO_NUM * sizeof(mo_drive_t)); memcpy(temp_mo_drives, mo_drives, MO_NUM * sizeof(mo_drive_t));
for (i = 0; i < MO_NUM; i++) { for (i = 0; i < MO_NUM; i++) {
if (mo_drives[i].bus_type == MO_BUS_ATAPI) if (mo_drives[i].bus_type == MO_BUS_ATAPI)
ide_tracking |= (1 << (mo_drives[i].ide_channel << 3)); ide_tracking |= (1 << (mo_drives[i].ide_channel << 3));
else if (mo_drives[i].bus_type == MO_BUS_SCSI) else if (mo_drives[i].bus_type == MO_BUS_SCSI)
scsi_tracking[mo_drives[i].scsi_device_id >> 3] |= (1 << ((mo_drives[i].scsi_device_id & 0x07) << 3)); scsi_tracking[mo_drives[i].scsi_device_id >> 3] |= (1 << ((mo_drives[i].scsi_device_id & 0x07) << 3));
} }
temp_deviceconfig = 0; temp_deviceconfig = 0;
} }
@@ -411,7 +411,7 @@ win_settings_changed(void)
/* Other removable devices category */ /* Other removable devices category */
i = i || memcmp(cdrom, temp_cdrom, CDROM_NUM * sizeof(cdrom_t)); i = i || memcmp(cdrom, temp_cdrom, CDROM_NUM * sizeof(cdrom_t));
i = i || memcmp(zip_drives, temp_zip_drives, ZIP_NUM * sizeof(zip_drive_t)); i = i || memcmp(zip_drives, temp_zip_drives, ZIP_NUM * sizeof(zip_drive_t));
i = i || memcmp(mo_drives, temp_mo_drives, MO_NUM * sizeof(mo_drive_t)); i = i || memcmp(mo_drives, temp_mo_drives, MO_NUM * sizeof(mo_drive_t));
i = i || !!temp_deviceconfig; i = i || !!temp_deviceconfig;
@@ -540,7 +540,7 @@ win_settings_save(void)
zip_drives[i].f = NULL; zip_drives[i].f = NULL;
zip_drives[i].priv = NULL; zip_drives[i].priv = NULL;
} }
memcpy(mo_drives, temp_mo_drives, MO_NUM * sizeof(mo_drive_t)); memcpy(mo_drives, temp_mo_drives, MO_NUM * sizeof(mo_drive_t));
for (i = 0; i < MO_NUM; i++) { for (i = 0; i < MO_NUM; i++) {
mo_drives[i].f = NULL; mo_drives[i].f = NULL;
mo_drives[i].priv = NULL; mo_drives[i].priv = NULL;
@@ -3518,7 +3518,7 @@ win_settings_hard_disks_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPar
{ {
HWND h = NULL; HWND h = NULL;
int old_sel = 0, b = 0, assign = 0; int old_sel = 0, b = 0, assign = 0;
const uint8_t hd_icons[2] = { 64, 0 }; const uint8_t hd_icons[2] = { 80, 0 };
switch (message) { switch (message) {
case WM_INITDIALOG: case WM_INITDIALOG:
@@ -3754,7 +3754,7 @@ win_settings_cdrom_drives_recalc_list(HWND hwndList)
WCHAR szText[256]; WCHAR szText[256];
lvI.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE; lvI.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE;
lvI.stateMask = lvI.iSubItem = lvI.state = 0; lvI.stateMask = lvI.iSubItem = lvI.state = 0;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
fsid = combo_id_to_format_string_id(temp_cdrom[i].bus_type); fsid = combo_id_to_format_string_id(temp_cdrom[i].bus_type);
@@ -4007,6 +4007,7 @@ win_settings_mo_drives_init_columns(HWND hwndList)
return TRUE; return TRUE;
} }
static BOOL static BOOL
win_settings_zip_drives_init_columns(HWND hwndList) win_settings_zip_drives_init_columns(HWND hwndList)
{ {
@@ -4150,6 +4151,7 @@ win_settings_cdrom_drives_update_item(HWND hwndList, int i)
return; return;
} }
static void static void
win_settings_mo_drives_update_item(HWND hwndList, int i) win_settings_mo_drives_update_item(HWND hwndList, int i)
{ {
@@ -4296,7 +4298,7 @@ static void cdrom_recalc_location_controls(HWND hdlg, int assign_id)
int i = 0; int i = 0;
HWND h; HWND h;
int bus = temp_cdrom[lv1_current_sel].bus_type; int bus = temp_cdrom[lv2_current_sel].bus_type;
for (i = IDT_1741; i < (IDT_1742 + 1); i++) { for (i = IDT_1741; i < (IDT_1742 + 1); i++) {
h = GetDlgItem(hdlg, i); h = GetDlgItem(hdlg, i);
@@ -4319,7 +4321,7 @@ static void cdrom_recalc_location_controls(HWND hdlg, int assign_id)
} else { } else {
ShowWindow(h, SW_SHOW); ShowWindow(h, SW_SHOW);
EnableWindow(h, TRUE); EnableWindow(h, TRUE);
SendMessage(h, CB_SETCURSEL, temp_cdrom[lv1_current_sel].speed - 1, 0); SendMessage(h, CB_SETCURSEL, temp_cdrom[lv2_current_sel].speed - 1, 0);
} }
h = GetDlgItem(hdlg, IDT_1758); h = GetDlgItem(hdlg, IDT_1758);
@@ -4338,12 +4340,12 @@ static void cdrom_recalc_location_controls(HWND hdlg, int assign_id)
EnableWindow(h, TRUE); EnableWindow(h, TRUE);
if (assign_id) if (assign_id)
temp_cdrom[lv1_current_sel].ide_channel = next_free_ide_channel(); temp_cdrom[lv2_current_sel].ide_channel = next_free_ide_channel();
h = GetDlgItem(hdlg, IDC_COMBO_CD_CHANNEL_IDE); h = GetDlgItem(hdlg, IDC_COMBO_CD_CHANNEL_IDE);
ShowWindow(h, SW_SHOW); ShowWindow(h, SW_SHOW);
EnableWindow(h, TRUE); EnableWindow(h, TRUE);
SendMessage(h, CB_SETCURSEL, temp_cdrom[lv1_current_sel].ide_channel, 0); SendMessage(h, CB_SETCURSEL, temp_cdrom[lv2_current_sel].ide_channel, 0);
break; break;
case CDROM_BUS_SCSI: /* SCSI */ case CDROM_BUS_SCSI: /* SCSI */
h = GetDlgItem(hdlg, IDT_1741); h = GetDlgItem(hdlg, IDT_1741);
@@ -4351,12 +4353,12 @@ static void cdrom_recalc_location_controls(HWND hdlg, int assign_id)
EnableWindow(h, TRUE); EnableWindow(h, TRUE);
if (assign_id) if (assign_id)
next_free_scsi_id((uint8_t *) &temp_cdrom[lv1_current_sel].scsi_device_id); next_free_scsi_id((uint8_t *) &temp_cdrom[lv2_current_sel].scsi_device_id);
h = GetDlgItem(hdlg, IDC_COMBO_CD_ID); h = GetDlgItem(hdlg, IDC_COMBO_CD_ID);
ShowWindow(h, SW_SHOW); ShowWindow(h, SW_SHOW);
EnableWindow(h, TRUE); EnableWindow(h, TRUE);
SendMessage(h, CB_SETCURSEL, temp_cdrom[lv1_current_sel].scsi_device_id, 0); SendMessage(h, CB_SETCURSEL, temp_cdrom[lv2_current_sel].scsi_device_id, 0);
break; break;
} }
} }
@@ -4364,15 +4366,15 @@ static void cdrom_recalc_location_controls(HWND hdlg, int assign_id)
static void static void
mo_add_locations(HWND hdlg) mo_add_locations(HWND hdlg)
{ {
LPTSTR lptsTemp; LPTSTR lptsTemp;
char *temp; char *temp;
HWND h; HWND h;
int i = 0; int i = 0;
lptsTemp = (LPTSTR) malloc(512 * sizeof(WCHAR)); lptsTemp = (LPTSTR) malloc(512 * sizeof(WCHAR));
temp = (char*) malloc(30*sizeof(char)); temp = (char*) malloc(30*sizeof(char));
h = GetDlgItem(hdlg, IDC_COMBO_MO_BUS); h = GetDlgItem(hdlg, IDC_COMBO_MO_BUS);
for (i = MO_BUS_DISABLED; i <= MO_BUS_SCSI; i++) { for (i = MO_BUS_DISABLED; i <= MO_BUS_SCSI; i++) {
if ((i == MO_BUS_DISABLED) || (i >= MO_BUS_ATAPI)) if ((i == MO_BUS_DISABLED) || (i >= MO_BUS_ATAPI))
SendMessage(h, CB_ADDSTRING, 0, win_get_string(combo_id_to_string_id(i))); SendMessage(h, CB_ADDSTRING, 0, win_get_string(combo_id_to_string_id(i)));
@@ -4390,21 +4392,21 @@ mo_add_locations(HWND hdlg)
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp); SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp);
} }
h = GetDlgItem(hdlg, IDC_COMBO_MO_TYPE); h = GetDlgItem(hdlg, IDC_COMBO_MO_TYPE);
for (int i=0; i < KNOWN_MO_DRIVE_TYPES; i++) { for (int i=0; i < KNOWN_MO_DRIVE_TYPES; i++) {
memset(temp, 0, 30); memset(temp, 0, 30);
memcpy(temp, mo_drive_types[i].vendor, 8); memcpy(temp, mo_drive_types[i].vendor, 8);
temp[strlen(temp)] = ' '; temp[strlen(temp)] = ' ';
memcpy(temp + strlen(temp), mo_drive_types[i].model, 16); memcpy(temp + strlen(temp), mo_drive_types[i].model, 16);
temp[strlen(temp)] = ' '; temp[strlen(temp)] = ' ';
memcpy(temp + strlen(temp), mo_drive_types[i].revision, 4); memcpy(temp + strlen(temp), mo_drive_types[i].revision, 4);
mbstowcs(lptsTemp, temp, strlen(temp)+1); mbstowcs(lptsTemp, temp, strlen(temp)+1);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp); SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp);
} }
free(temp); free(temp);
free(lptsTemp); free(lptsTemp);
} }
@@ -4639,12 +4641,14 @@ static LRESULT CALLBACK
#else #else
static BOOL CALLBACK static BOOL CALLBACK
#endif #endif
win_settings_floppy_drives_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) win_settings_floppy_and_cdrom_drives_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
{ {
HWND h = NULL; HWND h = NULL;
int i = 0, old_sel = 0; int i = 0, old_sel = 0, b = 0, assign = 0;
uint32_t b2 = 0;
WCHAR szText[256]; WCHAR szText[256];
const uint8_t fd_icons[15] = { 248, 16, 16, 16, 16, 16, 16, 24, 24, 24, 24, 24, 24, 24, 0 }; const uint8_t fd_icons[15] = { 248, 16, 16, 16, 16, 16, 16, 24, 24, 24, 24, 24, 24, 24, 0 };
const uint8_t cd_icons[3] = { 249, 32, 0 };
switch (message) { switch (message) {
case WM_INITDIALOG: case WM_INITDIALOG:
@@ -4673,6 +4677,33 @@ win_settings_floppy_drives_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM l
h = GetDlgItem(hdlg, IDC_CHECKBPB); h = GetDlgItem(hdlg, IDC_CHECKBPB);
SendMessage(h, BM_SETCHECK, temp_fdd_check_bpb[lv1_current_sel], 0); SendMessage(h, BM_SETCHECK, temp_fdd_check_bpb[lv1_current_sel], 0);
lv2_current_sel = 0;
h = GetDlgItem(hdlg, IDC_LIST_CDROM_DRIVES);
win_settings_cdrom_drives_init_columns(h);
image_list_init(h, (const uint8_t *) cd_icons);
win_settings_cdrom_drives_recalc_list(h);
ListView_SetItemState(h, 0, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
cdrom_add_locations(hdlg);
h = GetDlgItem(hdlg, IDC_COMBO_CD_BUS);
switch (temp_cdrom[lv2_current_sel].bus_type) {
case CDROM_BUS_DISABLED:
default:
b = 0;
break;
case CDROM_BUS_ATAPI:
b = 1;
break;
case CDROM_BUS_SCSI:
b = 2;
break;
}
SendMessage(h, CB_SETCURSEL, b, 0);
cdrom_recalc_location_controls(hdlg, 0);
ignore_change = 0; ignore_change = 0;
return TRUE; return TRUE;
@@ -4700,6 +4731,39 @@ win_settings_floppy_drives_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM l
h = GetDlgItem(hdlg, IDC_CHECKBPB); h = GetDlgItem(hdlg, IDC_CHECKBPB);
SendMessage(h, BM_SETCHECK, temp_fdd_check_bpb[lv1_current_sel], 0); SendMessage(h, BM_SETCHECK, temp_fdd_check_bpb[lv1_current_sel], 0);
ignore_change = 0; ignore_change = 0;
} else if ((((LPNMHDR)lParam)->code == LVN_ITEMCHANGED) && (((LPNMHDR)lParam)->idFrom == IDC_LIST_CDROM_DRIVES)) {
old_sel = lv2_current_sel;
lv2_current_sel = get_selected_drive(hdlg, IDC_LIST_CDROM_DRIVES);
if (lv2_current_sel == old_sel)
return FALSE;
else if (lv2_current_sel == -1) {
ignore_change = 1;
lv2_current_sel = old_sel;
ListView_SetItemState(h, lv2_current_sel, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
ignore_change = 0;
return FALSE;
}
ignore_change = 1;
h = GetDlgItem(hdlg, IDC_COMBO_CD_BUS);
switch (temp_cdrom[lv2_current_sel].bus_type) {
case CDROM_BUS_DISABLED:
default:
b = 0;
break;
case CDROM_BUS_ATAPI:
b = 1;
break;
case CDROM_BUS_SCSI:
b = 2;
break;
}
SendMessage(h, CB_SETCURSEL, b, 0);
mo_recalc_location_controls(hdlg, 0);
ignore_change = 0;
} }
break; break;
@@ -4729,109 +4793,7 @@ win_settings_floppy_drives_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM l
h = GetDlgItem(hdlg, IDC_LIST_FLOPPY_DRIVES); h = GetDlgItem(hdlg, IDC_LIST_FLOPPY_DRIVES);
win_settings_floppy_drives_update_item(h, lv1_current_sel); win_settings_floppy_drives_update_item(h, lv1_current_sel);
break; break;
}
ignore_change = 0;
default:
return FALSE;
}
return FALSE;
}
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK
#endif
win_settings_cdrom_drives_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND h = NULL;
int old_sel = 0, b = 0, assign = 0;
uint32_t b2 = 0;
const uint8_t cd_icons[3] = { 249, 32, 0 };
switch (message) {
case WM_INITDIALOG:
ignore_change = 1;
lv1_current_sel = 0;
h = GetDlgItem(hdlg, IDC_LIST_CDROM_DRIVES);
win_settings_cdrom_drives_init_columns(h);
image_list_init(h, (const uint8_t *) cd_icons);
win_settings_cdrom_drives_recalc_list(h);
ListView_SetItemState(h, 0, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
cdrom_add_locations(hdlg);
h = GetDlgItem(hdlg, IDC_COMBO_CD_BUS);
switch (temp_cdrom[lv1_current_sel].bus_type) {
case CDROM_BUS_DISABLED:
default:
b = 0;
break;
case CDROM_BUS_ATAPI:
b = 1;
break;
case CDROM_BUS_SCSI:
b = 2;
break;
}
SendMessage(h, CB_SETCURSEL, b, 0);
cdrom_recalc_location_controls(hdlg, 0);
ignore_change = 0;
return TRUE;
case WM_NOTIFY:
if (ignore_change)
return FALSE;
if ((((LPNMHDR)lParam)->code == LVN_ITEMCHANGED) && (((LPNMHDR)lParam)->idFrom == IDC_LIST_CDROM_DRIVES)) {
old_sel = lv1_current_sel;
lv1_current_sel = get_selected_drive(hdlg, IDC_LIST_CDROM_DRIVES);
if (lv1_current_sel == old_sel)
return FALSE;
else if (lv1_current_sel == -1) {
ignore_change = 1;
lv1_current_sel = old_sel;
ListView_SetItemState(h, lv1_current_sel, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
ignore_change = 0;
return FALSE;
}
ignore_change = 1;
h = GetDlgItem(hdlg, IDC_COMBO_CD_BUS);
switch (temp_cdrom[lv1_current_sel].bus_type) {
case CDROM_BUS_DISABLED:
default:
b = 0;
break;
case CDROM_BUS_ATAPI:
b = 1;
break;
case CDROM_BUS_SCSI:
b = 2;
break;
}
SendMessage(h, CB_SETCURSEL, b, 0);
mo_recalc_location_controls(hdlg, 0);
ignore_change = 0;
}
break;
case WM_COMMAND:
if (ignore_change)
return FALSE;
ignore_change = 1;
switch (LOWORD(wParam)) {
case IDC_COMBO_CD_BUS: case IDC_COMBO_CD_BUS:
h = GetDlgItem(hdlg, IDC_COMBO_CD_BUS); h = GetDlgItem(hdlg, IDC_COMBO_CD_BUS);
b = SendMessage(h, CB_GETCURSEL, 0, 0); b = SendMessage(h, CB_GETCURSEL, 0, 0);
@@ -4846,42 +4808,42 @@ win_settings_cdrom_drives_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lP
b2 = CDROM_BUS_SCSI; b2 = CDROM_BUS_SCSI;
break; break;
} }
if (b2 == temp_cdrom[lv1_current_sel].bus_type) if (b2 == temp_cdrom[lv2_current_sel].bus_type)
break; break;
cdrom_untrack(lv1_current_sel); cdrom_untrack(lv2_current_sel);
assign = (temp_cdrom[lv1_current_sel].bus_type == b2) ? 0 : 1; assign = (temp_cdrom[lv2_current_sel].bus_type == b2) ? 0 : 1;
if (temp_cdrom[lv1_current_sel].bus_type == CDROM_BUS_DISABLED) if (temp_cdrom[lv2_current_sel].bus_type == CDROM_BUS_DISABLED)
temp_cdrom[lv1_current_sel].speed = 8; temp_cdrom[lv2_current_sel].speed = 8;
temp_cdrom[lv1_current_sel].bus_type = b2; temp_cdrom[lv2_current_sel].bus_type = b2;
cdrom_recalc_location_controls(hdlg, assign); cdrom_recalc_location_controls(hdlg, assign);
cdrom_track(lv1_current_sel); cdrom_track(lv2_current_sel);
h = GetDlgItem(hdlg, IDC_LIST_CDROM_DRIVES); h = GetDlgItem(hdlg, IDC_LIST_CDROM_DRIVES);
win_settings_cdrom_drives_update_item(h, lv1_current_sel); win_settings_cdrom_drives_update_item(h, lv2_current_sel);
break; break;
case IDC_COMBO_CD_ID: case IDC_COMBO_CD_ID:
h = GetDlgItem(hdlg, IDC_COMBO_CD_ID); h = GetDlgItem(hdlg, IDC_COMBO_CD_ID);
cdrom_untrack(lv1_current_sel); cdrom_untrack(lv2_current_sel);
temp_cdrom[lv1_current_sel].scsi_device_id = SendMessage(h, CB_GETCURSEL, 0, 0); temp_cdrom[lv2_current_sel].scsi_device_id = SendMessage(h, CB_GETCURSEL, 0, 0);
cdrom_track(lv1_current_sel); cdrom_track(lv2_current_sel);
h = GetDlgItem(hdlg, IDC_LIST_CDROM_DRIVES); h = GetDlgItem(hdlg, IDC_LIST_CDROM_DRIVES);
win_settings_cdrom_drives_update_item(h, lv1_current_sel); win_settings_cdrom_drives_update_item(h, lv2_current_sel);
break; break;
case IDC_COMBO_CD_CHANNEL_IDE: case IDC_COMBO_CD_CHANNEL_IDE:
h = GetDlgItem(hdlg, IDC_COMBO_CD_CHANNEL_IDE); h = GetDlgItem(hdlg, IDC_COMBO_CD_CHANNEL_IDE);
cdrom_untrack(lv1_current_sel); cdrom_untrack(lv2_current_sel);
temp_cdrom[lv1_current_sel].ide_channel = SendMessage(h, CB_GETCURSEL, 0, 0); temp_cdrom[lv2_current_sel].ide_channel = SendMessage(h, CB_GETCURSEL, 0, 0);
cdrom_track(lv1_current_sel); cdrom_track(lv2_current_sel);
h = GetDlgItem(hdlg, IDC_LIST_CDROM_DRIVES); h = GetDlgItem(hdlg, IDC_LIST_CDROM_DRIVES);
win_settings_cdrom_drives_update_item(h, lv1_current_sel); win_settings_cdrom_drives_update_item(h, lv2_current_sel);
break; break;
case IDC_COMBO_CD_SPEED: case IDC_COMBO_CD_SPEED:
h = GetDlgItem(hdlg, IDC_COMBO_CD_SPEED); h = GetDlgItem(hdlg, IDC_COMBO_CD_SPEED);
temp_cdrom[lv1_current_sel].speed = SendMessage(h, CB_GETCURSEL, 0, 0) + 1; temp_cdrom[lv2_current_sel].speed = SendMessage(h, CB_GETCURSEL, 0, 0) + 1;
h = GetDlgItem(hdlg, IDC_LIST_CDROM_DRIVES); h = GetDlgItem(hdlg, IDC_LIST_CDROM_DRIVES);
win_settings_cdrom_drives_update_item(h, lv1_current_sel); win_settings_cdrom_drives_update_item(h, lv2_current_sel);
break; break;
} }
ignore_change = 0; ignore_change = 0;
@@ -4893,6 +4855,7 @@ win_settings_cdrom_drives_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lP
return FALSE; return FALSE;
} }
#if defined(__amd64__) || defined(__aarch64__) #if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK static LRESULT CALLBACK
#else #else
@@ -4903,7 +4866,7 @@ win_settings_other_removable_devices_proc(HWND hdlg, UINT message, WPARAM wParam
HWND h = NULL; HWND h = NULL;
int old_sel = 0, b = 0, assign = 0; int old_sel = 0, b = 0, assign = 0;
uint32_t b2 = 0; uint32_t b2 = 0;
const uint8_t mo_icons[3] = { 251, 56, 0 }; const uint8_t mo_icons[3] = { 251, 56, 0 };
const uint8_t zip_icons[3] = { 250, 48, 0 }; const uint8_t zip_icons[3] = { 250, 48, 0 };
switch (message) { switch (message) {
@@ -5195,11 +5158,8 @@ void win_settings_show_child(HWND hwndParent, DWORD child_id)
case SETTINGS_PAGE_HARD_DISKS: case SETTINGS_PAGE_HARD_DISKS:
hwndChildDialog = CreateDialog(hinstance, (LPCWSTR)DLG_CFG_HARD_DISKS, hwndParent, win_settings_hard_disks_proc); hwndChildDialog = CreateDialog(hinstance, (LPCWSTR)DLG_CFG_HARD_DISKS, hwndParent, win_settings_hard_disks_proc);
break; break;
case SETTINGS_PAGE_FLOPPY_DRIVES: case SETTINGS_PAGE_FLOPPY_AND_CDROM_DRIVES:
hwndChildDialog = CreateDialog(hinstance, (LPCWSTR)DLG_CFG_FLOPPY_DRIVES, hwndParent, win_settings_floppy_drives_proc); hwndChildDialog = CreateDialog(hinstance, (LPCWSTR)DLG_CFG_FLOPPY_AND_CDROM_DRIVES, hwndParent, win_settings_floppy_and_cdrom_drives_proc);
break;
case SETTINGS_PAGE_CDROM_DRIVES:
hwndChildDialog = CreateDialog(hinstance, (LPCWSTR)DLG_CFG_CDROM_DRIVES, hwndParent, win_settings_cdrom_drives_proc);
break; break;
case SETTINGS_PAGE_OTHER_REMOVABLE_DEVICES: case SETTINGS_PAGE_OTHER_REMOVABLE_DEVICES:
hwndChildDialog = CreateDialog(hinstance, (LPCWSTR)DLG_CFG_OTHER_REMOVABLE_DEVICES, hwndParent, win_settings_other_removable_devices_proc); hwndChildDialog = CreateDialog(hinstance, (LPCWSTR)DLG_CFG_OTHER_REMOVABLE_DEVICES, hwndParent, win_settings_other_removable_devices_proc);
@@ -5222,13 +5182,8 @@ win_settings_main_insert_categories(HWND hwndList)
lvI.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE; lvI.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE;
lvI.stateMask = lvI.iSubItem = lvI.state = 0; lvI.stateMask = lvI.iSubItem = lvI.state = 0;
for (i = 0; i < 11; i++) { for (i = 0; i < 10; i++) {
if (i <= 8) lvI.pszText = plat_get_string(IDS_2065+i);
lvI.pszText = plat_get_string(IDS_2065+i);
else if (i == 9)
lvI.pszText = plat_get_string(IDS_2139);
else if (i == 10)
lvI.pszText = plat_get_string(IDS_2074);
lvI.iItem = i; lvI.iItem = i;
lvI.iImage = i; lvI.iImage = i;
@@ -5275,7 +5230,7 @@ win_settings_main_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
{ {
HWND h = NULL; HWND h = NULL;
int category, i = 0, j = 0; int category, i = 0, j = 0;
const uint8_t cat_icons[12] = { 240, 241, 242, 243, 80, 244, 245, 64, 246, 32, 247, 0 }; const uint8_t cat_icons[12] = { 240, 241, 242, 243, 96, 244, 245, 80, 246, 247, 0 };
hwndParentDialog = hdlg; hwndParentDialog = hdlg;

View File

@@ -259,6 +259,7 @@ StatusBarCreateZIPTip(int part)
wcscpy(sbTips[part], tempTip); wcscpy(sbTips[part], tempTip);
} }
static void static void
StatusBarCreateMOTip(int part) StatusBarCreateMOTip(int part)
{ {
@@ -287,6 +288,7 @@ StatusBarCreateMOTip(int part)
wcscpy(sbTips[part], tempTip); wcscpy(sbTips[part], tempTip);
} }
static void static void
StatusBarCreateDiskTip(int part) StatusBarCreateDiskTip(int part)
{ {
@@ -677,12 +679,12 @@ ui_sb_update_panes(void)
break; break;
case SB_HDD: /* Hard disk */ case SB_HDD: /* Hard disk */
sb_part_icons[i] = 64; sb_part_icons[i] = 80;
StatusBarCreateDiskTip(i); StatusBarCreateDiskTip(i);
break; break;
case SB_NETWORK: /* Network */ case SB_NETWORK: /* Network */
sb_part_icons[i] = 80; sb_part_icons[i] = 96;
StatusBarCreateNetworkTip(i); StatusBarCreateNetworkTip(i);
break; break;
@@ -806,12 +808,14 @@ StatusBarCreate(HWND hwndParent, uintptr_t idStatus, HINSTANCE hInst)
hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i); hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i);
for (i = 48; i < 50; i++) for (i = 48; i < 50; i++)
hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i); hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i);
for (i = 56; i < 58; i++) for (i = 56; i < 58; i++)
hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i); hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i);
for (i = 64; i < 66; i++) for (i = 64; i < 66; i++)
hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i); hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i);
for (i = 80; i < 82; i++) for (i = 80; i < 82; i++)
hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i); hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i);
for (i = 96; i < 98; i++)
hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i);
for (i = 144; i < 146; i++) for (i = 144; i < 146; i++)
hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i); hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i);
for (i = 152; i < 154; i++) for (i = 152; i < 154; i++)
@@ -820,7 +824,9 @@ StatusBarCreate(HWND hwndParent, uintptr_t idStatus, HINSTANCE hInst)
hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i); hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i);
for (i = 176; i < 178; i++) for (i = 176; i < 178; i++)
hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i); hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i);
for (i = 184; i < 186; i++) for (i = 184; i < 186; i++)
hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i);
for (i = 192; i < 194; i++)
hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i); hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i);
for (i = 243; i < 244; i++) for (i = 243; i < 244; i++)
hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i); hIcon[i] = LoadIconEx((PCTSTR) (uintptr_t) i);