From a4081be22c8f39b343e68c4f798cd8f1be828115 Mon Sep 17 00:00:00 2001 From: ts-korhonen Date: Fri, 7 Jan 2022 18:09:16 +0200 Subject: [PATCH 01/10] Pass sysex messages in mpu-401 uart mode --- src/sound/snd_mpu401.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/sound/snd_mpu401.c b/src/sound/snd_mpu401.c index 1002e72f5..5ada36829 100644 --- a/src/sound/snd_mpu401.c +++ b/src/sound/snd_mpu401.c @@ -1385,6 +1385,17 @@ MPU401_InputSysex(void *p, uint8_t *buffer, uint32_t len, int abort) mpu401_log("MPU401 Input Sysex\n"); +#ifdef DOSBOX_CODE + if (mpu->mode == M_UART) { +#else + if (!mpu->intelligent && mpu->mode == M_UART) { +#endif + /* UART mode input. */ + for (i = 0; i < len; i++) + MPU401_QueueByte(mpu, buffer[i]); + return 0; + } + if (mpu->filter.sysex_in) { if (abort) { mpu->state.sysex_in_finished=1; From c4448492e816bf01bec5ac73dfe0734e7c429156 Mon Sep 17 00:00:00 2001 From: dob205 Date: Fri, 7 Jan 2022 17:16:18 +0100 Subject: [PATCH 02/10] Adjustments to the German translation Aligns the German translation to the CHS used in the disk overview table and fixes smaller mishaps --- src/win/languages/de-DE.rc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/win/languages/de-DE.rc b/src/win/languages/de-DE.rc index 0f1e35650..5a5ca5914 100644 --- a/src/win/languages/de-DE.rc +++ b/src/win/languages/de-DE.rc @@ -382,8 +382,8 @@ END #define STR_ISAMEM_2 "Steckkarte 2:" #define STR_ISAMEM_3 "Steckkarte 3:" #define STR_ISAMEM_4 "Steckkarte 4:" -#define STR_BUGGER "ISABugger-Gerät:" -#define STR_POSTCARD "POST-Code-Karte:" +#define STR_BUGGER "ISABugger-Gerät" +#define STR_POSTCARD "POST-Code-Karte" #define FONT_SIZE 9 #define FONT_NAME "Segoe UI" @@ -464,7 +464,7 @@ BEGIN IDS_2104 "Tastaturbeschleuniger konnten nicht geladen werden." IDS_2105 "Roheingaben konnten nicht registriert werden." IDS_2106 "%u" - IDS_2107 "%u MB (ZKS: %i, %i, %i)" + IDS_2107 "%u MB (CHS: %i, %i, %i)" IDS_2108 "Diskette %i (%s): %ls" IDS_2109 "Alle Images (*.0??;*.1??;*.??0;*.86F;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.JSON;*.TD0;*.*FD?;*.MFM;*.XDF)\0*.0??;*.1??;*.??0;*.86F;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.JSON;*.TD0;*.*FD?;*.MFM;*.XDF\0Fortgeschrittene Sektorimages (*.IMD;*.JSON;*.TD0)\0*.IMD;*.JSON;*.TD0\0Basissektorimages (*.0??;*.1??;*.??0;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?)\0*.0??;*.1??;*.??0;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?\0Fluximages (*.FDI)\0*.FDI\0Oberflächenimages (*.86F;*.MFM)\0*.86F;*.MFM\0Alle Dateien (*.*)\0*.*\0" IDS_2110 "FreeType konnte nicht initialisiert werden" From 6122aff602b699a40f41eb0e84bb2d49f5676ed3 Mon Sep 17 00:00:00 2001 From: dob205 Date: Fri, 7 Jan 2022 17:22:59 +0100 Subject: [PATCH 03/10] Updates to hr-HR.rc Translates previously untranslated renderer messages and fixes small glitches --- src/win/languages/hr-HR.rc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/win/languages/hr-HR.rc b/src/win/languages/hr-HR.rc index c6d4c4cc5..61fc0c475 100644 --- a/src/win/languages/hr-HR.rc +++ b/src/win/languages/hr-HR.rc @@ -376,7 +376,7 @@ END #define STR_ZIP_DRIVES "ZIP pogoni:" #define STR_250 "ZIP 250" -#define STR_ISARTC "Ura u stvarnom vrijemenu RTC:" +#define STR_ISARTC "Sat stvarnog vremena (RTC):" #define STR_ISAMEM "Proširenje memorije ISA" #define STR_ISAMEM_1 "Kartica 1:" #define STR_ISAMEM_2 "Kartica 2:" @@ -530,8 +530,8 @@ BEGIN IDS_2149 "Slike audio kasete (*.PCM;*.RAW;*.WAV;*.CAS)\0*.PCM;*.RAW;*.WAV;*.CAS\0Sve datoteke (*.*)\0*.*\0" IDS_2150 "Kaseta %i: %ls" IDS_2151 "Slike kasete (*.A;*.B;*.JRC)\0*.A;*.B;*.JRC\0Sve datoteke (*.*)\0*.*\0" - IDS_2152 "Error initializing renderer" - IDS_2153 "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer." + IDS_2152 "Nije moguće inicijalizirati renderer" + IDS_2153 "Nije moguće inicijalizirati OpenGL (3.0 jezgra) renderer. Molimte koristite drugi renderer." END STRINGTABLE DISCARDABLE From edc8c88062ae6eebbf82513bf47a8adb5fba35b7 Mon Sep 17 00:00:00 2001 From: ts-korhonen Date: Fri, 7 Jan 2022 23:36:25 +0200 Subject: [PATCH 04/10] Properly UART-mode detection on input sysex messages --- src/sound/snd_mpu401.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sound/snd_mpu401.c b/src/sound/snd_mpu401.c index 5ada36829..12e92b905 100644 --- a/src/sound/snd_mpu401.c +++ b/src/sound/snd_mpu401.c @@ -1388,7 +1388,7 @@ MPU401_InputSysex(void *p, uint8_t *buffer, uint32_t len, int abort) #ifdef DOSBOX_CODE if (mpu->mode == M_UART) { #else - if (!mpu->intelligent && mpu->mode == M_UART) { + if (!mpu->intelligent || mpu->mode == M_UART) { #endif /* UART mode input. */ for (i = 0; i < len; i++) From 65310e01419d1ce79edc8dea14558c98344d5d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Sat, 8 Jan 2022 21:43:04 +0100 Subject: [PATCH 05/10] Delay load `SetCurrentProcessExplicitAppUserModelID` Appears to be the only thing preventing 86Box from running on Vista. Note that this doesn't mean a change in the official system requirements. --- src/win/win.c | 3 --- src/win/win_ui.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/win/win.c b/src/win/win.c index 27386b5b7..a4854f65f 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -450,9 +450,6 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow) { char **argv = NULL; int argc, i; - wchar_t * AppID = L"86Box.86Box\0"; - - SetCurrentProcessExplicitAppUserModelID(AppID); /* Initialize the COM library for the main thread. */ CoInitializeEx(NULL, COINIT_MULTITHREADED); diff --git a/src/win/win_ui.c b/src/win/win_ui.c index 40f9068b0..912eef8cf 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -92,6 +92,13 @@ static dllimp_t user32_imports[] = { { NULL, NULL } }; +/* Taskbar application ID API, Windows 7+ */ +void* shell32_handle = NULL; +static HRESULT (WINAPI *pSetCurrentProcessExplicitAppUserModelID)(PCWSTR AppID); +static dllimp_t shell32_imports[]= { +{ "SetCurrentProcessExplicitAppUserModelID", &pSetCurrentProcessExplicitAppUserModelID } +}; + int win_get_dpi(HWND hwnd) { if (user32_handle != NULL) { @@ -1244,6 +1251,11 @@ ui_init(int nCmdShow) /* Load DPI related Windows 10 APIs */ user32_handle = dynld_module("user32.dll", user32_imports); + /* Set the application ID for the taskbar. */ + shell32_handle = dynld_module("shell32.dll", shell32_imports); + if (shell32_handle) + pSetCurrentProcessExplicitAppUserModelID(L"86Box.86Box"); + /* Set up TaskDialog configuration. */ tdconfig.cbSize = sizeof(tdconfig); tdconfig.dwFlags = TDF_ENABLE_HYPERLINKS; From 9a566a501c5c42c032b4bada254052f696840cd4 Mon Sep 17 00:00:00 2001 From: ts-korhonen Date: Sun, 9 Jan 2022 16:46:44 +0200 Subject: [PATCH 06/10] Add hide_tool_bar config file setting In preparation for toolbar implementation --- src/config.c | 7 +++++++ src/include/86box/plat.h | 2 +- src/unix/unix.c | 1 + src/win/win_ui.c | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/config.c b/src/config.c index bda66d417..eebc4462e 100644 --- a/src/config.c +++ b/src/config.c @@ -561,6 +561,7 @@ load_general(void) kbd_req_capture = config_get_int(cat, "kbd_req_capture", 0); hide_status_bar = config_get_int(cat, "hide_status_bar", 0); + hide_tool_bar = config_get_int(cat, "hide_tool_bar", 0); confirm_reset = config_get_int(cat, "confirm_reset", 1); confirm_exit = config_get_int(cat, "confirm_exit", 1); @@ -2036,6 +2037,7 @@ config_load(void) kbd_req_capture = 0; hide_status_bar = 0; + hide_tool_bar = 0; scale = 1; machine = machine_get_machine_from_internal_name("ibmpc"); dpi_scale = 1; @@ -2222,6 +2224,11 @@ save_general(void) else config_delete_var(cat, "hide_status_bar"); + if (hide_tool_bar != 0) + config_set_int(cat, "hide_tool_bar", hide_tool_bar); + else + config_delete_var(cat, "hide_tool_bar"); + if (confirm_reset != 1) config_set_int(cat, "confirm_reset", confirm_reset); else diff --git a/src/include/86box/plat.h b/src/include/86box/plat.h index 3a605fe6b..ff8b31b02 100644 --- a/src/include/86box/plat.h +++ b/src/include/86box/plat.h @@ -90,7 +90,7 @@ extern int update_icons; extern int unscaled_size_x, /* current unscaled size X */ unscaled_size_y; /* current unscaled size Y */ -extern int kbd_req_capture, hide_status_bar; +extern int kbd_req_capture, hide_status_bar, hide_tool_bar; /* System-related functions. */ extern char *fix_exe_path(char *str); diff --git a/src/unix/unix.c b/src/unix/unix.c index f707757fb..3727e1f63 100644 --- a/src/unix/unix.c +++ b/src/unix/unix.c @@ -40,6 +40,7 @@ int rctrl_is_lalt; int update_icons; int kbd_req_capture; int hide_status_bar; +int hide_tool_bar; int fixed_size_x = 640; int fixed_size_y = 480; extern int title_set; diff --git a/src/win/win_ui.c b/src/win/win_ui.c index 912eef8cf..f866ed5bf 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -65,6 +65,7 @@ int user_resize = 0; int fixed_size_x = 0, fixed_size_y = 0; int kbd_req_capture = 0; int hide_status_bar = 0; +int hide_tool_bar = 0; int dpi = 96; extern char openfilestring[512]; 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 07/10] 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 08/10] 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 09/10] 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 10/10] 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; }