Disable TypedArray support for now (still slower than the default Memory implementation)

This commit is contained in:
Jeff Parsons 2014-10-12 13:41:37 -07:00 committed by jeffpar
commit 93f5999b03
8 changed files with 1611 additions and 1607 deletions

View file

@ -755,10 +755,13 @@ CPU.prototype.setSpeed = function(nMultiplier, fOnClick)
*/
if (this.mhz/this.mhzTarget < 0.8) nMultiplier = 1;
this.nCyclesMultiplier = nMultiplier;
this.mhzTarget = this.mhzDefault * this.nCyclesMultiplier;
var sSpeed = this.getSpeedTarget();
if (this.bindings["setSpeed"]) this.bindings["setSpeed"].innerHTML = sSpeed;
this.println("target speed: " + sSpeed);
var mhz = this.mhzDefault * this.nCyclesMultiplier;
if (this.mhzTarget != mhz) {
this.mhzTarget = mhz;
var sSpeed = this.getSpeedTarget();
if (this.bindings["setSpeed"]) this.bindings["setSpeed"].innerHTML = sSpeed;
this.println("target speed: " + sSpeed);
}
if (fOnClick) this.setFocus();
}
this.addCycles(this.nRunCycles);

View file

@ -99,14 +99,19 @@ var FASTDISABLE = false;
var FATARRAYS = false;
/**
* TYPEDARRAYS enables use of typed arrays for Memory blocks. This used to be a compile-time * option, but since I've
* @define {boolean}
*
* TYPEDARRAYS enables use of typed arrays for Memory blocks. This used to be a compile-time-only option, but since I've
* added memory access functions for typed arrays (see Memory.afnTypedArray), I can turn the support on dynamically now.
* Originally, I didn't see much of a speed increase over the original (non-typed) implementation, but that will probably
* change over time.
*
* See the Memory component for details.
*
* UPDATE (Oct 2014): Time has passed, and TypedArray support is still measurably slower than the default Memory implementation,
* so it's turned off by default for now.
*/
var TYPEDARRAYS = (typeof ArrayBuffer !== 'undefined');
var TYPEDARRAYS = false; // (typeof ArrayBuffer !== 'undefined');
if (typeof module !== 'undefined') {
global.PCJSCLASS = PCJSCLASS;

View file

@ -1078,7 +1078,7 @@ X86CPU.prototype.restore = function(data)
this.opPrefixes = a[3];
this.intFlags = a[4];
this.regEA = a[5];
this.regEAWrite = a[6]; // NOTE: save/restore of prior EA calculation(s) isn't strictly necessary, but they may be of some interest to, say, the Debugger
this.regEAWrite = a[6]; // NOTE: save/restore of prior EA calculation(s) isn't strictly necessary, but they may be of some interest to, say, the Debugger
a = data[3];
this.nBurstDivisor = a[0];
this.nTotalCycles = a[1];