Fixed Host MIDI Out Device ID saving;

Did the UI-related preparations for adding removable hard disks.
This commit is contained in:
OBattler
2017-05-18 21:51:11 +02:00
parent d7676794d2
commit c669a05662
9 changed files with 268 additions and 96 deletions

View File

@@ -92,6 +92,118 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_CDROM_4_IMAGE
END
POPUP "Removable disk 01"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_01_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_01_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_01_IMAGE
END
POPUP "Removable disk 02"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_02_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_02_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_02_IMAGE
END
POPUP "Removable disk 03"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_03_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_03_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_03_IMAGE
END
POPUP "Removable disk 04"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_04_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_04_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_04_IMAGE
END
POPUP "Removable disk 05"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_05_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_05_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_05_IMAGE
END
POPUP "Removable disk 06"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_06_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_06_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_06_IMAGE
END
POPUP "Removable disk 07"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_07_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_07_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_07_IMAGE
END
POPUP "Removable disk 08"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_08_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_08_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_08_IMAGE
END
POPUP "Removable disk 09"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_09_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_09_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_09_IMAGE
END
POPUP "Removable disk 10"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_10_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_10_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_10_IMAGE
END
POPUP "Removable disk 11"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_11_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_11_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_11_IMAGE
END
POPUP "Removable disk 12"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_12_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_12_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_12_IMAGE
END
POPUP "Removable disk 13"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_13_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_13_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_13_IMAGE
END
POPUP "Removable disk 14"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_14_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_14_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_14_IMAGE
END
POPUP "Removable disk 15"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_15_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_15_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_15_IMAGE
END
POPUP "Removable disk 16"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_16_EMPTY
MENUITEM "&Reload previous disc", IDM_RDISK_16_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_RDISK_16_IMAGE
END
END
MAINMENU MENU DISCARDABLE
@@ -536,14 +648,14 @@ END
163 ICON DISCARDABLE "ICONS/cdrom_atapi_dma_active.ico"
164 ICON DISCARDABLE "ICONS/cdrom_scsi.ico"
165 ICON DISCARDABLE "ICONS/cdrom_scsi_active.ico"
176 ICON DISCARDABLE "ICONS/hard_disk_mfm.ico"
177 ICON DISCARDABLE "ICONS/hard_disk_mfm_active.ico"
178 ICON DISCARDABLE "ICONS/hard_disk.ico"
179 ICON DISCARDABLE "ICONS/hard_disk_active.ico"
180 ICON DISCARDABLE "ICONS/hard_disk_ide.ico"
181 ICON DISCARDABLE "ICONS/hard_disk_ide_active.ico"
182 ICON DISCARDABLE "ICONS/hard_disk_scsi.ico"
183 ICON DISCARDABLE "ICONS/hard_disk_scsi_active.ico"
192 ICON DISCARDABLE "ICONS/hard_disk_mfm.ico"
193 ICON DISCARDABLE "ICONS/hard_disk_mfm_active.ico"
194 ICON DISCARDABLE "ICONS/hard_disk.ico"
195 ICON DISCARDABLE "ICONS/hard_disk_active.ico"
196 ICON DISCARDABLE "ICONS/hard_disk_ide.ico"
197 ICON DISCARDABLE "ICONS/hard_disk_ide_active.ico"
198 ICON DISCARDABLE "ICONS/hard_disk_scsi.ico"
199 ICON DISCARDABLE "ICONS/hard_disk_scsi_active.ico"
256 ICON DISCARDABLE "ICONS/machine.ico"
257 ICON DISCARDABLE "ICONS/video.ico"
258 ICON DISCARDABLE "ICONS/input_devices.ico"

View File

