From 3323f26a1fb2992f92305c51d249d39352dad60a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Sun, 9 Jan 2022 20:01:59 +0100 Subject: [PATCH 01/13] Fix missing terminator of DLL import array --- src/win/win_ui.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/win/win_ui.c b/src/win/win_ui.c index f866ed5bf..97084858c 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -97,7 +97,8 @@ static dllimp_t user32_imports[] = { void* shell32_handle = NULL; static HRESULT (WINAPI *pSetCurrentProcessExplicitAppUserModelID)(PCWSTR AppID); static dllimp_t shell32_imports[]= { -{ "SetCurrentProcessExplicitAppUserModelID", &pSetCurrentProcessExplicitAppUserModelID } +{ "SetCurrentProcessExplicitAppUserModelID", &pSetCurrentProcessExplicitAppUserModelID }, +{ NULL, NULL } }; int From 50679f8faa0fe80aa13a2b30128c78bbfa55a87a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Sun, 9 Jan 2022 20:36:59 +0100 Subject: [PATCH 02/13] Fix link to WinBox in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e270bb2f4..0f48bc59e 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ System requirements and recommendations Performance may vary depending on both host and guest configuration. Most emulation logic is executed in a single thread, therefore generally systems with better IPC (instructions per clock) should be able to emulate higher clock speeds. It is also recommended to use a manager application with 86Box for easier handling of multiple virtual machines. -* [WinBox for 86Box](https://github.com/laciba96/WinBox-for-86Box) by [Laci bá'](https://github.com/laciba96) +* [WinBox for 86Box](https://github.com/86Box/WinBox-for-86Box) by Laci bá' * The new manager with improved new user experience; installer, automatic updates of emulator files and more. * [86Box Manager](https://github.com/86Box/86BoxManager) by [daviunic](https://github.com/daviunic) (Overdoze) * The traditional 86Box manager with simple interface. From 273d5af048bc0f62bc8f38ff4bcad0d779c470d3 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 10 Jan 2022 14:36:53 +0100 Subject: [PATCH 03/13] READ CD, READ CD OLD, and READ CD MSF with all flag bits cleared, are now treated as a non-data command. --- src/scsi/scsi_cdrom.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index a69413596..a53af6435 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -1623,7 +1623,12 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) dev->sector_len -= dev->sector_pos; dev->sector_len++; + msf = 1; + + /* If all the flag bits are cleared, then treat it as a non-data command. */ + if (cdb[9] == 0x00) + dev->sector_len = 0; break; case GPCMD_READ_CD_OLD: case GPCMD_READ_CD: @@ -1632,6 +1637,10 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) dev->sector_pos = (cdb[2] << 24) | (cdb[3] << 16) | (cdb[4] << 8) | cdb[5]; msf = 0; + + /* If all the flag bits are cleared, then treat it as a non-data command. */ + if (cdb[9] == 0x00) + dev->sector_len = 0; break; } From 28b772b1f73caf3f5dc2f48fb4dd6e021f41214a Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 10 Jan 2022 19:53:07 +0100 Subject: [PATCH 04/13] More READ CD fixes. --- src/cdrom/cdrom.c | 4 ++-- src/scsi/scsi_cdrom.c | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/cdrom/cdrom.c b/src/cdrom/cdrom.c index 37615a32e..b89232a46 100644 --- a/src/cdrom/cdrom.c +++ b/src/cdrom/cdrom.c @@ -1031,8 +1031,8 @@ cdrom_readsector_raw(cdrom_t *dev, uint8_t *buffer, int sector, int ismsf, int c memset(raw_buffer, 0, 2448); memset(extra_buffer, 0, 296); - if (!(cdrom_sector_flags & 0xf0)) { /* 0x00 and 0x08 are illegal modes */ - cdrom_log("CD-ROM %i: [Mode 1] 0x00 and 0x08 are illegal modes\n", dev->id); + if ((cdrom_sector_flags & 0xf8) == 0x08) { /* 0x08 is an illegal mode */ + cdrom_log("CD-ROM %i: [Mode 1] 0x08 is an illegal mode\n", dev->id); return 0; } diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index a53af6435..e099efe07 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -1626,8 +1626,14 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) msf = 1; + if ((cdb[9] & 0xf8) == 0x08) { + /* 0x08 is an illegal mode */ + scsi_cdrom_invalid_field(dev); + break; + } + /* If all the flag bits are cleared, then treat it as a non-data command. */ - if (cdb[9] == 0x00) + if ((cdb[9] == 0x00) && ((cdb[10] & 0x07) == 0x00)) dev->sector_len = 0; break; case GPCMD_READ_CD_OLD: @@ -1638,8 +1644,14 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) msf = 0; + if ((cdb[9] & 0xf8) == 0x08) { + /* 0x08 is an illegal mode */ + scsi_cdrom_invalid_field(dev); + break; + } + /* If all the flag bits are cleared, then treat it as a non-data command. */ - if (cdb[9] == 0x00) + if ((cdb[9] == 0x00) && ((cdb[10] & 0x07) == 0x00)) dev->sector_len = 0; break; } From 6b7e674877e40fd849baa97a940c87a0597d6614 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 10 Jan 2022 20:12:26 +0100 Subject: [PATCH 05/13] And another fix. --- src/cdrom/cdrom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cdrom/cdrom.c b/src/cdrom/cdrom.c index b89232a46..31f875a77 100644 --- a/src/cdrom/cdrom.c +++ b/src/cdrom/cdrom.c @@ -737,8 +737,8 @@ cdrom_read_disc_info_toc(cdrom_t *dev, unsigned char *b, unsigned char track, in static int track_type_is_valid(uint8_t id, int type, int flags, int audio, int mode2) { - if (!(flags & 0x70)) { /* 0x00/0x08/0x80/0x88 are illegal modes */ - cdrom_log("CD-ROM %i: [Any Mode] 0x00/0x08/0x80/0x88 are illegal modes\n", id); + if (!(flags & 0x70) && (flags & 0xf8)) { /* 0x08/0x80/0x88 are illegal modes */ + cdrom_log("CD-ROM %i: [Any Mode] 0x08/0x80/0x88 are illegal modes\n", id); return 0; } From e0578fbf5baeb71732b5f719b4d46652d44d0387 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 10 Jan 2022 20:26:36 +0100 Subject: [PATCH 06/13] And another fix. --- src/scsi/scsi_cdrom.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index e099efe07..842b8cc28 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -1635,6 +1635,10 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) /* If all the flag bits are cleared, then treat it as a non-data command. */ if ((cdb[9] == 0x00) && ((cdb[10] & 0x07) == 0x00)) dev->sector_len = 0; + else if ((cdb[9] == 0x00) && ((cdb[10] & 0x07) != 0x00)) { + scsi_cdrom_invalid_field(dev); + break; + } break; case GPCMD_READ_CD_OLD: case GPCMD_READ_CD: @@ -1653,6 +1657,10 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) /* If all the flag bits are cleared, then treat it as a non-data command. */ if ((cdb[9] == 0x00) && ((cdb[10] & 0x07) == 0x00)) dev->sector_len = 0; + else if ((cdb[9] == 0x00) && ((cdb[10] & 0x07) != 0x00)) { + scsi_cdrom_invalid_field(dev); + break; + } break; } From bf8227dd6c98ee57f4e472ed904a9d86830b1ac2 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 10 Jan 2022 20:41:43 +0100 Subject: [PATCH 07/13] And another. --- src/scsi/scsi_cdrom.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index 842b8cc28..8a443dd77 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -1629,7 +1629,7 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) if ((cdb[9] & 0xf8) == 0x08) { /* 0x08 is an illegal mode */ scsi_cdrom_invalid_field(dev); - break; + return; } /* If all the flag bits are cleared, then treat it as a non-data command. */ @@ -1637,7 +1637,7 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) dev->sector_len = 0; else if ((cdb[9] == 0x00) && ((cdb[10] & 0x07) != 0x00)) { scsi_cdrom_invalid_field(dev); - break; + return; } break; case GPCMD_READ_CD_OLD: @@ -1651,7 +1651,7 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) if ((cdb[9] & 0xf8) == 0x08) { /* 0x08 is an illegal mode */ scsi_cdrom_invalid_field(dev); - break; + return; } /* If all the flag bits are cleared, then treat it as a non-data command. */ @@ -1659,7 +1659,7 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) dev->sector_len = 0; else if ((cdb[9] == 0x00) && ((cdb[10] & 0x07) != 0x00)) { scsi_cdrom_invalid_field(dev); - break; + return; } break; } From 3198a844b0cc425c8882eee303fd5ebd0c95d9c1 Mon Sep 17 00:00:00 2001 From: altiereslima Date: Mon, 10 Jan 2022 20:55:12 -0300 Subject: [PATCH 08/13] Update pt-BR.rc --- src/win/languages/pt-BR.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win/languages/pt-BR.rc b/src/win/languages/pt-BR.rc index 06a000458..645587d99 100644 --- a/src/win/languages/pt-BR.rc +++ b/src/win/languages/pt-BR.rc @@ -478,7 +478,7 @@ BEGIN IDS_2115 "Magneto-óptico %i (%ls): %ls" IDS_2116 "Imagens magneto-ópticas (*.IM?;*.MDI)\0*.IM?;*.MDI\0Todos os arquivos (*.*)\0*.*\0" IDS_2117 "Bem-vindo ao 86Box!" - IDS_2118 "Controle interno" + IDS_2118 "Controlador interno" IDS_2119 "Sair" IDS_2120 "Nenhum ROM encontrada" IDS_2121 "Você deseja salvar as configurações?" From be76456921299d414f3bb1776b18c09b74e9ead6 Mon Sep 17 00:00:00 2001 From: altiereslima Date: Mon, 10 Jan 2022 21:05:09 -0300 Subject: [PATCH 09/13] Update pt-BR.rc --- src/win/languages/pt-BR.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win/languages/pt-BR.rc b/src/win/languages/pt-BR.rc index 645587d99..2e64edef4 100644 --- a/src/win/languages/pt-BR.rc +++ b/src/win/languages/pt-BR.rc @@ -368,7 +368,7 @@ END #define STR_SIZE_MB "Tamanho (MB):" #define STR_TYPE "Tipo:" #define STR_IMG_FORMAT "Formato:" -#define STR_BLOCK_SIZE "Tamanho do bloco:" +#define STR_BLOCK_SIZE "Bloco:" #define STR_FLOPPY_DRIVES "Unidades de disquete:" #define STR_TURBO "Turbo" From 3be3acf78fd4c4513f6296b78fd83406ece91610 Mon Sep 17 00:00:00 2001 From: ts-korhonen Date: Tue, 11 Jan 2022 08:04:56 +0200 Subject: [PATCH 10/13] Fix opengl core renderer message pump --- src/win/win_opengl.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/win/win_opengl.c b/src/win/win_opengl.c index 4f328c097..228cbb56f 100644 --- a/src/win/win_opengl.c +++ b/src/win/win_opengl.c @@ -200,8 +200,9 @@ static void set_parent_binding(int enable) * @param wParam * @param lParam * @param fullscreen + * @return Was message handled */ -static void handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, int fullscreen) +static int handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, int fullscreen) { switch (message) { @@ -219,7 +220,7 @@ static void handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, i /* Mouse events that enter and exit capture. */ PostMessage(parent, message, wParam, lParam); } - break; + return 1; case WM_KEYDOWN: case WM_KEYUP: case WM_SYSKEYDOWN: @@ -228,7 +229,7 @@ static void handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, i { PostMessage(parent, message, wParam, lParam); } - break; + return 1; case WM_INPUT: if (fullscreen) { @@ -256,8 +257,10 @@ static void handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, i } free(raw); } - break; + return 1; } + + return 0; } /** @@ -638,12 +641,13 @@ static void opengl_main(void* param) /* Handle window messages */ MSG msg; - if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { - if (msg.hwnd == window_hwnd) - handle_window_messages(msg.message, msg.wParam, msg.lParam, fullscreen); - TranslateMessage(&msg); - DispatchMessage(&msg); + if (msg.hwnd != window_hwnd || !handle_window_messages(msg.message, msg.wParam, msg.lParam, fullscreen)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } } /* Wait for synchronized events for 1ms before going back to window events */ From b13c14b039aff89ef503dbab30a8148256b6c04f Mon Sep 17 00:00:00 2001 From: ts-korhonen Date: Wed, 12 Jan 2022 19:39:17 +0200 Subject: [PATCH 11/13] Exit full screen mode if changing window with alt-tab etc. unintended way. --- src/win/win_opengl.c | 14 ++++++++++++++ src/win/win_ui.c | 10 ++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/win/win_opengl.c b/src/win/win_opengl.c index 228cbb56f..99843cd9f 100644 --- a/src/win/win_opengl.c +++ b/src/win/win_opengl.c @@ -258,6 +258,13 @@ static int handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, in free(raw); } return 1; + case WM_MOUSELEAVE: + if (fullscreen) + { + /* Leave fullscreen if mouse leaves the renderer window. */ + PostMessage(GetAncestor(parent, GA_ROOT), WM_LEAVEFULLSCREEN, 0, 0); + } + return 0; } return 0; @@ -726,7 +733,14 @@ static void opengl_main(void* param) { SetForegroundWindow(window_hwnd); SetFocus(window_hwnd); + + /* Clip cursor to prevent it moving to another monitor. */ + RECT rect; + GetWindowRect(window_hwnd, &rect); + ClipCursor(&rect); } + else + ClipCursor(NULL); } if (fullscreen) diff --git a/src/win/win_ui.c b/src/win/win_ui.c index 97084858c..c2740f0c7 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -961,6 +961,9 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) break; case WM_WINDOWPOSCHANGED: + if (video_fullscreen & 1) + PostMessage(hwndMain, WM_LEAVEFULLSCREEN, 0, 0); + pos = (WINDOWPOS*)lParam; GetClientRect(hwndMain, &rect); @@ -1160,6 +1163,13 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } break; + case WM_ACTIVATEAPP: + /* Leave full screen on switching application except + for OpenGL Core and VNC renderers. */ + if (video_fullscreen & 1 && wParam == FALSE && vid_api < 3) + PostMessage(hwndMain, WM_LEAVEFULLSCREEN, 0, 0); + break; + case WM_ENTERSIZEMOVE: user_resize = 1; break; From 9e0b945c707ffa8122f4b99263d65f992a0bb24a Mon Sep 17 00:00:00 2001 From: ts-korhonen Date: Wed, 12 Jan 2022 20:12:47 +0200 Subject: [PATCH 12/13] qt: Fix full screen strecth modes, implement -F switch Patches from Cacodemon345 --- src/qt/qt_mainwindow.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 96504cf23..2de91a279 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -292,6 +292,15 @@ MainWindow::MainWindow(QWidget *parent) : ui->actionTake_screenshot->setShortcutVisibleInContextMenu(true); #endif video_setblit(qt_blit); + + if (start_in_fullscreen) { + connect(ui->stackedWidget, &RendererStack::blitToRenderer, this, [this] () { + if (start_in_fullscreen) { + QTimer::singleShot(100, ui->actionFullscreen, &QAction::trigger); + start_in_fullscreen = 0; + } + }); + } } void MainWindow::closeEvent(QCloseEvent *event) { @@ -967,6 +976,7 @@ void MainWindow::on_actionFullscreen_triggered() { showFullScreen(); video_fullscreen = 1; } + ui->stackedWidget->rendererWindow->onResize(width(), height()); } void MainWindow::getTitle_(wchar_t *title) From 4c048375743072744834d9fecb299aa90386f949 Mon Sep 17 00:00:00 2001 From: ts-korhonen Date: Wed, 12 Jan 2022 20:38:27 +0200 Subject: [PATCH 13/13] Fix discord.h filename change on include --- src/win/win_ui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win/win_ui.c b/src/win/win_ui.c index c2740f0c7..7179b108b 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -43,7 +43,7 @@ #include <86box/ui.h> #include <86box/win.h> #include <86box/version.h> -# include <86box/win_discord.h> +#include <86box/discord.h> #ifdef MTR_ENABLED #include