mirror of
https://github.com/copy/v86.git
synced 2025-12-31 04:23:15 +00:00
VGA dummy adapter
This commit is contained in:
parent
06f9311a17
commit
e46a60cdcb
1 changed files with 21 additions and 1 deletions
22
src/vga.js
22
src/vga.js
|
|
@ -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() {};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue