Switch to microtick
This commit is contained in:
parent
7d250aec0d
commit
ba5ac54c04
10
src/cpu.js
10
src/cpu.js
|
@ -403,9 +403,7 @@ CPU.prototype.main_run = function()
|
|||
{
|
||||
if(this.in_hlt)
|
||||
{
|
||||
var t = this.hlt_loop();
|
||||
return 0;
|
||||
//return t;
|
||||
return this.hlt_loop();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -750,7 +748,7 @@ CPU.prototype.do_run = function()
|
|||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
start = Date.now(),
|
||||
start = v86.microtick(),
|
||||
now = start;
|
||||
|
||||
// outer loop:
|
||||
|
@ -790,7 +788,7 @@ CPU.prototype.do_run = function()
|
|||
}
|
||||
}
|
||||
|
||||
now = Date.now();
|
||||
now = v86.microtick();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -848,7 +846,7 @@ CPU.prototype.hlt_loop = function()
|
|||
{
|
||||
//dbg_log("In HLT loop", LOG_CPU);
|
||||
|
||||
var now = Date.now();
|
||||
var now = v86.microtick();
|
||||
|
||||
if(ENABLE_HPET)
|
||||
{
|
||||
|
|
|
@ -122,6 +122,7 @@ RTC.prototype.set_state = function(state)
|
|||
|
||||
RTC.prototype.timer = function(time, legacy_mode)
|
||||
{
|
||||
time = Date.now(); // XXX
|
||||
this.rtc_time += time - this.last_update;
|
||||
this.last_update = time;
|
||||
|
||||
|
|
Loading…
Reference in a new issue