diff --git a/doc/notes.txt b/doc/notes.txt index 8044269b..c6369f24 100644 --- a/doc/notes.txt +++ b/doc/notes.txt @@ -56,6 +56,7 @@ TODO: - intro/help text for each platform - make sure controls work with replay feature (we'll have to save control state every frame) - vscode/atom extension? +- navigator.getGamepads FYI: Image links for the books on http://8bitworkshop.com/ are broken On the website the additional grey spacing next to the program line numbers is not dynamically resized when the web browser window size is changed. Intentional? diff --git a/javatari.js b/javatari.js index 500c33f4..67d15ccb 160000 --- a/javatari.js +++ b/javatari.js @@ -1 +1 @@ -Subproject commit 500c33f4e8b854ddacaa588c47c23983feb27c24 +Subproject commit 67d15ccb4940c0049fcd6444a72316148056e5b3 diff --git a/package-lock.json b/package-lock.json index 435b4d8d..5f84379b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -85,6 +85,12 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -129,6 +135,12 @@ "integrity": "sha1-Ql1opY00R/AqBKqJQYf86K+Le44=", "dev": true }, + "btoa": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz", + "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==", + "dev": true + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", diff --git a/package.json b/package.json index fc7aea68..0ab4a4dc 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "devDependencies": { "@types/bootstrap": "^3.x", "@types/jquery": "^2.x", + "atob": "^2.1.2", + "btoa": "^1.2.1", "heapdump": "^0.3.9", "jsdom": "^12.0.0", "mocha": "^5.2.0", diff --git a/src/platform/vcs.ts b/src/platform/vcs.ts index 64c78b4d..59dc2aee 100644 --- a/src/platform/vcs.ts +++ b/src/platform/vcs.ts @@ -62,8 +62,8 @@ class VCSPlatform { // intercept clockPulse function Javatari.room.console.oldClockPulse = Javatari.room.console.clockPulse; Javatari.room.console.clockPulse = function() { - this.oldClockPulse(); self.updateRecorder(); + this.oldClockPulse(); } this.paused = false; } @@ -109,6 +109,10 @@ class VCSPlatform { advance() { Javatari.room.console.clockPulse(); } + // for unit test + nextFrame() { + Javatari.room.console.clockPulse(); + } step() { Javatari.room.console.debugSingleStepCPUClock(); } stepBack() { Javatari.room.console.debugStepBackInstruction(); } @@ -145,6 +149,12 @@ class VCSPlatform { loadState(state) { return Javatari.room.console.loadState(state); } + saveControlsState() { + return Javatari.room.console.saveControlsState(); + } + loadControlsState(state) { + Javatari.room.console.loadControlsState(state); + } // TODO: load/save controls state readAddress(addr) { return this.current_output[addr & 0xfff]; // TODO: use bus to read diff --git a/test/cli/testplatforms.js b/test/cli/testplatforms.js index 1f140b44..4add131e 100644 --- a/test/cli/testplatforms.js +++ b/test/cli/testplatforms.js @@ -8,12 +8,14 @@ const jsdom = require('jsdom'); const { JSDOM } = jsdom; const { window } = new JSDOM(); -const dom = new JSDOM(`
`); +const dom = new JSDOM(`