From 4c9f7867a83a3d68e0b7061fdd2ac5584a263148 Mon Sep 17 00:00:00 2001 From: cold-brewed Date: Thu, 5 Oct 2023 13:07:19 -0400 Subject: [PATCH 01/50] GHA workaround for homebrew package issue, enable macOS packaging again --- .github/workflows/cmake.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2e8a6c2fc..8a5392728 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -411,8 +411,15 @@ jobs: slug: -Qt packages: >- qt@5 + src-packages: >- + libsndfile steps: + - name: Install source dependencies + run: >- + brew install -s + ${{ matrix.ui.src-packages }} + - name: Install dependencies run: >- brew install @@ -458,12 +465,10 @@ jobs: sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" - name: Generate package - if: 0 run: | cmake --install build - name: Upload artifact - if: 0 uses: actions/upload-artifact@v3 with: name: '86Box${{ matrix.ui.slug }}${{ matrix.dynarec.slug }}${{ matrix.build.slug }}-macOS-x86_64-gha${{ github.run_number }}' From 149ce8ad2a9f3c82c715b605d526919c85e8c087 Mon Sep 17 00:00:00 2001 From: cold-brewed Date: Thu, 5 Oct 2023 13:40:00 -0400 Subject: [PATCH 02/50] GHA: Perform a reinstall instead --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 8a5392728..ae3f96de2 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -417,7 +417,7 @@ jobs: steps: - name: Install source dependencies run: >- - brew install -s + brew reinstall -s ${{ matrix.ui.src-packages }} - name: Install dependencies From 535fd005dc068d9a4c9dd81180b35ed3a6722a50 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 7 Oct 2023 22:50:17 +0200 Subject: [PATCH 03/50] Removed the useless codegen_close(). --- src/86box.c | 4 ---- src/codegen_new/codegen.h | 1 - src/codegen_new/codegen_block.c | 27 --------------------------- src/cpu/codegen_public.h | 3 --- 4 files changed, 35 deletions(-) diff --git a/src/86box.c b/src/86box.c index 5637415e3..9d41bd344 100644 --- a/src/86box.c +++ b/src/86box.c @@ -1212,10 +1212,6 @@ pc_close(UNUSED(thread_t *ptr)) /* Terminate the UI thread. */ is_quit = 1; -#if (defined(USE_DYNAREC) && defined(USE_NEW_DYNAREC)) - codegen_close(); -#endif - nvr_save(); config_save(); diff --git a/src/codegen_new/codegen.h b/src/codegen_new/codegen.h index 547f867e3..deeeb899c 100644 --- a/src/codegen_new/codegen.h +++ b/src/codegen_new/codegen.h @@ -290,7 +290,6 @@ codegen_mark_code_present(codeblock_t *block, uint32_t start_pc, int len) } extern void codegen_init(void); -extern void codegen_close(void); extern void codegen_reset(void); extern void codegen_block_init(uint32_t phys_addr); extern void codegen_block_remove(void); diff --git a/src/codegen_new/codegen_block.c b/src/codegen_new/codegen_block.c index 9f812d093..ee0a030ba 100644 --- a/src/codegen_new/codegen_block.c +++ b/src/codegen_new/codegen_block.c @@ -229,33 +229,6 @@ codegen_init(void) #endif } -void -codegen_close(void) -{ -#ifdef DEBUG_EXTRA - pclog("Instruction counts :\n"); - while (1) { - int c; - uint32_t highest_num = 0, highest_idx = 0; - - for (c = 0; c < 256 * 256; c++) { - if (instr_counts[c] > highest_num) { - highest_num = instr_counts[c]; - highest_idx = c; - } - } - if (!highest_num) - break; - - instr_counts[highest_idx] = 0; - if (highest_idx > 256) - pclog(" %02x %02x = %u\n", highest_idx >> 8, highest_idx & 0xff, highest_num); - else - pclog(" %02x = %u\n", highest_idx & 0xff, highest_num); - } -#endif -} - void codegen_reset(void) { diff --git a/src/cpu/codegen_public.h b/src/cpu/codegen_public.h index 36393296e..cb7ec57a7 100644 --- a/src/cpu/codegen_public.h +++ b/src/cpu/codegen_public.h @@ -50,9 +50,6 @@ #endif extern void codegen_init(void); -#ifdef USE_NEW_DYNAREC -extern void codegen_close(void); -#endif extern void codegen_flush(void); /*Current physical page of block being recompiled. -1 if no recompilation taking place */ From 753bb6103cc54358f0c0d38d9f13f605ca67ccdf Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 7 Oct 2023 22:54:06 +0200 Subject: [PATCH 04/50] Removed an unnecessary #include in chipset/umc_hb4.c. --- src/chipset/umc_hb4.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/chipset/umc_hb4.c b/src/chipset/umc_hb4.c index 4e115eeb6..d5cce0fca 100644 --- a/src/chipset/umc_hb4.c +++ b/src/chipset/umc_hb4.c @@ -103,25 +103,11 @@ #include <86box/timer.h> #include <86box/io.h> #include <86box/device.h> - #include <86box/mem.h> #include <86box/pci.h> #include <86box/plat_unused.h> #include <86box/port_92.h> #include <86box/smram.h> - -#ifdef USE_DYNAREC -# include "codegen_public.h" -#else -# ifdef USE_NEW_DYNAREC -# define PAGE_MASK_SHIFT 6 -# else -# define PAGE_MASK_INDEX_MASK 3 -# define PAGE_MASK_INDEX_SHIFT 10 -# define PAGE_MASK_SHIFT 4 -# endif -# define PAGE_MASK_MASK 63 -#endif #include <86box/chipset.h> #ifdef ENABLE_HB4_LOG From fc8edd47fabc7695be7ddb7a326cb395133d3fad Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 7 Oct 2023 22:55:44 +0200 Subject: [PATCH 05/50] Did the same in mem/mmu_2386.c. --- src/mem/mmu_2386.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/mem/mmu_2386.c b/src/mem/mmu_2386.c index 6e7236518..21c62b833 100644 --- a/src/mem/mmu_2386.c +++ b/src/mem/mmu_2386.c @@ -38,22 +38,6 @@ #include <86box/plat.h> #include <86box/rom.h> #include <86box/gdbstub.h> -#ifdef USE_DYNAREC -# include "codegen_public.h" -#else -# ifdef USE_NEW_DYNAREC -# define PAGE_MASK_SHIFT 6 -# else -# define PAGE_MASK_INDEX_MASK 3 -# define PAGE_MASK_INDEX_SHIFT 10 -# define PAGE_MASK_SHIFT 4 -# endif -# define PAGE_MASK_MASK 63 -#endif -#if (!defined(USE_DYNAREC) && defined(USE_NEW_DYNAREC)) -# define BLOCK_PC_INVALID 0xffffffff -# define BLOCK_INVALID 0 -#endif uint8_t mem_readb_map(uint32_t addr) From 7fe79f995da561a48b2da350c51aa8ef0b35e86b Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 8 Oct 2023 01:14:26 +0200 Subject: [PATCH 06/50] Intel GPIO sanitization, phase 1. --- src/sio/sio_pc87306.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sio/sio_pc87306.c b/src/sio/sio_pc87306.c index 5b3e23f31..e7c68eba5 100644 --- a/src/sio/sio_pc87306.c +++ b/src/sio/sio_pc87306.c @@ -35,11 +35,11 @@ #include <86box/fdc.h> #include <86box/sio.h> #include <86box/plat_unused.h> +#include <86box/machine.h> typedef struct pc87306_t { uint8_t tries; uint8_t regs[29]; - uint8_t gpio[2]; uint16_t gpioba; int cur_reg; fdc_t *fdc; @@ -51,8 +51,11 @@ static void pc87306_gpio_write(uint16_t port, uint8_t val, void *priv) { pc87306_t *dev = (pc87306_t *) priv; + uint8_t shift = ((8 << (port & 1)) - 8); + uint32_t shifted_val = (((uint32_t) val) << shift); + uint32_t ff_mask = ~(((uint32_t) 0xff) << shift); - dev->gpio[port & 1] = val; + (void) machine_handle_gpio(1, ff_mask | shifted_val); } uint8_t @@ -60,7 +63,7 @@ pc87306_gpio_read(uint16_t port, void *priv) { const pc87306_t *dev = (pc87306_t *) priv; - return dev->gpio[port & 1]; + return machine_handle_gpio(0, 0xffffffff) >> ((8 << (port & 1)) - 8); } static void @@ -411,9 +414,6 @@ pc87306_reset(void *priv) dev->regs[0x12] = 0x30; dev->regs[0x19] = 0xEF; - dev->gpio[0] = 0xff; - dev->gpio[1] = 0xfb; - /* 0 = 360 rpm @ 500 kbps for 3.5" 1 = Default, 300 rpm @ 500, 300, 250, 1000 kbps for 3.5" From 63ce626f29974f0c89b7bd41a942a794a8f345af Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 8 Oct 2023 01:16:42 +0200 Subject: [PATCH 07/50] Phase 2. --- src/machine/machine.c | 5 +++++ src/machine/machine_table.c | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/machine/machine.c b/src/machine/machine.c index 61aa9914d..cd785009b 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -72,6 +72,11 @@ machine_init_ex(int m) if (!bios_only) { machine_log("Initializing as \"%s\"\n", machine_getname()); + machine_init_p1(); + + machine_init_gpio(); + machine_init_gpio_acpi(); + is_vpc = 0; standalone_gameport_type = NULL; gameport_instance_id = 0; diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 6a30110b1..10b62c8fe 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -13263,9 +13263,13 @@ const machine_t machines[] = { /* Saved copies - jumpers get applied to these. We use also machine_gpio to store IBM PC/XT jumpers as they need more than one byte. */ +static uint8_t machine_p1_default; static uint8_t machine_p1; +static uint32_t machine_gpio_default; static uint32_t machine_gpio; + +static uint32_t machine_gpio_acpi_default; static uint32_t machine_gpio_acpi; uint8_t @@ -13301,7 +13305,7 @@ machine_handle_p1(uint8_t write, uint8_t val) void machine_init_p1(void) { - machine_p1 = machines[machine].kbc_p1; + machine_p1 = machine_p1_default = machines[machine].kbc_p1; } uint32_t @@ -13336,7 +13340,7 @@ machine_handle_gpio(uint8_t write, uint32_t val) void machine_init_gpio(void) { - machine_gpio = machines[machine].gpio; + machine_gpio = machine_gpio_default = machines[machine].gpio; } uint32_t @@ -13371,7 +13375,7 @@ machine_handle_gpio_acpi(uint8_t write, uint32_t val) void machine_init_gpio_acpi(void) { - machine_gpio_acpi = machines[machine].gpio_acpi; + machine_gpio_acpi = machine_gpio_acpi_default = machines[machine].gpio_acpi; } int From 4be73f0b7aa959683563c3032d92f14b288a55b3 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 8 Oct 2023 01:32:10 +0200 Subject: [PATCH 08/50] Phase 3. --- src/include/86box/machine.h | 5 ++++- src/machine/m_at_socket5.c | 36 ++++++++++++++++++++++++++++++++++++ src/machine/machine_table.c | 30 ++++++++++++++++++++++++------ 3 files changed, 64 insertions(+), 7 deletions(-) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 6d893e8ac..3fb3f5f9c 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -372,15 +372,18 @@ extern int machine_has_mouse(void); extern int machine_is_sony(void); extern uint8_t machine_get_p1(void); +extern void machine_set_p1_default(uint8_t val); extern void machine_set_p1(uint8_t val); extern void machine_init_p1(void); extern uint8_t machine_handle_p1(uint8_t write, uint8_t val); extern uint32_t machine_get_gpio(void); +extern void machine_set_gpio_default(uint32_t val); extern void machine_set_gpio(uint32_t val); extern void machine_init_gpio(void); extern uint32_t machine_handle_gpio(uint8_t write, uint32_t val); extern uint32_t machine_get_gpio_acpi(void); -extern void machine_set_gpio_acpi(uint32_t gpio_val); +extern void machine_set_gpio_acpi_default(uint32_t val); +extern void machine_set_gpio_acpi(uint32_t val); extern void machine_init_gpio_acpi(void); extern uint32_t machine_handle_gpio_acpi(uint8_t write, uint32_t val); diff --git a/src/machine/m_at_socket5.c b/src/machine/m_at_socket5.c index a75d87a96..8681c6995 100644 --- a/src/machine/m_at_socket5.c +++ b/src/machine/m_at_socket5.c @@ -158,6 +158,41 @@ machine_at_apollo_init(const machine_t *model) return ret; } +static void +machine_at_zappa_gpio_init(void) +{ + uint32_t gpio = 0xffffffff; + + /* Register 0x0079: */ + /* Bit 7: 0 = Clear password, 1 = Keep password. */ + /* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */ + /* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */ + /* Bit 4: External CPU clock (Switch 8). */ + /* Bit 3: External CPU clock (Switch 7). */ + /* 50 MHz: Switch 7 = Off, Switch 8 = Off. */ + /* 60 MHz: Switch 7 = On, Switch 8 = Off. */ + /* 66 MHz: Switch 7 = Off, Switch 8 = On. */ + /* Bit 2: No Connect. */ + /* Bit 1: No Connect. */ + /* Bit 0: 0 = 1.5x multiplier, 1 = 2x multiplier (Switch 6). */ + /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ + gpio = 0xffffe6ff; + + if (cpu_busspeed <= 50000000) + gpio |= 0xffff10ff; + else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) + gpio |= 0xffff18ff; + else if (cpu_busspeed > 60000000) + gpio |= 0xffff00ff; + + if (cpu_dmulti <= 1.5) + gpio |= 0xffff01ff; + else + gpio |= 0xffff00ff; + + machine_set_gpio_default(gpio); +} + int machine_at_zappa_init(const machine_t *model) { @@ -171,6 +206,7 @@ machine_at_zappa_init(const machine_t *model) return ret; machine_at_common_init_ex(model, 2); + machine_at_zappa_gpio_init(); pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 10b62c8fe..4df1985c7 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -13278,10 +13278,16 @@ machine_get_p1(void) return machine_p1; } +void +machine_set_p1_default(uint8_t val) +{ + machine_p1 = machine_p1_default = val; +} + void machine_set_p1(uint8_t val) { - machine_p1 = machines[machine].kbc_p1 & val; + machine_p1 = machine_p1_default & val; } @@ -13294,7 +13300,7 @@ machine_handle_p1(uint8_t write, uint8_t val) ret = machines[machine].p1_handler(write, val); else { if (write) - machine_p1 = machines[machine].kbc_p1 & val; + machine_p1 = machine_p1_default & val; else ret = machine_p1; } @@ -13314,10 +13320,16 @@ machine_get_gpio(void) return machine_gpio; } +void +machine_set_gpio_default(uint32_t val) +{ + machine_gpio = machine_gpio_default = val; +} + void machine_set_gpio(uint32_t val) { - machine_gpio = machines[machine].gpio & val; + machine_gpio = machine_gpio_default & val; } uint32_t @@ -13329,7 +13341,7 @@ machine_handle_gpio(uint8_t write, uint32_t val) ret = machines[machine].gpio_handler(write, val); else { if (write) - machine_gpio = machines[machine].gpio & val; + machine_gpio = machine_gpio_default & val; else ret = machine_gpio; } @@ -13349,10 +13361,16 @@ machine_get_gpio_acpi(void) return machine_gpio_acpi; } +void +machine_set_gpio_acpi_default(uint32_t val) +{ + machine_gpio_acpi = machine_gpio_acpi_default = val; +} + void machine_set_gpio_acpi(uint32_t val) { - machine_gpio_acpi = machines[machine].gpio_acpi & val; + machine_gpio_acpi = machine_gpio_acpi_default & val; } uint32_t @@ -13364,7 +13382,7 @@ machine_handle_gpio_acpi(uint8_t write, uint32_t val) ret = machines[machine].gpio_acpi_handler(write, val); else { if (write) - machine_gpio_acpi = machines[machine].gpio_acpi & val; + machine_gpio_acpi = machine_gpio_acpi_default & val; else ret = machine_gpio_acpi; } From 684a842699de0cd304c9f0784cdd9ca1bbfc465a Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 8 Oct 2023 05:21:12 +0200 Subject: [PATCH 09/50] Some fixes, Socket 7 3 V, and the on-board Vibra 16S. --- src/include/86box/machine.h | 8 ++ src/include/86box/snd_sb.h | 2 +- src/include/86box/sound.h | 3 + src/machine/m_at_socket5.c | 2 +- src/machine/m_at_socket7_3v.c | 160 +++++++++++++++++++++++++++++++++- src/machine/machine.c | 3 + src/machine/machine_table.c | 43 ++++++++- src/sio/sio_pc87306.c | 42 +++++++-- src/sound/snd_sb.c | 81 +++++++++++++++++ 9 files changed, 331 insertions(+), 13 deletions(-) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 3fb3f5f9c..7d6a89bcd 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -340,6 +340,7 @@ extern const machine_filter_t machine_chipsets[]; extern const machine_t machines[]; extern int bios_only; extern int machine; +extern void * machine_snd; /* Core functions. */ extern int machine_count(void); @@ -371,19 +372,25 @@ extern void machine_close(void); extern int machine_has_mouse(void); extern int machine_is_sony(void); +extern uint8_t machine_get_p1_default(void); extern uint8_t machine_get_p1(void); extern void machine_set_p1_default(uint8_t val); extern void machine_set_p1(uint8_t val); +extern void machine_and_p1(uint8_t val); extern void machine_init_p1(void); extern uint8_t machine_handle_p1(uint8_t write, uint8_t val); +extern uint32_t machine_get_gpio_default(void); extern uint32_t machine_get_gpio(void); extern void machine_set_gpio_default(uint32_t val); extern void machine_set_gpio(uint32_t val); +extern void machine_and_gpio(uint32_t val); extern void machine_init_gpio(void); extern uint32_t machine_handle_gpio(uint8_t write, uint32_t val); +extern uint32_t machine_get_gpio_acpi_default(void); extern uint32_t machine_get_gpio_acpi(void); extern void machine_set_gpio_acpi_default(uint32_t val); extern void machine_set_gpio_acpi(uint32_t val); +extern void machine_and_gpio_acpi(uint32_t val); extern void machine_init_gpio_acpi(void); extern uint32_t machine_handle_gpio_acpi(uint8_t write, uint32_t val); @@ -615,6 +622,7 @@ extern int machine_at_exp8551_init(const machine_t *); extern int machine_at_gw2katx_init(const machine_t *); extern int machine_at_thor_init(const machine_t *); extern int machine_at_mrthor_init(const machine_t *); +extern uint32_t machine_at_endeavor_gpio_handler(uint8_t write, uint32_t val); extern int machine_at_endeavor_init(const machine_t *); extern int machine_at_ms5119_init(const machine_t *); extern int machine_at_pb640_init(const machine_t *); diff --git a/src/include/86box/snd_sb.h b/src/include/86box/snd_sb.h index bc8b09b15..f83a31eb8 100644 --- a/src/include/86box/snd_sb.h +++ b/src/include/86box/snd_sb.h @@ -71,7 +71,6 @@ typedef struct sb_ct1345_mixer_t { uint8_t index; uint8_t regs[256]; - } sb_ct1345_mixer_t; /* SB16 and AWE32 */ @@ -147,6 +146,7 @@ typedef struct sb_t { uint8_t pnp_rom[512]; uint16_t opl_pnp_addr; + uint16_t gameport_addr; void *opl_mixer; void (*opl_mix)(void*, double*, double*); diff --git a/src/include/86box/sound.h b/src/include/86box/sound.h index 6a7143120..e2914c2c1 100644 --- a/src/include/86box/sound.h +++ b/src/include/86box/sound.h @@ -81,6 +81,8 @@ extern void inital(void); extern void givealbuffer(void *buf); extern void givealbuffer_cd(void *buf); +extern void sb_vibra16s_onboard_relocate_base(uint16_t new_addr, void *priv); + #ifdef EMU_DEVICE_H /* AdLib and AdLib Gold */ extern const device_t adlib_device; @@ -128,6 +130,7 @@ extern const device_t sb_pro_v2_device; extern const device_t sb_pro_mcv_device; extern const device_t sb_pro_compat_device; extern const device_t sb_16_device; +extern const device_t sb_vibra16s_onboard_device; extern const device_t sb_16_pnp_device; extern const device_t sb_16_compat_device; extern const device_t sb_16_compat_nompu_device; diff --git a/src/machine/m_at_socket5.c b/src/machine/m_at_socket5.c index 8681c6995..b7d6cf8ef 100644 --- a/src/machine/m_at_socket5.c +++ b/src/machine/m_at_socket5.c @@ -174,7 +174,7 @@ machine_at_zappa_gpio_init(void) /* 66 MHz: Switch 7 = Off, Switch 8 = On. */ /* Bit 2: No Connect. */ /* Bit 1: No Connect. */ - /* Bit 0: 0 = 1.5x multiplier, 1 = 2x multiplier (Switch 6). */ + /* Bit 0: 2x multiplier, 1 = 1.5x multiplier (Switch 6). */ /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ gpio = 0xffffe6ff; diff --git a/src/machine/m_at_socket7_3v.c b/src/machine/m_at_socket7_3v.c index 3357f5918..bc9ceed0a 100644 --- a/src/machine/m_at_socket7_3v.c +++ b/src/machine/m_at_socket7_3v.c @@ -41,11 +41,43 @@ #include <86box/fdc.h> #include <86box/nvr.h> #include <86box/plat_unused.h> +#include <86box/sound.h> + +static void +machine_at_thor_gpio_init(void) +{ + uint32_t gpio = 0xffffffff; + + /* Register 0x0079: */ + /* Bit 7: 0 = Clear password, 1 = Keep password. */ + /* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */ + /* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */ + /* Bit 4: External CPU clock (Switch 8). */ + /* Bit 3: External CPU clock (Switch 7). */ + /* 50 MHz: Switch 7 = Off, Switch 8 = Off. */ + /* 60 MHz: Switch 7 = On, Switch 8 = Off. */ + /* 66 MHz: Switch 7 = Off, Switch 8 = On. */ + /* Bit 2: 0 = On-board audio absent, 1 = On-board audio present. */ + /* Bit 1: 0 = Soft-off capable power supply present, 1 = Soft-off capable power supply absent. */ + /* Bit 0: 0 = Reserved. */ + /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ + gpio = 0xffffe1ff; + + if (cpu_busspeed <= 50000000) + gpio |= 0xffff10ff; + else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) + gpio |= 0xffff18ff; + else if (cpu_busspeed > 60000000) + gpio |= 0xffff00ff; + + machine_set_gpio_default(gpio); +} static void machine_at_thor_common_init(const machine_t *model, UNUSED(int mr)) { machine_at_common_init_ex(model, 2); + machine_at_thor_gpio_init(); pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); @@ -196,6 +228,92 @@ machine_at_mrthor_init(const machine_t *model) return ret; } +static void +machine_at_endeavor_gpio_init(void) +{ + uint32_t gpio = 0xffffe0cf; + uint16_t addr; + + /* Register 0x0078: */ + /* Bit 5,4: Vibra 16S base address: 0 = 220h, 1 = 260h, 2 = 240h, 3 = 280h. */ + device_context(machine_get_snd_device(machine)); + addr = device_get_config_hex16("base"); + switch (addr) { + case 0x0220: + gpio |= 0xffff00cf; + break; + case 0x0240: + gpio |= 0xffff00ef; + break; + case 0x0260: + gpio |= 0xffff00df; + break; + case 0x0280: + gpio |= 0xffff00ff; + break; + } + device_context_restore(); + + /* Register 0x0079: */ + /* Bit 7: 0 = Clear password, 1 = Keep password. */ + /* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */ + /* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */ + /* Bit 4: External CPU clock (Switch 8). */ + /* Bit 3: External CPU clock (Switch 7). */ + /* 50 MHz: Switch 7 = Off, Switch 8 = Off. */ + /* 60 MHz: Switch 7 = On, Switch 8 = Off. */ + /* 66 MHz: Switch 7 = Off, Switch 8 = On. */ + /* Bit 2: 0 = On-board audio absent, 1 = On-board audio present. */ + /* Bit 1: 0 = Soft-off capable power supply present, 1 = Soft-off capable power supply absent. */ + /* Bit 0: 0 = 2x multiplier, 1 = 1.5x multiplier (Switch 6). */ + /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ + if (cpu_busspeed <= 50000000) + gpio |= 0xffff10cf; + else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) + gpio |= 0xffff18cf; + else if (cpu_busspeed > 60000000) + gpio |= 0xffff00cf; + + if (sound_card_current[0] == SOUND_INTERNAL) + gpio |= 0xffff04cf; + + if (cpu_dmulti <= 1.5) + gpio |= 0xffff01cf; + else + gpio |= 0xffff00cf; + + machine_set_gpio_default(gpio); +} + +uint32_t +machine_at_endeavor_gpio_handler(uint8_t write, uint32_t val) +{ + uint32_t ret = machine_get_gpio_default(); + + if (write) { + ret &= (val | 0xffff00ff); + ret = (ret & 0xffffffcf) | (val & 0x0000ff30); + if (machine_snd != NULL) switch ((val >> 4) & 0x03) { + case 0x00: + sb_vibra16s_onboard_relocate_base(0x0220, machine_snd); + break; + case 0x01: + sb_vibra16s_onboard_relocate_base(0x0260, machine_snd); + break; + case 0x02: + sb_vibra16s_onboard_relocate_base(0x0240, machine_snd); + break; + case 0x03: + sb_vibra16s_onboard_relocate_base(0x0280, machine_snd); + break; + } + machine_set_gpio(ret); + } else + ret = machine_get_gpio(); + + return ret; +} + int machine_at_endeavor_init(const machine_t *model) { @@ -209,6 +327,7 @@ machine_at_endeavor_init(const machine_t *model) return ret; machine_at_common_init_ex(model, 2); + machine_at_endeavor_gpio_init(); pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); @@ -220,7 +339,10 @@ machine_at_endeavor_init(const machine_t *model) pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); if (gfxcard[0] == VID_INTERNAL) - device_add(&s3_phoenix_trio64_onboard_pci_device); + device_add(machine_get_vid_device(machine)); + + if (sound_card_current[0] == SOUND_INTERNAL) + machine_snd = device_add(machine_get_snd_device(machine)); device_add(&keyboard_ps2_intel_ami_pci_device); device_add(&i430fx_device); @@ -260,6 +382,41 @@ machine_at_ms5119_init(const machine_t *model) return ret; } +static void +machine_at_pb640_gpio_init(void) +{ + uint32_t gpio = 0xffffffff; + + /* Register 0x0079: */ + /* Bit 7: 0 = Clear password, 1 = Keep password. */ + /* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */ + /* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */ + /* Bit 4: External CPU clock (Switch 8). */ + /* Bit 3: External CPU clock (Switch 7). */ + /* 50 MHz: Switch 7 = Off, Switch 8 = Off. */ + /* 60 MHz: Switch 7 = On, Switch 8 = Off. */ + /* 66 MHz: Switch 7 = Off, Switch 8 = On. */ + /* Bit 2: No Connect. */ + /* Bit 1: No Connect. */ + /* Bit 0: 2x multiplier, 1 = 1.5x multiplier (Switch 6). */ + /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ + gpio = 0xffffe6ff; + + if (cpu_busspeed <= 50000000) + gpio |= 0xffff10ff; + else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) + gpio |= 0xffff18ff; + else if (cpu_busspeed > 60000000) + gpio |= 0xffff00ff; + + if (cpu_dmulti <= 1.5) + gpio |= 0xffff01ff; + else + gpio |= 0xffff00ff; + + machine_set_gpio_default(gpio); +} + int machine_at_pb640_init(const machine_t *model) { @@ -272,6 +429,7 @@ machine_at_pb640_init(const machine_t *model) return ret; machine_at_common_init_ex(model, 2); + machine_at_pb640_gpio_init(); pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); diff --git a/src/machine/machine.c b/src/machine/machine.c index cd785009b..a21d8115c 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -77,7 +77,10 @@ machine_init_ex(int m) machine_init_gpio(); machine_init_gpio_acpi(); + machine_snd = NULL; + is_vpc = 0; + standalone_gameport_type = NULL; gameport_instance_id = 0; diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 4df1985c7..5c1486fa0 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -9085,7 +9085,7 @@ const machine_t machines[] = { .chipset = MACHINE_CHIPSET_INTEL_430FX, .init = machine_at_endeavor_init, .p1_handler = NULL, - .gpio_handler = NULL, + .gpio_handler = machine_at_endeavor_gpio_handler, .available_flag = MACHINE_AVAILABLE, .gpio_acpi_handler = NULL, .cpu = { @@ -9114,7 +9114,7 @@ const machine_t machines[] = { .fdc_device = NULL, .sio_device = NULL, .vid_device = &s3_phoenix_trio64_onboard_pci_device, - .snd_device = NULL, + .snd_device = &sb_vibra16s_onboard_device, .net_device = NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ @@ -13272,6 +13272,14 @@ static uint32_t machine_gpio; static uint32_t machine_gpio_acpi_default; static uint32_t machine_gpio_acpi; +void *machine_snd = NULL; + +uint8_t +machine_get_p1_default(void) +{ + return machine_p1_default; +} + uint8_t machine_get_p1(void) { @@ -13287,9 +13295,14 @@ machine_set_p1_default(uint8_t val) void machine_set_p1(uint8_t val) { - machine_p1 = machine_p1_default & val; + machine_p1 = val; } +void +machine_and_p1(uint8_t val) +{ + machine_p1 = machine_p1_default & val; +} uint8_t machine_handle_p1(uint8_t write, uint8_t val) @@ -13314,6 +13327,12 @@ machine_init_p1(void) machine_p1 = machine_p1_default = machines[machine].kbc_p1; } +uint32_t +machine_get_gpio_default(void) +{ + return machine_gpio_default; +} + uint32_t machine_get_gpio(void) { @@ -13328,6 +13347,12 @@ machine_set_gpio_default(uint32_t val) void machine_set_gpio(uint32_t val) +{ + machine_gpio = val; +} + +void +machine_and_gpio(uint32_t val) { machine_gpio = machine_gpio_default & val; } @@ -13355,6 +13380,12 @@ machine_init_gpio(void) machine_gpio = machine_gpio_default = machines[machine].gpio; } +uint32_t +machine_get_gpio_acpi_default(void) +{ + return machine_gpio_acpi_default; +} + uint32_t machine_get_gpio_acpi(void) { @@ -13369,6 +13400,12 @@ machine_set_gpio_acpi_default(uint32_t val) void machine_set_gpio_acpi(uint32_t val) +{ + machine_gpio_acpi = val; +} + +void +machine_and_gpio_acpi(uint32_t val) { machine_gpio_acpi = machine_gpio_acpi_default & val; } diff --git a/src/sio/sio_pc87306.c b/src/sio/sio_pc87306.c index e7c68eba5..85adc712d 100644 --- a/src/sio/sio_pc87306.c +++ b/src/sio/sio_pc87306.c @@ -40,6 +40,7 @@ typedef struct pc87306_t { uint8_t tries; uint8_t regs[29]; + uint8_t gpio[2]; uint16_t gpioba; int cur_reg; fdc_t *fdc; @@ -51,19 +52,33 @@ static void pc87306_gpio_write(uint16_t port, uint8_t val, void *priv) { pc87306_t *dev = (pc87306_t *) priv; - uint8_t shift = ((8 << (port & 1)) - 8); - uint32_t shifted_val = (((uint32_t) val) << shift); - uint32_t ff_mask = ~(((uint32_t) 0xff) << shift); + uint32_t gpio = 0xffff0000; - (void) machine_handle_gpio(1, ff_mask | shifted_val); + dev->gpio[port & 0x0001] = val; + + if (port & 0x0001) { + gpio |= ((uint32_t) val) << 8; + gpio |= dev->gpio[0]; + } else { + gpio |= ((uint32_t) dev->gpio[1]) << 8; + gpio |= val; + } + + (void) machine_handle_gpio(1, gpio); } uint8_t pc87306_gpio_read(uint16_t port, void *priv) { const pc87306_t *dev = (pc87306_t *) priv; + uint32_t ret = machine_handle_gpio(0, 0xffffffff); - return machine_handle_gpio(0, 0xffffffff) >> ((8 << (port & 1)) - 8); + if (port & 0x0001) + ret = (ret >> 8) & 0xff; + else + ret &= 0xff; + + return ret; } static void @@ -397,7 +412,7 @@ pc87306_read(uint16_t port, void *priv) } void -pc87306_reset(void *priv) +pc87306_reset_common(void *priv) { pc87306_t *dev = (pc87306_t *) priv; @@ -432,6 +447,17 @@ pc87306_reset(void *priv) nvr_wp_set(0, 0, dev->nvr); } +void +pc87306_reset(void *priv) +{ + pc87306_t *dev = (pc87306_t *) priv; + + pc87306_gpio_write(0x0000, 0xff, dev); + pc87306_gpio_write(0x0001, 0xff, dev); + + pc87306_reset_common(dev); +} + static void pc87306_close(void *priv) { @@ -453,7 +479,9 @@ pc87306_init(UNUSED(const device_t *info)) dev->nvr = device_add(&at_mb_nvr_device); - pc87306_reset(dev); + dev->gpio[0] = dev->gpio[1] = 0xff; + + pc87306_reset_common(dev); io_sethandler(0x02e, 0x0002, pc87306_read, NULL, NULL, pc87306_write, NULL, NULL, dev); diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index 92df0ec8b..a488110df 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -854,6 +854,15 @@ sb_ct1745_mixer_write(uint16_t addr, uint8_t val, void *priv) case 0x84: /* MPU Control register, per the Linux source code. */ + /* Bits 2-1: MPU-401 address: + 0, 0 = 330h; + 0, 1 = Disabled; + 1, 0 = 300h; + 1, 1 = ???? (Reserved?) + Bit 0: Gameport address: + 0, 0 = 200-207h; + 0, 1 = Disabled + */ if (sb->mpu != NULL) { if ((val & 0x06) == 0x00) mpu401_change_addr(sb->mpu, 0x330); @@ -862,6 +871,12 @@ sb_ct1745_mixer_write(uint16_t addr, uint8_t val, void *priv) else if ((val & 0x06) == 0x02) mpu401_change_addr(sb->mpu, 0); } + sb->gameport_addr = 0; + gameport_remap(sb->gameport, 0); + if (!(val & 0x01)) { + sb->gameport_addr = 0x200; + gameport_remap(sb->gameport, 0x200); + } break; default: @@ -1055,6 +1070,8 @@ sb_ct1745_mixer_read(uint16_t addr, void *priv) else ret = 0x06; /* Should never happen. */ } + if (!sb->gameport_addr) + ret |= 0x01; break; case 0x90: @@ -1375,6 +1392,45 @@ sb_16_reply_mca_write(int port, uint8_t val, void *priv) sb_dsp_setdma16(&sb->dsp, high_dma); } +void +sb_vibra16s_onboard_relocate_base(uint16_t new_addr, void *priv) +{ + sb_t *sb = (sb_t *) priv; + uint16_t addr = sb->dsp.sb_addr; + + io_removehandler(addr, 0x0004, + sb->opl.read, NULL, NULL, + sb->opl.write, NULL, NULL, + sb->opl.priv); + io_removehandler(addr + 8, 0x0002, + sb->opl.read, NULL, NULL, + sb->opl.write, NULL, NULL, + sb->opl.priv); + io_removehandler(addr + 4, 0x0002, + sb_ct1745_mixer_read, NULL, NULL, + sb_ct1745_mixer_write, NULL, NULL, + sb); + + sb_dsp_setaddr(&sb->dsp, 0); + + addr = new_addr; + + io_sethandler(addr, 0x0004, + sb->opl.read, NULL, NULL, + sb->opl.write, NULL, NULL, + sb->opl.priv); + io_sethandler(addr + 8, 0x0002, + sb->opl.read, NULL, NULL, + sb->opl.write, NULL, NULL, + sb->opl.priv); + io_sethandler(addr + 4, 0x0002, + sb_ct1745_mixer_read, NULL, NULL, + sb_ct1745_mixer_write, NULL, NULL, + sb); + + sb_dsp_setaddr(&sb->dsp, addr); +} + static void sb_16_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *priv) { @@ -1968,6 +2024,8 @@ sb_16_init(UNUSED(const device_t *info)) if (device_get_config_int("receive_input")) midi_in_handler(1, sb_dsp_input_msg, sb_dsp_input_sysex, &sb->dsp); + sb->gameport_addr = 0x200; + return sb; } @@ -2003,6 +2061,8 @@ sb_16_reply_mca_init(UNUSED(const device_t *info)) sb->pos_regs[0] = 0x38; sb->pos_regs[1] = 0x51; + sb->gameport_addr = 0x200; + return sb; } @@ -2045,6 +2105,7 @@ sb_16_pnp_init(UNUSED(const device_t *info)) mpu401_change_addr(sb->mpu, 0); ide_remove_handlers(2); + sb->gameport_addr = 0; gameport_remap(sb->gameport, 0); return sb; @@ -2069,6 +2130,8 @@ sb_16_compat_init(const device_t *info) mpu401_init(sb->mpu, 0, 0, M_UART, info->local); sb_dsp_set_mpu(&sb->dsp, sb->mpu); + sb->gameport_addr = 0x200; + return sb; } @@ -2165,6 +2228,8 @@ sb_awe32_init(UNUSED(const device_t *info)) if (device_get_config_int("receive_input")) midi_in_handler(1, sb_dsp_input_msg, sb_dsp_input_sysex, &sb->dsp); + sb->gameport_addr = 0x200; + return sb; } @@ -2264,6 +2329,8 @@ sb_awe32_pnp_init(const device_t *info) emu8k_change_addr(&sb->emu8k, 0); + sb->gameport_addr = 0; + gameport_remap(sb->gameport, 0); return sb; @@ -3609,6 +3676,20 @@ const device_t sb_16_device = { .config = sb_16_config }; +const device_t sb_vibra16s_onboard_device = { + .name = "Sound Blaster Vibra 16S (On-Board)", + .internal_name = "sb_vibra16s_onboard", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = sb_16_init, + .close = sb_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_16_config +}; + const device_t sb_16_reply_mca_device = { .name = "Sound Blaster 16 Reply MCA", .internal_name = "sb16_reply_mca", From 881579f15aa0fcf8b97b7bb3466c4101fecf4873 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 8 Oct 2023 06:11:32 +0200 Subject: [PATCH 10/50] Last machines and more fixes. --- src/chipset/intel_piix.c | 40 +--------- src/include/86box/machine.h | 1 + src/include/86box/sound.h | 2 + src/machine/m_at_socket5.c | 4 +- src/machine/m_at_socket7.c | 142 +++++++++++++++++++++++++++++++++- src/machine/m_at_socket7_3v.c | 14 ++-- src/machine/machine_table.c | 25 +++--- src/sound/snd_sb.c | 14 ++++ 8 files changed, 177 insertions(+), 65 deletions(-) diff --git a/src/chipset/intel_piix.c b/src/chipset/intel_piix.c index 4066abe31..f588910f5 100644 --- a/src/chipset/intel_piix.c +++ b/src/chipset/intel_piix.c @@ -68,7 +68,6 @@ typedef struct _piix_ { uint8_t no_mirq0; uint8_t regs[4][256]; uint8_t readout_regs[256]; - uint8_t board_config[2]; uint16_t func0_id; uint16_t nvr_io_base; uint16_t acpi_io_base; @@ -1189,9 +1188,7 @@ board_write(uint16_t port, uint8_t val, void *priv) { piix_t *dev = (piix_t *) priv; - if (port == 0x0078) - dev->board_config[0] = val; - else if (port == 0x00e0) + if (port == 0x00e0) dev->cur_readout_reg = val; else if (port == 0x00e1) dev->readout_regs[dev->cur_readout_reg] = val; @@ -1203,11 +1200,7 @@ board_read(uint16_t port, void *priv) const piix_t *dev = (piix_t *) priv; uint8_t ret = 0x64; - if (port == 0x0078) - ret = dev->board_config[0]; - else if (port == 0x0079) - ret = dev->board_config[1]; - else if (port == 0x00e0) + if (port == 0x00e0) ret = dev->cur_readout_reg; else if (port == 0x00e1) ret = dev->readout_regs[dev->cur_readout_reg]; @@ -1662,37 +1655,8 @@ piix_init(const device_t *info) else if (cpu_dmulti > 2.5) dev->readout_regs[1] |= 0x80; - io_sethandler(0x0078, 0x0002, board_read, NULL, NULL, board_write, NULL, NULL, dev); io_sethandler(0x00e0, 0x0002, board_read, NULL, NULL, board_write, NULL, NULL, dev); - dev->board_config[0] = 0xff; - /* Register 0x0079: */ - /* Bit 7: 0 = Clear password, 1 = Keep password. */ - /* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */ - /* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */ - /* Bit 4: External CPU clock (Switch 8). */ - /* Bit 3: External CPU clock (Switch 7). */ - /* 50 MHz: Switch 7 = Off, Switch 8 = Off. */ - /* 60 MHz: Switch 7 = On, Switch 8 = Off. */ - /* 66 MHz: Switch 7 = Off, Switch 8 = On. */ - /* Bit 2: 0 = On-board audio absent, 1 = On-board audio present. */ - /* Bit 1: 0 = Soft-off capable power supply present, 1 = Soft-off capable power supply absent. */ - /* Bit 0: 0 = 1.5x multiplier, 1 = 2x multiplier (Switch 6). */ - /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ - dev->board_config[1] = 0xe0; - - if (cpu_busspeed <= 50000000) - dev->board_config[1] |= 0x10; - else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) - dev->board_config[1] |= 0x18; - else if (cpu_busspeed > 60000000) - dev->board_config[1] |= 0x00; - - if (cpu_dmulti <= 1.5) - dev->board_config[1] |= 0x01; - else - dev->board_config[1] |= 0x00; - #if 0 device_add(&i8254_sec_device); #endif diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 7d6a89bcd..29df64713 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -647,6 +647,7 @@ extern int machine_at_p55t2p4_init(const machine_t *); extern int machine_at_m7shi_init(const machine_t *); extern int machine_at_tc430hx_init(const machine_t *); extern int machine_at_infinia7200_init(const machine_t *); +extern uint32_t machine_at_cu430hx_gpio_handler(uint8_t write, uint32_t val); extern int machine_at_equium5200_init(const machine_t *); extern int machine_at_pcv90_init(const machine_t *); extern int machine_at_p65up5_cp55t2d_init(const machine_t *); diff --git a/src/include/86box/sound.h b/src/include/86box/sound.h index e2914c2c1..2d9d7b6bc 100644 --- a/src/include/86box/sound.h +++ b/src/include/86box/sound.h @@ -81,6 +81,7 @@ extern void inital(void); extern void givealbuffer(void *buf); extern void givealbuffer_cd(void *buf); +#define sb_vibra16c_onboard_relocate_base sb_vibra16s_onboard_relocate_base extern void sb_vibra16s_onboard_relocate_base(uint16_t new_addr, void *priv); #ifdef EMU_DEVICE_H @@ -131,6 +132,7 @@ extern const device_t sb_pro_mcv_device; extern const device_t sb_pro_compat_device; extern const device_t sb_16_device; extern const device_t sb_vibra16s_onboard_device; +extern const device_t sb_vibra16c_onboard_device; extern const device_t sb_16_pnp_device; extern const device_t sb_16_compat_device; extern const device_t sb_16_compat_nompu_device; diff --git a/src/machine/m_at_socket5.c b/src/machine/m_at_socket5.c index b7d6cf8ef..9c5228e7f 100644 --- a/src/machine/m_at_socket5.c +++ b/src/machine/m_at_socket5.c @@ -161,7 +161,7 @@ machine_at_apollo_init(const machine_t *model) static void machine_at_zappa_gpio_init(void) { - uint32_t gpio = 0xffffffff; + uint32_t gpio = 0xffffe6ff; /* Register 0x0079: */ /* Bit 7: 0 = Clear password, 1 = Keep password. */ @@ -176,8 +176,6 @@ machine_at_zappa_gpio_init(void) /* Bit 1: No Connect. */ /* Bit 0: 2x multiplier, 1 = 1.5x multiplier (Switch 6). */ /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ - gpio = 0xffffe6ff; - if (cpu_busspeed <= 50000000) gpio |= 0xffff10ff; else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index 1fee61b88..71c14e096 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -171,6 +171,44 @@ machine_at_m7shi_init(const machine_t *model) return ret; } +/* The Sony VAIO is an AG430HX, I'm assuming it has the same configuration bits + as the TC430HX, hence the #define. */ +#define machine_at_ag430hx_gpio_init machine_at_tc430hx_gpio_init + +/* The PB680 is a NV430VX, I'm assuming it has the same configuration bits as + the TC430HX, hence the #define. */ +#define machine_at_nv430vx_gpio_init machine_at_tc430hx_gpio_init + +static void +machine_at_tc430hx_gpio_init(void) +{ + uint32_t gpio = 0xffffffff; + + /* Register 0x0079: */ + /* Bit 7: 0 = Clear password, 1 = Keep password. */ + /* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */ + /* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */ + /* Bit 4: External CPU clock (Switch 8). */ + /* Bit 3: External CPU clock (Switch 7). */ + /* 50 MHz: Switch 7 = Off, Switch 8 = Off. */ + /* 60 MHz: Switch 7 = On, Switch 8 = Off. */ + /* 66 MHz: Switch 7 = Off, Switch 8 = On. */ + /* Bit 2: 0 = On-board audio absent, 1 = On-board audio present. */ + /* Bit 1: 0 = Soft-off capable power supply present, 1 = Soft-off capable power supply absent. */ + /* Bit 0: 0 = Reserved. */ + /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ + gpio = 0xffffe1ff; + + if (cpu_busspeed <= 50000000) + gpio |= 0xffff10ff; + else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) + gpio |= 0xffff18ff; + else if (cpu_busspeed > 60000000) + gpio |= 0xffff00ff; + + machine_set_gpio_default(gpio); +} + int machine_at_tc430hx_init(const machine_t *model) { @@ -187,6 +225,7 @@ machine_at_tc430hx_init(const machine_t *model) return ret; machine_at_common_init_ex(model, 2); + machine_at_tc430hx_gpio_init(); pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); @@ -196,7 +235,10 @@ machine_at_tc430hx_init(const machine_t *model) pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - device_add(&s3_virge_375_pci_device); + + if (gfxcard[0] == VID_INTERNAL) + device_add(machine_get_vid_device(machine)); + device_add(&i430hx_device); device_add(&piix3_device); device_add(&keyboard_ps2_ami_pci_device); @@ -222,6 +264,7 @@ machine_at_infinia7200_init(const machine_t *model) return ret; machine_at_common_init_ex(model, 2); + machine_at_tc430hx_gpio_init(); pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); @@ -231,7 +274,10 @@ machine_at_infinia7200_init(const machine_t *model) pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - device_add(&s3_virge_375_pci_device); + + if (gfxcard[0] == VID_INTERNAL) + device_add(machine_get_vid_device(machine)); + device_add(&i430hx_device); device_add(&piix3_device); device_add(&keyboard_ps2_ami_pci_device); @@ -241,6 +287,87 @@ machine_at_infinia7200_init(const machine_t *model) return ret; } +static void +machine_at_cu430hx_gpio_init(void) +{ + uint32_t gpio = 0xffffe1cf; + uint16_t addr; + + /* Register 0x0078: */ + /* Bit 5,4: Vibra 16C base address: 0 = 220h, 1 = 260h, 2 = 240h, 3 = 280h. */ + device_context(machine_get_snd_device(machine)); + addr = device_get_config_hex16("base"); + switch (addr) { + case 0x0220: + gpio |= 0xffff00cf; + break; + case 0x0240: + gpio |= 0xffff00ef; + break; + case 0x0260: + gpio |= 0xffff00df; + break; + case 0x0280: + gpio |= 0xffff00ff; + break; + } + device_context_restore(); + + /* Register 0x0079: */ + /* Bit 7: 0 = Clear password, 1 = Keep password. */ + /* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */ + /* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */ + /* Bit 4: External CPU clock (Switch 8). */ + /* Bit 3: External CPU clock (Switch 7). */ + /* 50 MHz: Switch 7 = Off, Switch 8 = Off. */ + /* 60 MHz: Switch 7 = On, Switch 8 = Off. */ + /* 66 MHz: Switch 7 = Off, Switch 8 = On. */ + /* Bit 2: 0 = On-board audio absent, 1 = On-board audio present. */ + /* Bit 1: 0 = Soft-off capable power supply present, 1 = Soft-off capable power supply absent. */ + /* Bit 0: 0 = Reserved. */ + /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ + if (cpu_busspeed <= 50000000) + gpio |= 0xffff10cf; + else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) + gpio |= 0xffff18cf; + else if (cpu_busspeed > 60000000) + gpio |= 0xffff00cf; + + if (sound_card_current[0] == SOUND_INTERNAL) + gpio |= 0xffff04cf; + + machine_set_gpio_default(gpio); +} + +uint32_t +machine_at_cu430hx_gpio_handler(uint8_t write, uint32_t val) +{ + uint32_t ret = machine_get_gpio_default(); + + if (write) { + ret &= (val | 0xffff00ff); + ret = (ret & 0xffffffcf) | (val & 0x0000ff30); + if (machine_snd != NULL) switch ((val >> 4) & 0x03) { + case 0x00: + sb_vibra16c_onboard_relocate_base(0x0220, machine_snd); + break; + case 0x01: + sb_vibra16c_onboard_relocate_base(0x0260, machine_snd); + break; + case 0x02: + sb_vibra16c_onboard_relocate_base(0x0240, machine_snd); + break; + case 0x03: + sb_vibra16c_onboard_relocate_base(0x0280, machine_snd); + break; + } + machine_set_gpio(ret); + } else + ret = machine_get_gpio(); + + return ret; +} + /* Information about that machine on machine.h */ int machine_at_equium5200_init(const machine_t *model) @@ -258,6 +385,7 @@ machine_at_equium5200_init(const machine_t *model) return ret; machine_at_common_init_ex(model, 2); + machine_at_cu430hx_gpio_init(); pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); @@ -267,6 +395,10 @@ machine_at_equium5200_init(const machine_t *model) pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 0, 0, 0); // riser + + if (sound_card_current[0] == SOUND_INTERNAL) + machine_snd = device_add(machine_get_snd_device(machine)); + device_add(&i430hx_device); device_add(&piix3_device); device_add(&keyboard_ps2_ami_pci_device); @@ -292,6 +424,7 @@ machine_at_pcv90_init(const machine_t *model) return ret; machine_at_common_init_ex(model, 2); + machine_at_ag430hx_gpio_init(); pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); @@ -548,6 +681,7 @@ machine_at_pb680_init(const machine_t *model) return ret; machine_at_common_init_ex(model, 2); + machine_at_nv430vx_gpio_init(); pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); @@ -556,6 +690,10 @@ machine_at_pb680_init(const machine_t *model) pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); + + if (gfxcard[0] == VID_INTERNAL) + device_add(machine_get_vid_device(machine)); + device_add(&i430vx_device); device_add(&piix3_device); device_add(&keyboard_ps2_ami_pci_device); diff --git a/src/machine/m_at_socket7_3v.c b/src/machine/m_at_socket7_3v.c index bc9ceed0a..7f090ca51 100644 --- a/src/machine/m_at_socket7_3v.c +++ b/src/machine/m_at_socket7_3v.c @@ -46,7 +46,7 @@ static void machine_at_thor_gpio_init(void) { - uint32_t gpio = 0xffffffff; + uint32_t gpio = 0xffffe1ff; /* Register 0x0079: */ /* Bit 7: 0 = Clear password, 1 = Keep password. */ @@ -61,8 +61,6 @@ machine_at_thor_gpio_init(void) /* Bit 1: 0 = Soft-off capable power supply present, 1 = Soft-off capable power supply absent. */ /* Bit 0: 0 = Reserved. */ /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ - gpio = 0xffffe1ff; - if (cpu_busspeed <= 50000000) gpio |= 0xffff10ff; else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) @@ -74,7 +72,7 @@ machine_at_thor_gpio_init(void) } static void -machine_at_thor_common_init(const machine_t *model, UNUSED(int mr)) +machine_at_thor_common_init(const machine_t *model, int has_video) { machine_at_common_init_ex(model, 2); machine_at_thor_gpio_init(); @@ -88,8 +86,8 @@ machine_at_thor_common_init(const machine_t *model, UNUSED(int mr)) pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 3, 2, 1); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - if (gfxcard[0] == VID_INTERNAL) - device_add(&s3_phoenix_trio64vplus_onboard_pci_device); + if (has_video && (gfxcard[0] == VID_INTERNAL)) + device_add(machine_get_vid_device(machine)); device_add(&keyboard_ps2_intel_ami_pci_device); device_add(&i430fx_device); @@ -207,7 +205,7 @@ machine_at_thor_init(const machine_t *model) if (bios_only || !ret) return ret; - machine_at_thor_common_init(model, 0); + machine_at_thor_common_init(model, 1); return ret; } @@ -223,7 +221,7 @@ machine_at_mrthor_init(const machine_t *model) if (bios_only || !ret) return ret; - machine_at_thor_common_init(model, 1); + machine_at_thor_common_init(model, 0); return ret; } diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 5c1486fa0..4a8a2a757 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -9071,7 +9071,7 @@ const machine_t machines[] = { .device = NULL, .fdc_device = NULL, .sio_device = NULL, - .vid_device = &s3_phoenix_trio64vplus_onboard_pci_device, + .vid_device = NULL, .snd_device = NULL, .net_device = NULL }, @@ -9099,7 +9099,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_APM | MACHINE_ACPI, + .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -9770,12 +9770,11 @@ const machine_t machines[] = { .device = NULL, .fdc_device = NULL, .sio_device = NULL, - .vid_device = NULL, + .vid_device = &s3_virge_375_pci_device, .snd_device = NULL, .net_device = NULL }, - /* OEM version of Intel TC430HX, has AMI MegaKey KBC firmware on the PC87306 - Super I/O chip */ + /* OEM version of Intel TC430HX, has AMI MegaKey KBC firmware on the PC87306 Super I/O chip. */ { .name = "[i430HX] Toshiba Infinia 7200", .internal_name = "infinia7200", @@ -9811,13 +9810,11 @@ const machine_t machines[] = { .device = NULL, .fdc_device = NULL, .sio_device = NULL, - .vid_device = NULL, + .vid_device = &s3_virge_375_pci_device, .snd_device = NULL, .net_device = NULL }, - /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the - PC87306 Super I/O chip, command 0xA1 returns '5'. - Command 0xA0 copyright string: (C)1994 AMI . */ + /* OEM-only Intel CU430HX, has AMI MegaKey KBC firmware on the PC87306 Super I/O chip. */ { .name = "[i430HX] Toshiba Equium 5200D", .internal_name = "equium5200", @@ -9825,7 +9822,7 @@ const machine_t machines[] = { .chipset = MACHINE_CHIPSET_INTEL_430HX, .init = machine_at_equium5200_init, .p1_handler = NULL, - .gpio_handler = NULL, + .gpio_handler = machine_at_cu430hx_gpio_handler, .available_flag = MACHINE_AVAILABLE, .gpio_acpi_handler = NULL, .cpu = { @@ -9839,7 +9836,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 196608, @@ -9854,7 +9851,7 @@ const machine_t machines[] = { .fdc_device = NULL, .sio_device = NULL, .vid_device = NULL, - .snd_device = NULL, + .snd_device = &sb_vibra16c_onboard_device, .net_device = NULL }, /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the @@ -10288,7 +10285,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, + .flags = MACHINE_VIDEO | MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -10302,7 +10299,7 @@ const machine_t machines[] = { .device = NULL, .fdc_device = NULL, .sio_device = NULL, - .vid_device = NULL, + .vid_device = &s3_phoenix_trio64vplus_onboard_pci_device, .snd_device = NULL, .net_device = NULL }, diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index a488110df..0f94cbaff 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -3690,6 +3690,20 @@ const device_t sb_vibra16s_onboard_device = { .config = sb_16_config }; +const device_t sb_vibra16c_onboard_device = { + .name = "Sound Blaster Vibra 16C (On-Board)", + .internal_name = "sb_vibra16c_onboard", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = sb_16_init, + .close = sb_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_16_config +}; + const device_t sb_16_reply_mca_device = { .name = "Sound Blaster 16 Reply MCA", .internal_name = "sb16_reply_mca", From edb9644676c7b7aec76cbdae2ffcdeb03e7786bc Mon Sep 17 00:00:00 2001 From: EmpyreusX <36258024+EmpyreusX@users.noreply.github.com> Date: Sun, 8 Oct 2023 23:53:33 +0800 Subject: [PATCH 11/50] Fix Japanese translation (Qt) --- src/qt/languages/ja-JP.po | 48 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/qt/languages/ja-JP.po b/src/qt/languages/ja-JP.po index f516a78ab..c6518f841 100644 --- a/src/qt/languages/ja-JP.po +++ b/src/qt/languages/ja-JP.po @@ -212,7 +212,7 @@ msgid "&Existing image..." msgstr "既存のイメージを開く(&E)..." msgid "Existing image (&Write-protected)..." -msgstr "既存のイメージを開く(書き込み保護)(&W)..." +msgstr "既存のイメージを開く(書き込み禁止)(&W)..." msgid "&Record" msgstr "録音(&R)" @@ -311,7 +311,7 @@ msgid "Icon set:" msgstr "アイコンセット:" msgid "Gain" -msgstr "ゲイン値" +msgstr "音量" msgid "File name:" msgstr "ファイル名:" @@ -335,7 +335,7 @@ msgid "Lock to this size" msgstr "サイズを固定" msgid "Machine type:" -msgstr "マシン タイプ:" +msgstr "マシンタイプ:" msgid "Machine:" msgstr "マシン:" @@ -374,7 +374,7 @@ msgid "Enabled (UTC)" msgstr "有効(UTC)" msgid "Dynamic Recompiler" -msgstr "動的リコンパイラ" +msgstr "動的再コンパイル" msgid "Video:" msgstr "ビデオカード:" @@ -638,7 +638,7 @@ msgid " - PAUSED" msgstr " - 一時停止" msgid "Press Ctrl+Alt+PgDn to return to windowed mode." -msgstr "Ctrl+Alt+PgDnでウィンドウモードに戻ります。" +msgstr "Ctrl+Alt+PgDnでウィンドウ モードに戻ります。" msgid "Speed" msgstr "速度" @@ -650,7 +650,7 @@ msgid "ZIP images" msgstr "ZIPイメージ" msgid "86Box could not find any usable ROM images.\n\nPlease download a ROM set and extract it into the \"roms\" directory." -msgstr "86Boxで使用可能なROMイメージが見つかりませんでした。\n\nROMセットをダウンロードして、「roms」ディレクトリに解凍してください。" +msgstr "86Boxで使用可能なROMイメージが見つかりません。\n\nROMセットをダウンロードして、roms ディレクトリに解凍してください。" msgid "(empty)" msgstr "(空)" @@ -671,10 +671,10 @@ msgid "All images" msgstr "すべてのイメージ" msgid "Basic sector images" -msgstr "基本的なセクターイメージ" +msgstr "ベーシック セクター イメージ" msgid "Surface images" -msgstr "表面イメージ" +msgstr "サーフェス イメージ" msgid "Machine \"%hs\" is not available due to missing ROMs in the roms/machines directory. Switching to an available machine." msgstr "roms/machines ディレクトリにROMがないため、マシン「%hs」は使用できません。使用可能なマシンに切り替えます。" @@ -686,7 +686,7 @@ msgid "Machine" msgstr "マシン" msgid "Display" -msgstr "画面表示" +msgstr "ディスプレイ" msgid "Input devices" msgstr "入力デバイス" @@ -701,28 +701,28 @@ msgid "Ports (COM & LPT)" msgstr "ポート (COM/LPT)" msgid "Storage controllers" -msgstr "ストレージ コントローラ" +msgstr "ストレージコントローラ" msgid "Hard disks" -msgstr "ハード ディスク" +msgstr "ハードディスク" msgid "Floppy & CD-ROM drives" -msgstr "フロッピー/CD-ROMドライブ" +msgstr "フロッピー/CD-ROMドライブ" msgid "Other removable devices" -msgstr "他のリムーバブル デバイス" +msgstr "他のリムーバブルデバイス" msgid "Other peripherals" msgstr "他の周辺デバイス" msgid "Click to capture mouse" -msgstr "クリックするとマウスをキャプチャします" +msgstr "左クリックでマウスをキャプチャします" msgid "Press F8+F12 to release mouse" msgstr "F8+F12キーでマウスを解放します" msgid "Press F8+F12 or middle button to release mouse" -msgstr "F8+F12キーまたはマウスの中ボタンを押してマウスを解放します" +msgstr "F8+F12キーまたは中クリックでマウスを解放します" msgid "Bus" msgstr "バス" @@ -761,7 +761,7 @@ msgid "No PCap devices found" msgstr "PCapデバイスがありません" msgid "Invalid PCap device" -msgstr "不正なPCapデバイスです" +msgstr "不正なPCapデバイス" msgid "Standard 2-button joystick(s)" msgstr "標準ジョイスティック(2ボタン)" @@ -899,7 +899,7 @@ msgid "CD-ROM images" msgstr "CD-ROMイメージ" msgid "%hs Device Configuration" -msgstr "%hs デバイスの設定" +msgstr "%hs のデバイス設定" msgid "Monitor in sleep mode" msgstr "モニターのスリープモード" @@ -911,7 +911,7 @@ msgid "OpenGL options" msgstr "OpenGL設定" msgid "You are loading an unsupported configuration" -msgstr "サポートされていない設定を読み込んでいます" +msgstr "読み込んでいる設定がサポートされません" msgid "CPU type filtering based on selected machine is disabled for this emulated machine.\n\nThis makes it possible to choose a CPU that is otherwise incompatible with the selected machine. However, you may run into incompatibilities with the machine BIOS or other software.\n\nEnabling this setting is not officially supported and any bug reports filed may be closed as invalid." msgstr "選択したマシンに基づくCPUタイプのフィルター機能は、使用中のマシンでは無効になっています。\n\nこれにより、選択したマシンと互換性のないCPUが選択できます。しかし、マシンのBIOSや他のソフトウェアと互換性がない場合があります。\n\nこの設定を有効にすることは公式にはサポートされておらず、バグレポートは無効として中止される可能性があります。" @@ -935,7 +935,7 @@ msgid "Error initializing renderer" msgstr "レンダラーの初期化エラー" msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer." -msgstr "OpenGL (3.0コア) レンダラーが初期化できませんでした。別のレンダラーを使用してください。" +msgstr "OpenGL (3.0コア) レンダラーが初期化できません。別のレンダラーを使用してください。" msgid "Resume execution" msgstr "実行を再開" @@ -944,10 +944,10 @@ msgid "Pause execution" msgstr "実行を一時停止" msgid "Press Ctrl+Alt+Del" -msgstr "Ctrl+Alt+DELを押し" +msgstr "Ctrl+Alt+DELを押す" msgid "Press Ctrl+Alt+Esc" -msgstr "Ctrl+Alt+Escを押し" +msgstr "Ctrl+Alt+Escを押す" msgid "Hard reset" msgstr "ハードリセット" @@ -965,13 +965,13 @@ msgid "%01i" msgstr "%01i" msgid "MFM/RLL or ESDI CD-ROM drives never existed" -msgstr "MFM/RLLまたはESDIのCD-ROMドライブが存在しません" +msgstr "MFM/RLLやESDI CD-ROMドライブが存在しません" msgid "Custom..." msgstr "カスタム..." msgid "Custom (large)..." -msgstr "カスタム (大型)..." +msgstr "カスタム (大容量)..." msgid "Add New Hard Disk" msgstr "新規のディスクを追加" @@ -1181,7 +1181,7 @@ msgid "5.25\" 1.3 GB" msgstr "5.25\" 1.3 GB" msgid "Perfect RPM" -msgstr "規定のRPM" +msgstr "既定RPM" msgid "1% below perfect RPM" msgstr "1%低いRPM" From aa95b141328e2fea33802bf2f62c67c1fc2eea41 Mon Sep 17 00:00:00 2001 From: EmpyreusX <36258024+EmpyreusX@users.noreply.github.com> Date: Sun, 8 Oct 2023 23:54:09 +0800 Subject: [PATCH 12/50] Fix Japanese translation (Win32) --- src/win/languages/ja-JP.rc | 58 +++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/win/languages/ja-JP.rc b/src/win/languages/ja-JP.rc index ab57fb495..bf9509453 100644 --- a/src/win/languages/ja-JP.rc +++ b/src/win/languages/ja-JP.rc @@ -140,7 +140,7 @@ BEGIN MENUITEM "新規イメージ(&N)...", IDM_CASSETTE_IMAGE_NEW MENUITEM SEPARATOR MENUITEM "既存のイメージを開く(&E)...", IDM_CASSETTE_IMAGE_EXISTING - MENUITEM "既存のイメージを開く(書き込み保護)(&W)...", IDM_CASSETTE_IMAGE_EXISTING_WP + MENUITEM "既存のイメージを開く(書き込み禁止)(&W)...", IDM_CASSETTE_IMAGE_EXISTING_WP MENUITEM SEPARATOR MENUITEM "記録(&R)", IDM_CASSETTE_RECORD MENUITEM "再生(&P)", IDM_CASSETTE_PLAY @@ -168,7 +168,7 @@ BEGIN MENUITEM "新規イメージ(&N)...", IDM_FLOPPY_IMAGE_NEW MENUITEM SEPARATOR MENUITEM "既存のイメージを開く(&E)...", IDM_FLOPPY_IMAGE_EXISTING - MENUITEM "既存のイメージを開く(書き込み保護)(&W)...", IDM_FLOPPY_IMAGE_EXISTING_WP + MENUITEM "既存のイメージを開く(書き込み禁止)(&W)...", IDM_FLOPPY_IMAGE_EXISTING_WP MENUITEM SEPARATOR MENUITEM "86Fイメージにエクスポート(&X)...", IDM_FLOPPY_EXPORT_TO_86F MENUITEM SEPARATOR @@ -197,7 +197,7 @@ BEGIN MENUITEM "新規イメージ(&N)...", IDM_ZIP_IMAGE_NEW MENUITEM SEPARATOR MENUITEM "既存のイメージを開く(&E)...", IDM_ZIP_IMAGE_EXISTING - MENUITEM "既存のイメージを開く(書き込み保護)(&W)...", IDM_ZIP_IMAGE_EXISTING_WP + MENUITEM "既存のイメージを開く(書き込み禁止)(&W)...", IDM_ZIP_IMAGE_EXISTING_WP MENUITEM SEPARATOR MENUITEM "取り出す(&J)", IDM_ZIP_EJECT MENUITEM "前のイメージを再読み込み(&R)", IDM_ZIP_RELOAD @@ -211,7 +211,7 @@ BEGIN MENUITEM "新規イメージ(&N)...", IDM_MO_IMAGE_NEW MENUITEM SEPARATOR MENUITEM "既存のイメージを開く(&E)...", IDM_MO_IMAGE_EXISTING - MENUITEM "既存のイメージを開く(書き込み保護)(&W)...", IDM_MO_IMAGE_EXISTING_WP + MENUITEM "既存のイメージを開く(書き込み禁止)(&W)...", IDM_MO_IMAGE_EXISTING_WP MENUITEM SEPARATOR MENUITEM "取り出す(&J)", IDM_MO_EJECT MENUITEM "前のイメージを再読み込み(&R)", IDM_MO_RELOAD @@ -253,7 +253,7 @@ END #define STR_LANGUAGE "言語:" #define STR_ICONSET "アイコン セット:" -#define STR_GAIN "ゲイン値" +#define STR_GAIN "音量" #define STR_FILE_NAME "ファイル名:" #define STR_DISK_SIZE "ディスク サイズ:" @@ -262,7 +262,7 @@ END #define STR_WIDTH "幅:" #define STR_HEIGHT "高さ:" -#define STR_LOCK_TO_SIZE "このサイズを固定" +#define STR_LOCK_TO_SIZE "サイズを固定" #define STR_MACHINE_TYPE "マシン タイプ:" #define STR_MACHINE "マシン:" @@ -277,7 +277,7 @@ END #define STR_DISABLED "無効" #define STR_ENABLED_LOCAL "有効(現地時間)" #define STR_ENABLED_UTC "有効(UTC)" -#define STR_DYNAREC "動的リコンパイラ" +#define STR_DYNAREC "動的再コンパイル" #define STR_SOFTFLOAT "Softfloat FPU" #define STR_VIDEO "ビデオカード:" @@ -402,34 +402,34 @@ BEGIN IDS_2053 "速度" IDS_2054 "ZIP %03i %i (%s): %ls" IDS_2055 "ZIPイメージ (*.IM?;*.ZDI)\0*.IM?;*.ZDI\0" - IDS_2056 "86Boxで使用可能なROMイメージが見つかりませんでした。\n\nROMセットをダウンロードして、「roms」ディレクトリに解凍してください。" + IDS_2056 "86Boxで使用可能なROMイメージが見つかりません。\n\nROMセットをダウンロードして、「roms」ディレクトリに解凍してください。" IDS_2057 "(空)" IDS_2058 "ZIPイメージ (*.IM?;*.ZDI)\0*.IM?;*.ZDI\0すべてのファイル (*.*)\0*.*\0" IDS_2059 "高速" IDS_2060 "オン" IDS_2061 "オフ" - IDS_2062 "すべてのイメージ (*.86F;*.DSK;*.FLP;*.IM?;*.*FD?)\0*.86F;*.DSK;*.FLP;*.IM?;*.*FD?\0基本的なセクターイメージ (*.DSK;*.FLP;*.IM?;*.*FD?)\0*.DSK;*.FLP;*.IM?;*.IMG;*.*FD?\0表面イメージ (*.86F)\0*.86F\0" - IDS_2063 "「roms/machines」ディレクトリにROMがないため、マシン「%hs」は使用できません。使用可能なマシンに切り替えます。" + IDS_2062 "すべてのイメージ (*.86F;*.DSK;*.FLP;*.IM?;*.*FD?)\0*.86F;*.DSK;*.FLP;*.IM?;*.*FD?\0ベーシック セクター イメージ (*.DSK;*.FLP;*.IM?;*.*FD?)\0*.DSK;*.FLP;*.IM?;*.IMG;*.*FD?\0サーフェス イメージ (*.86F)\0*.86F\0" + IDS_2063 "roms/machines ディレクトリにROMがないため、マシン「%hs」は使用できません。使用可能なマシンに切り替えます。" END STRINGTABLE DISCARDABLE BEGIN - IDS_2064 "「roms/video」ディレクトリにROMがないため、ビデオカード「%hs」は使用できません。使用可能なビデオカードに切り替えます。" + IDS_2064 "roms/video ディレクトリにROMがないため、ビデオカード「%hs」は使用できません。使用可能なビデオカードに切り替えます。" IDS_2065 "マシン" - IDS_2066 "画面表示" + IDS_2066 "ディスプレイ" IDS_2067 "入力デバイス" IDS_2068 "サウンド" IDS_2069 "ネットワーク" IDS_2070 "ポート (COM/LPT)" IDS_2071 "ストレージ コントローラ" IDS_2072 "ハード ディスク" - IDS_2073 "フロッピー/CD-ROMドライブ" + IDS_2073 "フロッピー/CD-ROMドライブ" IDS_2074 "他のリムーバブル デバイス" IDS_2075 "他の周辺デバイス" - IDS_2076 "表面イメージ (*.86F)\0*.86F\0" - IDS_2077 "クリックするとマウスをキャプチャします" + IDS_2076 "サーフェス イメージ (*.86F)\0*.86F\0" + IDS_2077 "左クリックでマウスをキャプチャします" IDS_2078 "F8+F12キーを押してマウスを解放します" - IDS_2079 "F8+F12キーまたはマウスの中ボタンを押してマウスを解放します" + IDS_2079 "F8+F12キーまたは中クリックでマウスを解放します" END STRINGTABLE DISCARDABLE @@ -449,7 +449,7 @@ BEGIN IDS_2093 "タイプ" IDS_2094 "PCapのセットアップに失敗しました" IDS_2095 "PCapデバイスがありません" - IDS_2096 "不正なPCapデバイスです" + IDS_2096 "不正なPCapデバイス" IDS_2097 "標準ジョイスティック(2ボタン)" IDS_2098 "標準ジョイスティック(4ボタン)" IDS_2099 "標準ジョイスティック(6ボタン)" @@ -463,7 +463,7 @@ BEGIN IDS_2107 "%u" IDS_2108 "%u MB (CHS値: %i、%i、%i)" IDS_2109 "フロッピー %i (%s): %ls" - IDS_2110 "すべてのイメージ (*.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\0アドバンスドセクターイメージ (*.IMD;*.JSON;*.TD0)\0*.IMD;*.JSON;*.TD0\0基本セクターイメージ (*.0??;*.1??;*.??0;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?)\0*.0??;*.1??;*.??0;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?\0フラックスイメージ (*.FDI)\0*.FDI\0表面イメージ (*.86F;*.MFM)\0*.86F;*.MFM\0すべてのファイル (*.*)\0*.*\0" + IDS_2110 "すべてのイメージ (*.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\0アドバンスド セクター イメージ (*.IMD;*.JSON;*.TD0)\0*.IMD;*.JSON;*.TD0\0ベーシック セクター イメージ (*.0??;*.1??;*.??0;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?)\0*.0??;*.1??;*.??0;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?\0フラックスイメージ (*.FDI)\0*.FDI\0サーフェス イメージ (*.86F;*.MFM)\0*.86F;*.MFM\0すべてのファイル (*.*)\0*.*\0" IDS_2112 "SDLが初期化できません。SDL2.dllが必要です" IDS_2113 "使用中のマシンをハードリ セットしますか?" IDS_2114 "86Boxを終了しますか?" @@ -503,11 +503,11 @@ BEGIN IDS_2139 "リセットしない" IDS_2140 "光磁気イメージ (*.IM?;*.MDI)\0*.IM?;*.MDI\0すべてのファイル (*.*)\0*.*\0" IDS_2141 "CD-ROMイメージ (*.ISO;*.CUE)\0*.ISO;*.CUE\0すべてのファイル (*.*)\0*.*\0" - IDS_2142 "%hs デバイスの設定" + IDS_2142 "%hs のデバイス設定" IDS_2143 "モニターのスリープ モード" IDS_2144 "OpenGLシェーダー (*.GLSL)\0*.GLSL\0すべてのファイル (*.*)\0*.*\0" IDS_2145 "OpenGL設定" - IDS_2146 "サポートされていない設定を読み込んでいます" + IDS_2146 "読み込んでいる設定がサポートされません" IDS_2147 "選択したマシンに基づくCPUタイプのフィルター機能は、使用中のマシンでは無効になっています。\n\nこれにより、選択したマシンと互換性のないCPUが選択できます。しかし、マシンのBIOSや他のソフトウェアと互換性がない場合があります。\n\nこの設定を有効にすることは公式にはサポートされておらず、バグレポートは無効として中止される可能性があります。" IDS_2148 "続行" IDS_2149 "カセット: %s" @@ -515,18 +515,18 @@ BEGIN IDS_2151 "カートリッジ %i: %ls" IDS_2152 "カートリッジ イメージ (*.A;*.B;*.JRC)\0*.A;*.B;*.JRC\0すべてのファイル (*.*)\0*.*\0" IDS_2153 "レンダラーの初期化エラー" - IDS_2154 "OpenGL (3.0コア) レンダラーが初期化できませんでした。別のレンダラーを使用してください。" + IDS_2154 "OpenGL (3.0コア) レンダラーが初期化できません。別のレンダラーを使用してください。" IDS_2155 "実行を再開" IDS_2156 "実行を一時停止" - IDS_2157 "Ctrl+Alt+DELを押し" - IDS_2158 "Ctrl+Alt+Escを押し" + IDS_2157 "Ctrl+Alt+DELを押す" + IDS_2158 "Ctrl+Alt+Escを押す" IDS_2159 "ハードリセット" IDS_2160 "ACPIシャットダウン" IDS_2161 "設定" IDS_2162 "タイプ" - IDS_2163 "Dynarecなし" - IDS_2164 "旧型Dynarec" - IDS_2165 "新型Dynarec" + IDS_2163 "動的再コンパイル禁止" + IDS_2164 "旧型の動的再コンパイル" + IDS_2165 "新型の動的再コンパイル" IDS_2166 "「roms/video」ディレクトリにROMがないため、ビデオカード#2「%hs」は使用できません。2枚目のビデオカードを無効にします。" IDS_2167 "ネットワーク ドライバの初期化に失敗しました。" IDS_2168 "ネットワーク設定がヌル ドライバに切り替えられます" @@ -537,7 +537,7 @@ BEGIN IDS_4096 "ハード ディスク (%s)" IDS_4097 "%01i:%01i" IDS_4098 "%01i" - IDS_4099 "MFM/RLLまたはESDIのCD-ROMドライブが存在しません" + IDS_4099 "MFM/RLLやESDI CD-ROMドライブが存在しません" IDS_4100 "カスタム..." IDS_4101 "カスタム (大容量)..." IDS_4102 "新規のディスクを追加" @@ -572,7 +572,7 @@ BEGIN IDS_4131 "親VHDの選択" IDS_4132 "親イメージが差分イメージの作成の後に変更される可能性があります。\n\nイメージ ファイルが移動またはコピーされたか、イメージ ファイルを作成したプログラムにバグが発生した可能性があります。\n\nタイム スタンプを修正しますか?" IDS_4133 "親ディスクと子ディスクのタイム スタンプが一致しません" - IDS_4134 "VHD のタイム スタンプを修正できませんでした。" + IDS_4134 "VHD のタイム スタンプを修正できません。" IDS_4135 "%01i:%02i" IDS_4352 "MFM/RLL" @@ -624,7 +624,7 @@ BEGIN IDS_5910 "5.25"" 1 GB" IDS_5911 "5.25"" 1.3 GB" - IDS_6144 "規定のRPM" + IDS_6144 "既定RPM" IDS_6145 "1%低いRPM" IDS_6146 "1.5%低いRPM" IDS_6147 "2%低いRPM" From 57375db3bdba22f964a2a073a01047b6e8380cf5 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 8 Oct 2023 18:15:27 +0200 Subject: [PATCH 13/50] More fixes. --- src/machine/m_at_socket7.c | 4 ++-- src/machine/m_at_socket7_3v.c | 4 ++-- src/sio/sio_pc87306.c | 21 +++++++++------------ src/sound/snd_sb.c | 3 +++ src/sound/sound.c | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index 71c14e096..7564da84a 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -345,8 +345,8 @@ machine_at_cu430hx_gpio_handler(uint8_t write, uint32_t val) uint32_t ret = machine_get_gpio_default(); if (write) { - ret &= (val | 0xffff00ff); - ret = (ret & 0xffffffcf) | (val & 0x0000ff30); + ret &= ((val & 0xffffffcf) | 0xffff0000); + ret |= (val & 0x00000030); if (machine_snd != NULL) switch ((val >> 4) & 0x03) { case 0x00: sb_vibra16c_onboard_relocate_base(0x0220, machine_snd); diff --git a/src/machine/m_at_socket7_3v.c b/src/machine/m_at_socket7_3v.c index 7f090ca51..268baafed 100644 --- a/src/machine/m_at_socket7_3v.c +++ b/src/machine/m_at_socket7_3v.c @@ -289,8 +289,8 @@ machine_at_endeavor_gpio_handler(uint8_t write, uint32_t val) uint32_t ret = machine_get_gpio_default(); if (write) { - ret &= (val | 0xffff00ff); - ret = (ret & 0xffffffcf) | (val & 0x0000ff30); + ret &= ((val & 0xffffffcf) | 0xffff0000); + ret |= (val & 0x00000030); if (machine_snd != NULL) switch ((val >> 4) & 0x03) { case 0x00: sb_vibra16s_onboard_relocate_base(0x0220, machine_snd); diff --git a/src/sio/sio_pc87306.c b/src/sio/sio_pc87306.c index 85adc712d..f5aa086d0 100644 --- a/src/sio/sio_pc87306.c +++ b/src/sio/sio_pc87306.c @@ -70,7 +70,6 @@ pc87306_gpio_write(uint16_t port, uint8_t val, void *priv) uint8_t pc87306_gpio_read(uint16_t port, void *priv) { - const pc87306_t *dev = (pc87306_t *) priv; uint32_t ret = machine_handle_gpio(0, 0xffffffff); if (port & 0x0001) @@ -99,11 +98,11 @@ pc87306_gpio_init(pc87306_t *dev) if (dev->gpioba != 0x0000) { if ((dev->regs[0x12]) & 0x10) - io_sethandler(dev->regs[0x0f] << 2, 0x0001, + io_sethandler(dev->gpioba, 0x0001, pc87306_gpio_read, NULL, NULL, pc87306_gpio_write, NULL, NULL, dev); if ((dev->regs[0x12]) & 0x20) - io_sethandler((dev->regs[0x0f] << 2) + 1, 0x0001, + io_sethandler(dev->gpioba + 1, 0x0001, pc87306_gpio_read, NULL, NULL, pc87306_gpio_write, NULL, NULL, dev); } } @@ -254,8 +253,6 @@ pc87306_write(uint16_t port, uint8_t val, void *priv) if ((dev->cur_reg <= 28) && (dev->cur_reg != 8)) { if (dev->cur_reg == 0) val &= 0x5f; - if (((dev->cur_reg == 0x0F) || (dev->cur_reg == 0x12)) && valxor) - pc87306_gpio_remove(dev); dev->regs[dev->cur_reg] = val; } else return; @@ -266,7 +263,7 @@ pc87306_write(uint16_t port, uint8_t val, void *priv) } switch (dev->cur_reg) { - case 0: + case 0x00: if (valxor & 1) { lpt1_remove(); if ((val & 1) && !(dev->regs[2] & 1)) @@ -288,7 +285,7 @@ pc87306_write(uint16_t port, uint8_t val, void *priv) fdc_set_base(dev->fdc, (val & 0x20) ? FDC_SECONDARY_ADDR : FDC_PRIMARY_ADDR); } break; - case 1: + case 0x01: if (valxor & 3) { lpt1_remove(); if ((dev->regs[0] & 1) && !(dev->regs[2] & 1)) @@ -305,7 +302,7 @@ pc87306_write(uint16_t port, uint8_t val, void *priv) serial_handler(dev, 1); } break; - case 2: + case 0x02: if (valxor & 1) { lpt1_remove(); serial_remove(dev->uart[0]); @@ -329,23 +326,23 @@ pc87306_write(uint16_t port, uint8_t val, void *priv) lpt1_handler(dev); } break; - case 4: + case 0x04: if (valxor & 0x80) nvr_lock_set(0x00, 256, !!(val & 0x80), dev->nvr); break; - case 5: + case 0x05: if (valxor & 0x08) nvr_at_handler(!!(val & 0x08), 0x0070, dev->nvr); if (valxor & 0x20) nvr_bank_set(0, !!(val & 0x20), dev->nvr); break; - case 9: + case 0x09: if (valxor & 0x44) { fdc_update_enh_mode(dev->fdc, (val & 4) ? 1 : 0); fdc_update_densel_polarity(dev->fdc, (val & 0x40) ? 1 : 0); } break; - case 0xF: + case 0x0f: if (valxor) pc87306_gpio_handler(dev); break; diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index 0f94cbaff..478f82546 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -2024,6 +2024,7 @@ sb_16_init(UNUSED(const device_t *info)) if (device_get_config_int("receive_input")) midi_in_handler(1, sb_dsp_input_msg, sb_dsp_input_sysex, &sb->dsp); + sb->gameport = gameport_add(&gameport_pnp_device); sb->gameport_addr = 0x200; return sb; @@ -2130,6 +2131,7 @@ sb_16_compat_init(const device_t *info) mpu401_init(sb->mpu, 0, 0, M_UART, info->local); sb_dsp_set_mpu(&sb->dsp, sb->mpu); + sb->gameport = gameport_add(&gameport_pnp_device); sb->gameport_addr = 0x200; return sb; @@ -2228,6 +2230,7 @@ sb_awe32_init(UNUSED(const device_t *info)) if (device_get_config_int("receive_input")) midi_in_handler(1, sb_dsp_input_msg, sb_dsp_input_sysex, &sb->dsp); + sb->gameport = gameport_add(&gameport_pnp_device); sb->gameport_addr = 0x200; return sb; diff --git a/src/sound/sound.c b/src/sound/sound.c index a93cd27d1..f02e83bc5 100644 --- a/src/sound/sound.c +++ b/src/sound/sound.c @@ -219,7 +219,7 @@ sound_card_get_from_internal_name(const char *s) void sound_card_init(void) { - if (sound_cards[sound_card_current[0]].device) + if ((sound_card_current[0] != SOUND_INTERNAL) && (sound_cards[sound_card_current[0]].device)) device_add(sound_cards[sound_card_current[0]].device); if (sound_cards[sound_card_current[1]].device) device_add(sound_cards[sound_card_current[1]].device); @@ -512,14 +512,14 @@ sound_reset(void) filter_cd_audio_p = NULL; sound_set_cd_volume(65535, 65535); + + /* Reset the MPU-401 already loaded flag and the chain of input/output handlers. */ + midi_in_handlers_clear(); } void sound_card_reset(void) { - /* Reset the MPU-401 already loaded flag and the chain of input/output handlers. */ - midi_in_handlers_clear(); - sound_card_init(); if (mpu401_standalone_enable) From 197e817ea3f2ecfb06f8c00b6ee589922e0e00e3 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 8 Oct 2023 13:32:43 -0400 Subject: [PATCH 14/50] Remove several unused variables --- src/cdrom/cdrom.c | 2 -- src/cpu/808x.c | 6 ------ src/pic.c | 1 - src/video/vid_xga.c | 1 - 4 files changed, 10 deletions(-) diff --git a/src/cdrom/cdrom.c b/src/cdrom/cdrom.c index c06e47f07..2a9ede6b0 100644 --- a/src/cdrom/cdrom.c +++ b/src/cdrom/cdrom.c @@ -898,7 +898,6 @@ cdrom_get_audio_status_pioneer(cdrom_t *dev, uint8_t *b) { uint8_t ret; subchannel_t subc; - uint32_t dat; dev->ops->get_subchannel(dev, dev->seek_pos, &subc); @@ -960,7 +959,6 @@ cdrom_get_audio_status_sony(cdrom_t *dev, uint8_t *b, int msf) void cdrom_get_current_subcodeq(cdrom_t *dev, uint8_t *b) { - uint8_t ret; subchannel_t subc; dev->ops->get_subchannel(dev, dev->seek_pos, &subc); diff --git a/src/cpu/808x.c b/src/cpu/808x.c index fd2aa52fb..0d5cc3e9a 100644 --- a/src/cpu/808x.c +++ b/src/cpu/808x.c @@ -92,9 +92,6 @@ static uint16_t mem_addr = 0; static int schedule_fetch = 1; static int pasv = 0; -static int pfq_idle = 1; -static int pfq_delay = 0; - #define BUS_OUT 1 #define BUS_HIGH 2 #define BUS_WIDE 4 @@ -1268,7 +1265,6 @@ intr_routine(uint16_t intr, int skip_first) uint16_t tempf = cpu_state.flags & (is_nec ? 0x8fd7 : 0x0fd7); uint16_t new_cs; uint16_t new_ip; - uint16_t old_ip; if (!skip_first) wait(1, 0); @@ -1368,7 +1364,6 @@ custom_nmi(void) uint16_t tempf = cpu_state.flags & (is_nec ? 0x8fd7 : 0x0fd7); uint16_t new_cs; uint16_t new_ip; - uint16_t old_ip; wait(1, 0); wait(2, 0); @@ -2155,7 +2150,6 @@ execx86(int cycs) uint16_t old_flags; uint16_t tmpa; int bits; - uint32_t dest_seg; uint32_t i; uint32_t carry; uint32_t nibble; diff --git a/src/pic.c b/src/pic.c index 43b2eee42..2e59dda10 100644 --- a/src/pic.c +++ b/src/pic.c @@ -54,7 +54,6 @@ static pc_timer_t pic_timer; static int shadow = 0; static int elcr_enabled = 0; static int tmr_inited = 0; -static int latched = 0; static int pic_pci = 0; static int kbd_latch = 0; static int mouse_latch = 0; diff --git a/src/video/vid_xga.c b/src/video/vid_xga.c index d27da0d36..915ac548a 100644 --- a/src/video/vid_xga.c +++ b/src/video/vid_xga.c @@ -1499,7 +1499,6 @@ xga_bitblt(svga_t *svga) int mix = 0; int xdir; int ydir; - int skip = 0; int x = 0; int y = 0; From ba369d37c90d0467c01eb5ef97a82919f6a383bd Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 9 Oct 2023 03:47:54 +0200 Subject: [PATCH 15/50] The Endeavor's on-board Vibra 16S now correctly has the YMF289B and also fixed the frequencies of YMF289B and YMF278B. --- src/sound/snd_opl_ymfm.cpp | 4 ++-- src/sound/snd_sb.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sound/snd_opl_ymfm.cpp b/src/sound/snd_opl_ymfm.cpp index 3f08b743f..1f542cf0b 100644 --- a/src/sound/snd_opl_ymfm.cpp +++ b/src/sound/snd_opl_ymfm.cpp @@ -312,11 +312,11 @@ ymfm_drv_init(const device_t *info) break; case FM_YMF289B: - fm = (YMFMChipBase *) new YMFMChip(33868800, FM_YMF289B, OPL_FREQ); + fm = (YMFMChipBase *) new YMFMChip(16934400, FM_YMF289B, 44100); break; case FM_YMF278B: - fm = (YMFMChipBase *) new YMFMChip(33868800, FM_YMF278B, 48000); + fm = (YMFMChipBase *) new YMFMChip(16934400, FM_YMF278B, 44100); break; } diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index 478f82546..107507d77 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -1982,7 +1982,7 @@ sb_16_init(UNUSED(const device_t *info)) sb->opl_enabled = device_get_config_int("opl"); if (sb->opl_enabled) - fm_driver_get(FM_YMF262, &sb->opl); + fm_driver_get(info->local, &sb->opl); sb_dsp_init(&sb->dsp, SB16, SB_SUBTYPE_DEFAULT, sb); sb_dsp_setaddr(&sb->dsp, addr); @@ -3669,7 +3669,7 @@ const device_t sb_16_device = { .name = "Sound Blaster 16", .internal_name = "sb16", .flags = DEVICE_ISA | DEVICE_AT, - .local = 0, + .local = FM_YMF262, .init = sb_16_init, .close = sb_close, .reset = NULL, @@ -3683,7 +3683,7 @@ const device_t sb_vibra16s_onboard_device = { .name = "Sound Blaster Vibra 16S (On-Board)", .internal_name = "sb_vibra16s_onboard", .flags = DEVICE_ISA | DEVICE_AT, - .local = 0, + .local = FM_YMF289B, .init = sb_16_init, .close = sb_close, .reset = NULL, @@ -3697,7 +3697,7 @@ const device_t sb_vibra16c_onboard_device = { .name = "Sound Blaster Vibra 16C (On-Board)", .internal_name = "sb_vibra16c_onboard", .flags = DEVICE_ISA | DEVICE_AT, - .local = 0, + .local = FM_YMF262, /* Should have the CQM but we do not emulate that yet. */ .init = sb_16_init, .close = sb_close, .reset = NULL, From 1c321caaedd361cd6f72557ea85970c71a2e7c7b Mon Sep 17 00:00:00 2001 From: richardg867 Date: Mon, 9 Oct 2023 11:26:25 -0300 Subject: [PATCH 16/50] isapnp: Improve PnP ROM parser logging --- src/device/isapnp.c | 92 +++++++++++++++++++++++++++++++-------------- 1 file changed, 63 insertions(+), 29 deletions(-) diff --git a/src/device/isapnp.c b/src/device/isapnp.c index 22b22dfcc..26301b622 100644 --- a/src/device/isapnp.c +++ b/src/device/isapnp.c @@ -183,7 +183,7 @@ isapnp_reset_ld_config(isapnp_device_t *ld) /* Populate configuration registers. */ ld->regs[0x30] = !!config->activate; - uint8_t reg_base; + uint8_t reg_base; uint32_t size; for (uint8_t i = 0; i < 4; i++) { reg_base = 0x40 + (8 * i); @@ -795,22 +795,28 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size) #ifdef ENABLE_ISAPNP_LOG uint16_t vendor = (card->rom[0] << 8) | card->rom[1]; isapnp_log("ISAPnP: Parsing ROM resources for card %c%c%c%02X%02X (serial %08X)\n", '@' + ((vendor >> 10) & 0x1f), '@' + ((vendor >> 5) & 0x1f), '@' + (vendor & 0x1f), card->rom[2], card->rom[3], (card->rom[7] << 24) | (card->rom[6] << 16) | (card->rom[5] << 8) | card->rom[4]); + const char *df_priority[] = { "good", "acceptable", "sub-optimal", "unknown priority" }; + const char *mem_control[] = { "8-bit", "16-bit", "8/16-bit", "32-bit" }; + const char *dma_transfer[] = { "8-bit", "8/16-bit", "16-bit", "unknown" }; + const char *dma_speed[] = { "compatibility", "Type A", "Type B", "Type F" }; #endif uint16_t i = 9; uint8_t existing = 0; - uint8_t ldn = 0; + uint8_t ldn = 0; uint8_t res; - uint8_t in_df = 0; - uint8_t irq = 0; - uint8_t io = 0; - uint8_t mem_range = 0; - uint8_t mem_range_32 = 0; - uint8_t irq_df = 0; - uint8_t io_df = 0; - uint8_t mem_range_df = 0; + uint8_t in_df = 0; + uint8_t irq = 0; + uint8_t dma = 0; + uint8_t io = 0; + uint8_t mem_range = 0; + uint8_t mem_range_32 = 0; + uint8_t irq_df = 0; + uint8_t dma_df = 0; + uint8_t io_df = 0; + uint8_t mem_range_df = 0; uint8_t mem_range_32_df = 0; uint32_t len; - isapnp_device_t *ld = NULL; + isapnp_device_t *ld = NULL; isapnp_device_t *prev_ld = NULL; /* Check if this is an existing card which already has logical devices. @@ -838,7 +844,10 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size) break; } - isapnp_log("ISAPnP: >>%s Memory range %d uses upper limit = ", in_df ? ">" : "", mem_range); + isapnp_log("ISAPnP: >>%s Memory range %d with %d bytes at %06X-%06X, align %d", + in_df ? ">" : "", mem_range, + *((uint16_t *) &card->rom[i + 10]) << 8, *((uint16_t *) &card->rom[i + 4]) << 8, ((card->rom[i + 3] & 0x4) ? 0 : (*((uint16_t *) &card->rom[i + 4]) << 8)) + (*((uint16_t *) &card->rom[i + 6]) << 8), + (*((uint16_t *) &card->rom[i + 8]) + 1) << 16); res = 1 << mem_range; mem_range++; } else { @@ -852,18 +861,27 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size) break; } - isapnp_log("ISAPnP: >>%s 32-bit memory range %d uses upper limit = ", in_df ? ">" : "", mem_range_32); + isapnp_log("ISAPnP: >>%s 32-bit memory range %d with %d bytes at %08X-%08X, align %d", in_df ? ">" : "", mem_range_32, + *((uint32_t *) &card->rom[i + 16]) << 8, *((uint32_t *) &card->rom[i + 4]) << 8, ((card->rom[i + 3] & 0x4) ? 0 : (*((uint32_t *) &card->rom[i + 4]) << 8)) + (*((uint32_t *) &card->rom[i + 8]) << 8), + *((uint32_t *) &card->rom[i + 12])); res = 1 << (4 + mem_range_32); mem_range_32++; } - if (card->rom[i + 3] & 0x4) { - isapnp_log("yes\n"); +#ifdef ENABLE_ISAPNP_LOG + isapnp_log(" bytes, %swritable, %sread cacheable, %s, %sshadowable, %sexpansion ROM\n", + (card->rom[i + 3] & 0x01) ? "not " : "", + (card->rom[i + 3] & 0x02) ? "not " : "", + (card->rom[i + 3] & 0x04) ? "upper limit" : "range length", + mem_control[(card->rom[i + 3] >> 3) & 0x03], + (card->rom[i + 3] & 0x20) ? "not " : "", + (card->rom[i + 3] & 0x40) ? "not " : ""); +#endif + + if (card->rom[i + 3] & 0x4) ld->mem_upperlimit |= res; - } else { - isapnp_log("no\n"); + else ld->mem_upperlimit &= ~res; - } break; @@ -874,14 +892,11 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size) isapnp_log("ISAPnP: >%s ANSI identifier: \"%s\"\n", ldn ? ">" : "", &card->rom[i + 3]); card->rom[i + 3 + len] = res; break; +#endif default: isapnp_log("ISAPnP: >%s%s Large resource %02X (length %d)\n", ldn ? ">" : "", in_df ? ">" : "", res, (card->rom[i + 2] << 8) | card->rom[i + 1]); break; -#else - default: - break; -#endif } i += 3; /* header */ @@ -890,7 +905,13 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size) len = card->rom[i] & 0x07; switch (res) { - case 0x02: +#ifdef ENABLE_ISAPNP_LOG + case 0x01: /* PnP version */ + isapnp_log("ISAPnP: > PnP version %d.%d, vendor-specific version %02X\n", card->rom[i + 1] >> 4, card->rom[i + 1] & 0x0f, card->rom[i + 2]); + break; +#endif + + case 0x02: /* logical device */ #ifdef ENABLE_ISAPNP_LOG vendor = (card->rom[i + 1] << 8) | card->rom[i + 2]; isapnp_log("ISAPnP: > Logical device %02X: %c%c%c%02X%02X\n", ldn, '@' + ((vendor >> 10) & 0x1f), '@' + ((vendor >> 5) & 0x1f), '@' + (vendor & 0x1f), card->rom[i + 3], card->rom[i + 4]); @@ -931,7 +952,7 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size) ld->number = ldn++; /* Start the position counts over. */ - irq = io = mem_range = mem_range_32 = irq_df = io_df = mem_range_df = mem_range_32_df = 0; + irq = dma = io = mem_range = mem_range_32 = irq_df = dma_df = io_df = mem_range_df = mem_range_32_df = 0; break; @@ -963,7 +984,7 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size) else /* specific */ res = card->rom[i + 3] & 0x0f; - isapnp_log("ISAPnP: >>%s IRQ index %d interrupt types = %01X\n", in_df ? ">" : "", irq, res); + isapnp_log("ISAPnP: >>%s IRQ index %d with mask %04X, types %01X\n", in_df ? ">" : "", irq, *((uint16_t *) &card->rom[i + 1]), res); ld->irq_types &= ~(0x0f << (4 * irq)); ld->irq_types |= res << (4 * irq); @@ -972,24 +993,39 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size) break; +#ifdef ENABLE_ISAPNP_LOG + case 0x05: /* DMA */ + isapnp_log("ISAPnP: >>%s DMA index %d with mask %02X, %s, %sbus master, %scount by byte, %scount by word, %s speed\n", in_df ? ">" : "", dma++, card->rom[i + 1], + dma_transfer[card->rom[i + 2] & 3], + (card->rom[i + 2] & 0x04) ? "not " : "", + (card->rom[i + 2] & 0x08) ? "not " : "", + (card->rom[i + 2] & 0x10) ? "not " : "", + dma_speed[(card->rom[i + 2] >> 5) & 3]); + break; +#endif + case 0x06: /* start dependent function */ if (!ld) { isapnp_log("ISAPnP: >> Start dependent function with no logical device\n"); break; } - isapnp_log("ISAPnP: >> Start dependent function: %s\n", (((len == 0) || (card->rom[i + 1] == 1)) ? "acceptable" : ((card->rom[i + 1] == 0) ? "good" : ((card->rom[i + 1] == 2) ? "sub-optimal" : "unknown priority")))); +#ifdef ENABLE_ISAPNP_LOG + isapnp_log("ISAPnP: >> Start dependent function: %s\n", df_priority[(len < 1) ? 1 : (card->rom[i + 1] & 3)]); +#endif if (in_df) { /* We're in a dependent function and this is the next one starting. Walk positions back to the saved values. */ irq = irq_df; + dma = dma_df; io = io_df; mem_range = mem_range_df; mem_range_32 = mem_range_32_df; } else { /* Save current positions to restore at the next DF. */ irq_df = irq; + dma_df = dma; io_df = io; mem_range_df = mem_range; mem_range_32_df = mem_range_32; @@ -1014,7 +1050,7 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size) break; } - isapnp_log("ISAPnP: >>%s I/O range %d %d-bit decode, %d ports\n", in_df ? ">" : "", io, (card->rom[i + 1] & 0x01) ? 16 : 10, card->rom[i + 7]); + isapnp_log("ISAPnP: >>%s I/O range %d with %d ports at %04X-%04X, align %d, %d-bit decode\n", in_df ? ">" : "", io, card->rom[i + 7], *((uint16_t *) &card->rom[i + 2]), *((uint16_t *) &card->rom[i + 4]), card->rom[i + 6], (card->rom[i + 1] & 0x01) ? 16 : 10); if (card->rom[i + 1] & 0x01) ld->io_16bit |= 1 << io; @@ -1042,9 +1078,7 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size) break; default: -#ifdef ENABLE_ISAPNP_LOG isapnp_log("ISAPnP: >%s%s Small resource %02X (length %d)\n", ldn ? ">" : "", in_df ? ">" : "", res, card->rom[i] & 0x07); -#endif break; } From 39d10899accf913b404fd1f21bb0be070a0f5290 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 9 Oct 2023 20:14:03 +0200 Subject: [PATCH 17/50] Sanitized some video code to avoid #include's inside headers, and added guards to include/86box/thread.h. --- src/include/86box/thread.h | 23 ++++++++ src/include/86box/vid_8514a.h | 2 +- src/include/86box/vid_svga.h | 14 ++--- src/include/86box/vid_xga.h | 2 +- src/video/vid_8514a.c | 53 ++++++++++-------- src/video/vid_ati68860_ramdac.c | 5 +- src/video/vid_ati_mach8.c | 50 +++++++++-------- src/video/vid_svga.c | 22 ++++---- src/video/vid_xga.c | 99 +++++++++++++++++---------------- 9 files changed, 154 insertions(+), 116 deletions(-) diff --git a/src/include/86box/thread.h b/src/include/86box/thread.h index 3f09bf8f9..4d5584787 100644 --- a/src/include/86box/thread.h +++ b/src/include/86box/thread.h @@ -1,3 +1,24 @@ +/* + * 86Box A hypervisor and IBM PC system emulator that specializes in + * running old operating systems and software designed for IBM + * PC systems and compatibles from 1981 through fairly recent + * system designs based on the PCI bus. + * + * This file is part of the 86Box distribution. + * + * Thread API header. + * + * + * + * Authors: Sarah Walker, + * Miran Grca, + * + * Copyright 2008-2023 Sarah Walker. + * Copyright 2016-2023 Miran Grca. + */ +#ifndef THREAD_H +# define THREAD_H + #ifdef __cplusplus extern "C" { #endif @@ -44,3 +65,5 @@ extern int thread_release_mutex(mutex_t *mutex); #ifdef __cplusplus } #endif + +#endif /*THREAD_H*/ diff --git a/src/include/86box/vid_8514a.h b/src/include/86box/vid_8514a.h index a78434bd2..983e98cd1 100644 --- a/src/include/86box/vid_8514a.h +++ b/src/include/86box/vid_8514a.h @@ -15,7 +15,6 @@ * * Copyright 2022 TheCollector1995. */ - #ifndef VIDEO_8514A_H #define VIDEO_8514A_H @@ -203,4 +202,5 @@ typedef struct ibm8514_t { int ext_pitch; int ext_crt_pitch; } ibm8514_t; + #endif /*VIDEO_8514A_H*/ diff --git a/src/include/86box/vid_svga.h b/src/include/86box/vid_svga.h index 2fd2acf50..f725996d8 100644 --- a/src/include/86box/vid_svga.h +++ b/src/include/86box/vid_svga.h @@ -16,11 +16,6 @@ * Copyright 2008-2020 Sarah Walker. * Copyright 2016-2020 Miran Grca. */ - -#include <86box/thread.h> -#include <86box/vid_8514a.h> -#include <86box/vid_xga.h> - #ifndef VIDEO_SVGA_H # define VIDEO_SVGA_H @@ -58,8 +53,6 @@ typedef union { } latch_t; typedef struct svga_t { - ibm8514_t dev8514; - xga_t xga; mem_mapping_t mapping; uint8_t fast; @@ -269,11 +262,14 @@ typedef struct svga_t { /* Pointer to monitor */ monitor_t *monitor; + + void * dev8514; + void * xga; } svga_t; extern int vga_on; -extern void ibm8514_poll(ibm8514_t *dev, svga_t *svga); +extern void ibm8514_poll(void *priv, svga_t *svga); extern void ibm8514_recalctimings(svga_t *svga); extern uint8_t ibm8514_ramdac_in(uint16_t port, void *priv); extern void ibm8514_ramdac_out(uint16_t port, uint8_t val, void *priv); @@ -283,7 +279,7 @@ extern void ibm8514_accel_out_pixtrans(svga_t *svga, uint16_t port, uint16_t extern void ibm8514_short_stroke_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, uint8_t ssv, int len); extern void ibm8514_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, int len); -extern void xga_poll(xga_t *xga, svga_t *svga); +extern void xga_poll(void *priv, svga_t *svga); extern void xga_recalctimings(svga_t *svga); extern int svga_init(const device_t *info, svga_t *svga, void *priv, int memsize, diff --git a/src/include/86box/vid_xga.h b/src/include/86box/vid_xga.h index 739e30c5c..e5248b309 100644 --- a/src/include/86box/vid_xga.h +++ b/src/include/86box/vid_xga.h @@ -14,7 +14,6 @@ * * Copyright 2022 TheCollector1995. */ - #ifndef VIDEO_XGA_H #define VIDEO_XGA_H @@ -232,4 +231,5 @@ typedef struct xga_t { int big_endian_linear; } xga_t; + #endif /*VIDEO_XGA_H*/ diff --git a/src/video/vid_8514a.c b/src/video/vid_8514a.c index ef735852c..a2cabfb0d 100644 --- a/src/video/vid_8514a.c +++ b/src/video/vid_8514a.c @@ -34,6 +34,8 @@ #include <86box/plat.h> #include <86box/thread.h> #include <86box/video.h> +#include <86box/vid_8514a.h> +#include <86box/vid_xga.h> #include <86box/vid_svga.h> #include <86box/vid_svga_render.h> #include "cpu.h" @@ -193,7 +195,7 @@ int ibm8514_active = 0; int ibm8514_cpu_src(svga_t *svga) { - const ibm8514_t *dev = &svga->dev8514; + const ibm8514_t *dev = (ibm8514_t *) svga->dev8514; if (!(dev->accel.cmd & 0x100)) return 0; @@ -207,7 +209,7 @@ ibm8514_cpu_src(svga_t *svga) int ibm8514_cpu_dest(svga_t *svga) { - const ibm8514_t *dev = &svga->dev8514; + const ibm8514_t *dev = (ibm8514_t *) svga->dev8514; if (!(dev->accel.cmd & 0x100)) return 0; @@ -221,7 +223,7 @@ ibm8514_cpu_dest(svga_t *svga) void ibm8514_accel_out_pixtrans(svga_t *svga, UNUSED(uint16_t port), uint16_t val, int len) { - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; uint8_t nibble = 0; uint32_t pixelxfer = 0; uint32_t monoxfer = 0xffffffff; @@ -443,7 +445,7 @@ regular_nibble: static void ibm8514_accel_out_fifo(svga_t *svga, uint16_t port, uint32_t val, int len) { - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; switch (port) { case 0x82e8: @@ -845,7 +847,7 @@ ibm8514_io_set(svga_t *svga) static void ibm8514_accel_out(uint16_t port, uint32_t val, svga_t *svga, int len) { - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; if (port & 0x8000) { ibm8514_accel_out_fifo(svga, port, val, len); @@ -993,7 +995,7 @@ ibm8514_accel_outw(uint16_t port, uint16_t val, void *priv) static uint32_t ibm8514_accel_in(uint16_t port, svga_t *svga, int len) { - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; uint32_t temp = 0; int cmd; int vpos = 0; @@ -1138,7 +1140,7 @@ ibm8514_accel_inw(uint16_t port, void *priv) void ibm8514_short_stroke_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, uint8_t ssv, int len) { - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; if (!cpu_input) { dev->accel.ssv_len = ssv & 0x0f; @@ -1156,7 +1158,7 @@ ibm8514_short_stroke_start(int count, int cpu_input, uint32_t mix_dat, uint32_t void ibm8514_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, UNUSED(int len)) { - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; uint16_t *vram_w = (uint16_t *) dev->vram; uint16_t src_dat = 0; uint16_t dest_dat; @@ -3817,7 +3819,7 @@ bitblt: void ibm8514_render_8bpp(svga_t *svga) { - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; uint32_t *p; uint32_t dat; @@ -3855,7 +3857,7 @@ ibm8514_render_8bpp(svga_t *svga) void ibm8514_render_15bpp(svga_t *svga) { - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; int x; uint32_t *p; uint32_t dat; @@ -3896,7 +3898,7 @@ ibm8514_render_15bpp(svga_t *svga) void ibm8514_render_16bpp(svga_t *svga) { - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; int x; uint32_t *p; uint32_t dat; @@ -3937,7 +3939,7 @@ ibm8514_render_16bpp(svga_t *svga) void ibm8514_render_24bpp(svga_t *svga) { - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; uint32_t *p; uint32_t dat; @@ -3973,7 +3975,7 @@ ibm8514_render_24bpp(svga_t *svga) void ibm8514_render_BGR(svga_t *svga) { - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; uint32_t *p; uint32_t dat; @@ -4009,7 +4011,7 @@ ibm8514_render_BGR(svga_t *svga) void ibm8514_render_ABGR8888(svga_t *svga) { - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; int x; uint32_t *p; uint32_t dat; @@ -4036,7 +4038,7 @@ ibm8514_render_ABGR8888(svga_t *svga) void ibm8514_render_RGBA8888(svga_t *svga) { - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; int x; uint32_t *p; uint32_t dat; @@ -4090,8 +4092,9 @@ ibm8514_render_overscan_right(ibm8514_t *dev, svga_t *svga) } void -ibm8514_poll(ibm8514_t *dev, svga_t *svga) +ibm8514_poll(void *priv, svga_t *svga) { + ibm8514_t *dev = (ibm8514_t *) priv; uint32_t x; int wx; int wy; @@ -4238,7 +4241,7 @@ ibm8514_poll(ibm8514_t *dev, svga_t *svga) void ibm8514_recalctimings(svga_t *svga) { - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; if (dev->on) { dev->h_disp = (dev->hdisp + 1) << 3; @@ -4307,7 +4310,7 @@ static uint8_t ibm8514_mca_read(int port, void *priv) { const svga_t *svga = (svga_t *) priv; - const ibm8514_t *dev = &svga->dev8514; + const ibm8514_t *dev = (ibm8514_t *) svga->dev8514; return (dev->pos_regs[port & 7]); } @@ -4316,7 +4319,7 @@ static void ibm8514_mca_write(int port, uint8_t val, void *priv) { svga_t *svga = (svga_t *) priv; - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; /* MCA does not write registers below 0x0100. */ if (port < 0x0102) @@ -4330,7 +4333,7 @@ static uint8_t ibm8514_mca_feedb(void *priv) { const svga_t *svga = (svga_t *) priv; - const ibm8514_t *dev = &svga->dev8514; + const ibm8514_t *dev = (ibm8514_t *) svga->dev8514; return dev->pos_regs[2] & 1; } @@ -4341,8 +4344,10 @@ ibm8514_init(const device_t *info) if (svga_get_pri() == NULL) return NULL; - svga_t *svga = svga_get_pri(); - ibm8514_t *dev = &svga->dev8514; + svga_t *svga = svga_get_pri(); + ibm8514_t *dev = (ibm8514_t *) calloc(1, sizeof(ibm8514_t)); + + svga->dev8514 = dev; dev->vram_size = 1024 << 10; dev->vram = calloc(dev->vram_size, 1); @@ -4368,11 +4373,13 @@ static void ibm8514_close(void *priv) { svga_t *svga = (svga_t *) priv; - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; if (dev) { free(dev->vram); free(dev->changedvram); + + free(dev); } } diff --git a/src/video/vid_ati68860_ramdac.c b/src/video/vid_ati68860_ramdac.c index 169199826..4e76cb808 100644 --- a/src/video/vid_ati68860_ramdac.c +++ b/src/video/vid_ati68860_ramdac.c @@ -46,6 +46,7 @@ #include <86box/mem.h> #include <86box/timer.h> #include <86box/video.h> +#include <86box/vid_8514a.h> #include <86box/vid_svga.h> #include <86box/vid_svga_render.h> #include <86box/plat_unused.h> @@ -68,7 +69,7 @@ void ati68860_ramdac_out(uint16_t addr, uint8_t val, void *priv, svga_t *svga) { ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) priv; - const ibm8514_t *dev = &svga->dev8514; + const ibm8514_t *dev = (ibm8514_t *) svga->dev8514; switch (addr) { case 0: @@ -172,7 +173,7 @@ uint8_t ati68860_ramdac_in(uint16_t addr, void *priv, svga_t *svga) { const ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) priv; - const ibm8514_t *dev = &svga->dev8514; + const ibm8514_t *dev = (ibm8514_t *) svga->dev8514; uint8_t temp = 0; switch (addr) { diff --git a/src/video/vid_ati_mach8.c b/src/video/vid_ati_mach8.c index 1d3f6bbc8..42a2a9f02 100644 --- a/src/video/vid_ati_mach8.c +++ b/src/video/vid_ati_mach8.c @@ -36,6 +36,7 @@ #include <86box/video.h> #include <86box/i2c.h> #include <86box/vid_ddc.h> +#include <86box/vid_8514a.h> #include <86box/vid_svga.h> #include <86box/vid_svga_render.h> #include <86box/vid_ati_eeprom.h> @@ -2299,7 +2300,7 @@ mach_out(uint16_t addr, uint8_t val, void *priv) { mach_t *mach = (mach_t *) priv; svga_t *svga = &mach->svga; - const ibm8514_t *dev = &svga->dev8514; + const ibm8514_t *dev = (ibm8514_t *) svga->dev8514; uint8_t old; uint8_t rs2; uint8_t rs3; @@ -2472,7 +2473,7 @@ mach_in(uint16_t addr, void *priv) { mach_t *mach = (mach_t *) priv; svga_t *svga = &mach->svga; - const ibm8514_t *dev = &svga->dev8514; + const ibm8514_t *dev = (ibm8514_t *) svga->dev8514; uint8_t temp = 0xff; uint8_t rs2; uint8_t rs3; @@ -2569,7 +2570,7 @@ static void mach_recalctimings(svga_t *svga) { const mach_t *mach = (mach_t *) svga->priv; - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; int clock_sel; clock_sel = ((svga->miscout >> 2) & 3) | ((mach->regs[0xbe] & 0x10) >> 1) | ((mach->regs[0xb9] & 2) << 1); @@ -3622,7 +3623,7 @@ static void mach_accel_out(uint16_t port, uint8_t val, mach_t *mach) { svga_t *svga = &mach->svga; - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; mach_log("Port accel out = %04x, val = %04x.\n", port, val); @@ -4349,7 +4350,7 @@ static uint8_t mach_accel_in(uint16_t port, mach_t *mach) { svga_t *svga = &mach->svga; - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; uint8_t temp = 0; int vpos = 0; int vblankend = svga->vblankstart + svga->crtc[0x16]; @@ -4550,7 +4551,7 @@ mach_accel_outb(uint16_t port, uint8_t val, void *priv) svga_t *svga = &mach->svga; if (port & 0x8000) - mach_accel_out_fifo(mach, svga, &svga->dev8514, port, val, 1); + mach_accel_out_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port, val, 1); else mach_accel_out(port, val, mach); } @@ -4562,7 +4563,7 @@ mach_accel_outw(uint16_t port, uint16_t val, void *priv) svga_t *svga = &mach->svga; if (port & 0x8000) - mach_accel_out_fifo(mach, svga, &svga->dev8514, port, val, 2); + mach_accel_out_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port, val, 2); else { mach_accel_out(port, val, mach); mach_accel_out(port + 1, (val >> 8), mach); @@ -4576,8 +4577,8 @@ mach_accel_outl(uint16_t port, uint32_t val, void *priv) svga_t *svga = &mach->svga; if (port & 0x8000) { - mach_accel_out_fifo(mach, svga, &svga->dev8514, port, val & 0xffff, 2); - mach_accel_out_fifo(mach, svga, &svga->dev8514, port + 2, val >> 16, 2); + mach_accel_out_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port, val & 0xffff, 2); + mach_accel_out_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port + 2, val >> 16, 2); } else { mach_accel_out(port, val, mach); mach_accel_out(port + 1, (val >> 8), mach); @@ -4593,7 +4594,7 @@ mach_accel_inb(uint16_t port, void *priv) uint8_t temp; if (port & 0x8000) - temp = mach_accel_in_fifo(mach, svga, &svga->dev8514, port, 1); + temp = mach_accel_in_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port, 1); else temp = mach_accel_in(port, mach); @@ -4608,7 +4609,7 @@ mach_accel_inw(uint16_t port, void *priv) uint16_t temp; if (port & 0x8000) - temp = mach_accel_in_fifo(mach, svga, &svga->dev8514, port, 2); + temp = mach_accel_in_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port, 2); else { temp = mach_accel_in(port, mach); temp |= (mach_accel_in(port + 1, mach) << 8); @@ -4624,8 +4625,8 @@ mach_accel_inl(uint16_t port, void *priv) uint32_t temp; if (port & 0x8000) { - temp = mach_accel_in_fifo(mach, svga, &svga->dev8514, port, 2); - temp = (mach_accel_in_fifo(mach, svga, &svga->dev8514, port + 2, 2) << 16); + temp = mach_accel_in_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port, 2); + temp = (mach_accel_in_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port + 2, 2) << 16); } else { temp = mach_accel_in(port, mach); temp |= (mach_accel_in(port + 1, mach) << 8); @@ -4639,7 +4640,7 @@ static void mach32_write_linear(uint32_t addr, uint8_t val, void *priv) { svga_t *svga = (svga_t *) priv; - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; int writemask2 = svga->writemask; int reset_wm = 0; latch_t vall; @@ -4802,7 +4803,7 @@ static uint8_t mach32_read_linear(uint32_t addr, void *priv) { svga_t *svga = (svga_t *) priv; - const ibm8514_t *dev = &svga->dev8514; + const ibm8514_t *dev = (ibm8514_t *) svga->dev8514; uint32_t latch_addr = 0; int readplane = svga->readplane; uint8_t count; @@ -5066,7 +5067,7 @@ static void mach32_updatemapping(mach_t *mach) { svga_t *svga = &mach->svga; - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; if (mach->pci_bus && (!(mach->pci_regs[PCI_REG_COMMAND] & PCI_COMMAND_MEM))) { mem_mapping_disable(&svga->mapping); @@ -5129,7 +5130,7 @@ static void mach32_hwcursor_draw(svga_t *svga, int displine) { const mach_t *mach = (mach_t *) svga->priv; - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; uint16_t dat; int comb; int offset = dev->hwcursor_latch.x - dev->hwcursor_latch.xoff; @@ -5452,7 +5453,7 @@ mach_mca_reset(void *priv) { mach_t *mach = (mach_t *) priv; svga_t *svga = &mach->svga; - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; mem_mapping_disable(&mach->bios_rom.mapping); mem_mapping_disable(&mach->bios_rom2.mapping); @@ -5599,11 +5600,12 @@ mach8_init(const device_t *info) svga_t *svga; ibm8514_t *dev; - mach = malloc(sizeof(mach_t)); - memset(mach, 0x00, sizeof(mach_t)); + mach = calloc(1, sizeof(mach_t)); - svga = &mach->svga; - dev = &svga->dev8514; + svga = &mach->svga; + dev = (ibm8514_t *) calloc(1, sizeof(ibm8514_t)); + + svga->dev8514 = dev; mach->pci_bus = !!(info->flags & DEVICE_PCI); mach->vlb_bus = !!(info->flags & DEVICE_VLB); @@ -5800,11 +5802,13 @@ mach_close(void *priv) { mach_t *mach = (mach_t *) priv; svga_t *svga = &mach->svga; - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; if (dev) { free(dev->vram); free(dev->changedvram); + + free(dev); } svga_close(svga); diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index e32575db7..c53053ac5 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -39,6 +39,8 @@ #include <86box/plat.h> #include <86box/ui.h> #include <86box/video.h> +#include <86box/vid_8514a.h> +#include <86box/vid_xga.h> #include <86box/vid_svga.h> #include <86box/vid_svga_render.h> #include <86box/vid_xga_device.h> @@ -110,8 +112,8 @@ void svga_out(uint16_t addr, uint8_t val, void *priv) { svga_t *svga = (svga_t *) priv; - ibm8514_t *dev = &svga->dev8514; - xga_t *xga = &svga->xga; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; + xga_t *xga = (xga_t *) svga->xga; uint8_t o; uint8_t index; @@ -357,7 +359,7 @@ uint8_t svga_in(uint16_t addr, void *priv) { svga_t *svga = (svga_t *) priv; - ibm8514_t *dev = &svga->dev8514; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; uint8_t index; uint8_t ret = 0xff; @@ -512,8 +514,8 @@ svga_in(uint16_t addr, void *priv) void svga_set_ramdac_type(svga_t *svga, int type) { - ibm8514_t *dev = &svga->dev8514; - xga_t *xga = &svga->xga; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; + xga_t *xga = (xga_t *) svga->xga; if (svga->ramdac_type != type) { svga->ramdac_type = type; @@ -548,7 +550,7 @@ svga_set_ramdac_type(svga_t *svga, int type) void svga_recalctimings(svga_t *svga) { - const ibm8514_t *dev = &svga->dev8514; + const ibm8514_t *dev = (ibm8514_t *) svga->dev8514; double crtcconst; double _dispontime; double _dispofftime; @@ -816,8 +818,8 @@ void svga_poll(void *priv) { svga_t *svga = (svga_t *) priv; - ibm8514_t *dev = &svga->dev8514; - xga_t *xga = &svga->xga; + ibm8514_t *dev = (ibm8514_t *) svga->dev8514; + xga_t *xga = (xga_t *) svga->xga; uint32_t x; uint32_t blink_delay; int wx; @@ -1229,7 +1231,7 @@ static __inline void svga_write_common(uint32_t addr, uint8_t val, uint8_t linear, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; int writemask2 = svga->writemask; int reset_wm = 0; latch_t vall; @@ -1449,7 +1451,7 @@ static __inline uint8_t svga_read_common(uint32_t addr, uint8_t linear, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint32_t latch_addr = 0; int readplane = svga->readplane; uint8_t count; diff --git a/src/video/vid_xga.c b/src/video/vid_xga.c index 915ac548a..21bde90fe 100644 --- a/src/video/vid_xga.c +++ b/src/video/vid_xga.c @@ -30,6 +30,7 @@ #include <86box/device.h> #include <86box/timer.h> #include <86box/video.h> +#include <86box/vid_xga.h> #include <86box/vid_svga.h> #include <86box/vid_svga_render.h> #include <86box/vid_xga_device.h> @@ -143,7 +144,7 @@ svga_xga_in(uint16_t addr, void *priv) void xga_updatemapping(svga_t *svga) { - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; xga_log("OpMode = %x, linear base = %08x, aperture cntl = %d, access mode = %x, map = %x, " "endian reverse = %d, a5test = %d, XGA on = %d.\n", xga->op_mode, xga->linear_base, @@ -186,7 +187,7 @@ xga_updatemapping(svga_t *svga) void xga_recalctimings(svga_t *svga) { - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; if (xga->on) { xga->v_total = xga->vtotal + 1; @@ -505,7 +506,7 @@ static void xga_ext_outb(uint16_t addr, uint8_t val, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; xga_log("[%04X:%08X]: EXT OUTB = %02x, val = %02x\n", CS, cpu_state.pc, addr, val); @@ -567,7 +568,7 @@ static uint8_t xga_ext_inb(uint16_t addr, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint8_t ret = 0; uint8_t index; @@ -906,7 +907,7 @@ xga_ext_inb(uint16_t addr, void *priv) static uint32_t xga_accel_read_pattern_map_pixel(svga_t *svga, int x, int y, int map, uint32_t base, int width) { - const xga_t *xga = &svga->xga; + const xga_t *xga = (xga_t *) svga->xga; uint32_t addr = base; int bits; uint8_t byte; @@ -944,7 +945,7 @@ xga_accel_read_pattern_map_pixel(svga_t *svga, int x, int y, int map, uint32_t b static uint32_t xga_accel_read_map_pixel(svga_t *svga, int x, int y, int map, uint32_t base, int width, UNUSED(int usesrc)) { - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint32_t addr = base; int bits; uint32_t byte; @@ -1024,7 +1025,7 @@ xga_accel_read_map_pixel(svga_t *svga, int x, int y, int map, uint32_t base, int static void xga_accel_write_map_pixel(svga_t *svga, int x, int y, int map, uint32_t base, uint32_t pixel, int width) { - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint32_t addr = base; uint8_t byte; uint8_t mask; @@ -1125,7 +1126,7 @@ xga_accel_write_map_pixel(svga_t *svga, int x, int y, int map, uint32_t base, ui static void xga_short_stroke(svga_t *svga, uint8_t ssv) { - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint32_t src_dat; uint32_t dest_dat; uint32_t old_dest_dat; @@ -1254,7 +1255,7 @@ xga_short_stroke(svga_t *svga, uint8_t ssv) static void xga_line_draw_write(svga_t *svga) { - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint32_t src_dat; uint32_t dest_dat; uint32_t old_dest_dat; @@ -1476,7 +1477,7 @@ xga_line_draw_write(svga_t *svga) static void xga_bitblt(svga_t *svga) { - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint8_t area_state = 0; uint32_t src_dat; uint32_t dest_dat; @@ -2283,7 +2284,7 @@ static void xga_memio_writeb(uint32_t addr, uint8_t val, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; xga_mem_write(addr, val, xga, svga, 1); @@ -2294,7 +2295,7 @@ static void xga_memio_writew(uint32_t addr, uint16_t val, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; xga_mem_write(addr, val, xga, svga, 2); @@ -2305,7 +2306,7 @@ static void xga_memio_writel(uint32_t addr, uint32_t val, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; xga_mem_write(addr, val, xga, svga, 4); @@ -2400,7 +2401,7 @@ static uint8_t xga_memio_readb(uint32_t addr, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint8_t temp; temp = xga_mem_read(addr, xga, svga); @@ -2414,7 +2415,7 @@ static uint16_t xga_memio_readw(uint32_t addr, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint16_t temp; temp = xga_mem_read(addr, xga, svga); @@ -2429,7 +2430,7 @@ static uint32_t xga_memio_readl(uint32_t addr, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint32_t temp; temp = xga_mem_read(addr, xga, svga); @@ -2445,7 +2446,7 @@ xga_memio_readl(uint32_t addr, void *priv) static void xga_hwcursor_draw(svga_t *svga, int displine) { - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint8_t dat = 0; int offset = xga->hwcursor_latch.x - xga->hwcursor_latch.xoff; int x_pos; @@ -2531,7 +2532,7 @@ xga_render_overscan_right(xga_t *xga, svga_t *svga) static void xga_render_4bpp(svga_t *svga) { - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint32_t *p; uint32_t dat; @@ -2572,7 +2573,7 @@ xga_render_4bpp(svga_t *svga) static void xga_render_8bpp(svga_t *svga) { - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint32_t *p; uint32_t dat; @@ -2609,7 +2610,7 @@ xga_render_8bpp(svga_t *svga) static void xga_render_16bpp(svga_t *svga) { - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; int x; uint32_t *p; uint32_t dat; @@ -2650,7 +2651,7 @@ static void xga_write(uint32_t addr, uint8_t val, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; if (!xga->on) { svga_write(addr, val, svga); @@ -2678,7 +2679,7 @@ static void xga_writew(uint32_t addr, uint16_t val, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; if (!xga->on) { svga_writew(addr, val, svga); @@ -2693,7 +2694,7 @@ static void xga_writel(uint32_t addr, uint32_t val, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; if (!xga->on) { svga_writel(addr, val, svga); @@ -2710,7 +2711,7 @@ static uint8_t xga_read(uint32_t addr, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint8_t ret = 0xff; if (!xga->on) { @@ -2740,7 +2741,7 @@ static uint16_t xga_readw(uint32_t addr, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint16_t ret = 0xffff; if (!xga->on) { @@ -2758,7 +2759,7 @@ static uint32_t xga_readl(uint32_t addr, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint32_t ret = 0xffffffff; if (!xga->on) { @@ -2778,7 +2779,7 @@ static void xga_write_linear(uint32_t addr, uint8_t val, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; if (!xga->on) { svga_write_linear(addr, val, svga); @@ -2810,7 +2811,7 @@ static void xga_writew_linear(uint32_t addr, uint16_t val, void *priv) { svga_t *svga = (svga_t *) priv; - const xga_t *xga = &svga->xga; + const xga_t *xga = (xga_t *) svga->xga; if (!xga->on) { svga_writew_linear(addr, val, svga); @@ -2825,7 +2826,7 @@ static void xga_writel_linear(uint32_t addr, uint32_t val, void *priv) { svga_t *svga = (svga_t *) priv; - const xga_t *xga = &svga->xga; + const xga_t *xga = (xga_t *) svga->xga; if (!xga->on) { svga_writel_linear(addr, val, svga); @@ -2842,7 +2843,7 @@ static uint8_t xga_read_linear(uint32_t addr, void *priv) { svga_t *svga = (svga_t *) priv; - const xga_t *xga = &svga->xga; + const xga_t *xga = (xga_t *) svga->xga; uint8_t ret = 0xff; if (!xga->on) @@ -2872,7 +2873,7 @@ static uint16_t xga_readw_linear(uint32_t addr, void *priv) { svga_t *svga = (svga_t *) priv; - const xga_t *xga = &svga->xga; + const xga_t *xga = (xga_t *) svga->xga; uint16_t ret; if (!xga->on) @@ -2888,7 +2889,7 @@ static uint32_t xga_readl_linear(uint32_t addr, void *priv) { svga_t *svga = (svga_t *) priv; - const xga_t *xga = &svga->xga; + const xga_t *xga = (xga_t *) svga->xga; uint32_t ret; if (!xga->on) @@ -2905,7 +2906,7 @@ xga_readl_linear(uint32_t addr, void *priv) static void xga_do_render(svga_t *svga) { - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; xga_log("DISPCNTL = %d, vga = %d.\n", xga->disp_cntl_2 & 7, vga_on); switch (xga->disp_cntl_2 & 7) { @@ -2936,8 +2937,9 @@ xga_do_render(svga_t *svga) } void -xga_poll(xga_t *xga, svga_t *svga) +xga_poll(void *priv, svga_t *svga) { + xga_t *xga = (xga_t *) priv; uint32_t x; int wx; int wy; @@ -3075,7 +3077,7 @@ static uint8_t xga_mca_read(int port, void *priv) { const svga_t *svga = (svga_t *) priv; - const xga_t *xga = &svga->xga; + const xga_t *xga = (xga_t *) svga->xga; uint8_t ret = xga->pos_regs[port & 7]; if (((port & 7) == 3) && !(ret & 1)) /*Always enable the mapping.*/ @@ -3091,7 +3093,7 @@ static void xga_mca_write(int port, uint8_t val, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; /* MCA does not write registers below 0x0100. */ if (port < 0x0102) @@ -3133,7 +3135,7 @@ static uint8_t xga_mca_feedb(void *priv) { const svga_t *svga = (svga_t *) priv; - const xga_t *xga = &svga->xga; + const xga_t *xga = (xga_t *) svga->xga; return xga->pos_regs[2] & 1; } @@ -3142,7 +3144,7 @@ static void xga_mca_reset(void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; mem_mapping_disable(&xga->bios_rom.mapping); mem_mapping_disable(&xga->memio_mapping); @@ -3155,7 +3157,7 @@ static void xga_reset(void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; mem_mapping_disable(&xga->bios_rom.mapping); mem_mapping_disable(&xga->memio_mapping); @@ -3169,7 +3171,7 @@ static uint8_t xga_pos_in(uint16_t addr, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; uint8_t ret = 0xff; if (!xga_standalone_enabled) { @@ -3285,7 +3287,7 @@ static void xga_pos_out(uint16_t addr, uint8_t val, void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; if (!xga_standalone_enabled) { switch (addr) { @@ -3337,10 +3339,12 @@ xga_init(const device_t *info) if (svga_get_pri() == NULL) return NULL; - svga_t *svga = svga_get_pri(); - xga_t *xga = &svga->xga; + svga_t *svga = svga_get_pri(); + xga_t *xga = (xga_t *) calloc(1, sizeof(xga_t)); FILE *fp; - uint8_t *rom = NULL; + uint8_t *rom = NULL; + + svga->xga = xga; xga->ext_mem_addr = device_get_config_hex16("ext_mem_addr"); xga->instance_isa = device_get_config_int("instance"); @@ -3427,8 +3431,7 @@ xga_init(const device_t *info) static void * svga_xga_init(const device_t *info) { - svga_t *svga = malloc(sizeof(svga_t)); - memset(svga, 0, sizeof(svga_t)); + svga_t *svga = (svga_t *) calloc(1, sizeof(svga_t)); video_inform(VIDEO_FLAG_TYPE_XGA, &timing_xga_isa); @@ -3451,11 +3454,13 @@ static void xga_close(void *priv) { svga_t *svga = (svga_t *) priv; - xga_t *xga = &svga->xga; + xga_t *xga = (xga_t *) svga->xga; if (svga) { free(xga->vram); free(xga->changedvram); + + free(xga); } } From dd5be819ebfd036ef7806425d2c9de8a45ad1ca1 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 9 Oct 2023 20:14:28 +0200 Subject: [PATCH 18/50] YMFM fixes. --- src/sound/snd_opl_ymfm.cpp | 32 ++++++++++++++++++++++---------- src/sound/ymfm/ymfm_fm.ipp | 2 +- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/sound/snd_opl_ymfm.cpp b/src/sound/snd_opl_ymfm.cpp index 1f542cf0b..28ed1d736 100644 --- a/src/sound/snd_opl_ymfm.cpp +++ b/src/sound/snd_opl_ymfm.cpp @@ -98,7 +98,7 @@ public: memset(m_samples, 0, sizeof(m_samples)); memset(m_oldsamples, 0, sizeof(m_oldsamples)); m_rateratio = (samplerate << RSM_FRAC) / m_chip.sample_rate(m_clock); - m_clock_us = 1000000 / (double) m_clock; + m_clock_us = 1000000.0 / (double) m_clock; m_subtract[0] = 80.0; m_subtract[1] = 320.0; m_type = type; @@ -139,7 +139,7 @@ public: virtual void set_clock(uint32_t clock) override { m_clock = clock; - m_clock_us = 1000000 / (double) m_clock; + m_clock_us = 1000000.0 / (double) m_clock; m_rateratio = (m_samplerate << RSM_FRAC) / m_chip.sample_rate(m_clock); ymfm_set_timer(0, m_duration_in_clocks[0]); @@ -150,9 +150,14 @@ public: { for (uint32_t i = 0; i < num_samples; i++) { m_chip.generate(&m_output); - if(m_type == FM_YMF278B) { - *data++ += m_output.data[4 % ChipType::OUTPUTS]; - *data++ += m_output.data[5 % ChipType::OUTPUTS]; + if ((m_type == FM_YMF278B) && (sizeof(m_output.data) > (4 * sizeof(int32_t)))) { + if (ChipType::OUTPUTS == 1) { + *data++ += m_output.data[4]; + *data++ += m_output.data[4]; + } else { + *data++ += m_output.data[4]; + *data++ += m_output.data[5]; + } } else if (ChipType::OUTPUTS == 1) { *data++ = m_output.data[0]; *data++ = m_output.data[0]; @@ -170,9 +175,14 @@ public: m_oldsamples[0] = m_samples[0]; m_oldsamples[1] = m_samples[1]; m_chip.generate(&m_output); - if(m_type == FM_YMF278B) { - m_samples[0] += m_output.data[4 % ChipType::OUTPUTS]; - m_samples[1] += m_output.data[5 % ChipType::OUTPUTS]; + if ((m_type == FM_YMF278B) && (sizeof(m_output.data) > (4 * sizeof(int32_t)))) { + if (ChipType::OUTPUTS == 1) { + m_samples[0] += m_output.data[4]; + m_samples[1] += m_output.data[4]; + } else { + m_samples[0] += m_output.data[4]; + m_samples[1] += m_output.data[5]; + } } else if (ChipType::OUTPUTS == 1) { m_samples[0] = m_output.data[0]; m_samples[1] = m_output.data[0]; @@ -312,11 +322,13 @@ ymfm_drv_init(const device_t *info) break; case FM_YMF289B: - fm = (YMFMChipBase *) new YMFMChip(16934400, FM_YMF289B, 44100); + /* According to the datasheet, we should be using 33868800, but YMFM appears + to cheat and does it using the same values as the YMF262. */ + fm = (YMFMChipBase *) new YMFMChip(14318181, FM_YMF289B, 44100); break; case FM_YMF278B: - fm = (YMFMChipBase *) new YMFMChip(16934400, FM_YMF278B, 44100); + fm = (YMFMChipBase *) new YMFMChip(33868800, FM_YMF278B, 44100); break; } diff --git a/src/sound/ymfm/ymfm_fm.ipp b/src/sound/ymfm/ymfm_fm.ipp index 6e8d39e3e..55cdd643d 100644 --- a/src/sound/ymfm/ymfm_fm.ipp +++ b/src/sound/ymfm/ymfm_fm.ipp @@ -1523,7 +1523,7 @@ void fm_engine_base::engine_timer_expired(uint32_t tnum) } // Make sure the array does not go out of bounds to keep gcc happy - if(tnum < 2) { + if ((tnum < 2) || (sizeof(m_timer_running) > (2 * sizeof(uint8_t)))) { // reset m_timer_running[tnum] = false; } From 66e334757eb9319e18485be89babf31e2fb989e1 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 10 Oct 2023 00:18:13 +0200 Subject: [PATCH 19/50] The Vibra 16C is now correctly PnP and added standalone Vibra 16S, 16XV, and 16C, as well as Intel CU430HX, the non-OEM version of the Toshiba Equium 5200. --- src/include/86box/machine.h | 2 +- src/include/86box/sound.h | 3 + src/machine/m_at_socket7.c | 120 ++++++++----------- src/machine/machine_table.c | 42 ++++++- src/sound/snd_sb.c | 231 +++++++++++++++++++++++++++++++++++- src/sound/sound.c | 3 + 6 files changed, 322 insertions(+), 79 deletions(-) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 29df64713..8af7f65ea 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -647,7 +647,7 @@ extern int machine_at_p55t2p4_init(const machine_t *); extern int machine_at_m7shi_init(const machine_t *); extern int machine_at_tc430hx_init(const machine_t *); extern int machine_at_infinia7200_init(const machine_t *); -extern uint32_t machine_at_cu430hx_gpio_handler(uint8_t write, uint32_t val); +extern int machine_at_cu430hx_init(const machine_t *); extern int machine_at_equium5200_init(const machine_t *); extern int machine_at_pcv90_init(const machine_t *); extern int machine_at_p65up5_cp55t2d_init(const machine_t *); diff --git a/src/include/86box/sound.h b/src/include/86box/sound.h index 2d9d7b6bc..28dda0c02 100644 --- a/src/include/86box/sound.h +++ b/src/include/86box/sound.h @@ -132,7 +132,10 @@ extern const device_t sb_pro_mcv_device; extern const device_t sb_pro_compat_device; extern const device_t sb_16_device; extern const device_t sb_vibra16s_onboard_device; +extern const device_t sb_vibra16s_device; +extern const device_t sb_vibra16xv_device; extern const device_t sb_vibra16c_onboard_device; +extern const device_t sb_vibra16c_device; extern const device_t sb_16_pnp_device; extern const device_t sb_16_compat_device; extern const device_t sb_16_compat_nompu_device; diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index 7564da84a..a698c9a35 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -182,7 +182,7 @@ machine_at_m7shi_init(const machine_t *model) static void machine_at_tc430hx_gpio_init(void) { - uint32_t gpio = 0xffffffff; + uint32_t gpio = 0xffffe1ff; /* Register 0x0079: */ /* Bit 7: 0 = Clear password, 1 = Keep password. */ @@ -197,8 +197,6 @@ machine_at_tc430hx_gpio_init(void) /* Bit 1: 0 = Soft-off capable power supply present, 1 = Soft-off capable power supply absent. */ /* Bit 0: 0 = Reserved. */ /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ - gpio = 0xffffe1ff; - if (cpu_busspeed <= 50000000) gpio |= 0xffff10ff; else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) @@ -290,28 +288,7 @@ machine_at_infinia7200_init(const machine_t *model) static void machine_at_cu430hx_gpio_init(void) { - uint32_t gpio = 0xffffe1cf; - uint16_t addr; - - /* Register 0x0078: */ - /* Bit 5,4: Vibra 16C base address: 0 = 220h, 1 = 260h, 2 = 240h, 3 = 280h. */ - device_context(machine_get_snd_device(machine)); - addr = device_get_config_hex16("base"); - switch (addr) { - case 0x0220: - gpio |= 0xffff00cf; - break; - case 0x0240: - gpio |= 0xffff00ef; - break; - case 0x0260: - gpio |= 0xffff00df; - break; - case 0x0280: - gpio |= 0xffff00ff; - break; - } - device_context_restore(); + uint32_t gpio = 0xffffe1ff; /* Register 0x0079: */ /* Bit 7: 0 = Clear password, 1 = Keep password. */ @@ -327,48 +304,64 @@ machine_at_cu430hx_gpio_init(void) /* Bit 0: 0 = Reserved. */ /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ if (cpu_busspeed <= 50000000) - gpio |= 0xffff10cf; + gpio |= 0xffff10ff; else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) - gpio |= 0xffff18cf; + gpio |= 0xffff18ff; else if (cpu_busspeed > 60000000) - gpio |= 0xffff00cf; + gpio |= 0xffff00ff; if (sound_card_current[0] == SOUND_INTERNAL) - gpio |= 0xffff04cf; + gpio |= 0xffff04ff; machine_set_gpio_default(gpio); } -uint32_t -machine_at_cu430hx_gpio_handler(uint8_t write, uint32_t val) +static void +machine_at_cu430hx_common_init(const machine_t *model) { - uint32_t ret = machine_get_gpio_default(); + machine_at_common_init_ex(model, 2); + machine_at_cu430hx_gpio_init(); - if (write) { - ret &= ((val & 0xffffffcf) | 0xffff0000); - ret |= (val & 0x00000030); - if (machine_snd != NULL) switch ((val >> 4) & 0x03) { - case 0x00: - sb_vibra16c_onboard_relocate_base(0x0220, machine_snd); - break; - case 0x01: - sb_vibra16c_onboard_relocate_base(0x0260, machine_snd); - break; - case 0x02: - sb_vibra16c_onboard_relocate_base(0x0240, machine_snd); - break; - case 0x03: - sb_vibra16c_onboard_relocate_base(0x0280, machine_snd); - break; - } - machine_set_gpio(ret); - } else - ret = machine_get_gpio(); + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); // ATI VGA Graphics + pci_register_slot(0x0C, PCI_CARD_NETWORK, 4, 0, 0, 0); // Intel 82557 Ethernet Network + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 0, 0, 0); // riser + + if (sound_card_current[0] == SOUND_INTERNAL) + machine_snd = device_add(machine_get_snd_device(machine)); + + device_add(&i430hx_device); + device_add(&piix3_device); + device_add(&keyboard_ps2_ami_pci_device); + device_add(&pc87306_device); + device_add(&intel_flash_bxt_ami_device); +} + +int +machine_at_cu430hx_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear_combined2("roms/machines/cu430hx/1006DK0_.BIO", + "roms/machines/cu430hx/1006DK0_.BI1", + "roms/machines/cu430hx/1006DK0_.BI2", + "roms/machines/cu430hx/1006DK0_.BI3", + "roms/machines/cu430hx/1006DK0_.RCV", + 0x3a000, 128); + + if (bios_only || !ret) + return ret; + + machine_at_cu430hx_common_init(model); return ret; } -/* Information about that machine on machine.h */ int machine_at_equium5200_init(const machine_t *model) { @@ -384,26 +377,7 @@ machine_at_equium5200_init(const machine_t *model) if (bios_only || !ret) return ret; - machine_at_common_init_ex(model, 2); - machine_at_cu430hx_gpio_init(); - - pci_init(PCI_CONFIG_TYPE_1); - pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 0, 0, 0); // riser - - if (sound_card_current[0] == SOUND_INTERNAL) - machine_snd = device_add(machine_get_snd_device(machine)); - - device_add(&i430hx_device); - device_add(&piix3_device); - device_add(&keyboard_ps2_ami_pci_device); - device_add(&pc87306_device); - device_add(&intel_flash_bxt_ami_device); + machine_at_cu430hx_common_init(model); return ret; } diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 4a8a2a757..c2bc31495 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -9815,6 +9815,46 @@ const machine_t machines[] = { .net_device = NULL }, /* OEM-only Intel CU430HX, has AMI MegaKey KBC firmware on the PC87306 Super I/O chip. */ + { + .name = "[i430HX] Intel CU430HX", + .internal_name = "cu430hx", + .type = MACHINE_TYPE_SOCKET7, + .chipset = MACHINE_CHIPSET_INTEL_430HX, + .init = machine_at_cu430hx_init, + .p1_handler = NULL, + .gpio_handler = NULL, + .available_flag = MACHINE_AVAILABLE, + .gpio_acpi_handler = NULL, + .cpu = { + .package = CPU_PKG_SOCKET5_7, + .block = CPU_BLOCK_NONE, + .min_bus = 50000000, + .max_bus = 66666667, + .min_voltage = 2800, + .max_voltage = 3520, + .min_multi = 1.5, + .max_multi = 3.0 + }, + .bus_flags = MACHINE_PS2_PCI, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI, + .ram = { + .min = 8192, + .max = 196608, + .step = 8192 + }, + .nvrmask = 255, + .kbc_device = NULL, + .kbc_p1 = 0xff, + .gpio = 0xffffffff, + .gpio_acpi = 0xffffffff, + .device = NULL, + .fdc_device = NULL, + .sio_device = NULL, + .vid_device = NULL, + .snd_device = &sb_vibra16c_onboard_device, + .net_device = NULL + }, + /* OEM-only Intel CU430HX, has AMI MegaKey KBC firmware on the PC87306 Super I/O chip. */ { .name = "[i430HX] Toshiba Equium 5200D", .internal_name = "equium5200", @@ -9822,7 +9862,7 @@ const machine_t machines[] = { .chipset = MACHINE_CHIPSET_INTEL_430HX, .init = machine_at_equium5200_init, .p1_handler = NULL, - .gpio_handler = machine_at_cu430hx_gpio_handler, + .gpio_handler = NULL, .available_flag = MACHINE_AVAILABLE, .gpio_acpi_handler = NULL, .cpu = { diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index 107507d77..ffb5240b8 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -1537,6 +1537,100 @@ sb_16_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *priv) } } +static void +sb_vibra16_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *priv) +{ + sb_t *sb = (sb_t *) priv; + uint16_t addr = sb->dsp.sb_addr; + uint8_t val; + + switch (ld) { + case 0: /* Audio */ + io_removehandler(addr, 0x0004, + sb->opl.read, NULL, NULL, + sb->opl.write, NULL, NULL, + sb->opl.priv); + io_removehandler(addr + 8, 0x0002, + sb->opl.read, NULL, NULL, + sb->opl.write, NULL, NULL, + sb->opl.priv); + io_removehandler(addr + 4, 0x0002, + sb_ct1745_mixer_read, NULL, NULL, + sb_ct1745_mixer_write, NULL, NULL, + sb); + + addr = sb->opl_pnp_addr; + if (addr) { + sb->opl_pnp_addr = 0; + io_removehandler(addr, 0x0004, + sb->opl.read, NULL, NULL, + sb->opl.write, NULL, NULL, + sb->opl.priv); + } + + sb_dsp_setaddr(&sb->dsp, 0); + sb_dsp_setirq(&sb->dsp, 0); + sb_dsp_setdma8(&sb->dsp, ISAPNP_DMA_DISABLED); + sb_dsp_setdma16(&sb->dsp, ISAPNP_DMA_DISABLED); + + mpu401_change_addr(sb->mpu, 0); + + if (config->activate) { + addr = config->io[0].base; + if (addr != ISAPNP_IO_DISABLED) { + io_sethandler(addr, 0x0004, + sb->opl.read, NULL, NULL, + sb->opl.write, NULL, NULL, + sb->opl.priv); + io_sethandler(addr + 8, 0x0002, + sb->opl.read, NULL, NULL, + sb->opl.write, NULL, NULL, + sb->opl.priv); + io_sethandler(addr + 4, 0x0002, + sb_ct1745_mixer_read, NULL, NULL, + sb_ct1745_mixer_write, NULL, NULL, + sb); + + sb_dsp_setaddr(&sb->dsp, addr); + } + + addr = config->io[1].base; + if (addr != ISAPNP_IO_DISABLED) + mpu401_change_addr(sb->mpu, addr); + + addr = config->io[2].base; + if (addr != ISAPNP_IO_DISABLED) { + sb->opl_pnp_addr = addr; + io_sethandler(addr, 0x0004, + sb->opl.read, NULL, NULL, + sb->opl.write, NULL, NULL, + sb->opl.priv); + } + + val = config->irq[0].irq; + if (val != ISAPNP_IRQ_DISABLED) + sb_dsp_setirq(&sb->dsp, val); + + val = config->dma[0].dma; + if (val != ISAPNP_DMA_DISABLED) + sb_dsp_setdma8(&sb->dsp, val); + + val = config->dma[1].dma; + if (val != ISAPNP_DMA_DISABLED) + sb_dsp_setdma16(&sb->dsp, val); + } + + break; + + case 1: /* Game */ + gameport_remap(sb->gameport, (config->activate && (config->io[0].base != ISAPNP_IO_DISABLED)) ? config->io[0].base : 0); + break; + + default: + break; + } +} + static void sb_awe32_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *priv) { @@ -2112,6 +2206,93 @@ sb_16_pnp_init(UNUSED(const device_t *info)) return sb; } +static int +sb_vibra16xv_available(void) +{ + return rom_present("roms/sound/CT4170 PnP.BIN"); +} + +static int +sb_vibra16c_available(void) +{ + return rom_present("roms/sound/CT4180 PnP.BIN"); +} + +static void * +sb_vibra16_pnp_init(UNUSED(const device_t *info)) +{ + sb_t *sb = malloc(sizeof(sb_t)); + memset(sb, 0x00, sizeof(sb_t)); + + sb->opl_enabled = 1; + fm_driver_get(FM_YMF262, &sb->opl); + + sb_dsp_init(&sb->dsp, SB16, SB_SUBTYPE_DEFAULT, sb); + sb_ct1745_mixer_reset(sb); + + sb->mixer_enabled = 1; + sb->mixer_sb16.output_filter = 1; + sound_add_handler(sb_get_buffer_sb16_awe32, sb); + sound_set_cd_audio_filter(sb16_awe32_filter_cd_audio, sb); + + sb->mpu = (mpu_t *) malloc(sizeof(mpu_t)); + memset(sb->mpu, 0, sizeof(mpu_t)); + mpu401_init(sb->mpu, 0, 0, M_UART, device_get_config_int("receive_input401")); + sb_dsp_set_mpu(&sb->dsp, sb->mpu); + + if (device_get_config_int("receive_input")) + midi_in_handler(1, sb_dsp_input_msg, sb_dsp_input_sysex, &sb->dsp); + + sb->gameport = gameport_add(&gameport_pnp_device); + + const char *pnp_rom_file = NULL; + switch (info->local) { + case 0: + pnp_rom_file = "roms/sound/CT4170 PnP.BIN"; + break; + + case 1: + pnp_rom_file = "roms/sound/CT4180 PnP.BIN"; + break; + + default: + break; + } + + uint8_t *pnp_rom = NULL; + if (pnp_rom_file) { + FILE *fp = rom_fopen(pnp_rom_file, "rb"); + if (fp) { + if (fread(sb->pnp_rom, 1, 512, fp) == 512) + pnp_rom = sb->pnp_rom; + fclose(fp); + } + } + + switch (info->local) { + case 0: + case 1: + isapnp_add_card(pnp_rom, sizeof(sb->pnp_rom), sb_vibra16_pnp_config_changed, + NULL, NULL, NULL, sb); + break; + + default: + break; + } + + sb_dsp_setaddr(&sb->dsp, 0); + sb_dsp_setirq(&sb->dsp, 0); + sb_dsp_setdma8(&sb->dsp, ISAPNP_DMA_DISABLED); + sb_dsp_setdma16(&sb->dsp, ISAPNP_DMA_DISABLED); + + mpu401_change_addr(sb->mpu, 0); + + sb->gameport_addr = 0; + gameport_remap(sb->gameport, 0); + + return sb; +} + static void * sb_16_compat_init(const device_t *info) { @@ -3693,11 +3874,11 @@ const device_t sb_vibra16s_onboard_device = { .config = sb_16_config }; -const device_t sb_vibra16c_onboard_device = { - .name = "Sound Blaster Vibra 16C (On-Board)", - .internal_name = "sb_vibra16c_onboard", +const device_t sb_vibra16s_device = { + .name = "Sound Blaster Vibra 16S", + .internal_name = "sb_vibra16s", .flags = DEVICE_ISA | DEVICE_AT, - .local = FM_YMF262, /* Should have the CQM but we do not emulate that yet. */ + .local = FM_YMF289B, .init = sb_16_init, .close = sb_close, .reset = NULL, @@ -3707,6 +3888,48 @@ const device_t sb_vibra16c_onboard_device = { .config = sb_16_config }; +const device_t sb_vibra16xv_device = { + .name = "Sound Blaster Vibra 16XV", + .internal_name = "sb_vibra16xv", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = sb_vibra16_pnp_init, + .close = sb_close, + .reset = NULL, + { .available = sb_vibra16xv_available }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_16_pnp_config +}; + +const device_t sb_vibra16c_onboard_device = { + .name = "Sound Blaster Vibra 16C (On-Board)", + .internal_name = "sb_vibra16c_onboard", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 1, + .init = sb_vibra16_pnp_init, + .close = sb_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_16_pnp_config +}; + +const device_t sb_vibra16c_device = { + .name = "Sound Blaster Vibra 16C", + .internal_name = "sb_vibra16c", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 1, + .init = sb_vibra16_pnp_init, + .close = sb_close, + .reset = NULL, + { .available = sb_vibra16c_available }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_16_pnp_config +}; + const device_t sb_16_reply_mca_device = { .name = "Sound Blaster 16 Reply MCA", .internal_name = "sb16_reply_mca", diff --git a/src/sound/sound.c b/src/sound/sound.c index f02e83bc5..4e0b4aa57 100644 --- a/src/sound/sound.c +++ b/src/sound/sound.c @@ -134,6 +134,9 @@ static const SOUND_CARD sound_cards[] = { { &sb_awe64_value_device }, { &sb_awe64_device }, { &sb_awe64_gold_device }, + { &sb_vibra16c_device }, + { &sb_vibra16s_device }, + { &sb_vibra16xv_device }, { &ssi2001_device }, #if defined(DEV_BRANCH) && defined(USE_PAS16) { &pas16_device }, From d00d39b9e828965370fbf0d721f05a6e54a8de5a Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 10 Oct 2023 00:22:40 +0200 Subject: [PATCH 20/50] Do not attempt to initialize the on-board Vibra 16C if its PnP rom is not present --- src/machine/m_at_socket7.c | 4 ++-- src/sound/snd_sb.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index a698c9a35..f600710af 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -310,7 +310,7 @@ machine_at_cu430hx_gpio_init(void) else if (cpu_busspeed > 60000000) gpio |= 0xffff00ff; - if (sound_card_current[0] == SOUND_INTERNAL) + if ((sound_card_current[0] == SOUND_INTERNAL) && machine_get_snd_device(machine)->available()) gpio |= 0xffff04ff; machine_set_gpio_default(gpio); @@ -332,7 +332,7 @@ machine_at_cu430hx_common_init(const machine_t *model) pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 0, 0, 0); // riser - if (sound_card_current[0] == SOUND_INTERNAL) + if ((sound_card_current[0] == SOUND_INTERNAL) && machine_get_snd_device(machine)->available()) machine_snd = device_add(machine_get_snd_device(machine)); device_add(&i430hx_device); diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index ffb5240b8..a0feed21f 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -3910,7 +3910,7 @@ const device_t sb_vibra16c_onboard_device = { .init = sb_vibra16_pnp_init, .close = sb_close, .reset = NULL, - { .available = NULL }, + { .available = sb_vibra16c_available }, .speed_changed = sb_speed_changed, .force_redraw = NULL, .config = sb_16_pnp_config From 881844dd32320a09f6368cb46559b435197536e6 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 10 Oct 2023 00:49:44 +0200 Subject: [PATCH 21/50] Do not call 8514/A or XGA recalculate timings functions until the function pointer is non-NULL. --- src/video/vid_svga.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index c53053ac5..36bd21005 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -718,12 +718,12 @@ svga_recalctimings(svga_t *svga) svga->recalctimings_ex(svga); } - if (ibm8514_active) { + if (ibm8514_active && (svga->dev8514 != NULL)) { if (!dev->local) ibm8514_recalctimings(svga); } - if (xga_active) + if (xga_active && (svga->xga != NULL)) xga_recalctimings(svga); if (svga->hdisp >= 2048) From 60feee01f4cafecfc6f0c65650cc98f48766c81c Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 10 Oct 2023 03:37:02 +0200 Subject: [PATCH 22/50] More OPL4 fixes. --- src/sound/snd_opl_ymfm.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/sound/snd_opl_ymfm.cpp b/src/sound/snd_opl_ymfm.cpp index 28ed1d736..e6ba8206f 100644 --- a/src/sound/snd_opl_ymfm.cpp +++ b/src/sound/snd_opl_ymfm.cpp @@ -152,11 +152,11 @@ public: m_chip.generate(&m_output); if ((m_type == FM_YMF278B) && (sizeof(m_output.data) > (4 * sizeof(int32_t)))) { if (ChipType::OUTPUTS == 1) { - *data++ += m_output.data[4]; - *data++ += m_output.data[4]; + *data++ = m_output.data[4]; + *data++ = m_output.data[4]; } else { - *data++ += m_output.data[4]; - *data++ += m_output.data[5]; + *data++ = m_output.data[4]; + *data++ = m_output.data[5]; } } else if (ChipType::OUTPUTS == 1) { *data++ = m_output.data[0]; @@ -177,11 +177,11 @@ public: m_chip.generate(&m_output); if ((m_type == FM_YMF278B) && (sizeof(m_output.data) > (4 * sizeof(int32_t)))) { if (ChipType::OUTPUTS == 1) { - m_samples[0] += m_output.data[4]; - m_samples[1] += m_output.data[4]; + m_samples[0] = m_output.data[4]; + m_samples[1] = m_output.data[4]; } else { - m_samples[0] += m_output.data[4]; - m_samples[1] += m_output.data[5]; + m_samples[0] = m_output.data[4]; + m_samples[1] = m_output.data[5]; } } else if (ChipType::OUTPUTS == 1) { m_samples[0] = m_output.data[0]; From 4e03753a6c5cba30090f1e3e1d4bcb70ff493d6f Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 10 Oct 2023 03:38:39 +0200 Subject: [PATCH 23/50] Creative ROM's are now in their own directory. --- src/sound/snd_sb.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index a0feed21f..cc3fc825d 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -2209,13 +2209,13 @@ sb_16_pnp_init(UNUSED(const device_t *info)) static int sb_vibra16xv_available(void) { - return rom_present("roms/sound/CT4170 PnP.BIN"); + return rom_present("roms/sound/creative/CT4170 PnP.BIN"); } static int sb_vibra16c_available(void) { - return rom_present("roms/sound/CT4180 PnP.BIN"); + return rom_present("roms/sound/creative/CT4180 PnP.BIN"); } static void * @@ -2248,11 +2248,11 @@ sb_vibra16_pnp_init(UNUSED(const device_t *info)) const char *pnp_rom_file = NULL; switch (info->local) { case 0: - pnp_rom_file = "roms/sound/CT4170 PnP.BIN"; + pnp_rom_file = "roms/sound/creative/CT4170 PnP.BIN"; break; case 1: - pnp_rom_file = "roms/sound/CT4180 PnP.BIN"; + pnp_rom_file = "roms/sound/creative/CT4180 PnP.BIN"; break; default: @@ -2321,37 +2321,37 @@ sb_16_compat_init(const device_t *info) static int sb_awe32_available(void) { - return rom_present("roms/sound/awe32.raw"); + return rom_present("roms/sound/creative/awe32.raw"); } static int sb_32_pnp_available(void) { - return sb_awe32_available() && rom_present("roms/sound/CT3600 PnP.BIN"); + return sb_awe32_available() && rom_present("roms/sound/creative/CT3600 PnP.BIN"); } static int sb_awe32_pnp_available(void) { - return sb_awe32_available() && rom_present("roms/sound/CT3980 PnP.BIN"); + return sb_awe32_available() && rom_present("roms/sound/creative/CT3980 PnP.BIN"); } static int sb_awe64_value_available(void) { - return sb_awe32_available() && rom_present("roms/sound/CT4520 PnP.BIN"); + return sb_awe32_available() && rom_present("roms/sound/creative/CT4520 PnP.BIN"); } static int sb_awe64_available(void) { - return sb_awe32_available() && rom_present("roms/sound/CT4520 PnP.BIN"); + return sb_awe32_available() && rom_present("roms/sound/creative/CT4520 PnP.BIN"); } static int sb_awe64_gold_available(void) { - return sb_awe32_available() && rom_present("roms/sound/CT4540 PnP.BIN"); + return sb_awe32_available() && rom_present("roms/sound/creative/CT4540 PnP.BIN"); } static void * @@ -2454,20 +2454,20 @@ sb_awe32_pnp_init(const device_t *info) const char *pnp_rom_file = NULL; switch (info->local) { case 0: - pnp_rom_file = "roms/sound/CT3600 PnP.BIN"; + pnp_rom_file = "roms/sound/creative/CT3600 PnP.BIN"; break; case 1: - pnp_rom_file = "roms/sound/CT3980 PnP.BIN"; + pnp_rom_file = "roms/sound/creative/CT3980 PnP.BIN"; break; case 2: case 3: - pnp_rom_file = "roms/sound/CT4520 PnP.BIN"; + pnp_rom_file = "roms/sound/creative/CT4520 PnP.BIN"; break; case 4: - pnp_rom_file = "roms/sound/CT4540 PnP.BIN"; + pnp_rom_file = "roms/sound/creative/CT4540 PnP.BIN"; break; default: From 11fd308d658efee341cb880c694f17a12597a08d Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 10 Oct 2023 04:39:25 +0200 Subject: [PATCH 24/50] Fixed YMF289B and YMF278B output sample rates to 48 kHz to match the emulator's output sample rate. --- src/sound/snd_opl_ymfm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sound/snd_opl_ymfm.cpp b/src/sound/snd_opl_ymfm.cpp index e6ba8206f..219cb6326 100644 --- a/src/sound/snd_opl_ymfm.cpp +++ b/src/sound/snd_opl_ymfm.cpp @@ -324,11 +324,11 @@ ymfm_drv_init(const device_t *info) case FM_YMF289B: /* According to the datasheet, we should be using 33868800, but YMFM appears to cheat and does it using the same values as the YMF262. */ - fm = (YMFMChipBase *) new YMFMChip(14318181, FM_YMF289B, 44100); + fm = (YMFMChipBase *) new YMFMChip(14318181, FM_YMF289B, OPL_FREQ); break; case FM_YMF278B: - fm = (YMFMChipBase *) new YMFMChip(33868800, FM_YMF278B, 44100); + fm = (YMFMChipBase *) new YMFMChip(33868800, FM_YMF278B, OPL_FREQ); break; } From ed4c57e94ce44815a5a055b83061075a3128c602 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 10 Oct 2023 06:43:07 +0200 Subject: [PATCH 25/50] Fixed some Intel board CPU switches. --- src/machine/m_at_socket4.c | 7 +++++ src/machine/m_at_socket5.c | 8 +++--- src/machine/m_at_socket7_3v.c | 51 ++++++++++++++++++++++------------- 3 files changed, 44 insertions(+), 22 deletions(-) diff --git a/src/machine/m_at_socket4.c b/src/machine/m_at_socket4.c index ad6d2c995..fa779b159 100644 --- a/src/machine/m_at_socket4.c +++ b/src/machine/m_at_socket4.c @@ -187,10 +187,17 @@ machine_at_dellxp60_init(const machine_t *model) pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); /* Not: 00, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F. */ /* Yes: 01, 10, 11, 12, 13, 14. */ +#if 0 pci_register_slot(0x01, PCI_CARD_NORMAL, 1, 3, 2, 4); pci_register_slot(0x04, PCI_CARD_NORMAL, 4, 4, 3, 3); pci_register_slot(0x05, PCI_CARD_NORMAL, 1, 4, 3, 2); pci_register_slot(0x06, PCI_CARD_NORMAL, 2, 1, 3, 4); +#else + pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0); + pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4); +#endif pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430lx_device); device_add(&keyboard_ps2_intel_ami_pci_device); diff --git a/src/machine/m_at_socket5.c b/src/machine/m_at_socket5.c index 9c5228e7f..5a336da24 100644 --- a/src/machine/m_at_socket5.c +++ b/src/machine/m_at_socket5.c @@ -177,11 +177,11 @@ machine_at_zappa_gpio_init(void) /* Bit 0: 2x multiplier, 1 = 1.5x multiplier (Switch 6). */ /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ if (cpu_busspeed <= 50000000) - gpio |= 0xffff10ff; - else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) - gpio |= 0xffff18ff; - else if (cpu_busspeed > 60000000) gpio |= 0xffff00ff; + else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) + gpio |= 0xffff08ff; + else if (cpu_busspeed > 60000000) + gpio |= 0xffff10ff; if (cpu_dmulti <= 1.5) gpio |= 0xffff01ff; diff --git a/src/machine/m_at_socket7_3v.c b/src/machine/m_at_socket7_3v.c index 268baafed..3b983c05f 100644 --- a/src/machine/m_at_socket7_3v.c +++ b/src/machine/m_at_socket7_3v.c @@ -46,7 +46,24 @@ static void machine_at_thor_gpio_init(void) { - uint32_t gpio = 0xffffe1ff; + uint32_t gpio = 0xffffe1cf; + + /* Register 0x0078 (Undocumented): */ + /* Bit 5: 0 = Multiplier. */ + /* Bit 4: 0 = Multiplier. */ + /* 1.5: 0, 0. */ + /* 3.0: 0, 1. */ + /* 2.0: 1, 0. */ + /* 2.5: 1, 1. */ + /* Bit 1: 0 = Error beep, 1 = No error. */ + if (cpu_dmulti <= 1.5) + gpio |= 0xffff0000; + else if ((cpu_dmulti > 1.5) && (cpu_dmulti <= 2.0)) + gpio |= 0xffff0020; + else if ((cpu_dmulti > 2.0) && (cpu_dmulti <= 2.5)) + gpio |= 0xffff0030; + else if (cpu_dmulti > 2.5) + gpio |= 0xffff0010; /* Register 0x0079: */ /* Bit 7: 0 = Clear password, 1 = Keep password. */ @@ -62,11 +79,11 @@ machine_at_thor_gpio_init(void) /* Bit 0: 0 = Reserved. */ /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ if (cpu_busspeed <= 50000000) - gpio |= 0xffff10ff; + gpio |= 0xffff0000; else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) - gpio |= 0xffff18ff; + gpio |= 0xffff0800; else if (cpu_busspeed > 60000000) - gpio |= 0xffff00ff; + gpio |= 0xffff1000; machine_set_gpio_default(gpio); } @@ -232,7 +249,7 @@ machine_at_endeavor_gpio_init(void) uint32_t gpio = 0xffffe0cf; uint16_t addr; - /* Register 0x0078: */ + /* Register 0x0078 (Undocumented): */ /* Bit 5,4: Vibra 16S base address: 0 = 220h, 1 = 260h, 2 = 240h, 3 = 280h. */ device_context(machine_get_snd_device(machine)); addr = device_get_config_hex16("base"); @@ -266,19 +283,19 @@ machine_at_endeavor_gpio_init(void) /* Bit 0: 0 = 2x multiplier, 1 = 1.5x multiplier (Switch 6). */ /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ if (cpu_busspeed <= 50000000) - gpio |= 0xffff10cf; + gpio |= 0xffff0000; else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) - gpio |= 0xffff18cf; + gpio |= 0xffff0800; else if (cpu_busspeed > 60000000) - gpio |= 0xffff00cf; + gpio |= 0xffff1000; if (sound_card_current[0] == SOUND_INTERNAL) - gpio |= 0xffff04cf; + gpio |= 0xffff0400; if (cpu_dmulti <= 1.5) - gpio |= 0xffff01cf; + gpio |= 0xffff0100; else - gpio |= 0xffff00cf; + gpio |= 0xffff0000; machine_set_gpio_default(gpio); } @@ -383,7 +400,7 @@ machine_at_ms5119_init(const machine_t *model) static void machine_at_pb640_gpio_init(void) { - uint32_t gpio = 0xffffffff; + uint32_t gpio = 0xffffe6ff; /* Register 0x0079: */ /* Bit 7: 0 = Clear password, 1 = Keep password. */ @@ -398,14 +415,12 @@ machine_at_pb640_gpio_init(void) /* Bit 1: No Connect. */ /* Bit 0: 2x multiplier, 1 = 1.5x multiplier (Switch 6). */ /* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */ - gpio = 0xffffe6ff; - if (cpu_busspeed <= 50000000) - gpio |= 0xffff10ff; - else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) - gpio |= 0xffff18ff; - else if (cpu_busspeed > 60000000) gpio |= 0xffff00ff; + else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000)) + gpio |= 0xffff08ff; + else if (cpu_busspeed > 60000000) + gpio |= 0xffff10ff; if (cpu_dmulti <= 1.5) gpio |= 0xffff01ff; From 39581e9110a354a60375f9fccdb84f97c5c5137c Mon Sep 17 00:00:00 2001 From: Alexander Babikov <2708460+lemondrops@users.noreply.github.com> Date: Tue, 10 Oct 2023 13:30:21 +0500 Subject: [PATCH 26/50] Revert a testing change that shouldn't have been there --- src/machine/m_at_socket4.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/machine/m_at_socket4.c b/src/machine/m_at_socket4.c index fa779b159..ad6d2c995 100644 --- a/src/machine/m_at_socket4.c +++ b/src/machine/m_at_socket4.c @@ -187,17 +187,10 @@ machine_at_dellxp60_init(const machine_t *model) pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); /* Not: 00, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F. */ /* Yes: 01, 10, 11, 12, 13, 14. */ -#if 0 pci_register_slot(0x01, PCI_CARD_NORMAL, 1, 3, 2, 4); pci_register_slot(0x04, PCI_CARD_NORMAL, 4, 4, 3, 3); pci_register_slot(0x05, PCI_CARD_NORMAL, 1, 4, 3, 2); pci_register_slot(0x06, PCI_CARD_NORMAL, 2, 1, 3, 4); -#else - pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0); - pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4); -#endif pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430lx_device); device_add(&keyboard_ps2_intel_ami_pci_device); From 40be31626ff5d46d8d5e658e495efa205a0d25b2 Mon Sep 17 00:00:00 2001 From: cold-brewed Date: Tue, 10 Oct 2023 10:03:11 -0400 Subject: [PATCH 27/50] Remove WinBox link --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 971f3c642..345af3878 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,6 @@ It is also recommended to use a manager application with 86Box for easier handli * [86Box Manager](https://github.com/86Box/86BoxManager) by [Overdoze](https://github.com/daviunic) (Windows only) * [86Box Manager Lite](https://github.com/insanemal/86box_manager_py) by [Insanemal](https://github.com/insanemal) -* [WinBox for 86Box](https://github.com/86Box/WinBox-for-86Box) by Laci bá' (Windows only) * [Linbox-qt5](https://github.com/Dungeonseeker/linbox-qt5) by Dungeonseeker (Linux focused, should work on Windows though untested) * [MacBox for 86Box](https://github.com/Moonif/MacBox) by [Moonif](https://github.com/Moonif) (MacOS only) From f2848b841eb4183fd982b287e779473a49cf419d Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 10 Oct 2023 16:25:12 +0200 Subject: [PATCH 28/50] Fixed the E-MU 8000 ROM path. --- src/sound/snd_emu8k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sound/snd_emu8k.c b/src/sound/snd_emu8k.c index a9366507a..22435c065 100644 --- a/src/sound/snd_emu8k.c +++ b/src/sound/snd_emu8k.c @@ -2172,7 +2172,7 @@ emu8k_init(emu8k_t *emu8k, uint16_t emu_addr, int onboard_ram) int c; double out; - fp = rom_fopen("roms/sound/awe32.raw", "rb"); + fp = rom_fopen("roms/sound/creative/awe32.raw", "rb"); if (!fp) fatal("AWE32.RAW not found\n"); From 8c60395f9889d5ad5aa5a7011441b2ae37ddd667 Mon Sep 17 00:00:00 2001 From: cold-brewed Date: Tue, 10 Oct 2023 10:54:12 -0400 Subject: [PATCH 29/50] Remove 86Box Manager Lite link, appears to no longer be maintained --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 345af3878..370bc940e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ Performance may vary depending on both host and guest configuration. Most emulat It is also recommended to use a manager application with 86Box for easier handling of multiple virtual machines. * [86Box Manager](https://github.com/86Box/86BoxManager) by [Overdoze](https://github.com/daviunic) (Windows only) -* [86Box Manager Lite](https://github.com/insanemal/86box_manager_py) by [Insanemal](https://github.com/insanemal) * [Linbox-qt5](https://github.com/Dungeonseeker/linbox-qt5) by Dungeonseeker (Linux focused, should work on Windows though untested) * [MacBox for 86Box](https://github.com/Moonif/MacBox) by [Moonif](https://github.com/Moonif) (MacOS only) From 1abc5b3f0483232d07eacfef92bdd071882d8c38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Tue, 10 Oct 2023 20:19:15 +0200 Subject: [PATCH 30/50] Update the bug report template (#3741) --- .github/ISSUE_TEMPLATE/bug_report.md | 32 ------------- .github/ISSUE_TEMPLATE/bug_report.yml | 66 +++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 32 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 2326a920c..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. Windows 10] - - 86Box version: [e.g. v3.7.1 build 4032; saying "Latest from Jenkins" isn't helpful] - - Build information: [i.e. new/old dynarec, architecture and build type] - -**Additional context** -Add any other context about the problem here. If you are using an Optimized build, make sure to try the regular build too before filing a bug report! diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..95905f6aa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,66 @@ +name: Bug Report +description: File a bug report +title: "Title" +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: textarea + attributes: + label: What happened? + description: Also tell us, what did you expect to happen? + placeholder: Tell us what you see! + - type: textarea + attributes: + label: Configuration file + description: Please copy and paste your machine configuration file (`86box.cfg`). This will be automatically formatted into code, so no need for backticks. + render: ini + - type: input + attributes: + label: Operating system + description: What is your host operating system? + placeholder: e.g. Windows 10 + - type: input + attributes: + label: CPU + description: What is your host CPU? + placeholder: e.g. AMD Ryzen 5 5600G + - type: input + attributes: + label: 86Box version + description: What version of 86Box are you running? (Saying "Latest from Jenkins" is not helpful.) + placeholder: e.g. v4.0 build 5000 + - type: dropdown + attributes: + label: Build architecture + description: 86Box for what architecture are you using? + options: + - Linux - ARM (32-bit) + - Linux - ARM (64-bit) + - Linux - x64 (64-bit) + - Linux - x86 (32-bit) + - macOS - Universal (Intel and Apple Silicon) + - Windows - x64 (64-bit) + - Windows - x86 (32-bit) + - type: checkboxes + attributes: + label: Build type + description: What type of build are you using? + options: + - label: New recompiler + - label: Debug build + - type: dropdown + attributes: + label: Download source + description: Where did you download 86Box from? + options: + - Official website (Jenkins, GitHub) + - Manager auto-update + - I built 86Box myself (please tell us more about your build configuration) + - I got 86Box from a third party repository (please tell us where) + - type: textarea + attributes: + label: Additional context + description: Is there anything else you want to tell us? From 9fd8fc14ef5c053294255e514d601967a6e6345f Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 11 Oct 2023 17:52:47 +0200 Subject: [PATCH 31/50] Added sanity checks to the ATi 68860 RAM DAC code. --- src/video/vid_ati68860_ramdac.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/video/vid_ati68860_ramdac.c b/src/video/vid_ati68860_ramdac.c index 4e76cb808..8b4c4924b 100644 --- a/src/video/vid_ati68860_ramdac.c +++ b/src/video/vid_ati68860_ramdac.c @@ -73,16 +73,16 @@ ati68860_ramdac_out(uint16_t addr, uint8_t val, void *priv, svga_t *svga) switch (addr) { case 0: - svga_out(dev->on ? 0x2ec : 0x3c8, val, svga); + svga_out((dev && dev->on) ? 0x2ec : 0x3c8, val, svga); break; case 1: - svga_out(dev->on ? 0x2ed : 0x3c9, val, svga); + svga_out((dev && dev->on) ? 0x2ed : 0x3c9, val, svga); break; case 2: - svga_out(dev->on ? 0x2ea : 0x3c6, val, svga); + svga_out((dev && dev->on) ? 0x2ea : 0x3c6, val, svga); break; case 3: - svga_out(dev->on ? 0x2eb : 0x3c7, val, svga); + svga_out((dev && dev->on) ? 0x2eb : 0x3c7, val, svga); break; default: ramdac->regs[addr & 0xf] = val; @@ -178,16 +178,16 @@ ati68860_ramdac_in(uint16_t addr, void *priv, svga_t *svga) switch (addr) { case 0: - temp = svga_in(dev->on ? 0x2ec : 0x3c8, svga); + temp = svga_in((dev && dev->on) ? 0x2ec : 0x3c8, svga); break; case 1: - temp = svga_in(dev->on ? 0x2ed : 0x3c9, svga); + temp = svga_in((dev && dev->on) ? 0x2ed : 0x3c9, svga); break; case 2: - temp = svga_in(dev->on ? 0x2ea : 0x3c6, svga); + temp = svga_in((dev && dev->on) ? 0x2ea : 0x3c6, svga); break; case 3: - temp = svga_in(dev->on ? 0x2eb : 0x3c7, svga); + temp = svga_in((dev && dev->on) ? 0x2eb : 0x3c7, svga); break; case 4: case 8: From 5a75ce9bf2691faaca9c72889655e17b39c0ddce Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 11 Oct 2023 18:18:02 +0200 Subject: [PATCH 32/50] Re-added the BIOS-less option of the Trantor T128b, this time with added sanity checks to avoid crashes, fixes #3742. --- src/scsi/scsi_ncr5380.c | 58 +++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/src/scsi/scsi_ncr5380.c b/src/scsi/scsi_ncr5380.c index 656257849..7e4145d9a 100644 --- a/src/scsi/scsi_ncr5380.c +++ b/src/scsi/scsi_ncr5380.c @@ -1388,31 +1388,36 @@ t128_read(uint32_t addr, void *priv) uint8_t ret = 0xff; addr &= 0x3fff; - if (addr >= 0 && addr < 0x1800) + if (ncr_dev->t128.bios_enabled && (addr >= 0) && (addr < 0x1800)) ret = ncr_dev->bios_rom.rom[addr & 0x1fff]; - else if (addr >= 0x1800 && addr < 0x1880) + else if ((addr >= 0x1800) && (addr < 0x1880)) ret = ncr_dev->t128.ext_ram[addr & 0x7f]; - else if (addr >= 0x1c00 && addr < 0x1c20) { + else if ((addr >= 0x1c00) && (addr < 0x1c20)) ret = ncr_dev->t128.ctrl; - } else if (addr >= 0x1c20 && addr < 0x1c40) { + else if ((addr >= 0x1c20) && (addr < 0x1c40)) { ret = ncr_dev->t128.status; - ncr_log("T128 status read = %02x, cur bus = %02x, req = %02x, dma = %02x\n", ret, ncr->cur_bus, ncr->cur_bus & BUS_REQ, ncr->mode & MODE_DMA); - } else if (addr >= 0x1d00 && addr < 0x1e00) { + ncr_log("T128 status read = %02x, cur bus = %02x, req = %02x, dma = %02x\n", + ret, ncr->cur_bus, ncr->cur_bus & BUS_REQ, ncr->mode & MODE_DMA); + } else if ((addr >= 0x1d00) && (addr < 0x1e00)) ret = ncr_read((addr - 0x1d00) >> 5, ncr_dev); - } else if (addr >= 0x1e00 && addr < 0x2000) { - if (ncr_dev->t128.host_pos >= MIN(512, dev->buffer_length) || ncr->dma_mode != DMA_INITIATOR_RECEIVE) { + else if (addr >= 0x1e00 && addr < 0x2000) { + if ((ncr_dev->t128.host_pos >= MIN(512, dev->buffer_length)) || + (ncr->dma_mode != DMA_INITIATOR_RECEIVE)) ret = 0xff; - } else { + else { ret = ncr_dev->t128.buffer[ncr_dev->t128.host_pos++]; - ncr_log("Read transfer, addr = %i, pos = %i\n", addr & 0x1ff, ncr_dev->t128.host_pos); + ncr_log("Read transfer, addr = %i, pos = %i\n", addr & 0x1ff, + ncr_dev->t128.host_pos); if (ncr_dev->t128.host_pos == MIN(512, dev->buffer_length)) { ncr_dev->t128.status &= ~0x04; - ncr_log("Transfer busy read, status = %02x, period = %lf\n", ncr_dev->t128.status, ncr_dev->period); + ncr_log("Transfer busy read, status = %02x, period = %lf\n", + ncr_dev->t128.status, ncr_dev->period); if (ncr_dev->period == 0.2 || ncr_dev->period == 0.02) timer_on_auto(&ncr_dev->timer, 40.2); - } else if (ncr_dev->t128.host_pos < MIN(512, dev->buffer_length) && scsi_device_get_callback(dev) > 100.0) + } else if ((ncr_dev->t128.host_pos < MIN(512, dev->buffer_length)) && + (scsi_device_get_callback(dev) > 100.0)) cycles += 100; /*Needed to avoid timer de-syncing with transfers.*/ } } @@ -1428,23 +1433,25 @@ t128_write(uint32_t addr, uint8_t val, void *priv) const scsi_device_t *dev = &scsi_devices[ncr_dev->bus][ncr->target_id]; addr &= 0x3fff; - if (addr >= 0x1800 && addr < 0x1880) + if ((addr >= 0x1800) && (addr < 0x1880)) ncr_dev->t128.ext_ram[addr & 0x7f] = val; - else if (addr >= 0x1c00 && addr < 0x1c20) { + else if ((addr >= 0x1c00) && (addr < 0x1c20)) { if ((val & 0x02) && !(ncr_dev->t128.ctrl & 0x02)) { ncr_dev->t128.status |= 0x02; ncr_log("Timer fired\n"); } ncr_dev->t128.ctrl = val; ncr_log("T128 ctrl write = %02x\n", val); - } else if (addr >= 0x1d00 && addr < 0x1e00) + } else if ((addr >= 0x1d00) && (addr < 0x1e00)) ncr_write((addr - 0x1d00) >> 5, val, ncr_dev); - else if (addr >= 0x1e00 && addr < 0x2000) { - if (ncr_dev->t128.host_pos < MIN(512, dev->buffer_length) && ncr->dma_mode == DMA_SEND) { + else if ((addr >= 0x1e00) && (addr < 0x2000)) { + if ((ncr_dev->t128.host_pos < MIN(512, dev->buffer_length)) && + (ncr->dma_mode == DMA_SEND)) { ncr_dev->t128.buffer[ncr_dev->t128.host_pos] = val; ncr_dev->t128.host_pos++; - ncr_log("Write transfer, addr = %i, pos = %i, val = %02x\n", addr & 0x1ff, ncr_dev->t128.host_pos, val); + ncr_log("Write transfer, addr = %i, pos = %i, val = %02x\n", + addr & 0x1ff, ncr_dev->t128.host_pos, val); if (ncr_dev->t128.host_pos == MIN(512, dev->buffer_length)) { ncr_dev->t128.status &= ~0x04; @@ -1605,8 +1612,9 @@ ncr_init(const device_t *info) ncr_dev->irq = device_get_config_int("irq"); ncr_dev->t128.bios_enabled = device_get_config_int("boot"); - rom_init(&ncr_dev->bios_rom, T128_ROM, - ncr_dev->rom_addr, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL); + if (ncr_dev->t128.bios_enabled) + rom_init(&ncr_dev->bios_rom, T128_ROM, + ncr_dev->rom_addr, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL); mem_mapping_add(&ncr_dev->mapping, ncr_dev->rom_addr, 0x4000, t128_read, NULL, NULL, @@ -1644,6 +1652,9 @@ ncr_init(const device_t *info) } else { ncr_dev->t128.status = 0x04; ncr_dev->t128.host_pos = 512; + + if (!ncr_dev->t128.bios_enabled) + ncr_dev->t128.status |= 0x80; } timer_add(&ncr_dev->timer, ncr_callback, ncr_dev, 0); @@ -1894,6 +1905,13 @@ static const device_config_t t128_config[] = { { .description = "" } }, }, + { + .name = "boot", + .description = "Enable Boot ROM", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, { .name = "", .description = "", .type = CONFIG_END } }; // clang-format on From 528c269cdd16509e5484c8d24eb39d4388d8ce03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miran=20Gr=C4=8Da?= Date: Wed, 11 Oct 2023 18:33:01 +0200 Subject: [PATCH 33/50] The INS and OUTS instruction on V20/V30 now increase/decrease the correct registers, fixes #3723. --- src/cpu/808x.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cpu/808x.c b/src/cpu/808x.c index 0d5cc3e9a..43927d84d 100644 --- a/src/cpu/808x.c +++ b/src/cpu/808x.c @@ -1960,18 +1960,18 @@ stos(int bits) static void ins(int bits) { - cpu_state.eaaddr = SI; + cpu_state.eaaddr = DI; cpu_io(bits, 0, cpu_state.eaaddr); - SI = string_increment(bits); + DI = string_increment(bits); } static void outs(int bits) { - cpu_state.eaaddr = DI; + cpu_state.eaaddr = SI; cpu_data = (bits == 16) ? AX : AL; cpu_io(bits, 1, cpu_state.eaaddr); - DI = string_increment(bits); + SI = string_increment(bits); } static void From 74ba935a0ce944d701adf49e867b294bf2428c0e Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 11 Oct 2023 18:43:53 +0200 Subject: [PATCH 34/50] Further fix the V20/V30 ins() and outs() instructions. --- src/cpu/808x.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/cpu/808x.c b/src/cpu/808x.c index 43927d84d..8f92a1198 100644 --- a/src/cpu/808x.c +++ b/src/cpu/808x.c @@ -1960,18 +1960,17 @@ stos(int bits) static void ins(int bits) { - cpu_state.eaaddr = DI; + cpu_state.eaaddr = DX; cpu_io(bits, 0, cpu_state.eaaddr); - DI = string_increment(bits); + stos(bits); } static void outs(int bits) { - cpu_state.eaaddr = SI; - cpu_data = (bits == 16) ? AX : AL; + lods(bits); + cpu_state.eaaddr = DX; cpu_io(bits, 1, cpu_state.eaaddr); - SI = string_increment(bits); } static void @@ -2274,7 +2273,6 @@ execx86(int cycs) bits = 8 << (opcode & 1); if (rep_start()) { ins(bits); - set_accum(bits, cpu_data); wait(3, 0); if (in_rep != 0) { @@ -2304,7 +2302,6 @@ execx86(int cycs) handled = 1; bits = 8 << (opcode & 1); if (rep_start()) { - cpu_data = AX; wait(1, 0); outs(bits); if (in_rep != 0) { From 6913de32c559d3babb8e1b8aefe5be08da8476cb Mon Sep 17 00:00:00 2001 From: TC1995 Date: Wed, 11 Oct 2023 18:46:15 +0200 Subject: [PATCH 35/50] More video fixes: ATI Mach64 is temporarily unthreaded because of blitter desyncing. ATI Mach32 now returns to ATI mode from IBM mode and vice versa more correctly. Make the IBM 8514/A compatible poll not run if a 3D add-on card (Voodoo1/2) takes precedence (seen on a Mach32 PCI and Voodoo2 3D combo). Finally ended the mess ups of the TGUI9440/96x0 pitch, it actually was the CRTC offset reg (SVGA CRTC 0x13) that defined it with some shifting based on the BPP. --- src/video/vid_ati_mach64.c | 160 ++++++++++++++++--------------------- src/video/vid_ati_mach8.c | 23 ++++-- src/video/vid_svga.c | 22 +++-- src/video/vid_tgui9440.c | 114 +++++++------------------- 4 files changed, 134 insertions(+), 185 deletions(-) diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index 92570ad1b..75e79dec9 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -420,7 +420,7 @@ mach64_out(uint16_t addr, uint8_t val, void *priv) case 0x3C8: case 0x3C9: if (mach64->type == MACH64_GX) - ati68860_ramdac_out((addr & 3) | ((mach64->dac_cntl & 3) << 2), val, mach64->svga.ramdac, svga); + ati68860_ramdac_out((addr & 3) | ((mach64->dac_cntl & 3) << 2), val, svga->ramdac, svga); else svga_out(addr, val, svga); return; @@ -487,7 +487,7 @@ mach64_in(uint16_t addr, void *priv) case 0x3C8: case 0x3C9: if (mach64->type == MACH64_GX) - return ati68860_ramdac_in((addr & 3) | ((mach64->dac_cntl & 3) << 2), mach64->svga.ramdac, svga); + return ati68860_ramdac_in((addr & 3) | ((mach64->dac_cntl & 3) << 2), svga->ramdac, svga); return svga_in(addr, svga); case 0x3D4: @@ -654,6 +654,7 @@ mach64_update_irqs(mach64_t *mach64) pci_clear_irq(mach64->pci_slot, PCI_INTA, &mach64->irq_state); } +#if 0 static __inline void wake_fifo_thread(mach64_t *mach64) { @@ -668,6 +669,7 @@ mach64_wait_fifo_idle(mach64_t *mach64) thread_wait_event(mach64->fifo_not_full_event, 1); } } +#endif #define READ8(addr, var) \ switch ((addr) &3) { \ @@ -1167,6 +1169,7 @@ mach64_accel_write_fifo_l(mach64_t *mach64, uint32_t addr, uint32_t val) } } +#if 0 static void fifo_thread(void *param) { @@ -1230,6 +1233,7 @@ mach64_queue(mach64_t *mach64, uint32_t addr, uint32_t val, uint32_t type) if (FIFO_ENTRIES > 0xe000 || FIFO_ENTRIES < 8) wake_fifo_thread(mach64); } +#endif void mach64_start_fill(mach64_t *mach64) @@ -2517,26 +2521,26 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x101: case 0x102: case 0x103: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->dst_off_pitch); break; case 0x104: case 0x105: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->dst_y_x); break; case 0x108: case 0x109: case 0x11c: case 0x11d: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr + 2, mach64->dst_y_x); break; case 0x10c: case 0x10d: case 0x10e: case 0x10f: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->dst_y_x); break; case 0x110: @@ -2551,7 +2555,7 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x11b: case 0x11e: case 0x11f: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->dst_height_width); break; @@ -2559,28 +2563,28 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x121: case 0x122: case 0x123: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->dst_bres_lnth); break; case 0x124: case 0x125: case 0x126: case 0x127: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->dst_bres_err); break; case 0x128: case 0x129: case 0x12a: case 0x12b: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->dst_bres_inc); break; case 0x12c: case 0x12d: case 0x12e: case 0x12f: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->dst_bres_dec); break; @@ -2588,7 +2592,7 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x131: case 0x132: case 0x133: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->dst_cntl); break; @@ -2596,75 +2600,75 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x181: case 0x182: case 0x183: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->src_off_pitch); break; case 0x184: case 0x185: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->src_y_x); break; case 0x188: case 0x189: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr + 2, mach64->src_y_x); break; case 0x18c: case 0x18d: case 0x18e: case 0x18f: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->src_y_x); break; case 0x190: case 0x191: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr + 2, mach64->src_height1_width1); break; case 0x194: case 0x195: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->src_height1_width1); break; case 0x198: case 0x199: case 0x19a: case 0x19b: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->src_height1_width1); break; case 0x19c: case 0x19d: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->src_y_x_start); break; case 0x1a0: case 0x1a1: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr + 2, mach64->src_y_x_start); break; case 0x1a4: case 0x1a5: case 0x1a6: case 0x1a7: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->src_y_x_start); break; case 0x1a8: case 0x1a9: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr + 2, mach64->src_height2_width2); break; case 0x1ac: case 0x1ad: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->src_height2_width2); break; case 0x1b0: case 0x1b1: case 0x1b2: case 0x1b3: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->src_height2_width2); break; @@ -2672,7 +2676,7 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x1b5: case 0x1b6: case 0x1b7: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->src_cntl); break; @@ -2680,7 +2684,7 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x241: case 0x242: case 0x243: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->host_cntl); break; @@ -2688,14 +2692,14 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x281: case 0x282: case 0x283: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->pat_reg0); break; case 0x284: case 0x285: case 0x286: case 0x287: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->pat_reg1); break; @@ -2703,7 +2707,7 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x289: case 0x28a: case 0x28b: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->pat_cntl); break; @@ -2711,7 +2715,7 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x2a1: case 0x2a8: case 0x2a9: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->sc_left_right); break; case 0x2a4: @@ -2720,7 +2724,7 @@ mach64_ext_readb(uint32_t addr, void *priv) fallthrough; case 0x2aa: case 0x2ab: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->sc_left_right); break; @@ -2728,7 +2732,7 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x2ad: case 0x2b4: case 0x2b5: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->sc_top_bottom); break; case 0x2b0: @@ -2737,7 +2741,7 @@ mach64_ext_readb(uint32_t addr, void *priv) fallthrough; case 0x2b6: case 0x2b7: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->sc_top_bottom); break; @@ -2745,14 +2749,14 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x2c1: case 0x2c2: case 0x2c3: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->dp_bkgd_clr); break; case 0x2c4: case 0x2c5: case 0x2c6: case 0x2c7: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->dp_frgd_clr); break; @@ -2760,7 +2764,7 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x2c9: case 0x2ca: case 0x2cb: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->write_mask); break; @@ -2768,7 +2772,7 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x2cd: case 0x2ce: case 0x2cf: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->chain_mask); break; @@ -2776,21 +2780,21 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x2d1: case 0x2d2: case 0x2d3: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->dp_pix_width); break; case 0x2d4: case 0x2d5: case 0x2d6: case 0x2d7: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->dp_mix); break; case 0x2d8: case 0x2d9: case 0x2da: case 0x2db: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->dp_src); break; @@ -2798,64 +2802,53 @@ mach64_ext_readb(uint32_t addr, void *priv) case 0x301: case 0x302: case 0x303: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->clr_cmp_clr); break; case 0x304: case 0x305: case 0x306: case 0x307: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->clr_cmp_mask); break; case 0x308: case 0x309: case 0x30a: case 0x30b: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->clr_cmp_cntl); break; case 0x310: case 0x311: - if (((mach64->crtc_gen_cntl >> 8) & 7) == BPP_24) { - ret = 0; - } else { - if (!FIFO_EMPTY) - wake_fifo_thread(mach64); - ret = 0; - if (FIFO_FULL) - ret = 0xff; - } + ret = 0; break; case 0x320: case 0x321: case 0x322: case 0x323: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->context_mask); break; case 0x330: case 0x331: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr, mach64->dst_cntl); break; case 0x332: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr - 2, mach64->src_cntl); break; case 0x333: - mach64_wait_fifo_idle(mach64); + //mach64_wait_fifo_idle(mach64); READ8(addr - 3, mach64->pat_cntl); break; case 0x338: - if (((mach64->crtc_gen_cntl >> 8) & 7) == BPP_24) - ret = 0; - else - ret = FIFO_EMPTY ? 0 : 1; + ret = 0; break; default: @@ -3039,10 +3032,7 @@ mach64_ext_writeb(uint32_t addr, uint8_t val, void *priv) mach64_log("nmach64_ext_writeb: addr=%04x val=%02x\n", addr, val); } else if (addr & 0x300) { - if (((mach64->crtc_gen_cntl >> 8) & 7) == BPP_24) - mach64_accel_write_fifo(mach64, addr & 0x3ff, val); - else - mach64_queue(mach64, addr & 0x3ff, val, FIFO_WRITE_BYTE); + mach64_accel_write_fifo(mach64, addr & 0x3ff, val); } else switch (addr & 0x3ff) { case 0x00: @@ -3051,6 +3041,7 @@ mach64_ext_writeb(uint32_t addr, uint8_t val, void *priv) case 0x03: WRITE8(addr, mach64->crtc_h_total_disp, val); svga_recalctimings(&mach64->svga); + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x08: case 0x09: @@ -3058,6 +3049,7 @@ mach64_ext_writeb(uint32_t addr, uint8_t val, void *priv) case 0x0b: WRITE8(addr, mach64->crtc_v_total_disp, val); svga_recalctimings(&mach64->svga); + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x0c: case 0x0d: @@ -3065,6 +3057,7 @@ mach64_ext_writeb(uint32_t addr, uint8_t val, void *priv) case 0x0f: WRITE8(addr, mach64->crtc_v_sync_strt_wid, val); svga_recalctimings(&mach64->svga); + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x14: @@ -3094,6 +3087,7 @@ mach64_ext_writeb(uint32_t addr, uint8_t val, void *priv) svga->fb_only = 0; svga->dpms = !!(mach64->crtc_gen_cntl & 0x0c); svga_recalctimings(&mach64->svga); + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x40: @@ -3268,10 +3262,7 @@ mach64_ext_writew(uint32_t addr, uint16_t val, void *priv) mach64_ext_writeb(addr, val, priv); mach64_ext_writeb(addr + 1, val >> 8, priv); } else if (addr & 0x300) { - if (((mach64->crtc_gen_cntl >> 8) & 7) == BPP_24) - mach64_accel_write_fifo_w(mach64, addr & 0x3fe, val); - else - mach64_queue(mach64, addr & 0x3fe, val, FIFO_WRITE_WORD); + mach64_accel_write_fifo_w(mach64, addr & 0x3fe, val); } else switch (addr & 0x3fe) { default: @@ -3292,10 +3283,7 @@ mach64_ext_writel(uint32_t addr, uint32_t val, void *priv) mach64_ext_writew(addr, val, priv); mach64_ext_writew(addr + 2, val >> 16, priv); } else if (addr & 0x300) { - if (((mach64->crtc_gen_cntl >> 8) & 7) == BPP_24) - mach64_accel_write_fifo_l(mach64, addr & 0x3fc, val); - else - mach64_queue(mach64, addr & 0x3fc, val, FIFO_WRITE_DWORD); + mach64_accel_write_fifo_l(mach64, addr & 0x3fc, val); } else switch (addr & 0x3fc) { default: @@ -4382,20 +4370,23 @@ mach64_pci_write(UNUSED(int func), int addr, uint8_t val, void *priv) static void * mach64_common_init(const device_t *info) { + svga_t *svga; mach64_t *mach64 = malloc(sizeof(mach64_t)); memset(mach64, 0, sizeof(mach64_t)); + svga = &mach64->svga; + mach64->vram_size = device_get_config_int("memory"); mach64->vram_mask = (mach64->vram_size << 20) - 1; - svga_init(info, &mach64->svga, mach64, mach64->vram_size << 20, + svga_init(info, svga, mach64, mach64->vram_size << 20, mach64_recalctimings, mach64_in, mach64_out, NULL, mach64_overlay_draw); - mach64->svga.dac_hwcursor.cur_ysize = 64; + svga->dac_hwcursor.cur_ysize = 64; - mem_mapping_add(&mach64->linear_mapping, 0, 0, svga_read_linear, svga_readw_linear, svga_readl_linear, svga_write_linear, svga_writew_linear, svga_writel_linear, NULL, MEM_MAPPING_EXTERNAL, &mach64->svga); + mem_mapping_add(&mach64->linear_mapping, 0, 0, svga_read_linear, svga_readw_linear, svga_readl_linear, svga_write_linear, svga_writew_linear, svga_writel_linear, NULL, MEM_MAPPING_EXTERNAL, svga); mem_mapping_add(&mach64->mmio_linear_mapping, 0, 0, mach64_ext_readb, mach64_ext_readw, mach64_ext_readl, mach64_ext_writeb, mach64_ext_writew, mach64_ext_writel, NULL, MEM_MAPPING_EXTERNAL, mach64); mem_mapping_add(&mach64->mmio_linear_mapping_2, 0, 0, mach64_ext_readb, mach64_ext_readw, mach64_ext_readl, mach64_ext_writeb, mach64_ext_writew, mach64_ext_writel, NULL, MEM_MAPPING_EXTERNAL, mach64); mem_mapping_add(&mach64->mmio_mapping, 0xbc000, 0x04000, mach64_ext_readb, mach64_ext_readw, mach64_ext_readl, mach64_ext_writeb, mach64_ext_writew, mach64_ext_writel, NULL, MEM_MAPPING_EXTERNAL, mach64); @@ -4411,21 +4402,16 @@ mach64_common_init(const device_t *info) mach64->pci_regs[0x32] = 0x0c; mach64->pci_regs[0x33] = 0x00; - mach64->svga.ramdac = device_add(&ati68860_ramdac_device); - mach64->svga.dac_hwcursor_draw = ati68860_hwcursor_draw; + svga->ramdac = device_add(&ati68860_ramdac_device); + svga->dac_hwcursor_draw = ati68860_hwcursor_draw; - mach64->svga.clock_gen = device_add(&ics2595_device); + svga->clock_gen = device_add(&ics2595_device); mach64->dst_cntl = 3; mach64->i2c = i2c_gpio_init("ddc_ati_mach64"); mach64->ddc = ddc_init(i2c_gpio_get_bus(mach64->i2c)); - mach64->wake_fifo_thread = thread_create_event(); - mach64->fifo_not_full_event = thread_create_event(); - mach64->thread_run = 1; - mach64->fifo_thread = thread_create(fifo_thread, mach64); - return mach64; } @@ -4521,12 +4507,6 @@ mach64_close(void *priv) { mach64_t *mach64 = (mach64_t *) priv; - mach64->thread_run = 0; - thread_set_event(mach64->wake_fifo_thread); - thread_wait(mach64->fifo_thread); - thread_destroy_event(mach64->fifo_not_full_event); - thread_destroy_event(mach64->wake_fifo_thread); - svga_close(&mach64->svga); ddc_close(mach64->ddc); diff --git a/src/video/vid_ati_mach8.c b/src/video/vid_ati_mach8.c index 42a2a9f02..86926f26e 100644 --- a/src/video/vid_ati_mach8.c +++ b/src/video/vid_ati_mach8.c @@ -101,6 +101,7 @@ typedef struct mach_t { uint8_t bank_r; uint16_t shadow_set; int ext_on; + int ati_mode; struct { uint8_t line_idx; @@ -3707,6 +3708,7 @@ mach_accel_out(uint16_t port, uint8_t val, mach_t *mach) mach_log("ATI 8514/A: (0x4ae9) val = %04x, ext = %d.\n", dev->accel.advfunc_cntl & 0x01, mach->ext_on); mach32_updatemapping(mach); } + mach->ati_mode = 0; svga_recalctimings(svga); break; @@ -3832,9 +3834,11 @@ mach_accel_out(uint16_t port, uint8_t val, mach_t *mach) WRITE8(port, mach->accel.clock_sel, val); if (port & 1) { dev->on = mach->accel.clock_sel & 0x01; + mach->ext_on = dev->on; vga_on = !dev->on; - pclog("ATI 8514/A: (0x4aef) val = %04x, ext = %d.\n", mach->accel.clock_sel & 0x01, mach->ext_on); + mach_log("ATI 8514/A: (0x4aef) val = %04x, ext = %d.\n", mach->accel.clock_sel & 0x01, mach->ext_on); } + mach->ati_mode = 1; svga_recalctimings(svga); break; @@ -3932,7 +3936,11 @@ mach_accel_out(uint16_t port, uint8_t val, mach_t *mach) break; } svga_set_ramdac_type(svga, !!(mach->accel.ext_ge_config & 0x4000)); - mach_log("7AEE write val = %04x.\n", mach->accel.ext_ge_config); + if (port & 1) { + mach->ati_mode = 1; + mach_log("ATI 8514/A: (0x%04x) val = %04x.\n", port, val); + mach32_updatemapping(mach); + } } svga_recalctimings(svga); break; @@ -5117,7 +5125,7 @@ mach32_updatemapping(mach_t *mach) mach->ap_size = 4; mem_mapping_disable(&mach->mmio_linear_mapping); } - if (mach->ext_on && (dev->local >= 2)) { + if (mach->ext_on && (dev->local >= 2) && mach->ati_mode) { mem_mapping_set_handler(&svga->mapping, mach32_read, mach32_readw, mach32_readl, mach32_write, mach32_writew, mach32_writel); mem_mapping_set_p(&svga->mapping, mach); } else { @@ -5553,20 +5561,25 @@ mach32_pci_write(UNUSED(int func), int addr, uint8_t val, void *priv) case PCI_REG_COMMAND: mach->pci_regs[PCI_REG_COMMAND] = val & 0x27; if (val & PCI_COMMAND_IO) { + io_removehandler(0x02ea, 4, mach_in, NULL, NULL, mach_out, NULL, NULL, mach); io_removehandler(0x03c0, 32, mach_in, NULL, NULL, mach_out, NULL, NULL, mach); + io_sethandler(0x02ea, 4, mach_in, NULL, NULL, mach_out, NULL, NULL, mach); io_sethandler(0x03c0, 32, mach_in, NULL, NULL, mach_out, NULL, NULL, mach); - } else + } else { io_removehandler(0x03c0, 32, mach_in, NULL, NULL, mach_out, NULL, NULL, mach); - + io_removehandler(0x02ea, 4, mach_in, NULL, NULL, mach_out, NULL, NULL, mach); + } mach32_updatemapping(mach); break; case 0x12: mach->linear_base = (mach->linear_base & 0xff000000) | ((val & 0xc0) << 16); + mach->ati_mode = 1; mach32_updatemapping(mach); break; case 0x13: mach->linear_base = (mach->linear_base & 0xc00000) | (val << 24); + mach->ati_mode = 1; mach32_updatemapping(mach); break; diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index 36bd21005..360fcbb5f 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -117,6 +117,9 @@ svga_out(uint16_t addr, uint8_t val, void *priv) uint8_t o; uint8_t index; + if (!dev && (addr >= 0x2ea) && (addr <= 0x2ed)) + return; + switch (addr) { case 0x2ea: dev->dac_mask = val; @@ -363,6 +366,9 @@ svga_in(uint16_t addr, void *priv) uint8_t index; uint8_t ret = 0xff; + if (!dev && (addr >= 0x2ea) && (addr <= 0x2ed)) + return ret; + switch (addr) { case 0x2ea: ret = dev->dac_mask; @@ -827,15 +833,17 @@ svga_poll(void *priv) int ret; int old_ma; - if (ibm8514_active && dev->on) { - ibm8514_poll(dev, svga); - return; - } - if (xga_active && xga->on) { - if ((xga->disp_cntl_2 & 7) >= 2) { - xga_poll(xga, svga); + if (!svga->override) { + if (ibm8514_active && dev->on) { + ibm8514_poll(dev, svga); return; } + if (xga_active && xga->on) { + if ((xga->disp_cntl_2 & 7) >= 2) { + xga_poll(xga, svga); + return; + } + } } if (!svga->linepos) { diff --git a/src/video/vid_tgui9440.c b/src/video/vid_tgui9440.c index 0f9473d1a..76ace6040 100644 --- a/src/video/vid_tgui9440.c +++ b/src/video/vid_tgui9440.c @@ -760,10 +760,18 @@ tgui_recalctimings(svga_t *svga) case 8: svga->render = svga_render_8bpp_highres; if (tgui->type >= TGUI_9660) { - if ((svga->dispend == 510) || (svga->dispend == 512)) - svga->hdisp = 1280; - else if ((svga->dispend == 600) && (svga->hdisp == 800) && svga->interlace) - svga->hdisp = 1600; + if (svga->dispend == ((1024 >> 1) - 2)) + svga->dispend += 2; + if (svga->dispend == (1024 >> 1)) + svga->hdisp <<= 1; + else if ((svga->hdisp == (1600 >> 1)) && (svga->dispend == (1200 >> 1)) && svga->interlace) + svga->hdisp <<= 1; + else if (svga->hdisp == (1024 >> 1)) { + if (svga->interlace && (svga->dispend == (768 >> 1))) + svga->hdisp <<= 1; + else if (!svga->interlace && (svga->dispend == 768)) + svga->hdisp <<= 1; + } if (ger22upper & 0x80) { svga->htotal <<= 1; @@ -799,7 +807,7 @@ tgui_recalctimings(svga_t *svga) case 32: svga->render = svga_render_32bpp_highres; if (tgui->type >= TGUI_9660) { - if (svga->hdisp == 1024) + if (!ger22upper) svga->rowoffset <<= 1; } break; @@ -1455,15 +1463,21 @@ tgui_accel_command(int count, uint32_t cpu_dat, tgui_t *tgui) } } - /*For delayed mode switches.*/ - if (tgui->type == TGUI_9440) { - if (tgui->accel.pitch == 800) - tgui->accel.pitch += 32; + /*See this: https://android.googlesource.com/kernel/tegra/+/android-tegra-flounder-3.10-lollipop-release/drivers/video/tridentfb.c for the pitch*/ + tgui->accel.pitch = svga->rowoffset; - if (tgui->accel.bpp == 1) { - if (!ger22upper) - tgui->accel.pitch = svga->rowoffset << 2; - } + switch (svga->bpp) { + case 8: + case 24: + tgui->accel.pitch <<= 3; + break; + case 15: + case 16: + tgui->accel.pitch <<= 2; + break; + case 32: + tgui->accel.pitch <<= 1; + break; } #if 0 pclog("TGUI accel command = %x, ger22 = %04x, hdisp = %d, dispend = %d, vtotal = %d, rowoffset = %d, svgabpp = %d, interlace = %d, accelbpp = %d, pitch = %d.\n", tgui->accel.command, tgui->accel.ger22, svga->hdisp, svga->dispend, svga->vtotal, svga->rowoffset, svga->bpp, svga->interlace, tgui->accel.bpp, tgui->accel.pitch); @@ -2056,7 +2070,6 @@ tgui_accel_out(uint16_t addr, uint8_t val, void *priv) switch (addr) { case 0x2122: tgui->accel.ger22 = (tgui->accel.ger22 & 0xff00) | val; - tgui->accel.pitch = 0x200 << ((val >> 2) & 3); switch (svga->bpp) { case 8: case 24: @@ -2076,7 +2089,8 @@ tgui_accel_out(uint16_t addr, uint8_t val, void *priv) break; case 0x2123: - //pclog("Pitch IO23: val = %02x, rowoffset = %x, pitch = %d.\n", val, svga->rowoffset, tgui->accel.pitch); + tgui->accel.ger22 = (tgui->accel.ger22 & 0xff) | (val << 8); + //pclog("Pitch IO23: val = %02x, rowoffset = %x.\n", tgui->accel.ger22, svga->crtc[0x13]); switch (svga->bpp) { case 8: case 24: @@ -2090,24 +2104,6 @@ tgui_accel_out(uint16_t addr, uint8_t val, void *priv) tgui->accel.bpp = 3; break; } - tgui->accel.ger22 = (tgui->accel.ger22 & 0xff) | (val << 8); - if ((val & 0x80) || ((val & 0xc0) == 0x40)) - tgui->accel.pitch = svga->rowoffset << 3; - else if (tgui->accel.pitch <= 1024) { - tgui->accel.pitch = svga->rowoffset << 3; - if (!val) - tgui->accel.pitch = 1024; - } - - if (tgui->accel.pitch == 800) - tgui->accel.pitch += 32; - - if (tgui->accel.bpp == 1) - tgui->accel.pitch >>= 1; - else if (tgui->accel.bpp == 3) - tgui->accel.pitch >>= 2; - - svga_recalctimings(svga); break; case 0x2124: /*Command*/ @@ -2724,59 +2720,11 @@ tgui_accel_write(uint32_t addr, uint8_t val, void *priv) switch (addr & 0xff) { case 0x22: - tgui->accel.ger22 = (tgui->accel.ger22 & 0xff00) | val; - tgui->accel.pitch = 0x200 << ((val >> 2) & 3); - switch (svga->bpp) { - case 8: - case 24: - tgui->accel.bpp = 0; - break; - case 15: - case 16: - tgui->accel.bpp = 1; - break; - case 32: - tgui->accel.bpp = 3; - break; - - default: - break; - } + tgui_accel_out(0x2122, val, tgui); break; case 0x23: - switch (svga->bpp) { - case 8: - case 24: - tgui->accel.bpp = 0; - break; - case 15: - case 16: - tgui->accel.bpp = 1; - break; - case 32: - tgui->accel.bpp = 3; - break; - } - tgui->accel.ger22 = (tgui->accel.ger22 & 0xff) | (val << 8); - if ((val & 0x80) || ((val & 0xc0) == 0x40)) - tgui->accel.pitch = svga->rowoffset << 3; - else if (tgui->accel.pitch <= 1024) { - tgui->accel.pitch = svga->rowoffset << 3; - if (!val) - tgui->accel.pitch = 1024; - } - - if (tgui->accel.pitch == 800) - tgui->accel.pitch += 32; - - if (tgui->accel.bpp == 1) - tgui->accel.pitch >>= 1; - else if (tgui->accel.bpp == 3) - tgui->accel.pitch >>= 2; - - //pclog("Pitch MM23: fullval = %04x, rowoffset = %x, pitch = %d.\n", tgui->accel.ger22, svga->rowoffset, tgui->accel.pitch); - svga_recalctimings(svga); + tgui_accel_out(0x2123, val, tgui); break; case 0x24: /*Command*/ From d80effddd14a6a356393cefb4495f1cb25ac6b99 Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 11 Oct 2023 18:51:50 +0200 Subject: [PATCH 36/50] Removed an unused variable. --- src/video/vid_tgui9440.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/video/vid_tgui9440.c b/src/video/vid_tgui9440.c index 76ace6040..aa89f8681 100644 --- a/src/video/vid_tgui9440.c +++ b/src/video/vid_tgui9440.c @@ -1407,7 +1407,6 @@ tgui_accel_command(int count, uint32_t cpu_dat, tgui_t *tgui) uint32_t trans_col = (tgui->accel.flags & TGUI_TRANSREV) ? tgui->accel.fg_col : tgui->accel.bg_col; uint16_t *vram_w = (uint16_t *) svga->vram; uint32_t *vram_l = (uint32_t *) svga->vram; - uint8_t ger22upper = (tgui->accel.ger22 >> 8); if (tgui->accel.bpp == 0) { trans_col &= 0xff; From 60cf5921a3f06bb9059934aede2f9793e3cb0f61 Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 11 Oct 2023 23:17:22 +0200 Subject: [PATCH 37/50] CPU clean-ups. --- src/cpu/808x/CMakeLists.txt | 16 --- src/cpu/808x/queue.c | 192 ------------------------------------ src/cpu/808x/queue.h | 42 -------- src/cpu/CMakeLists.txt | 3 - 4 files changed, 253 deletions(-) delete mode 100644 src/cpu/808x/CMakeLists.txt delete mode 100644 src/cpu/808x/queue.c delete mode 100644 src/cpu/808x/queue.h diff --git a/src/cpu/808x/CMakeLists.txt b/src/cpu/808x/CMakeLists.txt deleted file mode 100644 index d29bdf4e0..000000000 --- a/src/cpu/808x/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# -# 86Box A hypervisor and IBM PC system emulator that specializes in -# running old operating systems and software designed for IBM -# PC systems and compatibles from 1981 through fairly recent -# system designs based on the PCI bus. -# -# This file is part of the 86Box distribution. -# -# CMake build script. -# -# Authors: David Hrdlička, -# -# Copyright 2020-2021 David Hrdlička. -# - -add_library(808x OBJECT queue.c) diff --git a/src/cpu/808x/queue.c b/src/cpu/808x/queue.c deleted file mode 100644 index b37ee0fb0..000000000 --- a/src/cpu/808x/queue.c +++ /dev/null @@ -1,192 +0,0 @@ -/* - * 86Box A hypervisor and IBM PC system emulator that specializes in - * running old operating systems and software designed for IBM - * PC systems and compatibles from 1981 through fairly recent - * system designs based on the PCI bus. - * - * This file is part of the 86Box distribution. - * - * 808x CPU emulation, mostly ported from reenigne's XTCE, which - * is cycle-accurate. - * - * Authors: gloriouscow, - * Miran Grca, - * - * Copyright 2023 gloriouscow. - * Copyright 2023 Miran Grca. - */ -#include -#include -#include -#include -#include -#include -#include - -#define HAVE_STDARG_H -#include <86box/86box.h> -#include "cpu.h" -#include "x86.h" -#include <86box/machine.h> -#include <86box/io.h> -#include <86box/mem.h> -#include <86box/rom.h> -#include <86box/nmi.h> -#include <86box/pic.h> -#include <86box/ppi.h> -#include <86box/timer.h> -#include <86box/gdbstub.h> -// #include "808x.h" -#include "queue.h" - -/* TODO: Move to cpu.h so this can eventually be reused for 286+ as well. */ -#define QUEUE_MAX 6 - -/* NOTE: When porting from Rust to C, please use uintptr_t and not size_t, - so it can be printed with PRIuPTR. */ -typedef struct queue_t { - uintptr_t size; - uintptr_t len; - uintptr_t back; - uintptr_t front; - uint8_t q[QUEUE_MAX]; - uint16_t preload; - queue_delay_t delay; -} queue_t; - -static queue_t queue; - -#ifdef ENABLE_QUEUE_LOG -int queue_do_log = ENABLE_QUEUE_LOG; - -static void -queue_log(const char *fmt, ...) -{ - va_list ap; - - if (queue_do_log) { - va_start(ap, fmt); - pclog_ex(fmt, ap); - va_end(ap); - } -} -#else -# define queue_log(fmt, ...) -#endif - -void -queue_set_size(uintptr_t size) -{ - if (size > QUEUE_MAX) - fatal("Requested prefetch queue of %" PRIuPTR " bytes is too big\n", size); - - queue.size = size; -} - -uintptr_t -queue_get_len(void) -{ - return queue.len; -} - -int -queue_is_full(void) -{ - return (queue.len != queue.size); -} - -uint16_t -queue_get_preload(void) -{ - uint16_t ret = queue.preload; - queue.preload = 0x0000; - - return ret; -} - -int -queue_has_preload(void) -{ - return (queue.preload & FLAG_PRELOADED) ? 1 : 0; -} - -void -queue_set_preload(void) -{ - uint8_t byte; - - if (queue.len > 0) { - byte = queue_pop(); - queue.preload = ((uint16_t) byte) | FLAG_PRELOADED; - } else - fatal("Tried to preload with empty queue\n"); -} - -void -queue_push8(uint8_t byte) -{ - if (queue.len < queue.size) { - queue.q[queue.front] = byte; - queue.front = (queue.front + 1) % queue.size; - queue.len++; - - if (queue.len == 3) - queue.delay = DELAY_WRITE; - else - queue.delay = DELAY_NONE; - } else - fatal("Queue overrun\n"); -} - -void -queue_push16(uint16_t word) -{ - queue_push8((uint8_t) (word & 0xff)); - queue_push8((uint8_t) ((word >> 8) & 0xff)); -} - -uint8_t -queue_pop(void) -{ - uint8_t byte = 0xff; - - if (queue.len > 0) { - byte = queue.q[queue.back]; - - queue.back = (queue.back + 1) % queue.size; - queue.len--; - - if (queue.len >= 3) - queue.delay = DELAY_READ; - else - queue.delay = DELAY_NONE; - } else - fatal("Queue underrun\n"); - - return byte; -} - -queue_delay_t -queue_get_delay(void) -{ - return queue.delay; -} - -void -queue_flush(void) -{ - memset(&queue, 0x00, sizeof(queue_t)); - - queue.delay = DELAY_NONE; -} - -void -queue_init(void) -{ - queue_flush(); - - if (is8086) - queue_set_size(6); - else - queue_set_size(4); -} diff --git a/src/cpu/808x/queue.h b/src/cpu/808x/queue.h deleted file mode 100644 index 7c1998295..000000000 --- a/src/cpu/808x/queue.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 86Box A hypervisor and IBM PC system emulator that specializes in - * running old operating systems and software designed for IBM - * PC systems and compatibles from 1981 through fairly recent - * system designs based on the PCI bus. - * - * This file is part of the 86Box distribution. - * - * Prefetch queue implementation header. - * - * Authors: gloriouscow, - * Miran Grca, - * - * Copyright 2023 gloriouscow. - * Copyright 2023 Miran Grca. - */ -#ifndef EMU_QUEUE_H -#define EMU_QUEUE_H - -typedef enum queue_delay_t { - DELAY_READ, - DELAY_WRITE, - DELAY_NONE -} queue_delay_t; - -#define FLAG_PRELOADED 0x8000 - -extern void queue_set_size(uintptr_t size); -extern uintptr_t queue_get_len(void); -extern int queue_is_full(void); -extern uint16_t queue_get_preload(void); -extern int queue_has_preload(void); -extern void queue_set_preload(void); -extern void queue_push8(uint8_t byte); -extern void queue_push16(uint16_t word); -extern uint8_t queue_pop(void); -extern queue_delay_t queue_get_delay(void); -extern void queue_flush(void); - -extern void queue_init(void); - -#endif /*EMU_QUEUE_H*/ diff --git a/src/cpu/CMakeLists.txt b/src/cpu/CMakeLists.txt index 27e89c523..bd03a5558 100644 --- a/src/cpu/CMakeLists.txt +++ b/src/cpu/CMakeLists.txt @@ -36,6 +36,3 @@ endif() add_subdirectory(softfloat) target_link_libraries(86Box softfloat) - -add_subdirectory(808x) -target_link_libraries(86Box 808x) From 65175f4d7ce0560033415535ae7aa19bf7b0c0ef Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 11 Oct 2023 23:18:59 +0200 Subject: [PATCH 38/50] No warnings. --- src/cpu/808x.c | 51 -------------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/src/cpu/808x.c b/src/cpu/808x.c index 8f92a1198..f8209def6 100644 --- a/src/cpu/808x.c +++ b/src/cpu/808x.c @@ -1233,19 +1233,6 @@ nearcall(uint16_t new_ip) push(&ret_ip); } -static void -farcall(uint16_t new_cs, uint16_t new_ip, int jump) -{ - if (jump) - wait(1, 0); - pfq_do_suspend(); - wait(3, 0); - push(&CS); - load_cs(new_cs); - wait(2, 0); - nearcall(new_ip); -} - static void farcall2(uint16_t new_cs, uint16_t new_ip) { @@ -1320,20 +1307,6 @@ sw_int(uint16_t intr) push(&old_ip); } -static void -int1(void) -{ - wait(2, 0); - intr_routine(1, 1); -} - -static void -int2(void) -{ - wait(2, 0); - intr_routine(2, 1); -} - static void int3(void) { @@ -1341,17 +1314,6 @@ int3(void) intr_routine(3, 0); } -static void -int_o(void) -{ - wait(4, 0); - - if (cpu_state.flags & V_FLAG) { - wait(2, 0); - intr_routine(4, 0); - } -} - void interrupt_808x(uint16_t addr) { @@ -2098,19 +2060,6 @@ farret(int far) set_ip(new_ip); } -/* The IRET microcode routine. */ -static void -iret_routine(void) -{ - wait(1, 0); - farret(1); - if (is_nec) - cpu_state.flags = pop() | 0x8002; - else - cpu_state.flags = pop() | 0x0002; - wait(1, 0); -} - /* Executes instructions up to the specified number of cycles. */ void execx86(int cycs) From 937edd6a74b71fcda8853359c18f7e69f3372093 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 12 Oct 2023 00:01:43 +0200 Subject: [PATCH 39/50] Bumped the version to 4.0.1. --- CMakeLists.txt | 2 +- debian/changelog | 4 ++-- src/include_make/86box/version.h | 4 ++-- src/unix/assets/86Box.spec | 4 ++-- src/unix/assets/net.86box.86Box.metainfo.xml | 2 +- vcpkg.json | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8af57ca9a..f6da36cc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ if(MUNT_EXTERNAL) endif() project(86Box - VERSION 4.0 + VERSION 4.0.1 DESCRIPTION "Emulator of x86-based systems" HOMEPAGE_URL "https://86box.net" LANGUAGES C CXX) diff --git a/debian/changelog b/debian/changelog index 1bca318dd..a65d161a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ -86box (4.0) UNRELEASED; urgency=medium +86box (4.0.1) UNRELEASED; urgency=medium * Bump release. - -- Jasmine Iwanek Tue, 28 Feb 2023 00:02:16 -0500 + -- Jasmine Iwanek Thu, 12 Oct 2023 00:00:31 +0200 diff --git a/src/include_make/86box/version.h b/src/include_make/86box/version.h index 96e81ce5f..4eb6e515f 100644 --- a/src/include_make/86box/version.h +++ b/src/include_make/86box/version.h @@ -22,12 +22,12 @@ #define EMU_NAME "86Box" #define EMU_NAME_W LSTR(EMU_NAME) -#define EMU_VERSION "4.0" +#define EMU_VERSION "4.0.1" #define EMU_VERSION_W LSTR(EMU_VERSION) #define EMU_VERSION_EX "3.50" /* frozen due to IDE re-detection behavior on Windows */ #define EMU_VERSION_MAJ 4 #define EMU_VERSION_MIN 0 -#define EMU_VERSION_PATCH 0 +#define EMU_VERSION_PATCH 1 #define EMU_BUILD_NUM 0 diff --git a/src/unix/assets/86Box.spec b/src/unix/assets/86Box.spec index 255eca87f..edb371f49 100644 --- a/src/unix/assets/86Box.spec +++ b/src/unix/assets/86Box.spec @@ -15,7 +15,7 @@ %global romver 4.0 Name: 86Box -Version: 4.0 +Version: 4.0.1 Release: 1%{?dist} Summary: Classic PC emulator License: GPLv2+ @@ -121,5 +121,5 @@ popd %{_datadir}/%{name}/roms %changelog -* Sat Aug 26 2023 Robert de Rooy 4.0-1 +* Thu Oct 12 2023 Robert de Rooy 4.0.1-1 - Bump release diff --git a/src/unix/assets/net.86box.86Box.metainfo.xml b/src/unix/assets/net.86box.86Box.metainfo.xml index 59671d0f9..f883aa0cd 100644 --- a/src/unix/assets/net.86box.86Box.metainfo.xml +++ b/src/unix/assets/net.86box.86Box.metainfo.xml @@ -10,7 +10,7 @@ net.86box.86Box.desktop - + diff --git a/vcpkg.json b/vcpkg.json index af8c75545..815ce2cd9 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { "name": "86box", - "version-string": "4.0", + "version-string": "4.0.1", "homepage": "https://86box.net/", "documentation": "https://86box.readthedocs.io/", "license": "GPL-2.0-or-later", From 4978b8c18944a0de12e76ef4ad6cf4dc935fea74 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 12 Oct 2023 00:28:18 +0200 Subject: [PATCH 40/50] ROM version. --- src/unix/assets/86Box.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unix/assets/86Box.spec b/src/unix/assets/86Box.spec index edb371f49..1dfcbb214 100644 --- a/src/unix/assets/86Box.spec +++ b/src/unix/assets/86Box.spec @@ -12,7 +12,7 @@ # After a successful build, you can install the RPMs as follows: # sudo dnf install RPMS/$(uname -m)/86Box-3* RPMS/noarch/86Box-roms* -%global romver 4.0 +%global romver 4.0.1 Name: 86Box Version: 4.0.1 From b44d9d71c5c887b67c79da7b70a1b7e0e2de5525 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 12 Oct 2023 01:22:00 +0200 Subject: [PATCH 41/50] Make the MS-5119 use a newer (the latest) BIOS revision, fixes #3684. --- src/machine/m_at_socket7_3v.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/machine/m_at_socket7_3v.c b/src/machine/m_at_socket7_3v.c index 3b983c05f..06974a96d 100644 --- a/src/machine/m_at_socket7_3v.c +++ b/src/machine/m_at_socket7_3v.c @@ -373,7 +373,7 @@ machine_at_ms5119_init(const machine_t *model) { int ret; - ret = bios_load_linear("roms/machines/ms5119/A37E.ROM", + ret = bios_load_linear("roms/machines/ms5119/A37EB.ROM", 0x000e0000, 131072, 0); if (bios_only || !ret) From 49e7ee8adc60884f26e2c29cc95fe0b0f845ff7c Mon Sep 17 00:00:00 2001 From: richardg867 Date: Wed, 11 Oct 2023 20:54:06 -0300 Subject: [PATCH 42/50] snd_sb: Naming consistency on the new cards --- src/sound/snd_sb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index cc3fc825d..fde2e98ba 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -3861,7 +3861,7 @@ const device_t sb_16_device = { }; const device_t sb_vibra16s_onboard_device = { - .name = "Sound Blaster Vibra 16S (On-Board)", + .name = "Sound Blaster ViBRA 16S (On-Board)", .internal_name = "sb_vibra16s_onboard", .flags = DEVICE_ISA | DEVICE_AT, .local = FM_YMF289B, @@ -3875,7 +3875,7 @@ const device_t sb_vibra16s_onboard_device = { }; const device_t sb_vibra16s_device = { - .name = "Sound Blaster Vibra 16S", + .name = "Sound Blaster ViBRA 16S", .internal_name = "sb_vibra16s", .flags = DEVICE_ISA | DEVICE_AT, .local = FM_YMF289B, @@ -3889,7 +3889,7 @@ const device_t sb_vibra16s_device = { }; const device_t sb_vibra16xv_device = { - .name = "Sound Blaster Vibra 16XV", + .name = "Sound Blaster ViBRA 16XV", .internal_name = "sb_vibra16xv", .flags = DEVICE_ISA | DEVICE_AT, .local = 0, @@ -3903,7 +3903,7 @@ const device_t sb_vibra16xv_device = { }; const device_t sb_vibra16c_onboard_device = { - .name = "Sound Blaster Vibra 16C (On-Board)", + .name = "Sound Blaster ViBRA 16C (On-Board)", .internal_name = "sb_vibra16c_onboard", .flags = DEVICE_ISA | DEVICE_AT, .local = 1, @@ -3917,7 +3917,7 @@ const device_t sb_vibra16c_onboard_device = { }; const device_t sb_vibra16c_device = { - .name = "Sound Blaster Vibra 16C", + .name = "Sound Blaster ViBRA 16C", .internal_name = "sb_vibra16c", .flags = DEVICE_ISA | DEVICE_AT, .local = 1, From 78ec4927d4b395e18b54bb6e08189799ef3fa21e Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 12 Oct 2023 02:07:43 +0200 Subject: [PATCH 43/50] Added more parameters, including to clear CMOS, and removed -O / --debugcfg that was not used at all. --- src/86box.c | 150 +++++++++++++++++++++++++++----------- src/include/86box/86box.h | 1 - 2 files changed, 106 insertions(+), 45 deletions(-) diff --git a/src/86box.c b/src/86box.c index 9d41bd344..320eda721 100644 --- a/src/86box.c +++ b/src/86box.c @@ -123,7 +123,6 @@ int tracing_on = 0; /* Commandline options. */ int dump_on_exit = 0; /* (O) dump regs on exit */ -int do_dump_config = 0; /* (O) dump config on load */ int start_in_fullscreen = 0; /* (O) start in fullscreen */ #ifdef _WIN32 int force_debug = 0; /* (O) force debug output */ @@ -141,10 +140,14 @@ char rom_path[1024] = { '\0' }; /* (O) full path to ROMs */ rom_path_t rom_paths = { "", NULL }; /* (O) full paths to ROMs */ char log_path[1024] = { '\0' }; /* (O) full path of logfile */ char vm_name[1024] = { '\0' }; /* (O) display name of the VM */ +int do_nothing = 0; +int dump_missing = 0; #ifdef USE_INSTRUMENT -uint8_t instru_enabled = 0; -uint64_t instru_run_ms = 0; +uint8_t instru_enabled = 0; +uint64_t instru_run_ms = 0; #endif +int clear_cmos = 0; +int clear_flash = 0; /* Configuration values. */ int window_remember; @@ -398,6 +401,31 @@ pc_log(const char *fmt, ...) # define pc_log(fmt, ...) #endif +static void +delete_nvr_file(uint8_t flash) +{ + char *fn = NULL; + int c; + + /* Set up the NVR file's name. */ + c = strlen(machine_get_internal_name()) + 5; + fn = (char *) malloc(c + 1); + + if (fn == NULL) + fatal("Error allocating memory for the removal of the %s file\n", + flash ? "BIOS flash" : "CMOS"); + + if (flash) + sprintf(fn, "%s.bin", machine_get_internal_name()); + else + sprintf(fn, "%s.nvr", machine_get_internal_name()); + + remove(nvr_path(fn)); + + free(fn); + fn = NULL; +} + /* * Perform initial startup of the PC. * @@ -479,34 +507,39 @@ usage: printf("\nUsage: 86box [options] [cfg-file]\n\n"); printf("Valid options are:\n\n"); - printf("-? or --help - show this information\n"); - printf("-C or --config path - set 'path' to be config file\n"); + printf("-? or --help - show this information\n"); + printf("-B or --clearflash - clears the BIOS flash file\n"); + printf("-C or --config path - set 'path' to be config file\n"); #ifdef _WIN32 - printf("-D or --debug - force debug output logging\n"); + printf("-D or --debug - force debug output logging\n"); #endif #if 0 - printf("-E or --nographic - forces the old behavior\n"); + printf("-E or --nographic - forces the old behavior\n"); #endif - printf("-F or --fullscreen - start in fullscreen mode\n"); - printf("-G or --lang langid - start with specified language (e.g. en-US, or system)\n"); + printf("-F or --fullscreen - start in fullscreen mode\n"); + printf("-G or --lang langid - start with specified language (e.g. en-US, or system)\n"); #ifdef _WIN32 - printf("-H or --hwnd id,hwnd - sends back the main dialog's hwnd\n"); + printf("-H or --hwnd id,hwnd - sends back the main dialog's hwnd\n"); #endif - printf("-I or --image d:path - load 'path' as floppy image on drive d\n"); - printf("-L or --logfile path - set 'path' to be the logfile\n"); - printf("-N or --noconfirm - do not ask for confirmation on quit\n"); - printf("-O or --dumpcfg - dump config file after loading\n"); - printf("-P or --vmpath path - set 'path' to be root for vm\n"); - printf("-R or --rompath path - set 'path' to be ROM path\n"); - printf("-S or --settings - show only the settings dialog\n"); - printf("-V or --vmname name - overrides the name of the running VM\n"); - printf("-Z or --lastvmpath - the last parameter is VM path rather than config\n"); + printf("-I or --image d:path - load 'path' as floppy image on drive d\n"); +#ifdef USE_INSTRUMENT + printf("-J or --instrument name - set 'name' to be the profiling instrument\n"); +#endif + printf("-L or --logfile path - set 'path' to be the logfile\n"); + printf("-M or --dumpmissing - dump missing machines and video cards\n"); + printf("-N or --noconfirm - do not ask for confirmation on quit\n"); + printf("-P or --vmpath path - set 'path' to be root for vm\n"); + printf("-Q or --clearnvr - clears the CMOS file\n"); + printf("-R or --rompath path - set 'path' to be ROM path\n"); + printf("-S or --settings - show only the settings dialog\n"); + printf("-V or --vmname name - overrides the name of the running VM\n"); + printf("-X or --clearboth - clears the CMOS and BIOS flash files\n"); + printf("-Y or --donothing - do not show any UI or run the emulation\n"); + printf("-Z or --lastvmpath - the last parameter is VM path rather than config\n"); printf("\nA config file can be specified. If none is, the default file will be used.\n"); return 0; } else if (!strcasecmp(argv[c], "--lastvmpath") || !strcasecmp(argv[c], "-Z")) { lvmp = 1; - } else if (!strcasecmp(argv[c], "--dumpcfg") || !strcasecmp(argv[c], "-O")) { - do_dump_config = 1; #ifdef _WIN32 } else if (!strcasecmp(argv[c], "--debug") || !strcasecmp(argv[c], "-D")) { force_debug = 1; @@ -569,6 +602,17 @@ usage: settings_only = 1; } else if (!strcasecmp(argv[c], "--noconfirm") || !strcasecmp(argv[c], "-N")) { confirm_exit_cmdl = 0; + } else if (!strcasecmp(argv[c], "--dumpmissing") || !strcasecmp(argv[c], "-M")) { + dump_missing = 1; + } else if (!strcasecmp(argv[c], "--donothing") || !strcasecmp(argv[c], "-Y")) { + do_nothing = 1; + } else if (!strcasecmp(argv[c], "--clearflash") || !strcasecmp(argv[c], "-B")) { + clear_flash = 1; + } else if (!strcasecmp(argv[c], "--clearnvr") || !strcasecmp(argv[c], "-Q")) { + clear_cmos = 1; + } else if (!strcasecmp(argv[c], "--clearboth") || !strcasecmp(argv[c], "-X")) { + clear_cmos = 1; + clear_flash = 1; #ifdef _WIN32 } else if (!strcasecmp(argv[c], "--hwnd") || !strcasecmp(argv[c], "-H")) { @@ -578,9 +622,8 @@ usage: uid = (uint32_t *) &unique_id; shwnd = (uint32_t *) &source_hwnd; sscanf(argv[++c], "%08X%08X,%08X%08X", uid + 1, uid, shwnd + 1, shwnd); - } else if (!strcasecmp(argv[c], "--lang") || !strcasecmp(argv[c], "-G")) { - #endif + } else if (!strcasecmp(argv[c], "--lang") || !strcasecmp(argv[c], "-G")) { // This function is currently unimplemented for *nix but has placeholders. lang_init = plat_language_code(argv[++c]); @@ -590,13 +633,13 @@ usage: // The return value of 0 only means that the code is invalid, // not related to that translation is exists or not for the // selected language. - } else if (!strcasecmp(argv[c], "--test")) { + } else if (!strcasecmp(argv[c], "--test") || !strcasecmp(argv[c], "-T")) { /* some (undocumented) test function here.. */ /* .. and then exit. */ return 0; #ifdef USE_INSTRUMENT - } else if (!strcasecmp(argv[c], "--instrument")) { + } else if (!strcasecmp(argv[c], "--instrument") || !strcasecmp(argv[c], "-J")) { if ((c + 1) == argc) goto usage; instru_enabled = 1; @@ -779,6 +822,18 @@ usage: /* Load the configuration file. */ config_load(); + /* Clear the CMOS and/or BIOS flash file, if we were started with + the relevant parameter(s). */ + if (clear_cmos) { + delete_nvr_file(0); + clear_cmos = 0; + } + + if (clear_flash) { + delete_nvr_file(1); + clear_flash = 0; + } + for (uint8_t i = 0; i < FDD_NUM; i++) { if (fn[i] != NULL) { if (strlen(fn[i]) <= 511) @@ -826,27 +881,29 @@ pc_init_modules(void) wchar_t temp[512]; char tempc[512]; -#ifdef PRINT_MISSING_MACHINES_AND_VIDEO_CARDS - c = m = 0; - while (machine_get_internal_name_ex(c) != NULL) { - m = machine_available(c); - if (!m) - pclog("Missing machine: %s\n", machine_getname_ex(c)); - c++; - } + if (dump_missing) { + dump_missing = 0; - c = m = 0; - while (video_get_internal_name(c) != NULL) { - memset(tempc, 0, sizeof(tempc)); - device_get_name(video_card_getdevice(c), 0, tempc); - if ((c > 1) && !(tempc[0])) - break; - m = video_card_available(c); - if (!m) - pclog("Missing video card: %s\n", tempc); - c++; + c = m = 0; + while (machine_get_internal_name_ex(c) != NULL) { + m = machine_available(c); + if (!m) + pclog("Missing machine: %s\n", machine_getname_ex(c)); + c++; + } + + c = m = 0; + while (video_get_internal_name(c) != NULL) { + memset(tempc, 0, sizeof(tempc)); + device_get_name(video_card_getdevice(c), 0, tempc); + if ((c > 1) && !(tempc[0])) + break; + m = video_card_available(c); + if (!m) + pclog("Missing video card: %s\n", tempc); + c++; + } } -#endif pc_log("Scanning for ROM images:\n"); c = m = 0; @@ -945,6 +1002,11 @@ pc_init_modules(void) machine_status_init(); + if (do_nothing) { + do_nothing = 0; + exit(-1); + } + return 1; } diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index 471c0616d..62a57344e 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -78,7 +78,6 @@ extern "C" { extern uint32_t lang_sys; /* (-) system language code */ extern int dump_on_exit; /* (O) dump regs on exit*/ -extern int do_dump_config; /* (O) dump cfg after load */ extern int start_in_fullscreen; /* (O) start in fullscreen */ #ifdef _WIN32 extern int force_debug; /* (O) force debug output */ From 90d9a5b858ff299779143de55ce4eed9536fedc1 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 12 Oct 2023 04:52:53 +0200 Subject: [PATCH 44/50] Moved the mouse uncapture key combination to variables for future reconfigurability. --- src/device/keyboard.c | 26 ++++++++++++++++++-------- src/include/86box/86box.h | 16 +++++++++++----- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/device/keyboard.c b/src/device/keyboard.c index 15eb06035..ade4b17e4 100644 --- a/src/device/keyboard.c +++ b/src/device/keyboard.c @@ -29,6 +29,21 @@ #include "cpu.h" int keyboard_scan; + +#ifdef _WIN32 +/* Windows: F8+F12 */ +uint16_t key_prefix_1 = 0x042; /* F8 */ +uint16_t key_prefix_2 = 0x000; /* Invalid */ +uint16_t key_uncapture_1 = 0x058; /* F12 */ +uint16_t key_uncapture_2 = 0x000; /* Invalid */ +#else +/* WxWidgets cannot do two regular keys.. CTRL+END */ +uint16_t key_prefix_1 = 0x01d; /* Left Ctrl */ +uint16_t key_prefix_2 = 0x11d; /* Right Ctrl */ +uint16_t key_uncapture_1 = 0x04f; /* Numpad End */ +uint16_t key_uncapture_2 = 0x14f; /* End */ +#endif + void (*keyboard_send)(uint16_t val); static int recv_key[512]; /* keyboard input buffer */ @@ -350,15 +365,10 @@ keyboard_isfsexit_up(void) return (!recv_key[0x01d] && !recv_key[0x11d] && !recv_key[0x038] && !recv_key[0x138] && !recv_key[0x051] && !recv_key[0x151]); } -/* Do we have F8-F12 in the keyboard buffer? */ +/* Do we have the mouse uncapture combination in the keyboard buffer? */ int keyboard_ismsexit(void) { -#ifdef _WIN32 - /* Windows: F8+F12 */ - return (recv_key[0x042] && recv_key[0x058]); -#else - /* WxWidgets cannot do two regular keys.. CTRL+END */ - return ((recv_key[0x01D] || recv_key[0x11D]) && (recv_key[0x04F] || recv_key[0x14F])); -#endif + return ((recv_key[key_prefix_1] || recv_key[key_prefix_2]) && + (recv_key[key_uncapture_1] || recv_key[key_uncapture_2])); } diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index 62a57344e..9c83843b5 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -146,13 +146,19 @@ extern int enable_discord; /* (C) enable Discord integration */ extern int fixed_size_x; extern int fixed_size_y; -extern double mouse_sensitivity; /* (C) Mouse sensitivity scale */ +extern double mouse_sensitivity; /* (C) Mouse sensitivity scale */ #ifdef _Atomic -extern _Atomic double mouse_x_error; /* Mouse error accumulator - Y */ -extern _Atomic double mouse_y_error; /* Mouse error accumulator - Y */ +extern _Atomic double mouse_x_error; /* Mouse error accumulator - Y */ +extern _Atomic double mouse_y_error; /* Mouse error accumulator - Y */ #endif -extern int pit_mode; /* (C) force setting PIT mode */ -extern int fm_driver; /* (C) select FM sound driver */ +extern int pit_mode; /* (C) force setting PIT mode */ +extern int fm_driver; /* (C) select FM sound driver */ + +/* Keyboard variables for future key combination redefinition. */ +extern uint16_t key_prefix_1; +extern uint16_t key_prefix_2; +extern uint16_t key_uncapture_1; +extern uint16_t key_uncapture_2; extern char exe_path[2048]; /* path (dir) of executable */ extern char usr_path[1024]; /* path (dir) of user data */ From e13e854944c6046f39d03cf8c38a4e27254fbcc3 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 12 Oct 2023 05:08:11 +0200 Subject: [PATCH 45/50] Added support for a second prefix. --- src/device/keyboard.c | 21 +++++++++++++++------ src/include/86box/86box.h | 6 ++++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/device/keyboard.c b/src/device/keyboard.c index ade4b17e4..5f9986d7b 100644 --- a/src/device/keyboard.c +++ b/src/device/keyboard.c @@ -32,14 +32,18 @@ int keyboard_scan; #ifdef _WIN32 /* Windows: F8+F12 */ -uint16_t key_prefix_1 = 0x042; /* F8 */ -uint16_t key_prefix_2 = 0x000; /* Invalid */ +uint16_t key_prefix_1_1 = 0x042; /* F8 */ +uint16_t key_prefix_1_2 = 0x000; /* Invalid */ +uint16_t key_prefix_2_1 = 0x000; /* Invalid */ +uint16_t key_prefix_2_2 = 0x000; /* Invalid */ uint16_t key_uncapture_1 = 0x058; /* F12 */ uint16_t key_uncapture_2 = 0x000; /* Invalid */ #else /* WxWidgets cannot do two regular keys.. CTRL+END */ -uint16_t key_prefix_1 = 0x01d; /* Left Ctrl */ -uint16_t key_prefix_2 = 0x11d; /* Right Ctrl */ +uint16_t key_prefix_1_1 = 0x01d; /* Left Ctrl */ +uint16_t key_prefix_1_2 = 0x11d; /* Right Ctrl */ +uint16_t key_prefix_2_1 = 0x000; /* Invalid */ +uint16_t key_prefix_2_2 = 0x000; /* Invalid */ uint16_t key_uncapture_1 = 0x04f; /* Numpad End */ uint16_t key_uncapture_2 = 0x14f; /* End */ #endif @@ -369,6 +373,11 @@ keyboard_isfsexit_up(void) int keyboard_ismsexit(void) { - return ((recv_key[key_prefix_1] || recv_key[key_prefix_2]) && - (recv_key[key_uncapture_1] || recv_key[key_uncapture_2])); + if ((key_prefix_2_1 != 0x000) || (key_prefix_2_2 != 0x000)) + return ((recv_key[key_prefix_1_1] || recv_key[key_prefix_1_2]) && + (recv_key[key_prefix_2_1] || recv_key[key_prefix_2_2]) && + (recv_key[key_uncapture_1] || recv_key[key_uncapture_2])); + else + return ((recv_key[key_prefix_1_1] || recv_key[key_prefix_1_2]) && + (recv_key[key_uncapture_1] || recv_key[key_uncapture_2])); } diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index 9c83843b5..e0ff0e1d9 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -155,8 +155,10 @@ extern int pit_mode; /* (C) force setting PIT mode */ extern int fm_driver; /* (C) select FM sound driver */ /* Keyboard variables for future key combination redefinition. */ -extern uint16_t key_prefix_1; -extern uint16_t key_prefix_2; +extern uint16_t key_prefix_1_1; +extern uint16_t key_prefix_1_2; +extern uint16_t key_prefix_2_1; +extern uint16_t key_prefix_2_2; extern uint16_t key_uncapture_1; extern uint16_t key_uncapture_2; From 15104475a193257a5f79c2e59047be80367dc773 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 12 Oct 2023 05:16:37 +0200 Subject: [PATCH 46/50] Added --keycodes / -K to allow redefining the mouse uncapture key combination. --- src/86box.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/86box.c b/src/86box.c index 320eda721..7ff4ff4c7 100644 --- a/src/86box.c +++ b/src/86box.c @@ -525,6 +525,7 @@ usage: #ifdef USE_INSTRUMENT printf("-J or --instrument name - set 'name' to be the profiling instrument\n"); #endif + printf("-K or --keycodes codes - set 'codes' to be the uncapture combination\n"); printf("-L or --logfile path - set 'path' to be the logfile\n"); printf("-M or --dumpmissing - dump missing machines and video cards\n"); printf("-N or --noconfirm - do not ask for confirmation on quit\n"); @@ -610,6 +611,13 @@ usage: clear_flash = 1; } else if (!strcasecmp(argv[c], "--clearnvr") || !strcasecmp(argv[c], "-Q")) { clear_cmos = 1; + } else if (!strcasecmp(argv[c], "--keycodes") || !strcasecmp(argv[c], "-K")) { + if ((c + 1) == argc) + goto usage; + + sscanf(argv[++c], "%03hX,%03hX,%03hX,%03hX,%03hX,%03hX", + &key_prefix_1_1, &key_prefix_1_2, &key_prefix_2_1, &key_prefix_2_2, + &key_uncapture_1, &key_uncapture_2); } else if (!strcasecmp(argv[c], "--clearboth") || !strcasecmp(argv[c], "-X")) { clear_cmos = 1; clear_flash = 1; From be4d1600245df995df677696a0a7f74108887b5e Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 13 Oct 2023 06:00:38 +0200 Subject: [PATCH 47/50] Fixed the state of the 486 DX2 WB CPU's used by the PC 330. --- src/cpu/cpu.c | 5 ++++- src/cpu/cpu_table.c | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 0f12cf773..848826264 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -1920,7 +1920,10 @@ cpu_CPUID(void) EDX = 0x49656e69; ECX = 0x6c65746e; } else if (EAX == 1) { - EAX = CPUID; + if ((CPUID == 0x0436) && (cr0 & (1 << 29))) + EAX = 0x0470; + else + EAX = CPUID; EBX = ECX = 0; EDX = CPUID_FPU | CPUID_VME; } else diff --git a/src/cpu/cpu_table.c b/src/cpu/cpu_table.c index cec3c4874..194089f72 100644 --- a/src/cpu/cpu_table.c +++ b/src/cpu/cpu_table.c @@ -439,13 +439,13 @@ const cpu_family_t cpu_families[] = { {"", 0} } }, { - .package = CPU_PKG_SOCKET3_PC330, + .package = CPU_PKG_SOCKET1 | CPU_PKG_SOCKET3_PC330, .manufacturer = "Intel", - .name = "i486DX2", + .name = "i486DX2 WB", .internal_name = "i486dx2_pc330", .cpus = (const CPU[]) { - {"50", CPU_i486DX_SLENH, fpus_internal, 50000000, 2, 5000, 0x470, 0x470, 0, CPU_SUPPORTS_DYNAREC, 8, 8,6,6, 6}, - {"66", CPU_i486DX_SLENH, fpus_internal, 66666666, 2, 5000, 0x470, 0x470, 0, CPU_SUPPORTS_DYNAREC, 12,12,6,6, 8}, + {"50", CPU_i486DX_SLENH, fpus_internal, 50000000, 2, 5000, 0x436, 0x436, 0, CPU_SUPPORTS_DYNAREC, 8, 8,6,6, 6}, + {"66", CPU_i486DX_SLENH, fpus_internal, 66666666, 2, 5000, 0x436, 0x436, 0, CPU_SUPPORTS_DYNAREC, 12,12,6,6, 8}, {"", 0} } }, { From 35ea25914fdb137079d44a7f09e82ea6afe85213 Mon Sep 17 00:00:00 2001 From: Alexander Babikov <2708460+lemondrops@users.noreply.github.com> Date: Fri, 13 Oct 2023 15:47:01 +0500 Subject: [PATCH 48/50] Point feature requests to discussions and machine requests to a dedicated issue --- .github/ISSUE_TEMPLATE/config.yml | 7 +++++-- .github/ISSUE_TEMPLATE/feature_request.md | 20 -------------------- 2 files changed, 5 insertions(+), 22 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index cc1ec7f8e..c03c50764 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,8 @@ blank_issues_enabled: false contact_links: - - name: Question + - name: Machine Request + url: https://github.com/86Box/86Box/issues/3577#issue-comment-box + about: Please submit machine addition requests under this tracking issue. + - name: Feature Request or Question url: https://github.com/86Box/86Box/discussions - about: Please ask and answer questions here. + about: Please submit feature requests and ask questions here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 4fe86d5ec..000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: feature -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. From 5471b6eec70dd0ca22ae8ee8cb23c46677b01925 Mon Sep 17 00:00:00 2001 From: Alexander Babikov <2708460+lemondrops@users.noreply.github.com> Date: Fri, 13 Oct 2023 15:47:37 +0500 Subject: [PATCH 49/50] Mark most fields in the bug report form as mandatory --- .github/ISSUE_TEMPLATE/bug_report.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 95905f6aa..cdbc0a56f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -12,26 +12,36 @@ body: label: What happened? description: Also tell us, what did you expect to happen? placeholder: Tell us what you see! + validations: + required: true - type: textarea attributes: label: Configuration file description: Please copy and paste your machine configuration file (`86box.cfg`). This will be automatically formatted into code, so no need for backticks. render: ini + validations: + required: true - type: input attributes: label: Operating system description: What is your host operating system? placeholder: e.g. Windows 10 + validations: + required: true - type: input attributes: label: CPU description: What is your host CPU? placeholder: e.g. AMD Ryzen 5 5600G + validations: + required: true - type: input attributes: label: 86Box version description: What version of 86Box are you running? (Saying "Latest from Jenkins" is not helpful.) placeholder: e.g. v4.0 build 5000 + validations: + required: true - type: dropdown attributes: label: Build architecture @@ -44,6 +54,8 @@ body: - macOS - Universal (Intel and Apple Silicon) - Windows - x64 (64-bit) - Windows - x86 (32-bit) + validations: + required: true - type: checkboxes attributes: label: Build type @@ -60,6 +72,8 @@ body: - Manager auto-update - I built 86Box myself (please tell us more about your build configuration) - I got 86Box from a third party repository (please tell us where) + validations: + required: true - type: textarea attributes: label: Additional context From ecf5d4e65214b929399ee0b141c550b11716c267 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Fri, 13 Oct 2023 13:10:05 -0400 Subject: [PATCH 50/50] Fix win32 mingw makefile builds --- src/win/Makefile.mingw | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 7cb5ec3a7..e02b9c25c 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -571,8 +571,6 @@ MAINOBJ := 86box.o config.o log.o random.o timer.o io.o acpi.o apm.o dma.o ddma. MEMOBJ := catalyst_flash.o i2c_eeprom.o intel_flash.o mem.o mmu_2386.o rom.o row.o \ smram.o spd.o sst_flash.o -CPU808XOBJ := queue.o - CPUOBJ := $(DYNARECOBJ) \ $(CGTOBJ) \ cpu.o cpu_table.o fpu.o x86.o \ @@ -801,7 +799,7 @@ ifeq ($(RTMIDI), y) SNDOBJ += midi_rtmidi.o endif -OBJ := $(MAINOBJ) $(CPU808XOBJ) $(CPUOBJ) $(CHIPSETOBJ) $(MCHOBJ) $(DEVOBJ) $(MEMOBJ) \ +OBJ := $(MAINOBJ) $(CPUOBJ) $(CHIPSETOBJ) $(MCHOBJ) $(DEVOBJ) $(MEMOBJ) \ $(FDDOBJ) $(GAMEOBJ) $(CDROMOBJ) $(ZIPOBJ) $(MOOBJ) $(HDDOBJ) $(MINIVHDOBJ) \ $(NETOBJ) $(PRINTOBJ) $(SCSIOBJ) $(SIOOBJ) $(SNDOBJ) $(VIDOBJ) $(VOODOOOBJ) \ $(PLATOBJ) $(UIOBJ) $(FSYNTHOBJ) $(MUNTOBJ) $(DEVBROBJ) $(MINITRACEOBJ) $(THREADOBJ)