Trailing whitespace

This commit is contained in:
copy 2015-09-16 03:25:09 +02:00
parent 719aa81906
commit d26801457b
11 changed files with 132 additions and 131 deletions

View file

@ -64,7 +64,7 @@ CPU.prototype.adc = function(dest_operand, source_operand, op_size)
this.last_op1 = dest_operand;
this.last_op2 = source_operand;
this.last_add_result = this.last_result = (dest_operand + source_operand | 0) + cf | 0;
this.last_op_size = op_size;
this.flags_changed = flags_all;
@ -86,7 +86,7 @@ CPU.prototype.sub = function(dest_operand, source_operand, op_size)
this.last_add_result = dest_operand;
this.last_op2 = source_operand;
this.last_op1 = this.last_result = dest_operand - source_operand | 0;
this.last_op_size = op_size;
this.flags_changed = flags_all;
@ -100,7 +100,7 @@ CPU.prototype.sbb = function(dest_operand, source_operand, op_size)
this.last_op2 = source_operand;
this.last_op1 = this.last_result = dest_operand - source_operand - cf | 0;
this.last_op_size = op_size;
this.flags_changed = flags_all;
return this.last_result;
@ -125,7 +125,7 @@ CPU.prototype.inc = function(dest_operand, op_size)
this.last_op2 = 1;
this.last_add_result = this.last_result = dest_operand + 1 | 0;
this.last_op_size = op_size;
this.flags_changed = flags_all & ~1;
return this.last_result;
@ -138,7 +138,7 @@ CPU.prototype.dec = function(dest_operand, op_size)
this.last_op2 = 1;
this.last_op1 = this.last_result = dest_operand - 1 | 0;
this.last_op_size = op_size;
this.flags_changed = flags_all & ~1;
return this.last_result;
@ -155,7 +155,7 @@ CPU.prototype.neg32 = function(dest) { return this.neg(dest, OPSIZE_32); }
CPU.prototype.neg = function(dest_operand, op_size)
{
this.last_op1 = this.last_result = -dest_operand | 0;
this.flags_changed = flags_all;
this.last_add_result = 0;
this.last_op2 = dest_operand;
@ -427,7 +427,7 @@ CPU.prototype.div16 = function(source_operand)
{
dbg_assert(source_operand >= 0 && source_operand < 0x10000);
var
var
target_operand = (this.reg16[reg_ax] | this.reg16[reg_dx] << 16) >>> 0,
result = target_operand / source_operand | 0;
@ -448,13 +448,13 @@ CPU.prototype.idiv16 = function(source_operand)
var target_operand = this.reg16[reg_ax] | (this.reg16[reg_dx] << 16),
result = target_operand / source_operand | 0;
if(result >= 0x8000 || result <= -0x8001 || source_operand === 0)
{
this.trigger_de();
}
else
{
{
this.reg16[reg_ax] = result;
this.reg16[reg_dx] = target_operand % source_operand;
}
@ -587,7 +587,7 @@ CPU.prototype.idiv32 = function(source_operand)
this.trigger_de();
}
else
{
{
this.reg32s[reg_eax] = result;
this.reg32s[reg_edx] = mod;
}
@ -790,7 +790,7 @@ CPU.prototype.xor32 = function(dest, src) { return this.xor(dest, src, OPSIZE_32
CPU.prototype.and = function(dest_operand, source_operand, op_size)
{
this.last_result = dest_operand & source_operand;
this.last_op_size = op_size;
this.flags &= ~1 & ~flag_overflow & ~flag_adjust;
this.flags_changed = flags_all & ~1 & ~flag_overflow & ~flag_adjust;
@ -801,7 +801,7 @@ CPU.prototype.and = function(dest_operand, source_operand, op_size)
CPU.prototype.or = function(dest_operand, source_operand, op_size)
{
this.last_result = dest_operand | source_operand;
this.last_op_size = op_size;
this.flags &= ~1 & ~flag_overflow & ~flag_adjust;
this.flags_changed = flags_all & ~1 & ~flag_overflow & ~flag_adjust;
@ -812,7 +812,7 @@ CPU.prototype.or = function(dest_operand, source_operand, op_size)
CPU.prototype.xor = function(dest_operand, source_operand, op_size)
{
this.last_result = dest_operand ^ source_operand;
this.last_op_size = op_size;
this.flags &= ~1 & ~flag_overflow & ~flag_adjust;
this.flags_changed = flags_all & ~1 & ~flag_overflow & ~flag_adjust;
@ -836,7 +836,7 @@ CPU.prototype.rol8 = function(dest_operand, count)
var result = dest_operand << count | dest_operand >> (8 - count);
this.flags_changed &= ~1 & ~flag_overflow;
this.flags = (this.flags & ~1 & ~flag_overflow)
this.flags = (this.flags & ~1 & ~flag_overflow)
| (result & 1)
| (result << 11 ^ result << 4) & flag_overflow;
@ -854,7 +854,7 @@ CPU.prototype.rol16 = function(dest_operand, count)
var result = dest_operand << count | dest_operand >> (16 - count);
this.flags_changed &= ~1 & ~flag_overflow;
this.flags = (this.flags & ~1 & ~flag_overflow)
this.flags = (this.flags & ~1 & ~flag_overflow)
| (result & 1)
| (result << 11 ^ result >> 4) & flag_overflow;
@ -871,7 +871,7 @@ CPU.prototype.rol32 = function(dest_operand, count)
var result = dest_operand << count | dest_operand >>> (32 - count);
this.flags_changed &= ~1 & ~flag_overflow;
this.flags = (this.flags & ~1 & ~flag_overflow)
this.flags = (this.flags & ~1 & ~flag_overflow)
| (result & 1)
| (result << 11 ^ result >> 20) & flag_overflow;
@ -889,7 +889,7 @@ CPU.prototype.rcl8 = function(dest_operand, count)
var result = dest_operand << count | this.getcf() << (count - 1) | dest_operand >> (9 - count);
this.flags_changed &= ~1 & ~flag_overflow;
this.flags = (this.flags & ~1 & ~flag_overflow)
this.flags = (this.flags & ~1 & ~flag_overflow)
| (result >> 8 & 1)
| (result << 3 ^ result << 4) & flag_overflow;
@ -907,8 +907,8 @@ CPU.prototype.rcl16 = function(dest_operand, count)
var result = dest_operand << count | this.getcf() << (count - 1) | dest_operand >> (17 - count);
this.flags_changed &= ~1 & ~flag_overflow;
this.flags = (this.flags & ~1 & ~flag_overflow)
| (result >> 16 & 1)
this.flags = (this.flags & ~1 & ~flag_overflow)
| (result >> 16 & 1)
| (result >> 5 ^ result >> 4) & flag_overflow;
return result;
@ -946,12 +946,12 @@ CPU.prototype.ror8 = function(dest_operand, count)
var result = dest_operand >> count | dest_operand << (8 - count);
this.flags_changed &= ~1 & ~flag_overflow;
this.flags = (this.flags & ~1 & ~flag_overflow)
this.flags = (this.flags & ~1 & ~flag_overflow)
| (result >> 7 & 1)
| (result << 4 ^ result << 5) & flag_overflow;
return result;
}
}
CPU.prototype.ror16 = function(dest_operand, count)
{
@ -964,8 +964,8 @@ CPU.prototype.ror16 = function(dest_operand, count)
var result = dest_operand >> count | dest_operand << (16 - count);
this.flags_changed &= ~1 & ~flag_overflow;
this.flags = (this.flags & ~1 & ~flag_overflow)
| (result >> 15 & 1)
this.flags = (this.flags & ~1 & ~flag_overflow)
| (result >> 15 & 1)
| (result >> 4 ^ result >> 3) & flag_overflow;
return result;
@ -981,8 +981,8 @@ CPU.prototype.ror32 = function(dest_operand, count)
var result = dest_operand >>> count | dest_operand << (32 - count);
this.flags_changed &= ~1 & ~flag_overflow;
this.flags = (this.flags & ~1 & ~flag_overflow)
| (result >> 31 & 1)
this.flags = (this.flags & ~1 & ~flag_overflow)
| (result >> 31 & 1)
| (result >> 20 ^ result >> 19) & flag_overflow;
return result;
@ -999,12 +999,12 @@ CPU.prototype.rcr8 = function(dest_operand, count)
var result = dest_operand >> count | this.getcf() << (8 - count) | dest_operand << (9 - count);
this.flags_changed &= ~1 & ~flag_overflow;
this.flags = (this.flags & ~1 & ~flag_overflow)
this.flags = (this.flags & ~1 & ~flag_overflow)
| (result >> 8 & 1)
| (result << 4 ^ result << 5) & flag_overflow;
return result;
}
}
CPU.prototype.rcr16 = function(dest_operand, count)
{
@ -1017,7 +1017,7 @@ CPU.prototype.rcr16 = function(dest_operand, count)
var result = dest_operand >> count | this.getcf() << (16 - count) | dest_operand << (17 - count);
this.flags_changed &= ~1 & ~flag_overflow;
this.flags = (this.flags & ~1 & ~flag_overflow)
this.flags = (this.flags & ~1 & ~flag_overflow)
| (result >> 16 & 1)
| (result >> 4 ^ result >> 3) & flag_overflow;
@ -1039,7 +1039,7 @@ CPU.prototype.rcr32 = function(dest_operand, count)
}
this.flags_changed &= ~1 & ~flag_overflow;
this.flags = (this.flags & ~1 & ~flag_overflow)
this.flags = (this.flags & ~1 & ~flag_overflow)
| (dest_operand >> (count - 1) & 1)
| (result >> 20 ^ result >> 19) & flag_overflow;
@ -1057,7 +1057,7 @@ CPU.prototype.shl8 = function(dest_operand, count)
this.last_op_size = OPSIZE_8;
this.flags_changed = flags_all & ~1 & ~flag_overflow;
this.flags = (this.flags & ~1 & ~flag_overflow)
this.flags = (this.flags & ~1 & ~flag_overflow)
| (this.last_result >> 8 & 1)
| (this.last_result << 3 ^ this.last_result << 4) & flag_overflow;
@ -1075,7 +1075,7 @@ CPU.prototype.shl16 = function(dest_operand, count)
this.last_op_size = OPSIZE_16;
this.flags_changed = flags_all & ~1 & ~flag_overflow;
this.flags = (this.flags & ~1 & ~flag_overflow)
this.flags = (this.flags & ~1 & ~flag_overflow)
| (this.last_result >> 16 & 1)
| (this.last_result >> 5 ^ this.last_result >> 4) & flag_overflow;
@ -1129,12 +1129,12 @@ CPU.prototype.shr16 = function(dest_operand, count)
this.last_op_size = OPSIZE_16;
this.flags_changed = flags_all & ~1 & ~flag_overflow;
this.flags = (this.flags & ~1 & ~flag_overflow)
| (dest_operand >> (count - 1) & 1)
this.flags = (this.flags & ~1 & ~flag_overflow)
| (dest_operand >> (count - 1) & 1)
| (dest_operand >> 4) & flag_overflow;
return this.last_result;
}
}
CPU.prototype.shr32 = function(dest_operand, count)
{
@ -1147,7 +1147,7 @@ CPU.prototype.shr32 = function(dest_operand, count)
this.last_op_size = OPSIZE_32;
this.flags_changed = flags_all & ~1 & ~flag_overflow;
this.flags = (this.flags & ~1 & ~flag_overflow)
this.flags = (this.flags & ~1 & ~flag_overflow)
| (dest_operand >>> (count - 1) & 1)
| (dest_operand >> 20) & flag_overflow;
@ -1177,7 +1177,7 @@ CPU.prototype.sar8 = function(dest_operand, count)
this.flags_changed = flags_all & ~1 & ~flag_overflow;
return this.last_result;
}
}
CPU.prototype.sar16 = function(dest_operand, count)
{
@ -1390,7 +1390,7 @@ CPU.prototype.bsf16 = function(old, bit_base)
if(bit_base === 0)
{
this.flags |= flag_zero;
// not defined in the docs, but value doesn't change on my intel this
return old;
}

View file

@ -15,7 +15,7 @@
v86util.AsyncFileBuffer = AsyncFileBuffer;
v86util.SyncFileBuffer = SyncFileBuffer;
/**
/**
* @param {string} filename
* @param {Object} options
*/
@ -64,7 +64,7 @@
options.progress(e);
};
}
http.send(null);
}
@ -99,7 +99,7 @@
* using the `Range: bytes=...` header
*
* @constructor
* @param {string} filename Name of the file to download
* @param {string} filename Name of the file to download
* @param {number|undefined} size
*/
function AsyncXHRBuffer(filename, size)
@ -109,7 +109,7 @@
/** @const */
this.block_size = 256;
this.byteLength = size;
this.loaded_blocks = {};
this.onload = undefined;
@ -139,11 +139,11 @@
}
else
{
console.assert(false,
console.assert(false,
"Cannot use: " + this.filename + ". " +
"`Range: bytes=...` header not supported (Got `" + header + "`)");
}
}.bind(this),
}.bind(this),
headers: {
Range: "bytes=0-0",
@ -153,7 +153,7 @@
});
}
/**
/**
* @param {number} offset
* @param {number} len
* @param {function(!Uint8Array)} fn
@ -173,7 +173,7 @@
var block = new Uint8Array(buffer);
this.handle_read(offset, len, block);
fn(block);
}.bind(this),
}.bind(this),
headers: {
Range: "bytes=" + range_start + "-" + range_end,
}
@ -192,7 +192,7 @@
AsyncXHRBuffer.prototype.set = function(start, data, fn)
{
console.assert(start + data.byteLength <= this.byteLength);
var len = data.length;
console.assert(start % this.block_size === 0);
@ -230,7 +230,7 @@
{
// Used by AsyncXHRBuffer and AsyncFileBuffer
// Overwrites blocks from the original source that have been written since
var start_block = offset / this.block_size;
var block_count = len / this.block_size;
@ -282,8 +282,8 @@
this.load_next(0);
}
/**
* @param {number} start
/**
* @param {number} start
*/
SyncFileBuffer.prototype.load_next = function(start)
{
@ -302,7 +302,7 @@
if(this.onprogress)
{
this.onprogress({
loaded: start,
loaded: start,
total: this.byteLength,
lengthComputable: true,
});
@ -321,7 +321,7 @@
}
}
/**
/**
* @param {number} start
* @param {number} len
* @param {function(!Uint8Array)} fn
@ -332,7 +332,7 @@
fn(new Uint8Array(this.buffer, start, len));
};
/**
/**
* @param {number} offset
* @param {!Uint8Array} slice
* @param {function()} fn
@ -373,7 +373,7 @@
this.onload && this.onload({});
};
/**
/**
* @param {number} offset
* @param {number} len
* @param {function(!Uint8Array)} fn

View file

@ -26,7 +26,7 @@
}
}
/**
/**
* @return {Object.<string, string>}
*/
function get_query_arguments()
@ -60,8 +60,8 @@
}
else
{
return (time / 3600 | 0) + "h " +
v86util.pad0((time / 60 | 0) % 60, 2) + "m " +
return (time / 3600 | 0) + "h " +
v86util.pad0((time / 60 | 0) % 60, 2) + "m " +
v86util.pad0(time % 60, 2) + "s";
}
}
@ -87,7 +87,7 @@
if(e.file_index === e.file_count - 1 && e.loaded >= e.total - 2048)
{
// last file is (almost) loaded
// last file is (almost) loaded
el.textContent = "Done downloading. Starting now ...";
return;
}
@ -174,7 +174,7 @@
set_title(last_file.name);
}
start_emulation({
start_emulation({
settings: settings,
});
};
@ -358,8 +358,8 @@
{
$("boot_options").style.display = "none";
start_emulation({
settings: settings,
start_emulation({
settings: settings,
done: done,
});
}
@ -380,7 +380,7 @@
settings.fda = infos.fda;
settings.cdrom = infos.cdrom;
if(infos.hda)
{
settings.hda = infos.hda
@ -397,8 +397,8 @@
settings.memory_size = infos.memory_size;
settings.vga_memory_size = infos.vga_memory_size;
start_emulation({
settings: settings,
start_emulation({
settings: settings,
done: done,
});
}
@ -481,9 +481,9 @@
// old webkit fires popstate on every load, fuck webkit
// https://code.google.com/p/chromium/issues/detail?id=63040
window.addEventListener("load", function()
window.addEventListener("load", function()
{
setTimeout(function()
setTimeout(function()
{
window.addEventListener("popstate", onpopstate);
}, 0);
@ -513,7 +513,7 @@
memory_size = 32 * MB;
}
}
var vga_memory_size = settings.vga_memory_size;
if(!vga_memory_size)
@ -607,7 +607,7 @@
}
var news_element = $("news");
if(news_element)
if(news_element)
{
news_element.style.display = "none";
}
@ -861,7 +861,7 @@
0x53, // delete
// break codes
0x1D | 0x80,
0x1D | 0x80,
0x38 | 0x80,
0x53 | 0x80,
]);
@ -976,7 +976,7 @@
{
this.disabled = false;
if(uint8array)
if(uint8array)
{
var filename = this.value.replace(/\/$/, "").split("/");
filename = filename[filename.length - 1] || "root";
@ -984,7 +984,7 @@
dump_file(uint8array, filename);
this.value = "";
}
else
else
{
alert("Can't read file");
}

View file

@ -49,7 +49,7 @@ ModemAdapter.prototype.init = function(code_fn)
this.send_char = code_fn;
};
ModemAdapter.prototype.destroy = function()
ModemAdapter.prototype.destroy = function()
{
};

View file

@ -57,7 +57,7 @@ function MouseAdapter(bus)
function may_handle(e)
{
return mouse.enabled && mouse.emu_enabled &&
return mouse.enabled && mouse.emu_enabled &&
(!e.target || e.type === "mousemove" || (e.target.nodeName !== "INPUT" && e.target.nodeName !== "TEXTAREA"));
}

View file

@ -1,9 +1,9 @@
"use strict";
/**
* An ethernet-through-websocket adapter, to be used with
* An ethernet-through-websocket adapter, to be used with
* https://github.com/benjamincburns/websockproxy
*
*
* emulated ethernet card <--> this <--> websocket proxy <--> network
*
* @constructor
@ -63,7 +63,7 @@ NetworkAdapter.prototype.handle_error = function(e)
//console.log("onerror", e);
};
NetworkAdapter.prototype.destroy = function()
NetworkAdapter.prototype.destroy = function()
{
if(this.socket)
{

View file

@ -2,8 +2,8 @@
if(typeof window !== "undefined" && !window.requestAnimationFrame)
{
window.requestAnimationFrame =
window.mozRequestAnimationFrame ||
window.requestAnimationFrame =
window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame;
}
@ -18,14 +18,14 @@ function ScreenAdapter(screen_container, bus)
{
console.assert(screen_container, "1st argument must be a DOM container");
var
var
graphic_screen = screen_container.getElementsByTagName("canvas")[0],
graphic_context = graphic_screen.getContext("2d"),
text_screen = graphic_screen.nextElementSibling || graphic_screen.previousElementSibling,
cursor_element = document.createElement("div");
var
var
graphic_image_data,
graphic_buffer,
graphic_buffer32,
@ -81,19 +81,19 @@ function ScreenAdapter(screen_container, bus)
*/
var charmap_high = new Uint16Array([
0xC7, 0xFC, 0xE9, 0xE2, 0xE4, 0xE0, 0xE5, 0xE7,
0xEA, 0xEB, 0xE8, 0xEF, 0xEE, 0xEC, 0xC4, 0xC5,
0xC9, 0xE6, 0xC6, 0xF4, 0xF6, 0xF2, 0xFB, 0xF9,
0xEA, 0xEB, 0xE8, 0xEF, 0xEE, 0xEC, 0xC4, 0xC5,
0xC9, 0xE6, 0xC6, 0xF4, 0xF6, 0xF2, 0xFB, 0xF9,
0xFF, 0xD6, 0xDC, 0xA2, 0xA3, 0xA5, 0x20A7, 0x192,
0xE1, 0xED, 0xF3, 0xFA, 0xF1, 0xD1, 0xAA, 0xBA,
0xBF, 0x2310, 0xAC, 0xBD, 0xBC, 0xA1, 0xAB, 0xBB,
0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,
0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510,
0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F,
0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567,
0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567,
0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B,
0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
0x3B1, 0xDF, 0x393, 0x3C0, 0x3A3, 0x3C3, 0xB5, 0x3C4,
0x3A6, 0x398, 0x3A9, 0x3B4, 0x221E, 0x3C6, 0x3B5, 0x2229,
0x3A6, 0x398, 0x3A9, 0x3B4, 0x221E, 0x3C6, 0x3B5, 0x2229,
0x2261, 0xB1, 0x2265, 0x2264, 0x2320, 0x2321, 0xF7,
0x2248, 0xB0, 0x2219, 0xB7, 0x221A, 0x207F, 0xB2, 0x25A0, 0xA0
]);
@ -264,7 +264,7 @@ function ScreenAdapter(screen_container, bus)
};
/**
* @param {number} cols
* @param {number} cols
* @param {number} rows
*/
this.set_size_text = function(cols, rows)
@ -302,7 +302,7 @@ function ScreenAdapter(screen_container, bus)
graphic_screen.width = width;
graphic_screen.height = height;
//graphic_screen.style.width = width * scale_x + "px";
//graphic_screen.style.height = height * scale_y + "px";
@ -369,8 +369,8 @@ function ScreenAdapter(screen_container, bus)
this.text_update_row = function(row)
{
var offset = 3 * row * text_mode_width,
row_element,
color_element,
row_element,
color_element,
fragment;
var
@ -395,11 +395,11 @@ function ScreenAdapter(screen_container, bus)
color_element.style.backgroundColor = number_as_color(bg_color);
color_element.style.color = number_as_color(fg_color);
text = "";
// put characters of the same color in one element
while(i < text_mode_width
while(i < text_mode_width
&& text_mode_data[offset + 1] === bg_color
&& text_mode_data[offset + 2] === fg_color)
{

View file

@ -22,7 +22,7 @@ function SerialAdapter(element, bus)
}, this);
this.destroy = function()
this.destroy = function()
{
element.removeEventListener("keypress", keypress_handler, false);
element.removeEventListener("keydown", keydown_handler, false);
@ -64,7 +64,7 @@ function SerialAdapter(element, bus)
}
else if(chr === "\r")
{
// do nothing
// do nothing
}
else
{

View file

@ -1,6 +1,6 @@
"use strict";
/**
/**
* Constructor for emulator instances.
*
* Usage: `var emulator = new V86Starter(options);`
@ -53,14 +53,14 @@
*
* ```javascript
* // download file before boot
* options.bios = {
* url: "bios/seabios.bin"
* options.bios = {
* url: "bios/seabios.bin"
* }
* // download file sectors as requested, size is required
* options.hda = {
* options.hda = {
* url: "disk/linux.iso",
* async: true,
* size: 16 * 1024 * 1024
* size: 16 * 1024 * 1024
* }
* ```
*
@ -68,11 +68,11 @@
*
* ```javascript
* // use <input type=file>
* options.bios = {
* options.bios = {
* buffer: document.all.hd_image.files[0]
* }
* // start with empty hard drive
* options.hda = {
* options.hda = {
* buffer: new ArrayBuffer(16 * 1024 * 1024)
* }
* ```
@ -80,13 +80,13 @@
* ***
*
* @param {Object} options Options to initialize the emulator with.
* @constructor
* @constructor
*/
function V86Starter(options)
{
//var worker = new Worker("src/browser/worker.js");
//var adapter_bus = this.bus = WorkerBus.init(worker);
this.cpu_is_running = false;
var bus = Bus.create();
@ -213,7 +213,7 @@ function V86Starter(options)
{
// SyncFileBuffer:
// - loads the whole disk image into memory, impossible for large files (more than 1GB)
// - can later serve get/set operations fast and synchronously
// - can later serve get/set operations fast and synchronously
// - takes some time for first load, neglectable for small files (up to 100Mb)
//
// AsyncFileBuffer:
@ -426,7 +426,7 @@ V86Starter.prototype.restart = function()
* The callback function gets a single argument which depends on the event.
*
* @param {string} event Name of the event.
* @param {function(*)} listener The callback function.
* @param {function(*)} listener The callback function.
*/
V86Starter.prototype.add_listener = function(event, listener)
{
@ -434,7 +434,7 @@ V86Starter.prototype.add_listener = function(event, listener)
};
/**
* Remove an event listener.
* Remove an event listener.
*
* @param {string} event
* @param {function(*)} listener
@ -447,11 +447,11 @@ V86Starter.prototype.remove_listener = function(event, listener)
/**
* Restore the emulator state from the given state, which must be an
* ArrayBuffer returned by
* [`save_state`](#save_statefunctionobject-arraybuffer-callback).
* [`save_state`](#save_statefunctionobject-arraybuffer-callback).
*
* Note that the state can only be restored correctly if this constructor has
* been created with the same options as the original instance (e.g., same disk
* images, memory size, etc.).
* images, memory size, etc.).
*
* Different versions of the emulator might use a different format for the
* state buffer.
@ -593,7 +593,7 @@ V86Starter.prototype.is_running = function()
return this.cpu_is_running;
};
/**
/**
* Send a sequence of scan codes to the emulated PS2 controller. A list of
* codes can be found at http://stanislavs.org/helppc/make_codes.html.
* Do nothing if there is no keyboard controller.
@ -681,9 +681,9 @@ V86Starter.prototype.screen_go_fullscreen = function()
}
// bracket notation because otherwise they get renamed by closure compiler
var fn = elem["requestFullScreen"] ||
elem["webkitRequestFullscreen"] ||
elem["mozRequestFullScreen"] ||
var fn = elem["requestFullScreen"] ||
elem["webkitRequestFullscreen"] ||
elem["mozRequestFullScreen"] ||
elem["msRequestFullScreen"];
if(fn)
@ -720,7 +720,7 @@ V86Starter.prototype.lock_mouse = function()
}
};
/**
/**
* Enable or disable sending mouse events to the emulated PS2 controller.
*
* @param {boolean} enabled
@ -733,7 +733,7 @@ V86Starter.prototype.mouse_set_status = function(enabled)
}
};
/**
/**
* Enable or disable sending keyboard events to the emulated PS2 controller.
*
* @param {boolean} enabled
@ -747,7 +747,7 @@ V86Starter.prototype.keyboard_set_status = function(enabled)
};
/**
/**
* Send a string to the first emulated serial terminal.
*
* @param {string} data
@ -851,7 +851,7 @@ V86Starter.prototype.read_file = function(file, callback)
}
};
/**
/**
* @ignore
* @constructor
*

View file

@ -1,8 +1,8 @@
/** @define {boolean} */
/** @define {boolean} */
var DEBUG = true;
var
var
/** @const */ LOG_ALL = -1,
/** @const */ LOG_NONE = 0,
@ -73,14 +73,14 @@ var
/** @const */ TLB_USER_WRITE = 8;
var
var
/** @const */
ENABLE_HPET = false,
/** @const */
ENABLE_ACPI = false;
var
var
// flags register bitflags
@ -88,7 +88,7 @@ var
/** @const */ flag_parity = 4,
/** @const */ flag_adjust = 16,
/** @const */ flag_zero = 64,
/** @const */ flag_sign = 128,
/** @const */ flag_sign = 128,
/** @const */ flag_trap = 256,
/** @const */ flag_interrupt = 512,
/** @const */ flag_direction = 1024,
@ -102,17 +102,17 @@ var
/** @const */ flag_vip = 1 << 20,
/** @const */ flag_id = 1 << 21,
/**
/**
* default values of reserved flags bits
* @const
*/
flags_default = 1 << 1,
/**
/**
* bitmask to select non-reserved flags bits
* @const
*/
flags_mask =
flags_mask =
flag_carry | flag_parity | flag_adjust | flag_zero | flag_sign | flag_trap | flag_interrupt |
flag_direction | flag_overflow | flag_iopl | flag_nt | flag_rf | flag_vm | flag_ac |
flag_vif | flag_vip | flag_id,
@ -187,13 +187,14 @@ PSE_ENABLED = 128,
var OP_TRANSLATION = false;
var
/**
var
/**
* The minimum number of bytes that can be memory-mapped
* by one device.
* by one device.
*
* @const
*/
* @const
*/
MMAP_BLOCK_BITS = 17,
/** @const */
MMAP_BLOCK_SIZE = 1 << MMAP_BLOCK_BITS;
@ -207,7 +208,7 @@ var MEM_PAGE_WRITTEN = 1;
var MAGIC_CPU_EXCEPTION = 0xDEADBEE;
var
var
/** @const */
REPEAT_STRING_PREFIX_NONE = 0,
/** @const */
@ -215,7 +216,7 @@ var
/** @const */
REPEAT_STRING_PREFIX_Z = 2;
var
var
/** @const */
CR0_PE = 1,
/** @const */
@ -235,7 +236,7 @@ var
/** @const */
CR0_PG = 1 << 31;
var
var
/** @const */
CR4_VME = 1,
/** @const */
@ -252,7 +253,7 @@ var
// Segment prefixes must not collide with reg_*s variables
// _ZERO is a special zero offset segment
var
var
/** @const */
SEG_PREFIX_NONE = -1,

View file

@ -72,7 +72,7 @@ CPU.prototype.jmpcc32 = function(condition)
CPU.prototype.cmovcc16 = function(condition)
{
var data = this.read_e16();
if(condition)
if(condition)
{
this.write_g16(data);
}