From cf61ac635a777c78ff8b9dd0a4739d5d0a4c6577 Mon Sep 17 00:00:00 2001 From: Fabian Date: Mon, 21 Nov 2022 11:23:00 -0600 Subject: [PATCH] vga: correctly advertise the latest bochs version, and make it r/w (fix #768) --- src/vga.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/vga.js b/src/vga.js index a5b9c8d7..b1ce6760 100644 --- a/src/vga.js +++ b/src/vga.js @@ -191,6 +191,9 @@ function VGAScreen(cpu, bus, vga_memory_size) */ this.latch_dword = 0; + /** @type {number} */ + this.svga_version = 0xB0C5; + /** @type {number} */ this.svga_width = 0; @@ -1998,6 +2001,16 @@ VGAScreen.prototype.port1CF_write = function(value) switch(this.dispi_index) { + case 0: + if(value >= 0xB0C0 && value <= 0xB0C5) + { + this.svga_version = value; + } + else + { + dbg_log("Invalid version value: " + h(value), LOG_VGA); + } + break; case 1: this.svga_width = value; if(this.svga_width > MAX_XRES) @@ -2080,8 +2093,7 @@ VGAScreen.prototype.svga_register_read = function(n) switch(n) { case 0: - // id - return 0xB0C0; + return this.svga_version; case 1: return this.dispi_enable_value & 2 ? MAX_XRES : this.svga_width; case 2: