From 9cafca09abd21988d91db36378b71cbd19c066f0 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 25 Dec 2021 21:42:02 +0100 Subject: [PATCH 1/7] Increased the 86Box version to 3.2. --- CMakeLists.txt | 2 +- src/include_make/86box/version.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4be7c3de..b1f56e7da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ cmake_policy(SET CMP0091 NEW) cmake_policy(SET CMP0079 NEW) project(86Box - VERSION 3.1 + VERSION 3.2 DESCRIPTION "Emulator of x86-based systems" HOMEPAGE_URL "https://86box.net" LANGUAGES C CXX) diff --git a/src/include_make/86box/version.h b/src/include_make/86box/version.h index b2eb49aaf..9228c68e3 100644 --- a/src/include_make/86box/version.h +++ b/src/include_make/86box/version.h @@ -20,9 +20,9 @@ #define EMU_NAME "86Box" #define EMU_NAME_W LSTR(EMU_NAME) -#define EMU_VERSION "3.1" +#define EMU_VERSION "3.2" #define EMU_VERSION_W LSTR(EMU_VERSION) -#define EMU_VERSION_EX "3.01" +#define EMU_VERSION_EX "3.02" #define EMU_VERSION_MAJ 3 #define EMU_VERSION_MIN 0 #define EMU_VERSION_PATCH 0 From 3bf359cbf964ea8b82919defafab5017d51b27ee Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 26 Dec 2021 22:46:31 +0100 Subject: [PATCH 2/7] Make SiS 496/497 recalcmapping always use flushmmucache_nopc(). --- src/chipset/sis_85c496.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/chipset/sis_85c496.c b/src/chipset/sis_85c496.c index 33225e4a2..9f4952597 100644 --- a/src/chipset/sis_85c496.c +++ b/src/chipset/sis_85c496.c @@ -143,6 +143,8 @@ sis_85c496_recalcmapping(sis_85c496_t *dev) } else mem_set_mem_state_both(base, 0x8000, MEM_READ_EXTANY | MEM_WRITE_EXTANY); } + + flushmmucache_nopc(); } @@ -240,13 +242,8 @@ sis_85c49x_pci_write(int func, int addr, uint8_t val, void *priv) break; case 0x45: /* Shadow Configure */ dev->pci_conf[addr] = val & 0x0f; - if (valxor & 0x03) { + if (valxor & 0x03) sis_85c496_recalcmapping(dev); - if ((old == 0x0a) && (val == 0x09)) - flushmmucache_nopc(); - else - flushmmucache(); - } break; case 0x46: /* Cacheable Control */ dev->pci_conf[addr] = val; From 81bc032b00e1f2cff852acc60e6f901cc4e122be Mon Sep 17 00:00:00 2001 From: Alexander Babikov Date: Wed, 29 Dec 2021 09:48:56 +0500 Subject: [PATCH 3/7] Handle the internal name change for the S3 ViRGE/GX (formerly ViRGE/DX VBE 2.0) --- src/config.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/config.c b/src/config.c index bda66d417..6c5e4e0b5 100644 --- a/src/config.c +++ b/src/config.c @@ -888,7 +888,10 @@ load_video(void) } free_p = 1; } - gfxcard = video_get_video_from_internal_name(p); + if (!strcmp(p, "virge375_vbe20_pci")) /* migrate renamed cards */ + gfxcard = video_get_video_from_internal_name("virge385_pci"); + else + gfxcard = video_get_video_from_internal_name(p); if (free_p) free(p); } From 00640bdc44b87e3c0b5422140fc95012a293cf09 Mon Sep 17 00:00:00 2001 From: Alexander Babikov Date: Wed, 29 Dec 2021 09:49:38 +0500 Subject: [PATCH 4/7] Fix a typo in CH Flightstick Pro's internal name --- src/config.c | 4 +++- src/game/gameport.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/config.c b/src/config.c index 6c5e4e0b5..c37d0b18b 100644 --- a/src/config.c +++ b/src/config.c @@ -917,7 +917,7 @@ load_input_devices(void) p = config_get_string(cat, "joystick_type", NULL); if (p != NULL) { - if (!strcmp(p, "standard_2button")) + if (!strcmp(p, "standard_2button")) /* migrate renamed types */ joystick_type = joystick_get_from_internal_name("2axis_2button"); else if (!strcmp(p, "standard_4button")) joystick_type = joystick_get_from_internal_name("2axis_4button"); @@ -925,6 +925,8 @@ load_input_devices(void) joystick_type = joystick_get_from_internal_name("2axis_6button"); else if (!strcmp(p, "standard_8button")) joystick_type = joystick_get_from_internal_name("2axis_8button"); + else if (!strcmp(p, "ch_flighstick_pro")) + joystick_type = joystick_get_from_internal_name("ch_flightstick_pro"); joystick_type = joystick_get_from_internal_name(p); if (!joystick_type) { diff --git a/src/game/gameport.c b/src/game/gameport.c index 145262278..0d48444fd 100644 --- a/src/game/gameport.c +++ b/src/game/gameport.c @@ -88,7 +88,7 @@ static const struct { { "3axis_2button", &joystick_3axis_2button }, { "3axis_4button", &joystick_3axis_4button }, { "4axis_4button", &joystick_4axis_4button }, - { "ch_flighstick_pro", &joystick_ch_flightstick_pro }, + { "ch_flightstick_pro", &joystick_ch_flightstick_pro }, { "sidewinder_pad", &joystick_sw_pad }, { "thrustmaster_fcs", &joystick_tm_fcs }, { "", NULL } From 29595ce4f774cb81eb5fc4843bb7644d599f97f8 Mon Sep 17 00:00:00 2001 From: Alexander Babikov Date: Wed, 29 Dec 2021 09:51:42 +0500 Subject: [PATCH 5/7] Fix joystick type migration not working as intended Map legacy integer-based joystick type options directly --- src/config.c | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/src/config.c b/src/config.c index c37d0b18b..08326da71 100644 --- a/src/config.c +++ b/src/config.c @@ -927,21 +927,41 @@ load_input_devices(void) joystick_type = joystick_get_from_internal_name("2axis_8button"); else if (!strcmp(p, "ch_flighstick_pro")) joystick_type = joystick_get_from_internal_name("ch_flightstick_pro"); + else + joystick_type = joystick_get_from_internal_name(p); - joystick_type = joystick_get_from_internal_name(p); if (!joystick_type) { /* Try to read an integer for backwards compatibility with old configs */ - c = config_get_int(cat, "joystick_type", 8); - switch (c) { - case 0: case 1: case 2: case 3: /* 2-axis joysticks */ - joystick_type = c + 1; - break; - case 4: case 5: case 6: case 7: /* other joysticks */ - joystick_type = c + 3; - break; - default: /* "None" (8) or invalid value */ - joystick_type = 0; - break; + if (!strcmp(p, "0")) /* workaround for config_get_int returning 0 on non-integer data */ + joystick_type = joystick_get_from_internal_name("2axis_2button"); + else { + c = config_get_int(cat, "joystick_type", 8); + switch (c) { + case 1: + joystick_type = joystick_get_from_internal_name("2axis_4button"); + break; + case 2: + joystick_type = joystick_get_from_internal_name("2axis_6button"); + break; + case 3: + joystick_type = joystick_get_from_internal_name("2axis_8button"); + break; + case 4: + joystick_type = joystick_get_from_internal_name("4axis_4button"); + break; + case 5: + joystick_type = joystick_get_from_internal_name("ch_flightstick_pro"); + break; + case 6: + joystick_type = joystick_get_from_internal_name("sidewinder_pad"); + break; + case 7: + joystick_type = joystick_get_from_internal_name("thrustmaster_fcs"); + break; + default: + joystick_type = 0; + break; + } } } } else From bc26bc3ea64241d426a3b271c133b2a498ba9abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Wed, 29 Dec 2021 17:39:56 +0100 Subject: [PATCH 6/7] [opti495] fix read/writes to the scratch area --- src/chipset/opti495.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/chipset/opti495.c b/src/chipset/opti495.c index 5d2313ef9..20dc23bc5 100644 --- a/src/chipset/opti495.c +++ b/src/chipset/opti495.c @@ -151,8 +151,10 @@ opti495_write(uint16_t addr, uint8_t val, void *priv) break; case 0xe1: + dev->scratch[0] = val; + break; case 0xe2: - dev->scratch[addr] = val; + dev->scratch[1] = val; break; } } @@ -175,8 +177,10 @@ opti495_read(uint16_t addr, void *priv) } break; case 0xe1: + ret = dev->scratch[0]; + break; case 0xe2: - ret = dev->scratch[addr]; + ret = dev->scratch[1]; break; } From abacd105b2ac1c4c92247e195f7ff6a76563875e Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 29 Dec 2021 18:00:01 +0100 Subject: [PATCH 7/7] OPTi 49x scratch register writes no longer write out of the array's bounds. --- src/chipset/opti495.c | 4 ++-- src/chipset/opti499.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chipset/opti495.c b/src/chipset/opti495.c index 5d2313ef9..cdde85300 100644 --- a/src/chipset/opti495.c +++ b/src/chipset/opti495.c @@ -152,7 +152,7 @@ opti495_write(uint16_t addr, uint8_t val, void *priv) case 0xe1: case 0xe2: - dev->scratch[addr] = val; + dev->scratch[~addr & 0x01] = val; break; } } @@ -176,7 +176,7 @@ opti495_read(uint16_t addr, void *priv) break; case 0xe1: case 0xe2: - ret = dev->scratch[addr]; + ret = dev->scratch[~addr & 0x01]; break; } diff --git a/src/chipset/opti499.c b/src/chipset/opti499.c index 87bc39c8d..1768908a4 100644 --- a/src/chipset/opti499.c +++ b/src/chipset/opti499.c @@ -162,7 +162,7 @@ opti499_write(uint16_t addr, uint8_t val, void *priv) break; case 0xe1: case 0xe2: - dev->scratch[addr] = val; + dev->scratch[~addr & 0x01] = val; break; } } @@ -189,7 +189,7 @@ opti499_read(uint16_t addr, void *priv) break; case 0xe1: case 0xe2: - ret = dev->scratch[addr]; + ret = dev->scratch[~addr & 0x01]; break; }