@@ -180,6 +180,55 @@
#define IDM_CDROM_4_EMPTY 40179
#define IDM_CDROM_4_REAL 40195
#define IDM_RDISK_01_IMAGE 3200
#define IDM_RDISK_01_RELOAD 3216
#define IDM_RDISK_01_EMPTY 3232
#define IDM_RDISK_02_IMAGE 3201
#define IDM_RDISK_02_RELOAD 3217
#define IDM_RDISK_02_EMPTY 3233
#define IDM_RDISK_03_IMAGE 3202
#define IDM_RDISK_03_RELOAD 3218
#define IDM_RDISK_03_EMPTY 3234
#define IDM_RDISK_04_IMAGE 3203
#define IDM_RDISK_04_RELOAD 3219
#define IDM_RDISK_04_EMPTY 3235
#define IDM_RDISK_05_IMAGE 3204
#define IDM_RDISK_05_RELOAD 3220
#define IDM_RDISK_05_EMPTY 3236
#define IDM_RDISK_06_IMAGE 3205
#define IDM_RDISK_06_RELOAD 3221
#define IDM_RDISK_06_EMPTY 3237
#define IDM_RDISK_07_IMAGE 3206
#define IDM_RDISK_07_RELOAD 3222
#define IDM_RDISK_07_EMPTY 3238
#define IDM_RDISK_08_IMAGE 3207
#define IDM_RDISK_08_RELOAD 3223
#define IDM_RDISK_08_EMPTY 3239
#define IDM_RDISK_09_IMAGE 3208
#define IDM_RDISK_09_RELOAD 3224
#define IDM_RDISK_09_EMPTY 3240
#define IDM_RDISK_10_IMAGE 3209
#define IDM_RDISK_10_RELOAD 3225
#define IDM_RDISK_10_EMPTY 3241
#define IDM_RDISK_11_IMAGE 3210
#define IDM_RDISK_11_RELOAD 3226
#define IDM_RDISK_11_EMPTY 3242
#define IDM_RDISK_12_IMAGE 3211
#define IDM_RDISK_12_RELOAD 3227
#define IDM_RDISK_12_EMPTY 3243
#define IDM_RDISK_13_IMAGE 3212
#define IDM_RDISK_13_RELOAD 3228
#define IDM_RDISK_13_EMPTY 3244
#define IDM_RDISK_14_IMAGE 3213
#define IDM_RDISK_14_RELOAD 3229
#define IDM_RDISK_14_EMPTY 3245
#define IDM_RDISK_15_IMAGE 3214
#define IDM_RDISK_15_RELOAD 3230
#define IDM_RDISK_15_EMPTY 3246
#define IDM_RDISK_16_IMAGE 3215
#define IDM_RDISK_16_RELOAD 3231
#define IDM_RDISK_16_EMPTY 3247
#define IDM_IDE_TER_ENABLED 44000
#define IDM_IDE_TER_IRQ9 44009
#define IDM_IDE_TER_IRQ10 44010

View File

