Return correct CRTC index value in 3D4 read (VGA)

Fixes #190
This commit is contained in:
Ernest Wong 2018-02-14 17:05:28 +13:00 committed by Fabian
parent ea5d1f54ef
commit 3dd4d1d603

View file

@ -317,9 +317,9 @@ function VGAScreen(cpu, bus, vga_memory_size)
io.register_read(0x3CC, this, this.port3CC_read);
io.register_write_consecutive(0x3D4, this, this.port3D4_write, this.port3D5_write);
io.register_read(0x3D4, this, this.port3D4_read);
io.register_read(0x3D5, this, this.port3D5_read);
io.register_read(0x3D4, this, function() { dbg_log("3D4 read", LOG_VGA); return 0; });
io.register_read(0x3CA, this, function() { dbg_log("3CA read", LOG_VGA); return 0; });
io.register_read(0x3DA, this, this.port3DA_read);
@ -1723,9 +1723,16 @@ VGAScreen.prototype.port3CF_read = function()
VGAScreen.prototype.port3D4_write = function(register)
{
dbg_log("3D4 / crtc index: " + register, LOG_VGA);
this.index_crtc = register;
};
VGAScreen.prototype.port3D4_read = function()
{
dbg_log("3D4 read / crtc index: " + this.index_crtc, LOG_VGA);
return this.index_crtc;
};
/**
* CRT controller register writes
* @see {@link http://www.osdever.net/FreeVGA/vga/crtcreg.htm}