fixed wasm probe tests, updated jquery to 3.5.1

This commit is contained in:
Steven Hugg 2020-07-16 14:47:28 -05:00
parent ba2c288e8d
commit cf12b481a9
12 changed files with 29 additions and 24 deletions

View File

@ -51,7 +51,7 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
</div>
</div>
<script src="jquery/jquery-3.4.1.min.js"></script>
<script src="jquery/jquery.min.js"></script>
<script src="javatari.js/release/javatari/javatari.js"></script>
<script src="src/common/cpu/z80.js"></script>

View File

@ -531,7 +531,7 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
</div>
</div>
<script src="jquery/jquery-3.4.1.min.js"></script>
<script src="jquery/jquery.min.js"></script>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<script src="bootstrap/js/bootstrap.min.js"></script>

File diff suppressed because one or more lines are too long

2
jquery/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

15
package-lock.json generated
View File

@ -40,7 +40,7 @@
"@types/sizzle": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz",
"integrity": "sha1-qBG4wY4rq6t9VCszZYh64uTZ3kc=",
"integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==",
"dev": true
},
"abab": {
@ -953,9 +953,9 @@
"dev": true
},
"jquery": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz",
"integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw=="
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz",
"integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg=="
},
"js-yaml": {
"version": "3.13.1",
@ -1065,10 +1065,9 @@
}
},
"lodash": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
"dev": true
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
},
"lodash.sortby": {
"version": "4.7.0",

View File

@ -11,7 +11,7 @@
"dependencies": {
"bootstrap-tourist": "^0.2.1",
"browser-detect": "^0.2.28",
"jquery": "^3.4.1",
"jquery": "^3.5.1",
"reflect-metadata": "^0.1.13"
},
"devDependencies": {

View File

@ -1355,8 +1355,7 @@ export abstract class BaseWASMMachine {
// TODO: more efficient way to put into probe
var databuf = new Uint32Array(this.exports.memory.buffer, dataaddr, datalen);
this.probe.logNewFrame(); // TODO: machine should do this
for (var i=0; i<datalen; i++)
this.probe.logData(databuf[i]);
this.probe.addLogBuffer(databuf);
}
}
connectProbe(probe: ProbeAll): void {

View File

@ -145,6 +145,7 @@ export interface ProbeVRAM {
export interface ProbeAll extends ProbeTime, ProbeCPU, ProbeBus, ProbeIO, ProbeVRAM {
logData(data:number); // entire 32 bits
addLogBuffer(src: Uint32Array);
}
export class NullProbe implements ProbeAll {
@ -161,6 +162,7 @@ export class NullProbe implements ProbeAll {
logVRAMWrite() {}
logIllegal() {}
logData() {}
addLogBuffer(src: Uint32Array) {}
}
/// CONVENIENCE

View File

@ -178,7 +178,6 @@ export class ProbeRecorder implements ProbeAll {
m : Probeable; // machine to probe
buf : Uint32Array; // buffer
idx : number = 0; // index into buffer
fclk : number = 0; // clock cycle
sl : number = 0; // scanline
cur_sp = -1; // last stack pointer
singleFrame : boolean = true; // clear between frames
@ -196,7 +195,6 @@ export class ProbeRecorder implements ProbeAll {
reset(newbuflen? : number) {
if (newbuflen) this.buf = new Uint32Array(newbuflen);
this.sl = 0;
this.fclk = 0;
this.cur_sp = -1;
this.clear();
}
@ -226,10 +224,16 @@ export class ProbeRecorder implements ProbeAll {
else
return -1;
}
addLogBuffer(src: Uint32Array) {
if (this.idx + src.length > this.buf.length) {
src = src.slice(0, this.buf.length - this.idx);
}
this.buf.set(src, this.idx);
this.idx += src.length;
}
logClocks(clocks:number) {
clocks |= 0;
if (clocks > 0) {
this.fclk += clocks;
if (this.lastOp() == ProbeFlags.CLOCKS)
this.relog((this.lastAddr() + clocks) | ProbeFlags.CLOCKS); // coalesce clocks
else

View File

@ -13,7 +13,7 @@ global.window = dom.window;
global.document = dom.window.document;
dom.window.Audio = null;
global.Image = function() { }
global['$'] = require("jquery/jquery-3.4.1.min.js");
global['$'] = require("jquery/jquery.min.js");
includeInThisContext('src/common/cpu/6809.js');
includeInThisContext("javatari.js/release/javatari/javatari.js");
Javatari.AUTO_START = false;
@ -198,10 +198,11 @@ async function testPlatform(platid, romname, maxframes, callback) {
var lastclk = 0;
for (var i=0; i<5; i++) {
platform.nextFrame(true);
console.log(proberec.idx, proberec.fclk - lastclk, proberec.sl);
lastclk = proberec.fclk;
var clks = proberec.countClocks();
console.log(proberec.idx, clks - lastclk, proberec.sl);
lastclk = clks;
}
assert.equal(proberec.fclk, proberec.countClocks());
assert.equal(clks, proberec.countClocks());
}
// debug tree
if (platform.getDebugTree) {

View File

@ -27,7 +27,7 @@
mocha.ui('bdd')
</script>
<script src="jquery/jquery-3.4.1.min.js"></script>
<script src="jquery/jquery.min.js"></script>
<script src="javatari.js/release/javatari/javatari.js"></script>
<script src="src/cpu/z80.js"></script>

View File

@ -70,7 +70,7 @@ body {
</div>
</div>
<script src="jquery/jquery-3.4.1.min.js"></script>
<script src="jquery/jquery.min.js"></script>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<script src="bootstrap/js/bootstrap.min.js"></script>