Merge pull request #1640 from 86Box/master

Brought the branch up to par with master.
This commit is contained in:
Miran Grča
2021-09-01 15:03:15 +02:00
committed by GitHub
55 changed files with 5492 additions and 339 deletions

View File

@@ -519,6 +519,7 @@ BEGIN
CONTROL "Innovation SSI-2001",IDC_CHECK_SSI,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,84,95,10
PUSHBUTTON "Configure",IDC_CONFIGURE_SSI,214,82,46,12
CONTROL "CMS / Game Blaster",IDC_CHECK_CMS,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,102,95,10
@@ -1295,7 +1296,7 @@ BEGIN
VALUE "FileDescription", EMU_NAME "\0"
VALUE "FileVersion", EMU_VERSION "\0"
VALUE "InternalName", EMU_NAME "\0"
VALUE "LegalCopyright", "Copyright © 2007-2020 " EMU_NAME " contributors\0"
VALUE "LegalCopyright", "Copyright \xc2\xa9 2007-2020 " EMU_NAME " contributors\0"
VALUE "OriginalFilename", "86box.exe\0"
VALUE "ProductName", EMU_NAME "\0"
VALUE "ProductVersion", EMU_VERSION "\0"

View File

@@ -29,12 +29,14 @@ if(MSVC)
target_compile_definitions(ui PRIVATE NO_INCLUDE_MANIFEST)
target_sources(86Box PRIVATE 86Box.manifest)
target_sources(plat PRIVATE win_opendir.c)
# Append null to resource strings (fixes file dialogs)
set_property(SOURCE 86Box.rc PROPERTY COMPILE_FLAGS -n)
endif()
if(NOT MINGW)
target_sources(plat PRIVATE win_opendir.c)
endif()
if(DINPUT)
target_sources(plat PRIVATE win_joystick.cpp)
target_link_libraries(86Box dinput8)

View File

@@ -285,22 +285,39 @@ TOOL_PREFIX := x86_64-w64-mingw32-
else
TOOL_PREFIX := i686-w64-mingw32-
endif
CPP := ${TOOL_PREFIX}g++
CC := ${TOOL_PREFIX}gcc
WINDRES := windres
STRIP := strip
ifeq ($(ARM64), y)
CPP := aarch64-w64-mingw32-g++
CC := aarch64-w64-mingw32-gcc
WINDRES := aarch64-w64-mingw32-windres
STRIP := aarch64-w64-mingw32-strip
endif
ifeq ($(ARM), y)
CPP := armv7-w64-mingw32-g++
CC := armv7-w64-mingw32-gcc
WINDRES := armv7-w64-mingw32-windres
STRIP := armv7-w64-mingw32-strip
endif
ifeq ($(CLANG), y)
CPP := clang++
CC := clang
ifeq ($(ARM64), y)
CPP := aarch64-w64-mingw32-clang++
CC := aarch64-w64-mingw32-clang
endif
ifeq ($(ARM), y)
CPP := armv7-w64-mingw32-clang++
CC := armv7-w64-mingw32-clang
endif
else
CPP := ${TOOL_PREFIX}g++
CC := ${TOOL_PREFIX}gcc
ifeq ($(ARM64), y)
CPP := aarch64-w64-mingw32-g++
CC := aarch64-w64-mingw32-gcc
endif
ifeq ($(ARM), y)
CPP := armv7-w64-mingw32-g++
CC := armv7-w64-mingw32-gcc
endif
endif
DEPS = -MMD -MF $*.d -c $<
DEPFILE := win/.depends
@@ -314,15 +331,11 @@ endif
ifdef EXINC
OPTS += -I$(EXINC)
endif
ifeq ($(X64), y)
ifeq ($(OPTIM), y)
DFLAGS := -march=native
else
DFLAGS :=
endif
ifeq ($(OPTIM), y)
DFLAGS := -march=native
else
ifeq ($(OPTIM), y)
DFLAGS := -march=native
ifeq ($(X64), y)
DFLAGS :=
else
DFLAGS := -march=i686
endif
@@ -366,10 +379,6 @@ ifeq ($(VRAMDUMP), y)
OPTS += -DENABLE_VRAM_DUMP
RFLAGS += -DENABLE_VRAM_DUMP
endif
ifeq ($(NOHOOK), y)
OPTS += -DNO_KEYBOARD_HOOK
RFLAGS += -DNO_KEYBOARD_HOOK
endif
# Optional modules.
@@ -828,7 +837,7 @@ LIBS += -static
ifeq ($(AUTODEP), y)
%.o: %.c
@echo $<
@$(CC) $(CFLAGS) $(DEPS) -c $<
$(CC) $(CFLAGS) $(DEPS) -c $<
%.o: %.cc
@echo $<
@@ -865,7 +874,9 @@ endif
# Suppress false positive warnings in vid_voodoo_codegen_x86[-64].h
# that cause ~3000 lines to be output into the logs each time.
$(VOODOOOBJ): CFLAGS += -Wstringop-overflow=0
ifneq ($(CLANG), y)
$(VOODOOOBJ): CFLAGS += -Wstringop-overflow=0
endif
all: $(PROG).exe

