Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
Disable TypedArray support for now (still slower than the default Mem…
Browse files Browse the repository at this point in the history
…ory implementation)
  • Loading branch information
jeffpar committed Oct 12, 2014
1 parent b144ce3 commit 08c73a1
Show file tree
Hide file tree
Showing 8 changed files with 1,611 additions and 1,607 deletions.
891 changes: 445 additions & 446 deletions docs/pcjs/demos/pc-dbg.js

Large diffs are not rendered by default.

707 changes: 353 additions & 354 deletions docs/pcjs/demos/pc.js

Large diffs are not rendered by default.

Binary file modified docs/pcjs/demos/samples.zip
Binary file not shown.
11 changes: 7 additions & 4 deletions my_modules/pcjs-client/lib/cpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 7 additions & 2 deletions my_modules/pcjs-client/lib/defines.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion my_modules/pcjs-client/lib/x86cpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
891 changes: 445 additions & 446 deletions versions/pcjs/1.15.4/pc-dbg.js

Large diffs are not rendered by default.

707 changes: 353 additions & 354 deletions versions/pcjs/1.15.4/pc.js

Large diffs are not rendered by default.

0 comments on commit 08c73a1

Please sign in to comment.