VGA dummy adapter

This commit is contained in:
copy 2014-05-14 00:15:15 +02:00
parent 06f9311a17
commit e46a60cdcb

View file

@ -100,6 +100,11 @@ function VGAScreen(dev, adapter, vga_memory_size)
plane2,
plane3;
if(adapter === undefined)
{
adapter = new VGADummyAdapter();
}
// 4 times 64k
this._vga_memory = null;
@ -138,7 +143,7 @@ function VGAScreen(dev, adapter, vga_memory_size)
this._init = function()
{
if(vga_memory_size < 4 * VGA_BANK_SIZE)
if(vga_memory_size === undefined || vga_memory_size < 4 * VGA_BANK_SIZE)
{
vga_memory_size = 4 * VGA_BANK_SIZE;
dbg_log("vga memory size rounded up to " + vga_memory_size, LOG_VGA);
@ -1157,3 +1162,18 @@ function VGAScreen(dev, adapter, vga_memory_size)
this._init();
}
/** @constructor */
function VGADummyAdapter()
{
this.put_pixel_linear = function() {};
this.put_char = function() {};
this.put_pixel = function() {};
this.set_mode = function() {};
this.clear_screen = function() {};
this.update_cursor = function() {};
this.update_cursor_scanline = function() {};
this.set_size_graphical = function() {};
this.timer_text = function() {};
this.timer_graphical = function() {};
this.set_size_text = function() {};
}