Don't accept inputs when emulator is paused or crashed

This commit is contained in:
copy 2014-06-16 20:56:42 +02:00
parent affbcf6412
commit dac74191e6
2 changed files with 4 additions and 5 deletions

View file

@ -126,8 +126,6 @@ function v86()
*/
this.in_hlt = false;
this.step_mode = false;
/** @type {boolean} */
this.running = false;
@ -360,6 +358,8 @@ v86.prototype.exception_cleanup = function(e)
}
else
{
this.running = false;
console.log(e);
console.log(e.stack);
throw e;
@ -515,7 +515,6 @@ v86.prototype.init = function(settings)
this.timestamp_counter = 0;
this.previous_ip = 0;
this.step_mode = false;
this.in_hlt = false;
this.running = false;

View file

@ -106,7 +106,7 @@ function PS2(cpu, keyboard, mouse)
function kbd_send_code(code)
{
if(enable_keyboard_stream)
if(cpu.running && enable_keyboard_stream)
{
kbd_buffer.push(code);
kbd_irq();
@ -116,7 +116,7 @@ function PS2(cpu, keyboard, mouse)
function mouse_send_delta(delta_x, delta_y)
{
if(!have_mouse || !enable_mouse)
if(!cpu.running || !have_mouse || !enable_mouse)
{
return;
}