Cleanup, mostly network threading madness. Statusbar is now created at hard reset, IF the configuration has changed. Other minor things.

This commit is contained in:
waltje
2017-10-29 04:20:20 -05:00
parent f4367133e7
commit bfe038ded9
37 changed files with 506 additions and 600 deletions

View File

@@ -8,7 +8,7 @@
#
# Makefile for Win32 (MinGW32) environment.
#
# Version: @(#)Makefile.mingw 1.0.69 2017/10/26
# Version: @(#)Makefile.mingw 1.0.70 2017/10/28
#
# Authors: Miran Grca, <mgrca8@gmail.com>
# Fred N. van Kempen, <decwiz@yahoo.com>
@@ -117,7 +117,7 @@ DEPS = -MMD -MF $*.d -c $<
DEPFILE := win/.depends
# Set up the correct toolchain flags.
OPTS := -DWIN32 $(EXTRAS) $(STUFF)
OPTS := $(EXTRAS) $(STUFF)
ifdef EXFLAGS
OPTS += $(EXFLAGS)
endif

View File

@@ -6,9 +6,9 @@
*
* This file is part of the 86Box distribution.
*
* The Emulator's Windows core.
* Platform main support module for Windows.
*
* Version: @(#)win.c 1.0.29 2017/10/24
* Version: @(#)win.c 1.0.30 2017/10/28
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -561,7 +561,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
rom_load_bios(romset);
network_init();
ResetAllMenus();
ui_sb_update_panes();
pc_reset_hard_init();
}
}

View File

@@ -8,7 +8,7 @@
*
* Windows 86Box Settings dialog handler.
*
* Version: @(#)win_settings.c 1.0.21 2017/10/16
* Version: @(#)win_settings.c 1.0.22 2017/10/28
*
* Author: Miran Grca, <mgrca8@gmail.com>
*
@@ -378,6 +378,12 @@ static void win_settings_save(void)
}
memcpy(cdrom_drives, temp_cdrom_drives, CDROM_NUM * sizeof(cdrom_drive_t));
/* Mark configuration as changed. */
config_changed = 1;
#if 1
pc_reset_hard_init();
#else
mem_resize();
rom_load_bios(romset);
@@ -396,6 +402,7 @@ static void win_settings_save(void)
pc_speed_changed();
if (joystick_type != 7) gameport_update_joystick_type();
#endif
}

View File

@@ -8,7 +8,7 @@
*
* Implement the application's Status Bar.
*
* Version: @(#)win_stbar.c 1.0.3 2017/10/16
* Version: @(#)win_stbar.c 1.0.4 2017/10/28
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -119,15 +119,6 @@ hdd_count(int bus)
}
static int
display_network_icon(void)
{
if ((network_type == 0) || (network_card == 0)) return(0);
return(network_test());
}
static void
StatusBarCreateFloppySubmenu(HMENU m, int id)
{
@@ -530,7 +521,7 @@ ui_sb_update_panes(void)
c_ide_pio = hdd_count(HDD_BUS_IDE_PIO_ONLY);
c_ide_dma = hdd_count(HDD_BUS_IDE_PIO_AND_DMA);
c_scsi = hdd_count(HDD_BUS_SCSI);
do_net = display_network_icon();
do_net = network_available();
if (sb_parts > 0) {
for (i = 0; i < sb_parts; i++)
@@ -1075,9 +1066,29 @@ StatusBarCreate(HWND hwndParent, int idStatus, HINSTANCE hInst)
/* Load the dummu menu for this window. */
menuSBAR = LoadMenu(hInst, SB_MENU_NAME);
/* Initialize the status bar and populate the icons and menus. */
/* Initialize the status bar. This is clumsy. */
sb_parts = 1;
iStatusWidths = (int *)malloc(sb_parts * sizeof(int));
memset(iStatusWidths, 0, sb_parts * sizeof(int));
sb_part_meanings = (int *)malloc(sb_parts * sizeof(int));
memset(sb_part_meanings, 0, sb_parts * sizeof(int));
sb_part_icons = (int *)malloc(sb_parts * sizeof(int));
memset(sb_part_icons, 0, sb_parts * sizeof(int));
sb_icon_flags = (int *)malloc(sb_parts * sizeof(int));
memset(sb_icon_flags, 0, sb_parts * sizeof(int));
sb_menu_handles = (HMENU *)malloc(sb_parts * sizeof(HMENU));
memset(sb_menu_handles, 0, sb_parts * sizeof(HMENU));
sbTips = (WCHAR **)malloc(sb_parts * sizeof(WCHAR *));
memset(sbTips, 0, sb_parts * sizeof(WCHAR *));
sb_parts = 0;
ui_sb_update_panes();
iStatusWidths[sb_parts] = -1;
sb_part_meanings[sb_parts] = SB_TEXT;
sb_part_icons[sb_parts] = -1;
sb_parts++;
SendMessage(hwndSBAR, SB_SETPARTS, (WPARAM)sb_parts, (LPARAM)iStatusWidths);
SendMessage(hwndSBAR, SB_SETTEXT, 0 | SBT_NOBORDERS,
(LPARAM)L"Welcome to 86Box !");
sb_ready = 1;
}

View File

@@ -8,7 +8,7 @@
*
* Platform video API support for Win32.
*
* Version: @(#)win_video.c 1.0.3 2017/10/24
* Version: @(#)win_video.c 1.0.4 2017/10/28
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
*
@@ -254,11 +254,7 @@ take_screenshot(void)
if (! plat_dir_check(path))
plat_dir_create(path);
#ifdef WIN32
wcscat(path, L"\\");
#else
wcscat(path, L"/");
#endif
switch(vid_api) {
case 0: /* ddraw */