View File

@@ -68,7 +68,7 @@ void
discord_update_activity(int paused)
{
struct DiscordActivity activity;
char config_name[1024], cpufamily[1024];
char cpufamily[1024];
char *paren;
if(discord_activities == NULL)
@@ -78,16 +78,14 @@ discord_update_activity(int paused)
memset(&activity, 0x00, sizeof(activity));
plat_get_dirname(config_name, usr_path);
strncpy(cpufamily, cpu_f->name, sizeof(cpufamily) - 1);
paren = strchr(cpufamily, '(');
if (paren)
*(paren - 1) = '\0';
if (strlen(plat_get_filename(config_name)) < 100)
if (strlen(vm_name) < 100)
{
sprintf_s(activity.details, sizeof(activity.details), "Running \"%s\"", plat_get_filename(config_name));
sprintf_s(activity.details, sizeof(activity.details), "Running \"%s\"", vm_name);
sprintf_s(activity.state, sizeof(activity.state), "%s (%s/%s)", strchr(machine_getname(), ']') + 2, cpufamily, cpu_s->name);
}
else

View File

@@ -1382,6 +1382,7 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
settings_set_check(hdlg, IDC_CHECK_GUS, temp_GUS);
settings_enable_window(hdlg, IDC_CONFIGURE_GUS, temp_GUS);
settings_set_check(hdlg, IDC_CHECK_SSI, temp_SSI2001);
settings_enable_window(hdlg, IDC_CONFIGURE_SSI, temp_SSI2001);
settings_set_check(hdlg, IDC_CHECK_FLOAT, temp_float);
free(lptsTemp);
@@ -1458,6 +1459,16 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
case IDC_CONFIGURE_GUS:
temp_deviceconfig |= deviceconfig_open(hdlg, (void *)&gus_device);
break;
case IDC_CHECK_SSI:
temp_SSI2001 = settings_get_check(hdlg, IDC_CHECK_SSI);
settings_enable_window(hdlg, IDC_CONFIGURE_SSI, temp_SSI2001);
break;
case IDC_CONFIGURE_SSI:
temp_deviceconfig |= deviceconfig_open(hdlg, &ssi2001_device);
break;
}
return FALSE;

View File

