From 403203cd6fb02e2014dbb8da72803cfa3df51ec4 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Fri, 26 Apr 2024 18:50:06 +0600 Subject: [PATCH] More necessary changes --- src/include/86box/video.h | 3 +++ src/video/vid_bochs_vbe.c | 17 ++++++++++++++++- src/video/vid_table.c | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/include/86box/video.h b/src/include/86box/video.h index bf36bf7de0..18055eb962 100644 --- a/src/include/86box/video.h +++ b/src/include/86box/video.h @@ -583,6 +583,9 @@ extern const device_t wy700_device; extern const device_t chips_69000_device; extern const device_t chips_69000_onboard_device; +/* Bochs */ +extern const device_t bochs_svga_device; + #endif #endif /*EMU_VIDEO_H*/ diff --git a/src/video/vid_bochs_vbe.c b/src/video/vid_bochs_vbe.c index e25ab71e57..b60c74791f 100644 --- a/src/video/vid_bochs_vbe.c +++ b/src/video/vid_bochs_vbe.c @@ -239,6 +239,21 @@ bochs_vbe_outw(uint16_t addr, uint16_t val, void *priv) svga_recalctimings(&bochs_vbe->svga); break; + case VBE_DISPI_INDEX_BANK: + { + uint16_t rw_mode = VBE_DISPI_BANK_RW; // compatibility mode + if ((val & VBE_DISPI_BANK_RW) != 0) { + rw_mode = (val & VBE_DISPI_BANK_RW); + } + if (val & VBE_DISPI_BANK_RD) { + bochs_vbe->svga.read_bank = (val & 0x1ff) * (bochs_vbe->bank_gran << 10); + } + if (val & VBE_DISPI_BANK_WR) { + bochs_vbe->svga.write_bank = (val & 0x1ff) * (bochs_vbe->bank_gran << 10); + } + break; + } + case VBE_DISPI_INDEX_ENABLE: { uint32_t new_bank_gran = 64; if ((val & VBE_DISPI_ENABLED) && !(bochs_vbe->vbe_regs[VBE_DISPI_ENABLED] & VBE_DISPI_ENABLED)) { @@ -413,7 +428,7 @@ bochs_vbe_force_redraw(void *priv) bochs_vbe->svga.fullchange = changeframecount; } -const device_t vga_device = { +const device_t bochs_svga_device = { .name = "Bochs SVGA", .internal_name = "bochs_svga", .flags = DEVICE_PCI, diff --git a/src/video/vid_table.c b/src/video/vid_table.c index e526216c3e..6d1aabca44 100644 --- a/src/video/vid_table.c +++ b/src/video/vid_table.c @@ -271,6 +271,7 @@ video_cards[] = { { &compaq_voodoo_3_3500_agp_device }, { &voodoo_3_3500_se_agp_device }, { &voodoo_3_3500_si_agp_device }, + { &bochs_svga_device }, { NULL } // clang-format on };