@@ -696,7 +696,7 @@ void update_status_bar_icon(int tag, int active)
int found = -1;
int temp_flags = 0;
if ((tag & 0xf0) >= 0x30)
if ((tag & 0xf0) >= 0x40)
{
return;
}
@@ -833,7 +833,7 @@ void update_tip(int meaning)
if (part != -1)
{
switch(meaning & 0x30)
switch(meaning & 0xf0)
{
case 0x00:
create_floppy_tip(part);
@@ -841,7 +841,12 @@ void update_tip(int meaning)
case 0x10:
create_cdrom_tip(part);
break;
#if 0
case 0x20:
create_removable_hd_tip(part);
break;
#endif
case 0x30:
create_hd_tip(part);
break;
default:
@@ -883,7 +888,7 @@ void status_settextw(wchar_t *wstr)
for (i = 0; i < sb_parts; i++)
{
if (sb_part_meanings[i] == 0x30)
if (sb_part_meanings[i] == 0x40)
{
part = i;
}
@@ -949,32 +954,44 @@ void update_status_bar_panes(HWND hwnds)
sb_parts++;
}
}
#if 0
for (i = 0; i < 16; i++)
{
if (hdc[i].bus == 5)
{
edge += sb_icon_width;
iStatusWidths[sb_parts] = edge;
sb_part_meanings[sb_parts] = 0x20 | i;
sb_parts++;
}
}
#endif
if (c_mfm && !(models[model].flags & MODEL_HAS_IDE) && !!memcmp(hdd_controller_name, "none", 4) && !!memcmp(hdd_controller_name, "xtide", 5))
{
edge += sb_icon_width;
iStatusWidths[sb_parts] = edge;
sb_part_meanings[sb_parts] = 0x20;
sb_part_meanings[sb_parts] = 0x30;
sb_parts++;
}
if (c_ide_pio && ((models[model].flags & MODEL_HAS_IDE) || !memcmp(hdd_controller_name, "xtide", 5)))
{
edge += sb_icon_width;
iStatusWidths[sb_parts] = edge;
sb_part_meanings[sb_parts] = 0x21;
sb_part_meanings[sb_parts] = 0x31;
sb_parts++;
}
if (c_ide_dma && ((models[model].flags & MODEL_HAS_IDE) || !memcmp(hdd_controller_name, "xtide", 5)))
{
edge += sb_icon_width;
iStatusWidths[sb_parts] = edge;
sb_part_meanings[sb_parts] = 0x22;
sb_part_meanings[sb_parts] = 0x32;
sb_parts++;
}
if (c_scsi)
{
edge += sb_icon_width;
iStatusWidths[sb_parts] = edge;
sb_part_meanings[sb_parts] = 0x23;
sb_part_meanings[sb_parts] = 0x33;
sb_parts++;
}
if (sb_parts)
@@ -982,14 +999,14 @@ void update_status_bar_panes(HWND hwnds)
iStatusWidths[sb_parts - 1] += (24 - sb_icon_width);
}
iStatusWidths[sb_parts] = -1;
sb_part_meanings[sb_parts] = 0x30;
sb_part_meanings[sb_parts] = 0x40;
sb_parts++;
SendMessage(hwnds, SB_SETPARTS, (WPARAM) sb_parts, (LPARAM) iStatusWidths);
for (i = 0; i < sb_parts; i++)
{
switch (sb_part_meanings[i] & 0x30)
switch (sb_part_meanings[i] & 0xf0)
{
case 0x00:
/* Floppy */
@@ -1030,12 +1047,20 @@ void update_status_bar_panes(HWND hwnds)
sb_part_icons[i] = j | sb_icon_flags[i];
create_cdrom_tip(i);
break;
#if 0
case 0x20:
/* Removable hard disk */
sb_icon_flags[i] = (wcslen(discfns[sb_part_meanings[i] & 0xf]) == 0) ? 256 : 0;
sb_part_icons[i] = 176 + sb_icon_flags[i];
create_floppy_tip(i);
break;
#endif
case 0x30:
/* Hard disk */
sb_part_icons[i] = 176 + ((sb_part_meanings[i] & 0xf) << 1);
sb_part_icons[i] = 192 + ((sb_part_meanings[i] & 0xf) << 1);
create_hd_tip(i);
break;
case 0x30:
case 0x40:
/* Status text */
SendMessage(hwnds, SB_SETTEXT, i | SBT_NOBORDERS, (LPARAM) L"Welcome to Unicode 86Box! :p");
sb_part_icons[i] = -1;
@@ -1082,7 +1107,14 @@ HWND EmulatorStatusBar(HWND hwndParent, int idStatus, HINSTANCE hinst)
hIcon[i] = LoadIconEx((PCTSTR) i);
}
for (i = 176; i < 184; i++)
#if 0
for (i = 176; i < 178; i++)
{
hIcon[i] = LoadIconEx((PCTSTR) i);
}
#endif
for (i = 192; i < 200; i++)
{
hIcon[i] = LoadIconEx((PCTSTR) i);
}
@@ -1107,6 +1139,13 @@ HWND EmulatorStatusBar(HWND hwndParent, int idStatus, HINSTANCE hinst)
hIcon[i] = LoadIconEx((PCTSTR) i);
}
#if 0
for (i = 432; i < 434; i++)
{
hIcon[i] = LoadIconEx((PCTSTR) i);
}
#endif
GetWindowRect(hwndParent, &rectDialog);
dw = rectDialog.right - rectDialog.left;
dh = rectDialog.bottom - rectDialog.top;
@@ -2192,14 +2231,20 @@ VOID APIENTRY HandlePopupMenu(HWND hwnd, POINT pt, int id)
pt.x = id * sb_icon_width; /* Justify to the left. */
pt.y = 0; /* Justify to the top. */
ClientToScreen(hwnd, (LPPOINT) &pt);
if ((sb_part_meanings[id] & 0x30) == 0x00)
if ((sb_part_meanings[id] & 0xf0) == 0x00)
{
menu_id = sb_part_meanings[id] & 0xf;
}
else if ((sb_part_meanings[id] & 0x30) == 0x10)
else if ((sb_part_meanings[id] & 0xf0) == 0x10)
{
menu_id = (sb_part_meanings[id] & 0xf) + 4;
}
#if 0
else if ((sb_part_meanings[id] & 0xf0) == 0x20)
{
menu_id = (sb_part_meanings[id] & 0xf) + 8;
}
#endif
if (menu_id != -1)
{
pmenu = GetSubMenu(smenu, menu_id);