@@ -76,10 +76,6 @@ extern WCHAR wopenfilestring[512];
/* Local data. */
static wchar_t wTitle[512];
#ifndef NO_KEYBOARD_HOOK
static HHOOK hKeyboardHook;
static int hook_enabled = 0;
#endif
static int manager_wm = 0;
static int save_window_pos = 0, pause_state = 0;
static int dpi = 96;
@@ -399,42 +395,6 @@ ResetAllMenus(void)
}
#ifndef NO_KEYBOARD_HOOK
static LRESULT CALLBACK
LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
{
BOOL bControlKeyDown;
KBDLLHOOKSTRUCT *p;
if (nCode < 0 || nCode != HC_ACTION ||
(!mouse_capture && !video_fullscreen) || (kbd_req_capture && !mouse_capture && !video_fullscreen))
return(CallNextHookEx(hKeyboardHook, nCode, wParam, lParam));
p = (KBDLLHOOKSTRUCT*)lParam;
/* disable alt-tab */
if (p->vkCode == VK_TAB && p->flags & LLKHF_ALTDOWN) return(1);
/* disable alt-space */
if (p->vkCode == VK_SPACE && p->flags & LLKHF_ALTDOWN) return(1);
/* disable alt-escape */
if (p->vkCode == VK_ESCAPE && p->flags & LLKHF_ALTDOWN) return(1);
/* disable windows keys */
if((p->vkCode == VK_LWIN) || (p->vkCode == VK_RWIN)) return(1);
/* checks ctrl key pressed */
bControlKeyDown = GetAsyncKeyState(VK_CONTROL)>>((sizeof(SHORT)*8)-1);
/* disable ctrl-escape */
if (p->vkCode == VK_ESCAPE && bControlKeyDown) return(1);
return(CallNextHookEx(hKeyboardHook, nCode, wParam, lParam));
}
#endif
void
win_notify_dlg_open(void)
{
@@ -467,10 +427,6 @@ plat_power_off(void)
run before the main thread is terminated */
cycles -= 99999999;
#ifndef NO_KEYBOARD_HOOK
UnhookWindowsHookEx(hKeyboardHook);
#endif
KillTimer(hwndMain, TIMER_1SEC);
PostQuitMessage(0);
@@ -532,26 +488,11 @@ input_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
case WM_SETFOCUS:
infocus = 1;
#ifndef NO_KEYBOARD_HOOK
if (! hook_enabled) {
hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL,
LowLevelKeyboardProc,
GetModuleHandle(NULL),
0);
hook_enabled = 1;
}
#endif
break;
case WM_KILLFOCUS:
infocus = 0;
plat_mouse_capture(0);
#ifndef NO_KEYBOARD_HOOK
if (hook_enabled) {
UnhookWindowsHookEx(hKeyboardHook);
hook_enabled = 0;
}
#endif
break;
case WM_LBUTTONDOWN:
@@ -597,12 +538,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
switch (message) {
case WM_CREATE:
SetTimer(hwnd, TIMER_1SEC, 1000, NULL);
#ifndef NO_KEYBOARD_HOOK
hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL,
LowLevelKeyboardProc,
GetModuleHandle(NULL), 0);
hook_enabled = 1;
#endif
break;
case WM_COMMAND:
@@ -654,9 +589,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
nvr_save();
config_save();
}
#ifndef NO_KEYBOARD_HOOK
UnhookWindowsHookEx(hKeyboardHook);
#endif
KillTimer(hwnd, TIMER_1SEC);
PostQuitMessage(0);
}
@@ -1125,9 +1057,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
nvr_save();
config_save();
}
#ifndef NO_KEYBOARD_HOOK
UnhookWindowsHookEx(hKeyboardHook);
#endif
KillTimer(hwnd, TIMER_1SEC);
PostQuitMessage(0);
}
@@ -1135,9 +1064,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
case WM_DESTROY:
#ifndef NO_KEYBOARD_HOOK
UnhookWindowsHookEx(hKeyboardHook);
#endif
KillTimer(hwnd, TIMER_1SEC);
PostQuitMessage(0);
break;
@@ -1192,9 +1118,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
nvr_save();
config_save();
}
#ifndef NO_KEYBOARD_HOOK
UnhookWindowsHookEx(hKeyboardHook);
#endif
KillTimer(hwnd, TIMER_1SEC);
PostQuitMessage(0);
}
@@ -1224,26 +1147,11 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_SETFOCUS:
infocus = 1;
#ifndef NO_KEYBOARD_HOOK
if (! hook_enabled) {
hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL,
LowLevelKeyboardProc,
GetModuleHandle(NULL),
0);
hook_enabled = 1;
}
#endif
break;
case WM_KILLFOCUS:
infocus = 0;
plat_mouse_capture(0);
#ifndef NO_KEYBOARD_HOOK
if (hook_enabled) {
UnhookWindowsHookEx(hKeyboardHook);
hook_enabled = 0;
}
#endif
break;
case WM_ACTIVATE: