Merge branch 'master' into ecs
This commit is contained in:
commit
73ab50f9b6
|
@ -1,13 +1,13 @@
|
||||||
*~
|
*~
|
||||||
node_modules
|
node_modules
|
||||||
local/
|
./local/
|
||||||
tests_output/
|
./tests_output/
|
||||||
test/output/
|
./test/output/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
tmp/
|
./tmp/
|
||||||
web/
|
./web/
|
||||||
release/
|
./release/
|
||||||
gen/
|
./gen/
|
||||||
config.js
|
config.js
|
||||||
chromedriver.log
|
chromedriver.log
|
||||||
nightwatch.conf.js
|
nightwatch.conf.js
|
||||||
|
|
1
Makefile
1
Makefile
|
@ -22,6 +22,7 @@ distro: buildtsc
|
||||||
rm -fr $(TMP) && mkdir -p $(TMP)
|
rm -fr $(TMP) && mkdir -p $(TMP)
|
||||||
git archive HEAD | tar x -C $(TMP)
|
git archive HEAD | tar x -C $(TMP)
|
||||||
cp -rp gen $(TMP)
|
cp -rp gen $(TMP)
|
||||||
|
cp -rp codemirror tss $(TMP)
|
||||||
rm -r $(TMP)/doc $(TMP)/scripts $(TMP)/test* $(TMP)/tools $(TMP)/.[a-z]* $(TMP)/ts*.json # $(TMP)/meta
|
rm -r $(TMP)/doc $(TMP)/scripts $(TMP)/test* $(TMP)/tools $(TMP)/.[a-z]* $(TMP)/ts*.json # $(TMP)/meta
|
||||||
rm -f $(TMP)/javatari && mkdir -p $(TMP)/javatari && cp -p javatari.js/release/javatari/* $(TMP)/javatari/
|
rm -f $(TMP)/javatari && mkdir -p $(TMP)/javatari && cp -p javatari.js/release/javatari/* $(TMP)/javatari/
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -55,7 +55,7 @@
|
||||||
"chromedriver": "^97.0.1",
|
"chromedriver": "^97.0.1",
|
||||||
"heapdump": "^0.3.15",
|
"heapdump": "^0.3.15",
|
||||||
"jsfuzz": "^1.0.14",
|
"jsfuzz": "^1.0.14",
|
||||||
"nightwatch": "^1.7.13",
|
"nightwatch": "^2.0.5",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"rgbquant": "^1.1.2",
|
"rgbquant": "^1.1.2",
|
||||||
"typedoc": "^0.22.11"
|
"typedoc": "^0.22.11"
|
||||||
|
|
|
@ -142,5 +142,4 @@ scopes are banks!
|
||||||
banks need to duplicate code and/or rodata
|
banks need to duplicate code and/or rodata
|
||||||
- don't split critical code across banks
|
- don't split critical code across banks
|
||||||
need bank trampoline macro
|
need bank trampoline macro
|
||||||
|
nested scopes for game modes? (title / demo / play)
|
||||||
events might need args
|
|
||||||
|
|
|
@ -188,8 +188,8 @@ class UserPrefs {
|
||||||
getLastPlatformID() {
|
getLastPlatformID() {
|
||||||
return hasLocalStorage && !isEmbed && localStorage.getItem("__lastplatform");
|
return hasLocalStorage && !isEmbed && localStorage.getItem("__lastplatform");
|
||||||
}
|
}
|
||||||
getLastRepoID() {
|
getLastRepoID(platform: string) {
|
||||||
return hasLocalStorage && !isEmbed && localStorage.getItem("__lastrepo_" + platform_id);
|
return hasLocalStorage && !isEmbed && platform && localStorage.getItem("__lastrepo_" + platform);
|
||||||
}
|
}
|
||||||
shouldCompleteTour() {
|
shouldCompleteTour() {
|
||||||
return hasLocalStorage && !isEmbed && !localStorage.getItem("8bitworkshop.hello");
|
return hasLocalStorage && !isEmbed && !localStorage.getItem("8bitworkshop.hello");
|
||||||
|
@ -1829,8 +1829,10 @@ function _addIncludeFile() {
|
||||||
addFileToProject("Include", ".inc", (s) => { return '\t.include "'+s+'"' });
|
addFileToProject("Include", ".inc", (s) => { return '\t.include "'+s+'"' });
|
||||||
else if (tool == 'verilator')
|
else if (tool == 'verilator')
|
||||||
addFileToProject("Verilog", ".v", (s) => { return '`include "'+s+'"' });
|
addFileToProject("Verilog", ".v", (s) => { return '`include "'+s+'"' });
|
||||||
else if (tool == 'wiz')
|
else if (tool == 'wiz')
|
||||||
addFileToProject("Include", ".wiz", (s) => { return 'import "'+s+'";' });
|
addFileToProject("Include", ".wiz", (s) => { return 'import "'+s+'";' });
|
||||||
|
else if (tool == 'ecs')
|
||||||
|
addFileToProject("Include", ".ecs", (s) => { return 'import "'+s+'"' });
|
||||||
else
|
else
|
||||||
alertError("Can't add include file to this project type (" + tool + ")");
|
alertError("Can't add include file to this project type (" + tool + ")");
|
||||||
}
|
}
|
||||||
|
@ -2373,29 +2375,34 @@ function setPlatformUI() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getPlatformAndRepo() {
|
export function getPlatformAndRepo() {
|
||||||
// add default platform?
|
// lookup repository for this platform (TODO: enable cross-platform repos)
|
||||||
// TODO: do this after repo_id
|
|
||||||
platform_id = qs.platform || userPrefs.getLastPlatformID();
|
platform_id = qs.platform || userPrefs.getLastPlatformID();
|
||||||
if (!platform_id) {
|
repo_id = qs.repo;
|
||||||
if (isEmbed) fatalError(`The 'platform' must be specified when embed=1`);
|
// only look at cached repo_id if file= is not present, so back button works
|
||||||
platform_id = qs.platform = "vcs";
|
if (!qs.repo && !qs.file)
|
||||||
}
|
repo_id = userPrefs.getLastRepoID(platform_id);
|
||||||
// lookup repository for this platform
|
// are we in a repo?
|
||||||
repo_id = qs.repo || userPrefs.getLastRepoID();
|
|
||||||
if (hasLocalStorage && repo_id && repo_id !== '/') {
|
if (hasLocalStorage && repo_id && repo_id !== '/') {
|
||||||
var repo = getRepos()[repo_id];
|
var repo = getRepos()[repo_id];
|
||||||
|
// override query string params w/ repo settings
|
||||||
if (repo) {
|
if (repo) {
|
||||||
|
console.log(platform_id, qs, repo);
|
||||||
qs.repo = repo_id;
|
qs.repo = repo_id;
|
||||||
if (repo.platform_id && !qs.platform)
|
if (repo.platform_id && !qs.platform)
|
||||||
qs.platform = platform_id = repo.platform_id;
|
qs.platform = platform_id = repo.platform_id;
|
||||||
if (!qs.file)
|
if (!qs.file && repo.mainPath)
|
||||||
qs.file = repo.mainPath;
|
qs.file = repo.mainPath;
|
||||||
requestPersistPermission(true, true);
|
//requestPersistPermission(true, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
repo_id = '';
|
repo_id = '';
|
||||||
delete qs.repo;
|
delete qs.repo;
|
||||||
}
|
}
|
||||||
|
// add default platform
|
||||||
|
if (!platform_id) {
|
||||||
|
if (isEmbed) fatalError(`The 'platform' must be specified when embed=1`);
|
||||||
|
platform_id = qs.platform = "vcs";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// start
|
// start
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
williams
|
|
@ -132,9 +132,11 @@ export function assembleLWASM(step: BuildStep): BuildStepResult {
|
||||||
gatherFiles(step, { mainFilePath: "main.s" });
|
gatherFiles(step, { mainFilePath: "main.s" });
|
||||||
var objpath = step.prefix + ".o";
|
var objpath = step.prefix + ".o";
|
||||||
var lstpath = step.prefix + ".lst";
|
var lstpath = step.prefix + ".lst";
|
||||||
|
const isRaw = step.path.endsWith('.asm');
|
||||||
if (staleFiles(step, [objpath, lstpath])) {
|
if (staleFiles(step, [objpath, lstpath])) {
|
||||||
var objout, lstout;
|
var objout, lstout;
|
||||||
var args = ['-9', '--obj', '-I/share/asminc', '-o' + objpath, '-l' + lstpath, step.path];
|
var args = ['-9', '-I/share/asminc', '-o' + objpath, '-l' + lstpath, step.path];
|
||||||
|
args.push(isRaw ? '-r' : '--obj');
|
||||||
var LWASM: EmscriptenModule = emglobal.lwasm({
|
var LWASM: EmscriptenModule = emglobal.lwasm({
|
||||||
instantiateWasm: moduleInstFn('lwasm'),
|
instantiateWasm: moduleInstFn('lwasm'),
|
||||||
noInitialRun: true,
|
noInitialRun: true,
|
||||||
|
@ -153,6 +155,11 @@ export function assembleLWASM(step: BuildStep): BuildStepResult {
|
||||||
lstout = FS.readFile(lstpath, { encoding: 'utf8' });
|
lstout = FS.readFile(lstpath, { encoding: 'utf8' });
|
||||||
putWorkFile(objpath, objout);
|
putWorkFile(objpath, objout);
|
||||||
putWorkFile(lstpath, lstout);
|
putWorkFile(lstpath, lstout);
|
||||||
|
if (isRaw) {
|
||||||
|
return {
|
||||||
|
output: objout
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
linktool: "lwlink",
|
linktool: "lwlink",
|
||||||
|
|
|
@ -127,9 +127,17 @@ var PLATFORM_PARAMS = {
|
||||||
data_start: 0x9800,
|
data_start: 0x9800,
|
||||||
data_size: 0x2800,
|
data_size: 0x2800,
|
||||||
stack_end: 0xc000,
|
stack_end: 0xc000,
|
||||||
//extra_compile_args: ['--vectrex'],
|
|
||||||
extra_link_files: ['williams.scr', 'libcmoc-crt-vec.a', 'libcmoc-std-vec.a'],
|
extra_link_files: ['williams.scr', 'libcmoc-crt-vec.a', 'libcmoc-std-vec.a'],
|
||||||
extra_link_args: ['-swilliams.scr', '-lcmoc-crt-vec', '-lcmoc-std-vec'],
|
extra_link_args: ['-swilliams.scr', '-lcmoc-crt-vec', '-lcmoc-std-vec'],
|
||||||
|
extra_compile_files: ['assert.h','cmoc.h','stdarg.h','vectrex.h','stdlib.h','bios.h'],
|
||||||
|
},
|
||||||
|
'williams-defender': {
|
||||||
|
arch: '6809',
|
||||||
|
code_start: 0x0,
|
||||||
|
rom_size: 0xc000,
|
||||||
|
data_start: 0x9800,
|
||||||
|
data_size: 0x2800,
|
||||||
|
stack_end: 0xc000,
|
||||||
},
|
},
|
||||||
'williams-z80': {
|
'williams-z80': {
|
||||||
arch: 'z80',
|
arch: 'z80',
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
|
||||||
|
// https://nightwatchjs.org/api/
|
||||||
|
|
||||||
|
//var IDEURL = 'https://8bitworkshop.com/dev/';
|
||||||
|
var IDEURL = 'http://localhost:8000/'
|
||||||
|
var REPO = 'sehugg/happy2020'
|
||||||
|
var PLATFORM = 'astrocade'
|
||||||
|
var FILE = 'happy2020.c'
|
||||||
|
var PRESETFILE = 'hello.c'
|
||||||
|
var QS_GITHUBURL = '&githubURL=https%3A%2F%2Fgithub.com%2F' + REPO
|
||||||
|
|
||||||
|
try {
|
||||||
|
var github_config = JSON.parse(require('fs').readFileSync('./github.json','utf-8'));
|
||||||
|
exports['beforeEach'] = function(browser) {
|
||||||
|
browser.setCookie({
|
||||||
|
name: '__github_key',
|
||||||
|
value: github_config.token,
|
||||||
|
path: '/'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log('warning: need ./github.json with {token:"..."}')
|
||||||
|
}
|
||||||
|
|
||||||
|
exports['test import Github'] = async function (browser) {
|
||||||
|
|
||||||
|
await browser.url(`${IDEURL}?${QS_GITHUBURL}`)
|
||||||
|
.waitForElementNotPresent('#step-0')
|
||||||
|
.waitForElementNotVisible('#compile_spinner', time = 10000)
|
||||||
|
.waitForElementNotVisible('#error_alert')
|
||||||
|
.waitForElementVisible('#emuscreen')
|
||||||
|
.waitForElementVisible('.emuvideo')
|
||||||
|
.url(`${IDEURL}?repo=${REPO}`)
|
||||||
|
|
||||||
|
browser.expect.url().to.contain(`platform=${PLATFORM}`)
|
||||||
|
browser.expect.url().to.contain(`file=${FILE}`)
|
||||||
|
browser.expect.url().to.contain(`repo=${REPO.replace('/', '%2F')}`)
|
||||||
|
|
||||||
|
await browser.url(`${IDEURL}?`)
|
||||||
|
.waitForElementNotVisible('#error_alert')
|
||||||
|
.waitForElementVisible('#emuscreen')
|
||||||
|
.waitForElementVisible('.emuvideo')
|
||||||
|
|
||||||
|
browser.expect.url().to.contain(`platform=${PLATFORM}`)
|
||||||
|
browser.expect.url().to.contain(`file=${FILE}`)
|
||||||
|
browser.expect.url().to.contain(`repo=${REPO.replace('/', '%2F')}`)
|
||||||
|
|
||||||
|
await browser.url(`${IDEURL}?repo=${REPO}`)
|
||||||
|
.waitForElementNotVisible('#error_alert')
|
||||||
|
.waitForElementVisible('#emuscreen')
|
||||||
|
.waitForElementVisible('.emuvideo')
|
||||||
|
|
||||||
|
browser.expect.url().to.contain(`platform=${PLATFORM}`)
|
||||||
|
browser.expect.url().to.contain(`file=${FILE}`)
|
||||||
|
browser.expect.url().to.contain(`repo=${REPO.replace('/', '%2F')}`)
|
||||||
|
|
||||||
|
await browser.url(`${IDEURL}?platform=${PLATFORM}`)
|
||||||
|
.waitForElementNotVisible('#error_alert')
|
||||||
|
.waitForElementVisible('#emuscreen')
|
||||||
|
.waitForElementVisible('.emuvideo')
|
||||||
|
|
||||||
|
browser.expect.url().to.contain(`platform=${PLATFORM}`)
|
||||||
|
browser.expect.url().to.contain(`file=${FILE}`)
|
||||||
|
browser.expect.url().to.contain(`repo=${REPO.replace('/', '%2F')}`)
|
||||||
|
|
||||||
|
await browser.url(`${IDEURL}?platform=apple2`)
|
||||||
|
.waitForElementNotVisible('#error_alert')
|
||||||
|
.waitForElementVisible('#emuscreen')
|
||||||
|
.waitForElementVisible('.emuvideo')
|
||||||
|
|
||||||
|
browser.expect.url().to.contain(`platform=apple2`)
|
||||||
|
browser.expect.url().to.not.contain(`repo=${REPO.replace('/', '%2F')}`)
|
||||||
|
|
||||||
|
await browser.url(`${IDEURL}?platform=${PLATFORM}&file=${PRESETFILE}`)
|
||||||
|
.waitForElementNotVisible('#error_alert')
|
||||||
|
.waitForElementVisible('#emuscreen')
|
||||||
|
.waitForElementVisible('.emuvideo')
|
||||||
|
|
||||||
|
browser.expect.url().to.contain(`platform=${PLATFORM}`)
|
||||||
|
browser.expect.url().to.contain(`file=${PRESETFILE}`)
|
||||||
|
browser.expect.url().to.not.contain(`repo=${REPO.replace('/', '%2F')}`)
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue