vga: correctly advertise the latest bochs version, and make it r/w (fix #768)
This commit is contained in:
parent
baffa6c0d6
commit
cf61ac635a
16
src/vga.js
16
src/vga.js
|
@ -191,6 +191,9 @@ function VGAScreen(cpu, bus, vga_memory_size)
|
||||||
*/
|
*/
|
||||||
this.latch_dword = 0;
|
this.latch_dword = 0;
|
||||||
|
|
||||||
|
/** @type {number} */
|
||||||
|
this.svga_version = 0xB0C5;
|
||||||
|
|
||||||
/** @type {number} */
|
/** @type {number} */
|
||||||
this.svga_width = 0;
|
this.svga_width = 0;
|
||||||
|
|
||||||
|
@ -1998,6 +2001,16 @@ VGAScreen.prototype.port1CF_write = function(value)
|
||||||
|
|
||||||
switch(this.dispi_index)
|
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:
|
case 1:
|
||||||
this.svga_width = value;
|
this.svga_width = value;
|
||||||
if(this.svga_width > MAX_XRES)
|
if(this.svga_width > MAX_XRES)
|
||||||
|
@ -2080,8 +2093,7 @@ VGAScreen.prototype.svga_register_read = function(n)
|
||||||
switch(n)
|
switch(n)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
// id
|
return this.svga_version;
|
||||||
return 0xB0C0;
|
|
||||||
case 1:
|
case 1:
|
||||||
return this.dispi_enable_value & 2 ? MAX_XRES : this.svga_width;
|
return this.dispi_enable_value & 2 ? MAX_XRES : this.svga_width;
|
||||||
case 2:
|
case 2:
|
||||||
|
|
Loading…
Reference in a new issue