Got from hlt to loop main loop directly and vice versa (improves latency and fixes bug introduces in 914d4ee
)
This commit is contained in:
parent
4067908da4
commit
1b8d2cb0d2
24
src/cpu.js
24
src/cpu.js
|
@ -423,18 +423,21 @@ CPU.prototype.main_run = function()
|
|||
//if(false)
|
||||
//{
|
||||
// var _t = this.hlt_loop();
|
||||
// return 0;
|
||||
// var t = 0;
|
||||
//}
|
||||
//else
|
||||
{
|
||||
return this.hlt_loop();
|
||||
var t = this.hlt_loop();
|
||||
}
|
||||
|
||||
if(this.in_hlt)
|
||||
{
|
||||
return t;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.do_run();
|
||||
return 0;
|
||||
}
|
||||
|
||||
this.do_run();
|
||||
return 0;
|
||||
};
|
||||
|
||||
CPU.prototype.exception_cleanup = function(e)
|
||||
|
@ -811,6 +814,12 @@ CPU.prototype.do_run = function()
|
|||
this.handle_irqs();
|
||||
this.do_many_cycles();
|
||||
|
||||
if(this.in_hlt)
|
||||
{
|
||||
this.hlt_loop();
|
||||
return;
|
||||
}
|
||||
|
||||
now = v86.microtick();
|
||||
}
|
||||
};
|
||||
|
@ -937,6 +946,7 @@ CPU.prototype.run_prefix_instruction = function()
|
|||
|
||||
CPU.prototype.hlt_loop = function()
|
||||
{
|
||||
dbg_assert(this.flags & flag_interrupt);
|
||||
//dbg_log("In HLT loop", LOG_CPU);
|
||||
|
||||
var now = v86.microtick();
|
||||
|
|
Loading…
Reference in a new issue