mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2026-10-25 00:02:16 +00:00
cc65: convert to WASI build; pinned to 2021 6ac4aa4; fs zips are converted old packages
This commit is contained in:
1 parent
50b26e09b8
commit
95e98eb0df
52 files changed
+215
-337140
No files matched your search
@@ -1,13 +1,14 @@
|
||||
// What a host C parser (clangd, cpptools) needs to read cc65 and SDCC
|
||||
// code: the toolchain's headers, extracted from the worker's emscripten
|
||||
// packages and patched where clang can't parse them; the defines the build
|
||||
// code: the toolchain's headers, extracted from the worker's filesystem
|
||||
// packages (emscripten .data or WASI .zip) and patched where clang can't parse them; the defines the build
|
||||
// passes; and flags that match the compiler's dialect. Forced-include shims
|
||||
// in extension/shims/ hide the keywords a macro can hide.
|
||||
// No vscode import: scripts/clangcheck.ts and the extension share it.
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { TOOL_META, getPreloadFSName } from '../../src/common/toolmeta';
|
||||
import * as zlib from 'zlib';
|
||||
import { TOOL_META, getSharedFileSystemName, getIncludeDirs } from '../../src/common/toolmeta';
|
||||
import { PLATFORM_PARAMS } from '../../src/worker/platforms';
|
||||
|
||||
export interface PackageFile { path: string; data: Buffer; }
|
||||
@@ -20,6 +21,34 @@ export function readPreloadPackage(workerDir: string, fsName: string): PackageFi
|
||||
return meta.files.map((f: any) => ({ path: f.filename, data: data.subarray(f.start, f.end) }));
|
||||
}
|
||||
|
||||
/** Files in a WASI filesystem zip (src/worker/fs/<name>.zip), at '/' + their zip path. */
|
||||
export function readWASIZipPackage(workerDir: string, zipName: string): PackageFile[] {
|
||||
const zip = fs.readFileSync(path.join(workerDir, 'fs', zipName));
|
||||
// the end-of-central-directory record gives the central directory's offset
|
||||
let eocd = zip.length - 22;
|
||||
while (eocd >= 0 && zip.readUInt32LE(eocd) !== 0x06054b50) eocd--;
|
||||
if (eocd < 0) throw new Error(`${zipName}: not a zip file`);
|
||||
const count = zip.readUInt16LE(eocd + 10);
|
||||
let p = zip.readUInt32LE(eocd + 16);
|
||||
const files: PackageFile[] = [];
|
||||
for (let i = 0; i < count; i++) {
|
||||
const method = zip.readUInt16LE(p + 10);
|
||||
const csize = zip.readUInt32LE(p + 20);
|
||||
const namelen = zip.readUInt16LE(p + 28);
|
||||
const extralen = zip.readUInt16LE(p + 30);
|
||||
const commentlen = zip.readUInt16LE(p + 32);
|
||||
const local = zip.readUInt32LE(p + 42);
|
||||
const name = zip.toString('utf8', p + 46, p + 46 + namelen);
|
||||
p += 46 + namelen + extralen + commentlen;
|
||||
if (name.endsWith('/')) continue; // directory
|
||||
const start = local + 30 + zip.readUInt16LE(local + 26) + zip.readUInt16LE(local + 28);
|
||||
const raw = zip.subarray(start, start + csize);
|
||||
if (method !== 0 && method !== 8) throw new Error(`${zipName}: ${name} uses unsupported compression ${method}`);
|
||||
files.push({ path: '/' + name, data: method === 8 ? zlib.inflateRawSync(raw) : raw });
|
||||
}
|
||||
return files;
|
||||
}
|
||||
|
||||
/** Rewrites what clang rejects in a toolchain header but the compiler accepts. */
|
||||
export function patchHeaderForClang(tool: string, text: string): string {
|
||||
if (tool === 'cc65') {
|
||||
@@ -37,15 +66,16 @@ export function patchHeaderForClang(tool: string, text: string): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a tool's patched headers under outDir: the preload package's files
|
||||
* at their own paths (/include/...), and the platform's lib directory
|
||||
* Writes a tool's patched headers under outDir: the filesystem package's
|
||||
* files at their own paths (/include/..., /share/cc65/include/...), and the platform's lib directory
|
||||
* (src/worker/lib/<platform>, which the worker copies into the build) in
|
||||
* /lib. Returns the files written.
|
||||
*/
|
||||
export function extractHeaders(workerDir: string, tool: string, platform: string, outDir: string): string[] {
|
||||
const files: PackageFile[] = [];
|
||||
const fsName = getPreloadFSName(tool, platform);
|
||||
if (fsName) files.push(...readPreloadPackage(workerDir, fsName));
|
||||
const fsName = getSharedFileSystemName(tool, platform);
|
||||
if (fsName && fsName.startsWith('wasi:')) files.push(...readWASIZipPackage(workerDir, fsName.substring(5)));
|
||||
else if (fsName) files.push(...readPreloadPackage(workerDir, fsName));
|
||||
const libDir = path.join(workerDir, 'lib', platform);
|
||||
if (fs.existsSync(libDir)) {
|
||||
for (const f of fs.readdirSync(libDir).filter((f) => /\.h$/i.test(f)))
|
||||
@@ -93,7 +123,8 @@ export function clangConfig(tool: string, platform: string, dirs: {
|
||||
: dir.replace(/^\/share/, dirs.headerDir));
|
||||
}
|
||||
}
|
||||
const includeRoot = path.join(dirs.headerDir, 'include');
|
||||
// the first of the tool's include dirs, as extractHeaders() wrote it
|
||||
const includeRoot = path.join(dirs.headerDir, getIncludeDirs(tool, platform)[0] || '/include');
|
||||
if (tool === 'cc65') {
|
||||
return {
|
||||
target: 'msp430', std: 'gnu89',
|
||||
|
||||
@@ -32,6 +32,7 @@ describe('clangConfig', function () {
|
||||
assert.equal(c.target, 'msp430');
|
||||
assert.ok(clangArgs(c).includes('-funsigned-char'));
|
||||
assert.equal(c.forcedInclude, path.join('/shims', 'cc65.h'));
|
||||
assert.ok(c.includeDirs.includes(path.join('/h', 'share', 'cc65', 'include')));
|
||||
});
|
||||
|
||||
it('reads -D and -I from extra_preproc_args', function () {
|
||||
@@ -59,8 +60,8 @@ describe('extractHeaders', function () {
|
||||
const out = fs.mkdtempSync(path.join(os.tmpdir(), 'cheaders-'));
|
||||
try {
|
||||
const files = extractHeaders(WORKER, 'cc65', 'c64', out);
|
||||
assert.ok(files.some((f) => f.endsWith(path.join('include', 'c64.h'))));
|
||||
const c64 = fs.readFileSync(path.join(out, 'include', 'c64.h'), 'latin1');
|
||||
assert.ok(files.some((f) => f.endsWith(path.join('share', 'cc65', 'include', 'c64.h'))));
|
||||
const c64 = fs.readFileSync(path.join(out, 'share', 'cc65', 'include', 'c64.h'), 'latin1');
|
||||
assert.ok(!/extern void \w+\[\]/.test(c64));
|
||||
const lib = extractHeaders(WORKER, 'sdcc', 'msx-libcv', out);
|
||||
assert.ok(lib.some((f) => f.endsWith(path.join('lib', 'cv.h'))));
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@
|
||||
"test-cli": "NODE_PATH=$(pwd) mocha --timeout 60000 test/cli/testcli.js",
|
||||
"test-services": "NODE_PATH=$(pwd) mocha --timeout 60000 test/services",
|
||||
"test-verilog": "NODE_PATH=$(pwd) mocha --timeout 60000 --reporter mocha-simple-html-reporter --reporter-options output=test/output/verilog.html test/verilog/testverilog.js",
|
||||
"test-extension": "cd extension && npm run test",
|
||||
"test-extension": "cd extension && npm run assets-quick && npm run test",
|
||||
"test-web-quick": "nightwatch -e chrome test/web/testembed.js",
|
||||
"test-web-all": "nightwatch -e chrome test/web",
|
||||
"fuzzbasic": "jsfuzz gen/common/basic/fuzz.js ~/basic/corpus/ --versifier false",
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface SymbolRecord {
|
||||
/** On-disk shape of a prebuilt index (gen/symidx/<name>.json). */
|
||||
export interface PrebuiltIndex {
|
||||
version: number; // bump when the extractor changes; runtime rejects mismatches
|
||||
corpus: string; // fs name, e.g. 'fs65-c64', or 'docs'
|
||||
corpus: string; // fs name, e.g. 'sdcc', 'wasi:cc65-fs-c64.zip', or 'docs'
|
||||
generated: string; // ISO date
|
||||
records: SymbolRecord[];
|
||||
ms?: object; // MiniSearch.toJSON() output, loaded via loadJSAsync
|
||||
|
||||
+26
-22
@@ -50,6 +50,8 @@ export interface BuildArgs {
|
||||
export interface PlatformToolConfig {
|
||||
/** preload filesystem name for this platform (was TOOL_PRELOADFS compound keys) */
|
||||
preloadFS?: string;
|
||||
/** WASI filesystem zip (in src/worker/fs/) for this platform, e.g. 'cc65-fs-nes.zip' */
|
||||
wasiFSZip?: string;
|
||||
/** skeleton filename override (defaults to tool id) */
|
||||
skeleton?: string;
|
||||
/** library args for this platform (was PLATFORM_PARAMS.libargs) */
|
||||
@@ -266,18 +268,18 @@ const TOOL_PLATFORM_HELPURL: { [tool: string]: { [platform: string]: string } }
|
||||
},
|
||||
};
|
||||
|
||||
const CC65_PRELOADFS: { [platform: string]: PlatformToolConfig } = {
|
||||
'apple2': { preloadFS: '65-apple2' },
|
||||
'c64': { preloadFS: '65-c64' },
|
||||
'vic20': { preloadFS: '65-vic20' },
|
||||
'nes': { preloadFS: '65-nes' },
|
||||
'atari8': { preloadFS: '65-atari8' },
|
||||
'vector': { preloadFS: '65-none' },
|
||||
'atari7800': { preloadFS: '65-none' },
|
||||
'devel': { preloadFS: '65-none' },
|
||||
'vcs': { preloadFS: '65-atari2600' },
|
||||
'pce': { preloadFS: '65-pce' },
|
||||
'exidy': { preloadFS: '65-none' },
|
||||
const CC65_WASIFS: { [platform: string]: PlatformToolConfig } = {
|
||||
'apple2': { wasiFSZip: 'cc65-fs-apple2.zip' },
|
||||
'c64': { wasiFSZip: 'cc65-fs-c64.zip' },
|
||||
'vic20': { wasiFSZip: 'cc65-fs-vic20.zip' },
|
||||
'nes': { wasiFSZip: 'cc65-fs-nes.zip' },
|
||||
'atari8': { wasiFSZip: 'cc65-fs-atari8.zip' },
|
||||
'vector': { wasiFSZip: 'cc65-fs-none.zip' },
|
||||
'atari7800': { wasiFSZip: 'cc65-fs-none.zip' },
|
||||
'devel': { wasiFSZip: 'cc65-fs-none.zip' },
|
||||
'vcs': { wasiFSZip: 'cc65-fs-atari2600.zip' },
|
||||
'pce': { wasiFSZip: 'cc65-fs-pce.zip' },
|
||||
'exidy': { wasiFSZip: 'cc65-fs-none.zip' },
|
||||
};
|
||||
|
||||
//// tool registry
|
||||
@@ -346,13 +348,13 @@ export const TOOL_META: { [id: string]: ToolMeta } = {
|
||||
cc65: {
|
||||
id: 'cc65', name: 'cc65', kind: 'compiler', arch: '6502',
|
||||
extensions: ['.c', '.h'],
|
||||
includeDirs: ['/include', '/asminc'],
|
||||
includeDirs: ['/share/cc65/include', '/share/cc65/asminc'],
|
||||
editorStyle: 'text/x-csrc',
|
||||
helpURL: 'https://cc65.github.io/doc/cc65.html',
|
||||
wasmModule: 'cc65',
|
||||
version: '2.19',
|
||||
defineFlag: '-D', defineInline: true,
|
||||
platforms: CC65_PRELOADFS,
|
||||
platforms: CC65_WASIFS,
|
||||
includePatterns: SHARED_INCLUDE_PATTERNS,
|
||||
linkPatterns: SHARED_LINK_PATTERNS,
|
||||
},
|
||||
@@ -360,13 +362,13 @@ export const TOOL_META: { [id: string]: ToolMeta } = {
|
||||
ca65: {
|
||||
id: 'ca65', name: 'ca65', kind: 'assembler', arch: '6502',
|
||||
extensions: ['.s', '.ca65', '.inc'],
|
||||
includeDirs: ['/include', '/asminc'],
|
||||
includeDirs: ['/share/cc65/include', '/share/cc65/asminc'],
|
||||
editorStyle: '6502',
|
||||
helpURL: 'https://cc65.github.io/doc/ca65.html',
|
||||
wasmModule: 'ca65',
|
||||
version: '2.19',
|
||||
defineFlag: '-D', defineInline: false,
|
||||
platforms: CC65_PRELOADFS,
|
||||
platforms: CC65_WASIFS,
|
||||
includePatterns: SHARED_INCLUDE_PATTERNS,
|
||||
linkPatterns: SHARED_LINK_PATTERNS,
|
||||
},
|
||||
@@ -614,7 +616,7 @@ export const TOOL_META: { [id: string]: ToolMeta } = {
|
||||
helpURL: 'https://github.com/dmsc/fastbasic/blob/v4.4/manual.md',
|
||||
wasmModule: 'fastbasic-int',
|
||||
version: '4.4',
|
||||
platforms: { default: { preloadFS: '65-atari8' } },
|
||||
platforms: { default: { wasiFSZip: 'cc65-fs-atari8.zip' } },
|
||||
includePatterns: SHARED_INCLUDE_PATTERNS,
|
||||
linkPatterns: SHARED_LINK_PATTERNS,
|
||||
},
|
||||
@@ -670,9 +672,9 @@ export const TOOL_META: { [id: string]: ToolMeta } = {
|
||||
extensions: ['.ecs'],
|
||||
editorStyle: 'ecs',
|
||||
platforms: {
|
||||
vcs: { preloadFS: '65-atari2600' },
|
||||
nes: { preloadFS: '65-nes' },
|
||||
c64: { preloadFS: '65-c64' },
|
||||
vcs: { wasiFSZip: 'cc65-fs-atari2600.zip' },
|
||||
nes: { wasiFSZip: 'cc65-fs-nes.zip' },
|
||||
c64: { wasiFSZip: 'cc65-fs-c64.zip' },
|
||||
},
|
||||
includePatterns: [...SHARED_INCLUDE_PATTERNS, ...ECS_INCLUDE_PATTERNS],
|
||||
},
|
||||
@@ -844,7 +846,7 @@ export function getPreloadFSName(tool: string, platform?: string): string | unde
|
||||
if (platform) {
|
||||
// Try the exact id, then the root base id so suffixed platform ids
|
||||
// (e.g. 'atari8-800', 'atari8-5200.xlmame') resolve to the shared
|
||||
// filesystem registered under the root ('atari8' -> '65-atari8').
|
||||
// filesystem registered under the root (e.g. 'atari8-800' -> 'atari8').
|
||||
let p = meta.platforms[platform];
|
||||
if (p && p.preloadFS) return p.preloadFS;
|
||||
let base = getRootBasePlatform(platform);
|
||||
@@ -957,13 +959,15 @@ export function getIncludeDirs(tool: string, platform_id: string): string[] {
|
||||
|
||||
/**
|
||||
* Name of the shared filesystem to query for this tool's bundled files:
|
||||
* either the emscripten preloadFS package name (e.g. '65-nes') or, for tools
|
||||
* either the emscripten preloadFS package name (e.g. 'sdcc') or, for tools
|
||||
* with a WASI filesystem zip (e.g. cc2600), 'wasi:<zipname>'.
|
||||
* Undefined if the tool has no bundled filesystem.
|
||||
*/
|
||||
export function getSharedFileSystemName(tool: string, platform?: string): string | undefined {
|
||||
var fsName = getPreloadFSName(tool, platform);
|
||||
if (fsName) return fsName;
|
||||
let config = getPlatformToolConfig(tool, platform);
|
||||
if (config && config.wasiFSZip) return 'wasi:' + config.wasiFSZip;
|
||||
let meta = tool && getToolMeta(tool);
|
||||
return (meta && meta.wasiFSZip) ? 'wasi:' + meta.wasiFSZip : undefined;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ export interface WorkerItemUpdate {
|
||||
// TODO: split into different msg types
|
||||
export interface WorkerMessage {
|
||||
preload?:string
|
||||
/** preload a filesystem package directly by name (e.g. '65-nes') */
|
||||
/** preload a filesystem package directly by name (e.g. 'sdcc', 'wasi:cc65-fs-nes.zip') */
|
||||
preload_fs?:string
|
||||
/** read a file from the preloaded filesystem package (path e.g. '/include/nes.h')
|
||||
* requires preload_fs; result comes back as {output:Uint8Array} */
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large.
Load diff
@@ -1,236 +0,0 @@
|
||||
|
||||
var Module = typeof Module !== 'undefined' ? Module : {};
|
||||
|
||||
if (!Module.expectedDataFileDownloads) {
|
||||
Module.expectedDataFileDownloads = 0;
|
||||
}
|
||||
Module.expectedDataFileDownloads++;
|
||||
(function() {
|
||||
// When running as a pthread, FS operations are proxied to the main thread, so we don't need to
|
||||
// fetch the .data bundle on the worker
|
||||
if (Module['ENVIRONMENT_IS_PTHREAD']) return;
|
||||
var loadPackage = function(metadata) {
|
||||
|
||||
var PACKAGE_PATH = '';
|
||||
if (typeof window === 'object') {
|
||||
PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
} else if (typeof process === 'undefined' && typeof location !== 'undefined') {
|
||||
// web worker
|
||||
PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
}
|
||||
var PACKAGE_NAME = '/home/pzp/8bitworkshop-compilers/output/fs/fs65-apple2.data';
|
||||
var REMOTE_PACKAGE_BASE = 'fs65-apple2.data';
|
||||
if (typeof Module['locateFilePackage'] === 'function' && !Module['locateFile']) {
|
||||
Module['locateFile'] = Module['locateFilePackage'];
|
||||
err('warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)');
|
||||
}
|
||||
var REMOTE_PACKAGE_NAME = Module['locateFile'] ? Module['locateFile'](REMOTE_PACKAGE_BASE, '') : REMOTE_PACKAGE_BASE;
|
||||
|
||||
var REMOTE_PACKAGE_SIZE = metadata['remote_package_size'];
|
||||
var PACKAGE_UUID = metadata['package_uuid'];
|
||||
|
||||
function fetchRemotePackage(packageName, packageSize, callback, errback) {
|
||||
|
||||
if (typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string') {
|
||||
require('fs').readFile(packageName, function(err, contents) {
|
||||
if (err) {
|
||||
errback(err);
|
||||
} else {
|
||||
callback(contents.buffer);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', packageName, true);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.onprogress = function(event) {
|
||||
var url = packageName;
|
||||
var size = packageSize;
|
||||
if (event.total) size = event.total;
|
||||
if (event.loaded) {
|
||||
if (!xhr.addedTotal) {
|
||||
xhr.addedTotal = true;
|
||||
if (!Module.dataFileDownloads) Module.dataFileDownloads = {};
|
||||
Module.dataFileDownloads[url] = {
|
||||
loaded: event.loaded,
|
||||
total: size
|
||||
};
|
||||
} else {
|
||||
Module.dataFileDownloads[url].loaded = event.loaded;
|
||||
}
|
||||
var total = 0;
|
||||
var loaded = 0;
|
||||
var num = 0;
|
||||
for (var download in Module.dataFileDownloads) {
|
||||
var data = Module.dataFileDownloads[download];
|
||||
total += data.total;
|
||||
loaded += data.loaded;
|
||||
num++;
|
||||
}
|
||||
total = Math.ceil(total * Module.expectedDataFileDownloads/num);
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data... (' + loaded + '/' + total + ')');
|
||||
} else if (!Module.dataFileDownloads) {
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data...');
|
||||
}
|
||||
};
|
||||
xhr.onerror = function(event) {
|
||||
throw new Error("NetworkError for: " + packageName);
|
||||
}
|
||||
xhr.onload = function(event) {
|
||||
if (xhr.status == 200 || xhr.status == 304 || xhr.status == 206 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
|
||||
var packageData = xhr.response;
|
||||
callback(packageData);
|
||||
} else {
|
||||
throw new Error(xhr.statusText + " : " + xhr.responseURL);
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
};
|
||||
|
||||
function handleError(error) {
|
||||
console.error('package error:', error);
|
||||
};
|
||||
|
||||
var fetchedCallback = null;
|
||||
var fetched = Module['getPreloadedPackage'] ? Module['getPreloadedPackage'](REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE) : null;
|
||||
|
||||
if (!fetched) fetchRemotePackage(REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE, function(data) {
|
||||
if (fetchedCallback) {
|
||||
fetchedCallback(data);
|
||||
fetchedCallback = null;
|
||||
} else {
|
||||
fetched = data;
|
||||
}
|
||||
}, handleError);
|
||||
|
||||
function runWithFS() {
|
||||
|
||||
function assert(check, msg) {
|
||||
if (!check) throw msg + new Error().stack;
|
||||
}
|
||||
Module['FS_createPath']("/", "include", true, true);
|
||||
Module['FS_createPath']("/include", "em", true, true);
|
||||
Module['FS_createPath']("/include", "geos", true, true);
|
||||
Module['FS_createPath']("/include", "tgi", true, true);
|
||||
Module['FS_createPath']("/include", "mouse", true, true);
|
||||
Module['FS_createPath']("/include", "joystick", true, true);
|
||||
Module['FS_createPath']("/include", "sys", true, true);
|
||||
Module['FS_createPath']("/", "asminc", true, true);
|
||||
Module['FS_createPath']("/", "cfg", true, true);
|
||||
Module['FS_createPath']("/", "lib", true, true);
|
||||
Module['FS_createPath']("/", "target", true, true);
|
||||
Module['FS_createPath']("/target", "apple2", true, true);
|
||||
Module['FS_createPath']("/target/apple2", "drv", true, true);
|
||||
Module['FS_createPath']("/target/apple2/drv", "ser", true, true);
|
||||
Module['FS_createPath']("/target/apple2/drv", "joy", true, true);
|
||||
Module['FS_createPath']("/target/apple2/drv", "tgi", true, true);
|
||||
Module['FS_createPath']("/target/apple2/drv", "emd", true, true);
|
||||
Module['FS_createPath']("/target/apple2/drv", "mou", true, true);
|
||||
Module['FS_createPath']("/target/apple2", "util", true, true);
|
||||
Module['FS_createPath']("/target", "apple2enh", true, true);
|
||||
Module['FS_createPath']("/target/apple2enh", "drv", true, true);
|
||||
Module['FS_createPath']("/target/apple2enh/drv", "ser", true, true);
|
||||
Module['FS_createPath']("/target/apple2enh/drv", "joy", true, true);
|
||||
Module['FS_createPath']("/target/apple2enh/drv", "tgi", true, true);
|
||||
Module['FS_createPath']("/target/apple2enh/drv", "emd", true, true);
|
||||
Module['FS_createPath']("/target/apple2enh/drv", "mou", true, true);
|
||||
Module['FS_createPath']("/target/apple2enh", "util", true, true);
|
||||
|
||||
/** @constructor */
|
||||
function DataRequest(start, end, audio) {
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.audio = audio;
|
||||
}
|
||||
DataRequest.prototype = {
|
||||
requests: {},
|
||||
open: function(mode, name) {
|
||||
this.name = name;
|
||||
this.requests[name] = this;
|
||||
Module['addRunDependency']('fp ' + this.name);
|
||||
},
|
||||
send: function() {},
|
||||
onload: function() {
|
||||
var byteArray = this.byteArray.subarray(this.start, this.end);
|
||||
this.finish(byteArray);
|
||||
},
|
||||
finish: function(byteArray) {
|
||||
var that = this;
|
||||
|
||||
Module['FS_createDataFile'](this.name, null, byteArray, true, true, true); // canOwn this data in the filesystem, it is a slide into the heap that will never change
|
||||
Module['removeRunDependency']('fp ' + that.name);
|
||||
|
||||
this.requests[this.name] = null;
|
||||
}
|
||||
};
|
||||
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
new DataRequest(files[i]['start'], files[i]['end'], files[i]['audio'] || 0).open('GET', files[i]['filename']);
|
||||
}
|
||||
|
||||
|
||||
function processPackageData(arrayBuffer) {
|
||||
assert(arrayBuffer, 'Loading data file failed.');
|
||||
assert(arrayBuffer instanceof ArrayBuffer, 'bad input to processPackageData');
|
||||
var byteArray = new Uint8Array(arrayBuffer);
|
||||
var curr;
|
||||
|
||||
// Reuse the bytearray from the XHR as the source for file reads.
|
||||
DataRequest.prototype.byteArray = byteArray;
|
||||
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
DataRequest.prototype.requests[files[i].filename].onload();
|
||||
}
|
||||
Module['removeRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-apple2.data');
|
||||
|
||||
};
|
||||
Module['addRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-apple2.data');
|
||||
|
||||
if (!Module.preloadResults) Module.preloadResults = {};
|
||||
|
||||
Module.preloadResults[PACKAGE_NAME] = {fromCache: false};
|
||||
if (fetched) {
|
||||
processPackageData(fetched);
|
||||
fetched = null;
|
||||
} else {
|
||||
fetchedCallback = processPackageData;
|
||||
}
|
||||
|
||||
}
|
||||
if (Module['calledRun']) {
|
||||
runWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runWithFS); // FS is not initialized yet, wait for it
|
||||
}
|
||||
|
||||
Module['removeRunDependency']('fs65-apple2.js.metadata');
|
||||
}
|
||||
|
||||
function runMetaWithFS() {
|
||||
Module['addRunDependency']('fs65-apple2.js.metadata');
|
||||
var REMOTE_METADATA_NAME = Module['locateFile'] ? Module['locateFile']('fs65-apple2.js.metadata', '') : 'fs65-apple2.js.metadata';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
loadPackage(JSON.parse(xhr.responseText));
|
||||
}
|
||||
}
|
||||
xhr.open('GET', REMOTE_METADATA_NAME, true);
|
||||
xhr.overrideMimeType('application/json');
|
||||
xhr.send(null);
|
||||
}
|
||||
|
||||
if (Module['calledRun']) {
|
||||
runMetaWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runMetaWithFS);
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{"files":[{"filename":"/include/lz4.h","start":0,"end":2641},{"filename":"/include/c64.h","start":2641,"end":9642},{"filename":"/include/_pbi.h","start":9642,"end":12785},{"filename":"/include/apple2_filetype.h","start":12785,"end":29883},{"filename":"/include/nes.h","start":29883,"end":36683},{"filename":"/include/assert.h","start":36683,"end":39683},{"filename":"/include/_6545.h","start":39683,"end":42515},{"filename":"/include/_6522.h","start":42515,"end":46296},{"filename":"/include/modload.h","start":46296,"end":51278},{"filename":"/include/unistd.h","start":51278,"end":55587},{"filename":"/include/c128.h","start":55587,"end":62105},{"filename":"/include/cx16.h","start":62105,"end":76818},{"filename":"/include/_mikey.h","start":76818,"end":82171},{"filename":"/include/c16.h","start":82171,"end":85136},{"filename":"/include/_6525.h","start":85136,"end":88546},{"filename":"/include/stdio.h","start":88546,"end":94466},{"filename":"/include/lynx.h","start":94466,"end":103027},{"filename":"/include/6502.h","start":103027,"end":108497},{"filename":"/include/string.h","start":108497,"end":113601},{"filename":"/include/atari5200.h","start":113601,"end":117655},{"filename":"/include/_vic.h","start":117655,"end":121371},{"filename":"/include/cbm_filetype.h","start":121371,"end":126320},{"filename":"/include/dirent.h","start":126320,"end":131644},{"filename":"/include/vic20.h","start":131644,"end":137148},{"filename":"/include/atari_screen_charmap.h","start":137148,"end":147122},{"filename":"/include/iso646.h","start":147122,"end":149985},{"filename":"/include/locale.h","start":149985,"end":153642},{"filename":"/include/stddef.h","start":153642,"end":156699},{"filename":"/include/em.h","start":156699,"end":162993},{"filename":"/include/cc65.h","start":162993,"end":168134},{"filename":"/include/stdbool.h","start":168134,"end":170640},{"filename":"/include/osic1p.h","start":170640,"end":173439},{"filename":"/include/stdlib.h","start":173439,"end":179438},{"filename":"/include/atari.h","start":179438,"end":201203},{"filename":"/include/_heap.h","start":201203,"end":202321},{"filename":"/include/cbm_petscii_charmap.h","start":202321,"end":212061},{"filename":"/include/conio.h","start":212061,"end":221087},{"filename":"/include/dio.h","start":221087,"end":226557},{"filename":"/include/_vic2.h","start":226557,"end":237392},{"filename":"/include/time.h","start":237392,"end":242529},{"filename":"/include/cbm510.h","start":242529,"end":249125},{"filename":"/include/atari_atascii_charmap.h","start":249125,"end":258961},{"filename":"/include/joystick.h","start":258961,"end":264102},{"filename":"/include/_suzy.h","start":264102,"end":275260},{"filename":"/include/tgi.h","start":275260,"end":286112},{"filename":"/include/serial.h","start":286112,"end":294017},{"filename":"/include/zlib.h","start":294017,"end":301129},{"filename":"/include/_atari5200os.h","start":301129,"end":305689},{"filename":"/include/stdint.h","start":305689,"end":311885},{"filename":"/include/cbm610.h","start":311885,"end":317911},{"filename":"/include/pet.h","start":317911,"end":322558},{"filename":"/include/_tia.h","start":322558,"end":325189},{"filename":"/include/ctype.h","start":325189,"end":329579},{"filename":"/include/_vdc.h","start":329579,"end":332406},{"filename":"/include/_6526.h","start":332406,"end":336368},{"filename":"/include/geos.h","start":336368,"end":339579},{"filename":"/include/atari2600.h","start":339579,"end":340628},{"filename":"/include/device.h","start":340628,"end":343840},{"filename":"/include/pce.h","start":343840,"end":348647},{"filename":"/include/apple2enh.h","start":348647,"end":353379},{"filename":"/include/cbm264.h","start":353379,"end":359658},{"filename":"/include/plus4.h","start":359658,"end":362726},{"filename":"/include/_riot.h","start":362726,"end":363774},{"filename":"/include/inttypes.h","start":363774,"end":371584},{"filename":"/include/peekpoke.h","start":371584,"end":374692},{"filename":"/include/setjmp.h","start":374692,"end":377538},{"filename":"/include/dbg.h","start":377538,"end":383313},{"filename":"/include/_antic.h","start":383313,"end":395141},{"filename":"/include/target.h","start":395141,"end":398133},{"filename":"/include/_gtia.h","start":398133,"end":411972},{"filename":"/include/stdarg.h","start":411972,"end":414885},{"filename":"/include/gamate.h","start":414885,"end":422616},{"filename":"/include/fcntl.h","start":422616,"end":426166},{"filename":"/include/sym1.h","start":426166,"end":432999},{"filename":"/include/creativision.h","start":432999,"end":436611},{"filename":"/include/telestrat.h","start":436611,"end":441466},{"filename":"/include/atmos.h","start":441466,"end":447354},{"filename":"/include/_atarios.h","start":447354,"end":488540},{"filename":"/include/cbm.h","start":488540,"end":500432},{"filename":"/include/signal.h","start":500432,"end":503773},{"filename":"/include/_sid.h","start":503773,"end":507399},{"filename":"/include/pen.h","start":507399,"end":511099},{"filename":"/incluLine truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,210 +0,0 @@
|
||||
|
||||
var Module = typeof Module !== 'undefined' ? Module : {};
|
||||
|
||||
if (!Module.expectedDataFileDownloads) {
|
||||
Module.expectedDataFileDownloads = 0;
|
||||
}
|
||||
|
||||
Module.expectedDataFileDownloads++;
|
||||
(function() {
|
||||
// Do not attempt to redownload the virtual filesystem data when in a pthread or a Wasm Worker context.
|
||||
if (Module['ENVIRONMENT_IS_PTHREAD'] || Module['$ww']) return;
|
||||
var loadPackage = function(metadata) {
|
||||
|
||||
var PACKAGE_PATH = '';
|
||||
if (typeof window === 'object') {
|
||||
PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
} else if (typeof process === 'undefined' && typeof location !== 'undefined') {
|
||||
// web worker
|
||||
PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
}
|
||||
var PACKAGE_NAME = '/home/pzp/8bitworkshop-compilers/output/fs/fs65-atari2600.data';
|
||||
var REMOTE_PACKAGE_BASE = 'fs65-atari2600.data';
|
||||
if (typeof Module['locateFilePackage'] === 'function' && !Module['locateFile']) {
|
||||
Module['locateFile'] = Module['locateFilePackage'];
|
||||
err('warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)');
|
||||
}
|
||||
var REMOTE_PACKAGE_NAME = Module['locateFile'] ? Module['locateFile'](REMOTE_PACKAGE_BASE, '') : REMOTE_PACKAGE_BASE;
|
||||
var REMOTE_PACKAGE_SIZE = metadata['remote_package_size'];
|
||||
|
||||
function fetchRemotePackage(packageName, packageSize, callback, errback) {
|
||||
if (typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string') {
|
||||
require('fs').readFile(packageName, function(err, contents) {
|
||||
if (err) {
|
||||
errback(err);
|
||||
} else {
|
||||
callback(contents.buffer);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', packageName, true);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.onprogress = function(event) {
|
||||
var url = packageName;
|
||||
var size = packageSize;
|
||||
if (event.total) size = event.total;
|
||||
if (event.loaded) {
|
||||
if (!xhr.addedTotal) {
|
||||
xhr.addedTotal = true;
|
||||
if (!Module.dataFileDownloads) Module.dataFileDownloads = {};
|
||||
Module.dataFileDownloads[url] = {
|
||||
loaded: event.loaded,
|
||||
total: size
|
||||
};
|
||||
} else {
|
||||
Module.dataFileDownloads[url].loaded = event.loaded;
|
||||
}
|
||||
var total = 0;
|
||||
var loaded = 0;
|
||||
var num = 0;
|
||||
for (var download in Module.dataFileDownloads) {
|
||||
var data = Module.dataFileDownloads[download];
|
||||
total += data.total;
|
||||
loaded += data.loaded;
|
||||
num++;
|
||||
}
|
||||
total = Math.ceil(total * Module.expectedDataFileDownloads/num);
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data... (' + loaded + '/' + total + ')');
|
||||
} else if (!Module.dataFileDownloads) {
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data...');
|
||||
}
|
||||
};
|
||||
xhr.onerror = function(event) {
|
||||
throw new Error("NetworkError for: " + packageName);
|
||||
}
|
||||
xhr.onload = function(event) {
|
||||
if (xhr.status == 200 || xhr.status == 304 || xhr.status == 206 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
|
||||
var packageData = xhr.response;
|
||||
callback(packageData);
|
||||
} else {
|
||||
throw new Error(xhr.statusText + " : " + xhr.responseURL);
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
};
|
||||
|
||||
function handleError(error) {
|
||||
console.error('package error:', error);
|
||||
};
|
||||
|
||||
var fetchedCallback = null;
|
||||
var fetched = Module['getPreloadedPackage'] ? Module['getPreloadedPackage'](REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE) : null;
|
||||
|
||||
if (!fetched) fetchRemotePackage(REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE, function(data) {
|
||||
if (fetchedCallback) {
|
||||
fetchedCallback(data);
|
||||
fetchedCallback = null;
|
||||
} else {
|
||||
fetched = data;
|
||||
}
|
||||
}, handleError);
|
||||
|
||||
function runWithFS() {
|
||||
|
||||
function assert(check, msg) {
|
||||
if (!check) throw msg + new Error().stack;
|
||||
}
|
||||
Module['FS_createPath']("/", "asminc", true, true);
|
||||
Module['FS_createPath']("/", "cfg", true, true);
|
||||
Module['FS_createPath']("/", "include", true, true);
|
||||
Module['FS_createPath']("/include", "arpa", true, true);
|
||||
Module['FS_createPath']("/include", "em", true, true);
|
||||
Module['FS_createPath']("/include", "geos", true, true);
|
||||
Module['FS_createPath']("/include", "joystick", true, true);
|
||||
Module['FS_createPath']("/include", "mouse", true, true);
|
||||
Module['FS_createPath']("/include", "sys", true, true);
|
||||
Module['FS_createPath']("/include", "tgi", true, true);
|
||||
Module['FS_createPath']("/", "lib", true, true);
|
||||
|
||||
/** @constructor */
|
||||
function DataRequest(start, end, audio) {
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.audio = audio;
|
||||
}
|
||||
DataRequest.prototype = {
|
||||
requests: {},
|
||||
open: function(mode, name) {
|
||||
this.name = name;
|
||||
this.requests[name] = this;
|
||||
Module['addRunDependency']('fp ' + this.name);
|
||||
},
|
||||
send: function() {},
|
||||
onload: function() {
|
||||
var byteArray = this.byteArray.subarray(this.start, this.end);
|
||||
this.finish(byteArray);
|
||||
},
|
||||
finish: function(byteArray) {
|
||||
var that = this;
|
||||
// canOwn this data in the filesystem, it is a slide into the heap that will never change
|
||||
Module['FS_createDataFile'](this.name, null, byteArray, true, true, true);
|
||||
Module['removeRunDependency']('fp ' + that.name);
|
||||
this.requests[this.name] = null;
|
||||
}
|
||||
};
|
||||
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
new DataRequest(files[i]['start'], files[i]['end'], files[i]['audio'] || 0).open('GET', files[i]['filename']);
|
||||
}
|
||||
|
||||
function processPackageData(arrayBuffer) {
|
||||
assert(arrayBuffer, 'Loading data file failed.');
|
||||
assert(arrayBuffer.constructor.name === ArrayBuffer.name, 'bad input to processPackageData');
|
||||
var byteArray = new Uint8Array(arrayBuffer);
|
||||
var curr;
|
||||
// Reuse the bytearray from the XHR as the source for file reads.
|
||||
DataRequest.prototype.byteArray = byteArray;
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
DataRequest.prototype.requests[files[i].filename].onload();
|
||||
} Module['removeRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-atari2600.data');
|
||||
|
||||
};
|
||||
Module['addRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-atari2600.data');
|
||||
|
||||
if (!Module.preloadResults) Module.preloadResults = {};
|
||||
|
||||
Module.preloadResults[PACKAGE_NAME] = {fromCache: false};
|
||||
if (fetched) {
|
||||
processPackageData(fetched);
|
||||
fetched = null;
|
||||
} else {
|
||||
fetchedCallback = processPackageData;
|
||||
}
|
||||
|
||||
}
|
||||
if (Module['calledRun']) {
|
||||
runWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runWithFS); // FS is not initialized yet, wait for it
|
||||
}
|
||||
|
||||
Module['removeRunDependency']('fs65-atari2600.js.metadata');
|
||||
}
|
||||
|
||||
function runMetaWithFS() {
|
||||
Module['addRunDependency']('fs65-atari2600.js.metadata');
|
||||
var REMOTE_METADATA_NAME = Module['locateFile'] ? Module['locateFile']('fs65-atari2600.js.metadata', '') : 'fs65-atari2600.js.metadata';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
loadPackage(JSON.parse(xhr.responseText));
|
||||
}
|
||||
}
|
||||
xhr.open('GET', REMOTE_METADATA_NAME, true);
|
||||
xhr.overrideMimeType('application/json');
|
||||
xhr.send(null);
|
||||
}
|
||||
|
||||
if (Module['calledRun']) {
|
||||
runMetaWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runMetaWithFS);
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -1 +0,0 @@
|
||||
{"files":[{"filename":"/asminc/_file.inc","start":0,"end":464},{"filename":"/asminc/_heap.inc","start":464,"end":1349},{"filename":"/asminc/accelerator.inc","start":1349,"end":3049},{"filename":"/asminc/apple2.inc","start":3049,"end":6307},{"filename":"/asminc/apple2.mac","start":6307,"end":7595},{"filename":"/asminc/ascii_charmap.inc","start":7595,"end":14425},{"filename":"/asminc/atari.inc","start":14425,"end":62110},{"filename":"/asminc/atari.mac","start":62110,"end":63823},{"filename":"/asminc/atari2600.inc","start":63823,"end":64016},{"filename":"/asminc/atari2600_riot.inc","start":64016,"end":64400},{"filename":"/asminc/atari2600_tia.inc","start":64400,"end":65449},{"filename":"/asminc/atari5200.inc","start":65449,"end":69752},{"filename":"/asminc/atari7800.inc","start":69752,"end":70080},{"filename":"/asminc/atari7800_maria.inc","start":70080,"end":70610},{"filename":"/asminc/atari7800_riot.inc","start":70610,"end":70994},{"filename":"/asminc/atari7800_tia.inc","start":70994,"end":72043},{"filename":"/asminc/atari_antic.inc","start":72043,"end":75365},{"filename":"/asminc/atari_atascii_charmap.inc","start":75365,"end":82338},{"filename":"/asminc/atari_gtia.inc","start":82338,"end":86760},{"filename":"/asminc/atari_pokey.inc","start":86760,"end":88494},{"filename":"/asminc/atari_screen_charmap.inc","start":88494,"end":95469},{"filename":"/asminc/atmos.inc","start":95469,"end":98860},{"filename":"/asminc/c128.inc","start":98860,"end":105926},{"filename":"/asminc/c16.inc","start":105926,"end":106066},{"filename":"/asminc/c64.inc","start":106066,"end":112649},{"filename":"/asminc/cbm.mac","start":112649,"end":114085},{"filename":"/asminc/cbm510.inc","start":114085,"end":118479},{"filename":"/asminc/cbm610.inc","start":118479,"end":121083},{"filename":"/asminc/cbm_filetype.inc","start":121083,"end":122234},{"filename":"/asminc/cbm_kernal.inc","start":122234,"end":128300},{"filename":"/asminc/cbm_petscii_charmap.inc","start":128300,"end":135103},{"filename":"/asminc/cbm_screen_charmap.inc","start":135103,"end":141373},{"filename":"/asminc/cpu.mac","start":141373,"end":142310},{"filename":"/asminc/creativision.inc","start":142310,"end":144022},{"filename":"/asminc/ctype.inc","start":144022,"end":145098},{"filename":"/asminc/ctype_common.inc","start":145098,"end":151854},{"filename":"/asminc/ctypetable.inc","start":151854,"end":153425},{"filename":"/asminc/cx16.inc","start":153425,"end":167757},{"filename":"/asminc/em-error.inc","start":167757,"end":170840},{"filename":"/asminc/em-kernel.inc","start":170840,"end":175789},{"filename":"/asminc/errno.inc","start":175789,"end":177152},{"filename":"/asminc/fcntl.inc","start":177152,"end":177500},{"filename":"/asminc/gamate.inc","start":177500,"end":178914},{"filename":"/asminc/generic.mac","start":178914,"end":179870},{"filename":"/asminc/get_tv.inc","start":179870,"end":180095},{"filename":"/asminc/joy-error.inc","start":180095,"end":182980},{"filename":"/asminc/joy-kernel.inc","start":182980,"end":186983},{"filename":"/asminc/kim1.inc","start":186983,"end":188172},{"filename":"/asminc/longbranch.mac","start":188172,"end":190804},{"filename":"/asminc/lynx.inc","start":190804,"end":196556},{"filename":"/asminc/modload.inc","start":196556,"end":200576},{"filename":"/asminc/module.mac","start":200576,"end":200854},{"filename":"/asminc/mouse-kernel.inc","start":200854,"end":208554},{"filename":"/asminc/nes.inc","start":208554,"end":211360},{"filename":"/asminc/o65.inc","start":211360,"end":218757},{"filename":"/asminc/opcodes.inc","start":218757,"end":229981},{"filename":"/asminc/pce.inc","start":229981,"end":232914},{"filename":"/asminc/pet.inc","start":232914,"end":236908},{"filename":"/asminc/plus4.inc","start":236908,"end":239736},{"filename":"/asminc/ser-error.inc","start":239736,"end":243180},{"filename":"/asminc/ser-kernel.inc","start":243180,"end":249960},{"filename":"/asminc/signal.inc","start":249960,"end":253005},{"filename":"/asminc/smc.inc","start":253005,"end":261206},{"filename":"/asminc/stdio.inc","start":261206,"end":264617},{"filename":"/asminc/supervision.inc","start":264617,"end":266089},{"filename":"/asminc/sym1.inc","start":266089,"end":272999},{"filename":"/asminc/telestrat.inc","start":272999,"end":289778},{"filename":"/asminc/tgi-error.inc","start":289778,"end":293074},{"filename":"/asminc/tgi-kernel.inc","start":293074,"end":303557},{"filename":"/asminc/tgi-vectorfont.inc","start":303557,"end":307470},{"filename":"/asminc/time.inc","start":307470,"end":310928},{"filename":"/asminc/utsname.inc","start":310928,"end":313742},{"filename":"/asminc/vic20.inc","start":313742,"end":318619},{"filename":"/asminc/zeropage.inc","start":318619,"end":319338},{"filename":"/cfg/atari2600.cfg","start":319338,"end":320159},{"filename":"/include/6502.h","start":320159,"end":325629},{"filename":"/include/_6522.h","start":325629,"end":329410},{"filename":"/include/_6525.h","start":329410,"end":332820},{"filename":"/include/_6526.h","start":332820,"end":336782}Line truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,238 +0,0 @@
|
||||
|
||||
var Module = typeof Module !== 'undefined' ? Module : {};
|
||||
|
||||
if (!Module.expectedDataFileDownloads) {
|
||||
Module.expectedDataFileDownloads = 0;
|
||||
}
|
||||
Module.expectedDataFileDownloads++;
|
||||
(function() {
|
||||
// When running as a pthread, FS operations are proxied to the main thread, so we don't need to
|
||||
// fetch the .data bundle on the worker
|
||||
if (Module['ENVIRONMENT_IS_PTHREAD']) return;
|
||||
var loadPackage = function(metadata) {
|
||||
|
||||
var PACKAGE_PATH = '';
|
||||
if (typeof window === 'object') {
|
||||
PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
} else if (typeof process === 'undefined' && typeof location !== 'undefined') {
|
||||
// web worker
|
||||
PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
}
|
||||
var PACKAGE_NAME = '/home/pzp/8bitworkshop-compilers/output/fs/fs65-atari.data';
|
||||
var REMOTE_PACKAGE_BASE = 'fs65-atari.data';
|
||||
if (typeof Module['locateFilePackage'] === 'function' && !Module['locateFile']) {
|
||||
Module['locateFile'] = Module['locateFilePackage'];
|
||||
err('warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)');
|
||||
}
|
||||
var REMOTE_PACKAGE_NAME = Module['locateFile'] ? Module['locateFile'](REMOTE_PACKAGE_BASE, '') : REMOTE_PACKAGE_BASE;
|
||||
|
||||
var REMOTE_PACKAGE_SIZE = metadata['remote_package_size'];
|
||||
var PACKAGE_UUID = metadata['package_uuid'];
|
||||
|
||||
function fetchRemotePackage(packageName, packageSize, callback, errback) {
|
||||
|
||||
if (typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string') {
|
||||
require('fs').readFile(packageName, function(err, contents) {
|
||||
if (err) {
|
||||
errback(err);
|
||||
} else {
|
||||
callback(contents.buffer);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', packageName, true);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.onprogress = function(event) {
|
||||
var url = packageName;
|
||||
var size = packageSize;
|
||||
if (event.total) size = event.total;
|
||||
if (event.loaded) {
|
||||
if (!xhr.addedTotal) {
|
||||
xhr.addedTotal = true;
|
||||
if (!Module.dataFileDownloads) Module.dataFileDownloads = {};
|
||||
Module.dataFileDownloads[url] = {
|
||||
loaded: event.loaded,
|
||||
total: size
|
||||
};
|
||||
} else {
|
||||
Module.dataFileDownloads[url].loaded = event.loaded;
|
||||
}
|
||||
var total = 0;
|
||||
var loaded = 0;
|
||||
var num = 0;
|
||||
for (var download in Module.dataFileDownloads) {
|
||||
var data = Module.dataFileDownloads[download];
|
||||
total += data.total;
|
||||
loaded += data.loaded;
|
||||
num++;
|
||||
}
|
||||
total = Math.ceil(total * Module.expectedDataFileDownloads/num);
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data... (' + loaded + '/' + total + ')');
|
||||
} else if (!Module.dataFileDownloads) {
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data...');
|
||||
}
|
||||
};
|
||||
xhr.onerror = function(event) {
|
||||
throw new Error("NetworkError for: " + packageName);
|
||||
}
|
||||
xhr.onload = function(event) {
|
||||
if (xhr.status == 200 || xhr.status == 304 || xhr.status == 206 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
|
||||
var packageData = xhr.response;
|
||||
callback(packageData);
|
||||
} else {
|
||||
throw new Error(xhr.statusText + " : " + xhr.responseURL);
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
};
|
||||
|
||||
function handleError(error) {
|
||||
console.error('package error:', error);
|
||||
};
|
||||
|
||||
var fetchedCallback = null;
|
||||
var fetched = Module['getPreloadedPackage'] ? Module['getPreloadedPackage'](REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE) : null;
|
||||
|
||||
if (!fetched) fetchRemotePackage(REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE, function(data) {
|
||||
if (fetchedCallback) {
|
||||
fetchedCallback(data);
|
||||
fetchedCallback = null;
|
||||
} else {
|
||||
fetched = data;
|
||||
}
|
||||
}, handleError);
|
||||
|
||||
function runWithFS() {
|
||||
|
||||
function assert(check, msg) {
|
||||
if (!check) throw msg + new Error().stack;
|
||||
}
|
||||
Module['FS_createPath']("/", "include", true, true);
|
||||
Module['FS_createPath']("/include", "em", true, true);
|
||||
Module['FS_createPath']("/include", "geos", true, true);
|
||||
Module['FS_createPath']("/include", "tgi", true, true);
|
||||
Module['FS_createPath']("/include", "mouse", true, true);
|
||||
Module['FS_createPath']("/include", "joystick", true, true);
|
||||
Module['FS_createPath']("/include", "sys", true, true);
|
||||
Module['FS_createPath']("/", "asminc", true, true);
|
||||
Module['FS_createPath']("/", "cfg", true, true);
|
||||
Module['FS_createPath']("/", "lib", true, true);
|
||||
Module['FS_createPath']("/", "target", true, true);
|
||||
Module['FS_createPath']("/target", "atari", true, true);
|
||||
Module['FS_createPath']("/target/atari", "drv", true, true);
|
||||
Module['FS_createPath']("/target/atari/drv", "ser", true, true);
|
||||
Module['FS_createPath']("/target/atari/drv", "joy", true, true);
|
||||
Module['FS_createPath']("/target/atari/drv", "tgi", true, true);
|
||||
Module['FS_createPath']("/target/atari/drv", "emd", true, true);
|
||||
Module['FS_createPath']("/target/atari/drv", "mou", true, true);
|
||||
Module['FS_createPath']("/target/atari", "util", true, true);
|
||||
Module['FS_createPath']("/target", "atari5200", true, true);
|
||||
Module['FS_createPath']("/target/atari5200", "drv", true, true);
|
||||
Module['FS_createPath']("/target/atari5200/drv", "joy", true, true);
|
||||
Module['FS_createPath']("/target", "atarixl", true, true);
|
||||
Module['FS_createPath']("/target/atarixl", "drv", true, true);
|
||||
Module['FS_createPath']("/target/atarixl/drv", "ser", true, true);
|
||||
Module['FS_createPath']("/target/atarixl/drv", "joy", true, true);
|
||||
Module['FS_createPath']("/target/atarixl/drv", "tgi", true, true);
|
||||
Module['FS_createPath']("/target/atarixl/drv", "emd", true, true);
|
||||
Module['FS_createPath']("/target/atarixl/drv", "mou", true, true);
|
||||
|
||||
/** @constructor */
|
||||
function DataRequest(start, end, audio) {
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.audio = audio;
|
||||
}
|
||||
DataRequest.prototype = {
|
||||
requests: {},
|
||||
open: function(mode, name) {
|
||||
this.name = name;
|
||||
this.requests[name] = this;
|
||||
Module['addRunDependency']('fp ' + this.name);
|
||||
},
|
||||
send: function() {},
|
||||
onload: function() {
|
||||
var byteArray = this.byteArray.subarray(this.start, this.end);
|
||||
this.finish(byteArray);
|
||||
},
|
||||
finish: function(byteArray) {
|
||||
var that = this;
|
||||
|
||||
Module['FS_createDataFile'](this.name, null, byteArray, true, true, true); // canOwn this data in the filesystem, it is a slide into the heap that will never change
|
||||
Module['removeRunDependency']('fp ' + that.name);
|
||||
|
||||
this.requests[this.name] = null;
|
||||
}
|
||||
};
|
||||
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
new DataRequest(files[i]['start'], files[i]['end'], files[i]['audio'] || 0).open('GET', files[i]['filename']);
|
||||
}
|
||||
|
||||
|
||||
function processPackageData(arrayBuffer) {
|
||||
assert(arrayBuffer, 'Loading data file failed.');
|
||||
assert(arrayBuffer instanceof ArrayBuffer, 'bad input to processPackageData');
|
||||
var byteArray = new Uint8Array(arrayBuffer);
|
||||
var curr;
|
||||
|
||||
// Reuse the bytearray from the XHR as the source for file reads.
|
||||
DataRequest.prototype.byteArray = byteArray;
|
||||
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
DataRequest.prototype.requests[files[i].filename].onload();
|
||||
}
|
||||
Module['removeRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-atari.data');
|
||||
|
||||
};
|
||||
Module['addRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-atari.data');
|
||||
|
||||
if (!Module.preloadResults) Module.preloadResults = {};
|
||||
|
||||
Module.preloadResults[PACKAGE_NAME] = {fromCache: false};
|
||||
if (fetched) {
|
||||
processPackageData(fetched);
|
||||
fetched = null;
|
||||
} else {
|
||||
fetchedCallback = processPackageData;
|
||||
}
|
||||
|
||||
}
|
||||
if (Module['calledRun']) {
|
||||
runWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runWithFS); // FS is not initialized yet, wait for it
|
||||
}
|
||||
|
||||
Module['removeRunDependency']('fs65-atari.js.metadata');
|
||||
}
|
||||
|
||||
function runMetaWithFS() {
|
||||
Module['addRunDependency']('fs65-atari.js.metadata');
|
||||
var REMOTE_METADATA_NAME = Module['locateFile'] ? Module['locateFile']('fs65-atari.js.metadata', '') : 'fs65-atari.js.metadata';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
loadPackage(JSON.parse(xhr.responseText));
|
||||
}
|
||||
}
|
||||
xhr.open('GET', REMOTE_METADATA_NAME, true);
|
||||
xhr.overrideMimeType('application/json');
|
||||
xhr.send(null);
|
||||
}
|
||||
|
||||
if (Module['calledRun']) {
|
||||
runMetaWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runMetaWithFS);
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{"files":[{"filename":"/include/lz4.h","start":0,"end":2641},{"filename":"/include/c64.h","start":2641,"end":9642},{"filename":"/include/_pbi.h","start":9642,"end":12785},{"filename":"/include/apple2_filetype.h","start":12785,"end":29883},{"filename":"/include/nes.h","start":29883,"end":36683},{"filename":"/include/assert.h","start":36683,"end":39683},{"filename":"/include/_6545.h","start":39683,"end":42515},{"filename":"/include/_6522.h","start":42515,"end":46296},{"filename":"/include/modload.h","start":46296,"end":51278},{"filename":"/include/unistd.h","start":51278,"end":55587},{"filename":"/include/c128.h","start":55587,"end":62105},{"filename":"/include/cx16.h","start":62105,"end":76818},{"filename":"/include/_mikey.h","start":76818,"end":82171},{"filename":"/include/c16.h","start":82171,"end":85136},{"filename":"/include/_6525.h","start":85136,"end":88546},{"filename":"/include/stdio.h","start":88546,"end":94466},{"filename":"/include/lynx.h","start":94466,"end":103027},{"filename":"/include/6502.h","start":103027,"end":108497},{"filename":"/include/string.h","start":108497,"end":113601},{"filename":"/include/atari5200.h","start":113601,"end":117655},{"filename":"/include/_vic.h","start":117655,"end":121371},{"filename":"/include/cbm_filetype.h","start":121371,"end":126320},{"filename":"/include/dirent.h","start":126320,"end":131644},{"filename":"/include/vic20.h","start":131644,"end":137148},{"filename":"/include/atari_screen_charmap.h","start":137148,"end":147122},{"filename":"/include/iso646.h","start":147122,"end":149985},{"filename":"/include/locale.h","start":149985,"end":153642},{"filename":"/include/stddef.h","start":153642,"end":156699},{"filename":"/include/em.h","start":156699,"end":162993},{"filename":"/include/cc65.h","start":162993,"end":168134},{"filename":"/include/stdbool.h","start":168134,"end":170640},{"filename":"/include/osic1p.h","start":170640,"end":173439},{"filename":"/include/stdlib.h","start":173439,"end":179438},{"filename":"/include/atari.h","start":179438,"end":201203},{"filename":"/include/_heap.h","start":201203,"end":202321},{"filename":"/include/cbm_petscii_charmap.h","start":202321,"end":212061},{"filename":"/include/conio.h","start":212061,"end":221087},{"filename":"/include/dio.h","start":221087,"end":226557},{"filename":"/include/_vic2.h","start":226557,"end":237392},{"filename":"/include/time.h","start":237392,"end":242529},{"filename":"/include/cbm510.h","start":242529,"end":249125},{"filename":"/include/atari_atascii_charmap.h","start":249125,"end":258961},{"filename":"/include/joystick.h","start":258961,"end":264102},{"filename":"/include/_suzy.h","start":264102,"end":275260},{"filename":"/include/tgi.h","start":275260,"end":286112},{"filename":"/include/serial.h","start":286112,"end":294017},{"filename":"/include/zlib.h","start":294017,"end":301129},{"filename":"/include/_atari5200os.h","start":301129,"end":305689},{"filename":"/include/stdint.h","start":305689,"end":311885},{"filename":"/include/cbm610.h","start":311885,"end":317911},{"filename":"/include/pet.h","start":317911,"end":322558},{"filename":"/include/_tia.h","start":322558,"end":325189},{"filename":"/include/ctype.h","start":325189,"end":329579},{"filename":"/include/_vdc.h","start":329579,"end":332406},{"filename":"/include/_6526.h","start":332406,"end":336368},{"filename":"/include/geos.h","start":336368,"end":339579},{"filename":"/include/atari2600.h","start":339579,"end":340628},{"filename":"/include/device.h","start":340628,"end":343840},{"filename":"/include/pce.h","start":343840,"end":348647},{"filename":"/include/apple2enh.h","start":348647,"end":353379},{"filename":"/include/cbm264.h","start":353379,"end":359658},{"filename":"/include/plus4.h","start":359658,"end":362726},{"filename":"/include/_riot.h","start":362726,"end":363774},{"filename":"/include/inttypes.h","start":363774,"end":371584},{"filename":"/include/peekpoke.h","start":371584,"end":374692},{"filename":"/include/setjmp.h","start":374692,"end":377538},{"filename":"/include/dbg.h","start":377538,"end":383313},{"filename":"/include/_antic.h","start":383313,"end":395141},{"filename":"/include/target.h","start":395141,"end":398133},{"filename":"/include/_gtia.h","start":398133,"end":411972},{"filename":"/include/stdarg.h","start":411972,"end":414885},{"filename":"/include/gamate.h","start":414885,"end":422616},{"filename":"/include/fcntl.h","start":422616,"end":426166},{"filename":"/include/sym1.h","start":426166,"end":432999},{"filename":"/include/creativision.h","start":432999,"end":436611},{"filename":"/include/telestrat.h","start":436611,"end":441466},{"filename":"/include/atmos.h","start":441466,"end":447354},{"filename":"/include/_atarios.h","start":447354,"end":488540},{"filename":"/include/cbm.h","start":488540,"end":500432},{"filename":"/include/signal.h","start":500432,"end":503773},{"filename":"/include/_sid.h","start":503773,"end":507399},{"filename":"/include/pen.h","start":507399,"end":511099},{"filename":"/incluLine truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,227 +0,0 @@
|
||||
|
||||
var Module = typeof Module !== 'undefined' ? Module : {};
|
||||
|
||||
if (!Module.expectedDataFileDownloads) {
|
||||
Module.expectedDataFileDownloads = 0;
|
||||
}
|
||||
Module.expectedDataFileDownloads++;
|
||||
(function() {
|
||||
// When running as a pthread, FS operations are proxied to the main thread, so we don't need to
|
||||
// fetch the .data bundle on the worker
|
||||
if (Module['ENVIRONMENT_IS_PTHREAD']) return;
|
||||
var loadPackage = function(metadata) {
|
||||
|
||||
var PACKAGE_PATH = '';
|
||||
if (typeof window === 'object') {
|
||||
PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
} else if (typeof process === 'undefined' && typeof location !== 'undefined') {
|
||||
// web worker
|
||||
PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
}
|
||||
var PACKAGE_NAME = '/home/pzp/8bitworkshop-compilers/output/fs/fs65-c64.data';
|
||||
var REMOTE_PACKAGE_BASE = 'fs65-c64.data';
|
||||
if (typeof Module['locateFilePackage'] === 'function' && !Module['locateFile']) {
|
||||
Module['locateFile'] = Module['locateFilePackage'];
|
||||
err('warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)');
|
||||
}
|
||||
var REMOTE_PACKAGE_NAME = Module['locateFile'] ? Module['locateFile'](REMOTE_PACKAGE_BASE, '') : REMOTE_PACKAGE_BASE;
|
||||
|
||||
var REMOTE_PACKAGE_SIZE = metadata['remote_package_size'];
|
||||
var PACKAGE_UUID = metadata['package_uuid'];
|
||||
|
||||
function fetchRemotePackage(packageName, packageSize, callback, errback) {
|
||||
|
||||
if (typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string') {
|
||||
require('fs').readFile(packageName, function(err, contents) {
|
||||
if (err) {
|
||||
errback(err);
|
||||
} else {
|
||||
callback(contents.buffer);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', packageName, true);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.onprogress = function(event) {
|
||||
var url = packageName;
|
||||
var size = packageSize;
|
||||
if (event.total) size = event.total;
|
||||
if (event.loaded) {
|
||||
if (!xhr.addedTotal) {
|
||||
xhr.addedTotal = true;
|
||||
if (!Module.dataFileDownloads) Module.dataFileDownloads = {};
|
||||
Module.dataFileDownloads[url] = {
|
||||
loaded: event.loaded,
|
||||
total: size
|
||||
};
|
||||
} else {
|
||||
Module.dataFileDownloads[url].loaded = event.loaded;
|
||||
}
|
||||
var total = 0;
|
||||
var loaded = 0;
|
||||
var num = 0;
|
||||
for (var download in Module.dataFileDownloads) {
|
||||
var data = Module.dataFileDownloads[download];
|
||||
total += data.total;
|
||||
loaded += data.loaded;
|
||||
num++;
|
||||
}
|
||||
total = Math.ceil(total * Module.expectedDataFileDownloads/num);
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data... (' + loaded + '/' + total + ')');
|
||||
} else if (!Module.dataFileDownloads) {
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data...');
|
||||
}
|
||||
};
|
||||
xhr.onerror = function(event) {
|
||||
throw new Error("NetworkError for: " + packageName);
|
||||
}
|
||||
xhr.onload = function(event) {
|
||||
if (xhr.status == 200 || xhr.status == 304 || xhr.status == 206 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
|
||||
var packageData = xhr.response;
|
||||
callback(packageData);
|
||||
} else {
|
||||
throw new Error(xhr.statusText + " : " + xhr.responseURL);
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
};
|
||||
|
||||
function handleError(error) {
|
||||
console.error('package error:', error);
|
||||
};
|
||||
|
||||
var fetchedCallback = null;
|
||||
var fetched = Module['getPreloadedPackage'] ? Module['getPreloadedPackage'](REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE) : null;
|
||||
|
||||
if (!fetched) fetchRemotePackage(REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE, function(data) {
|
||||
if (fetchedCallback) {
|
||||
fetchedCallback(data);
|
||||
fetchedCallback = null;
|
||||
} else {
|
||||
fetched = data;
|
||||
}
|
||||
}, handleError);
|
||||
|
||||
function runWithFS() {
|
||||
|
||||
function assert(check, msg) {
|
||||
if (!check) throw msg + new Error().stack;
|
||||
}
|
||||
Module['FS_createPath']("/", "include", true, true);
|
||||
Module['FS_createPath']("/include", "em", true, true);
|
||||
Module['FS_createPath']("/include", "geos", true, true);
|
||||
Module['FS_createPath']("/include", "tgi", true, true);
|
||||
Module['FS_createPath']("/include", "mouse", true, true);
|
||||
Module['FS_createPath']("/include", "joystick", true, true);
|
||||
Module['FS_createPath']("/include", "sys", true, true);
|
||||
Module['FS_createPath']("/", "asminc", true, true);
|
||||
Module['FS_createPath']("/", "cfg", true, true);
|
||||
Module['FS_createPath']("/", "lib", true, true);
|
||||
Module['FS_createPath']("/", "target", true, true);
|
||||
Module['FS_createPath']("/target", "c64", true, true);
|
||||
Module['FS_createPath']("/target/c64", "drv", true, true);
|
||||
Module['FS_createPath']("/target/c64/drv", "ser", true, true);
|
||||
Module['FS_createPath']("/target/c64/drv", "joy", true, true);
|
||||
Module['FS_createPath']("/target/c64/drv", "tgi", true, true);
|
||||
Module['FS_createPath']("/target/c64/drv", "emd", true, true);
|
||||
Module['FS_createPath']("/target/c64/drv", "mou", true, true);
|
||||
|
||||
/** @constructor */
|
||||
function DataRequest(start, end, audio) {
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.audio = audio;
|
||||
}
|
||||
DataRequest.prototype = {
|
||||
requests: {},
|
||||
open: function(mode, name) {
|
||||
this.name = name;
|
||||
this.requests[name] = this;
|
||||
Module['addRunDependency']('fp ' + this.name);
|
||||
},
|
||||
send: function() {},
|
||||
onload: function() {
|
||||
var byteArray = this.byteArray.subarray(this.start, this.end);
|
||||
this.finish(byteArray);
|
||||
},
|
||||
finish: function(byteArray) {
|
||||
var that = this;
|
||||
|
||||
Module['FS_createDataFile'](this.name, null, byteArray, true, true, true); // canOwn this data in the filesystem, it is a slide into the heap that will never change
|
||||
Module['removeRunDependency']('fp ' + that.name);
|
||||
|
||||
this.requests[this.name] = null;
|
||||
}
|
||||
};
|
||||
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
new DataRequest(files[i]['start'], files[i]['end'], files[i]['audio'] || 0).open('GET', files[i]['filename']);
|
||||
}
|
||||
|
||||
|
||||
function processPackageData(arrayBuffer) {
|
||||
assert(arrayBuffer, 'Loading data file failed.');
|
||||
assert(arrayBuffer instanceof ArrayBuffer, 'bad input to processPackageData');
|
||||
var byteArray = new Uint8Array(arrayBuffer);
|
||||
var curr;
|
||||
|
||||
// Reuse the bytearray from the XHR as the source for file reads.
|
||||
DataRequest.prototype.byteArray = byteArray;
|
||||
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
DataRequest.prototype.requests[files[i].filename].onload();
|
||||
}
|
||||
Module['removeRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-c64.data');
|
||||
|
||||
};
|
||||
Module['addRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-c64.data');
|
||||
|
||||
if (!Module.preloadResults) Module.preloadResults = {};
|
||||
|
||||
Module.preloadResults[PACKAGE_NAME] = {fromCache: false};
|
||||
if (fetched) {
|
||||
processPackageData(fetched);
|
||||
fetched = null;
|
||||
} else {
|
||||
fetchedCallback = processPackageData;
|
||||
}
|
||||
|
||||
}
|
||||
if (Module['calledRun']) {
|
||||
runWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runWithFS); // FS is not initialized yet, wait for it
|
||||
}
|
||||
|
||||
Module['removeRunDependency']('fs65-c64.js.metadata');
|
||||
}
|
||||
|
||||
function runMetaWithFS() {
|
||||
Module['addRunDependency']('fs65-c64.js.metadata');
|
||||
var REMOTE_METADATA_NAME = Module['locateFile'] ? Module['locateFile']('fs65-c64.js.metadata', '') : 'fs65-c64.js.metadata';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
loadPackage(JSON.parse(xhr.responseText));
|
||||
}
|
||||
}
|
||||
xhr.open('GET', REMOTE_METADATA_NAME, true);
|
||||
xhr.overrideMimeType('application/json');
|
||||
xhr.send(null);
|
||||
}
|
||||
|
||||
if (Module['calledRun']) {
|
||||
runMetaWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runMetaWithFS);
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{"files":[{"filename":"/include/lz4.h","start":0,"end":2641},{"filename":"/include/c64.h","start":2641,"end":9642},{"filename":"/include/_pbi.h","start":9642,"end":12785},{"filename":"/include/apple2_filetype.h","start":12785,"end":29883},{"filename":"/include/nes.h","start":29883,"end":36683},{"filename":"/include/assert.h","start":36683,"end":39683},{"filename":"/include/_6545.h","start":39683,"end":42515},{"filename":"/include/_6522.h","start":42515,"end":46296},{"filename":"/include/modload.h","start":46296,"end":51278},{"filename":"/include/unistd.h","start":51278,"end":55587},{"filename":"/include/c128.h","start":55587,"end":62105},{"filename":"/include/cx16.h","start":62105,"end":76818},{"filename":"/include/_mikey.h","start":76818,"end":82171},{"filename":"/include/c16.h","start":82171,"end":85136},{"filename":"/include/_6525.h","start":85136,"end":88546},{"filename":"/include/stdio.h","start":88546,"end":94466},{"filename":"/include/lynx.h","start":94466,"end":103027},{"filename":"/include/6502.h","start":103027,"end":108497},{"filename":"/include/string.h","start":108497,"end":113601},{"filename":"/include/atari5200.h","start":113601,"end":117655},{"filename":"/include/_vic.h","start":117655,"end":121371},{"filename":"/include/cbm_filetype.h","start":121371,"end":126320},{"filename":"/include/dirent.h","start":126320,"end":131644},{"filename":"/include/vic20.h","start":131644,"end":137148},{"filename":"/include/atari_screen_charmap.h","start":137148,"end":147122},{"filename":"/include/iso646.h","start":147122,"end":149985},{"filename":"/include/locale.h","start":149985,"end":153642},{"filename":"/include/stddef.h","start":153642,"end":156699},{"filename":"/include/em.h","start":156699,"end":162993},{"filename":"/include/cc65.h","start":162993,"end":168134},{"filename":"/include/stdbool.h","start":168134,"end":170640},{"filename":"/include/osic1p.h","start":170640,"end":173439},{"filename":"/include/stdlib.h","start":173439,"end":179438},{"filename":"/include/atari.h","start":179438,"end":201203},{"filename":"/include/_heap.h","start":201203,"end":202321},{"filename":"/include/cbm_petscii_charmap.h","start":202321,"end":212061},{"filename":"/include/conio.h","start":212061,"end":221087},{"filename":"/include/dio.h","start":221087,"end":226557},{"filename":"/include/_vic2.h","start":226557,"end":237392},{"filename":"/include/time.h","start":237392,"end":242529},{"filename":"/include/cbm510.h","start":242529,"end":249125},{"filename":"/include/atari_atascii_charmap.h","start":249125,"end":258961},{"filename":"/include/joystick.h","start":258961,"end":264102},{"filename":"/include/_suzy.h","start":264102,"end":275260},{"filename":"/include/tgi.h","start":275260,"end":286112},{"filename":"/include/serial.h","start":286112,"end":294017},{"filename":"/include/zlib.h","start":294017,"end":301129},{"filename":"/include/_atari5200os.h","start":301129,"end":305689},{"filename":"/include/stdint.h","start":305689,"end":311885},{"filename":"/include/cbm610.h","start":311885,"end":317911},{"filename":"/include/pet.h","start":317911,"end":322558},{"filename":"/include/_tia.h","start":322558,"end":325189},{"filename":"/include/ctype.h","start":325189,"end":329579},{"filename":"/include/_vdc.h","start":329579,"end":332406},{"filename":"/include/_6526.h","start":332406,"end":336368},{"filename":"/include/geos.h","start":336368,"end":339579},{"filename":"/include/atari2600.h","start":339579,"end":340628},{"filename":"/include/device.h","start":340628,"end":343840},{"filename":"/include/pce.h","start":343840,"end":348647},{"filename":"/include/apple2enh.h","start":348647,"end":353379},{"filename":"/include/cbm264.h","start":353379,"end":359658},{"filename":"/include/plus4.h","start":359658,"end":362726},{"filename":"/include/_riot.h","start":362726,"end":363774},{"filename":"/include/inttypes.h","start":363774,"end":371584},{"filename":"/include/peekpoke.h","start":371584,"end":374692},{"filename":"/include/setjmp.h","start":374692,"end":377538},{"filename":"/include/dbg.h","start":377538,"end":383313},{"filename":"/include/_antic.h","start":383313,"end":395141},{"filename":"/include/target.h","start":395141,"end":398133},{"filename":"/include/_gtia.h","start":398133,"end":411972},{"filename":"/include/stdarg.h","start":411972,"end":414885},{"filename":"/include/gamate.h","start":414885,"end":422616},{"filename":"/include/fcntl.h","start":422616,"end":426166},{"filename":"/include/sym1.h","start":426166,"end":432999},{"filename":"/include/creativision.h","start":432999,"end":436611},{"filename":"/include/telestrat.h","start":436611,"end":441466},{"filename":"/include/atmos.h","start":441466,"end":447354},{"filename":"/include/_atarios.h","start":447354,"end":488540},{"filename":"/include/cbm.h","start":488540,"end":500432},{"filename":"/include/signal.h","start":500432,"end":503773},{"filename":"/include/_sid.h","start":503773,"end":507399},{"filename":"/include/pen.h","start":507399,"end":511099},{"filename":"/incluLine truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,224 +0,0 @@
|
||||
|
||||
var Module = typeof Module !== 'undefined' ? Module : {};
|
||||
|
||||
if (!Module.expectedDataFileDownloads) {
|
||||
Module.expectedDataFileDownloads = 0;
|
||||
}
|
||||
Module.expectedDataFileDownloads++;
|
||||
(function() {
|
||||
// When running as a pthread, FS operations are proxied to the main thread, so we don't need to
|
||||
// fetch the .data bundle on the worker
|
||||
if (Module['ENVIRONMENT_IS_PTHREAD']) return;
|
||||
var loadPackage = function(metadata) {
|
||||
|
||||
var PACKAGE_PATH = '';
|
||||
if (typeof window === 'object') {
|
||||
PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
} else if (typeof process === 'undefined' && typeof location !== 'undefined') {
|
||||
// web worker
|
||||
PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
}
|
||||
var PACKAGE_NAME = '/home/pzp/8bitworkshop-compilers/output/fs/fs65-nes.data';
|
||||
var REMOTE_PACKAGE_BASE = 'fs65-nes.data';
|
||||
if (typeof Module['locateFilePackage'] === 'function' && !Module['locateFile']) {
|
||||
Module['locateFile'] = Module['locateFilePackage'];
|
||||
err('warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)');
|
||||
}
|
||||
var REMOTE_PACKAGE_NAME = Module['locateFile'] ? Module['locateFile'](REMOTE_PACKAGE_BASE, '') : REMOTE_PACKAGE_BASE;
|
||||
|
||||
var REMOTE_PACKAGE_SIZE = metadata['remote_package_size'];
|
||||
var PACKAGE_UUID = metadata['package_uuid'];
|
||||
|
||||
function fetchRemotePackage(packageName, packageSize, callback, errback) {
|
||||
|
||||
if (typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string') {
|
||||
require('fs').readFile(packageName, function(err, contents) {
|
||||
if (err) {
|
||||
errback(err);
|
||||
} else {
|
||||
callback(contents.buffer);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', packageName, true);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.onprogress = function(event) {
|
||||
var url = packageName;
|
||||
var size = packageSize;
|
||||
if (event.total) size = event.total;
|
||||
if (event.loaded) {
|
||||
if (!xhr.addedTotal) {
|
||||
xhr.addedTotal = true;
|
||||
if (!Module.dataFileDownloads) Module.dataFileDownloads = {};
|
||||
Module.dataFileDownloads[url] = {
|
||||
loaded: event.loaded,
|
||||
total: size
|
||||
};
|
||||
} else {
|
||||
Module.dataFileDownloads[url].loaded = event.loaded;
|
||||
}
|
||||
var total = 0;
|
||||
var loaded = 0;
|
||||
var num = 0;
|
||||
for (var download in Module.dataFileDownloads) {
|
||||
var data = Module.dataFileDownloads[download];
|
||||
total += data.total;
|
||||
loaded += data.loaded;
|
||||
num++;
|
||||
}
|
||||
total = Math.ceil(total * Module.expectedDataFileDownloads/num);
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data... (' + loaded + '/' + total + ')');
|
||||
} else if (!Module.dataFileDownloads) {
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data...');
|
||||
}
|
||||
};
|
||||
xhr.onerror = function(event) {
|
||||
throw new Error("NetworkError for: " + packageName);
|
||||
}
|
||||
xhr.onload = function(event) {
|
||||
if (xhr.status == 200 || xhr.status == 304 || xhr.status == 206 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
|
||||
var packageData = xhr.response;
|
||||
callback(packageData);
|
||||
} else {
|
||||
throw new Error(xhr.statusText + " : " + xhr.responseURL);
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
};
|
||||
|
||||
function handleError(error) {
|
||||
console.error('package error:', error);
|
||||
};
|
||||
|
||||
var fetchedCallback = null;
|
||||
var fetched = Module['getPreloadedPackage'] ? Module['getPreloadedPackage'](REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE) : null;
|
||||
|
||||
if (!fetched) fetchRemotePackage(REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE, function(data) {
|
||||
if (fetchedCallback) {
|
||||
fetchedCallback(data);
|
||||
fetchedCallback = null;
|
||||
} else {
|
||||
fetched = data;
|
||||
}
|
||||
}, handleError);
|
||||
|
||||
function runWithFS() {
|
||||
|
||||
function assert(check, msg) {
|
||||
if (!check) throw msg + new Error().stack;
|
||||
}
|
||||
Module['FS_createPath']("/", "include", true, true);
|
||||
Module['FS_createPath']("/include", "em", true, true);
|
||||
Module['FS_createPath']("/include", "geos", true, true);
|
||||
Module['FS_createPath']("/include", "tgi", true, true);
|
||||
Module['FS_createPath']("/include", "mouse", true, true);
|
||||
Module['FS_createPath']("/include", "joystick", true, true);
|
||||
Module['FS_createPath']("/include", "sys", true, true);
|
||||
Module['FS_createPath']("/", "asminc", true, true);
|
||||
Module['FS_createPath']("/", "cfg", true, true);
|
||||
Module['FS_createPath']("/", "lib", true, true);
|
||||
Module['FS_createPath']("/", "target", true, true);
|
||||
Module['FS_createPath']("/target", "nes", true, true);
|
||||
Module['FS_createPath']("/target/nes", "drv", true, true);
|
||||
Module['FS_createPath']("/target/nes/drv", "joy", true, true);
|
||||
Module['FS_createPath']("/target/nes/drv", "tgi", true, true);
|
||||
|
||||
/** @constructor */
|
||||
function DataRequest(start, end, audio) {
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.audio = audio;
|
||||
}
|
||||
DataRequest.prototype = {
|
||||
requests: {},
|
||||
open: function(mode, name) {
|
||||
this.name = name;
|
||||
this.requests[name] = this;
|
||||
Module['addRunDependency']('fp ' + this.name);
|
||||
},
|
||||
send: function() {},
|
||||
onload: function() {
|
||||
var byteArray = this.byteArray.subarray(this.start, this.end);
|
||||
this.finish(byteArray);
|
||||
},
|
||||
finish: function(byteArray) {
|
||||
var that = this;
|
||||
|
||||
Module['FS_createDataFile'](this.name, null, byteArray, true, true, true); // canOwn this data in the filesystem, it is a slide into the heap that will never change
|
||||
Module['removeRunDependency']('fp ' + that.name);
|
||||
|
||||
this.requests[this.name] = null;
|
||||
}
|
||||
};
|
||||
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
new DataRequest(files[i]['start'], files[i]['end'], files[i]['audio'] || 0).open('GET', files[i]['filename']);
|
||||
}
|
||||
|
||||
|
||||
function processPackageData(arrayBuffer) {
|
||||
assert(arrayBuffer, 'Loading data file failed.');
|
||||
assert(arrayBuffer instanceof ArrayBuffer, 'bad input to processPackageData');
|
||||
var byteArray = new Uint8Array(arrayBuffer);
|
||||
var curr;
|
||||
|
||||
// Reuse the bytearray from the XHR as the source for file reads.
|
||||
DataRequest.prototype.byteArray = byteArray;
|
||||
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
DataRequest.prototype.requests[files[i].filename].onload();
|
||||
}
|
||||
Module['removeRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-nes.data');
|
||||
|
||||
};
|
||||
Module['addRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-nes.data');
|
||||
|
||||
if (!Module.preloadResults) Module.preloadResults = {};
|
||||
|
||||
Module.preloadResults[PACKAGE_NAME] = {fromCache: false};
|
||||
if (fetched) {
|
||||
processPackageData(fetched);
|
||||
fetched = null;
|
||||
} else {
|
||||
fetchedCallback = processPackageData;
|
||||
}
|
||||
|
||||
}
|
||||
if (Module['calledRun']) {
|
||||
runWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runWithFS); // FS is not initialized yet, wait for it
|
||||
}
|
||||
|
||||
Module['removeRunDependency']('fs65-nes.js.metadata');
|
||||
}
|
||||
|
||||
function runMetaWithFS() {
|
||||
Module['addRunDependency']('fs65-nes.js.metadata');
|
||||
var REMOTE_METADATA_NAME = Module['locateFile'] ? Module['locateFile']('fs65-nes.js.metadata', '') : 'fs65-nes.js.metadata';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
loadPackage(JSON.parse(xhr.responseText));
|
||||
}
|
||||
}
|
||||
xhr.open('GET', REMOTE_METADATA_NAME, true);
|
||||
xhr.overrideMimeType('application/json');
|
||||
xhr.send(null);
|
||||
}
|
||||
|
||||
if (Module['calledRun']) {
|
||||
runMetaWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runMetaWithFS);
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{"files":[{"filename":"/include/lz4.h","start":0,"end":2641},{"filename":"/include/c64.h","start":2641,"end":9642},{"filename":"/include/_pbi.h","start":9642,"end":12785},{"filename":"/include/apple2_filetype.h","start":12785,"end":29883},{"filename":"/include/nes.h","start":29883,"end":36683},{"filename":"/include/assert.h","start":36683,"end":39683},{"filename":"/include/_6545.h","start":39683,"end":42515},{"filename":"/include/_6522.h","start":42515,"end":46296},{"filename":"/include/modload.h","start":46296,"end":51278},{"filename":"/include/unistd.h","start":51278,"end":55587},{"filename":"/include/c128.h","start":55587,"end":62105},{"filename":"/include/cx16.h","start":62105,"end":76818},{"filename":"/include/_mikey.h","start":76818,"end":82171},{"filename":"/include/c16.h","start":82171,"end":85136},{"filename":"/include/_6525.h","start":85136,"end":88546},{"filename":"/include/stdio.h","start":88546,"end":94466},{"filename":"/include/lynx.h","start":94466,"end":103027},{"filename":"/include/6502.h","start":103027,"end":108497},{"filename":"/include/string.h","start":108497,"end":113601},{"filename":"/include/atari5200.h","start":113601,"end":117655},{"filename":"/include/_vic.h","start":117655,"end":121371},{"filename":"/include/cbm_filetype.h","start":121371,"end":126320},{"filename":"/include/dirent.h","start":126320,"end":131644},{"filename":"/include/vic20.h","start":131644,"end":137148},{"filename":"/include/atari_screen_charmap.h","start":137148,"end":147122},{"filename":"/include/iso646.h","start":147122,"end":149985},{"filename":"/include/locale.h","start":149985,"end":153642},{"filename":"/include/stddef.h","start":153642,"end":156699},{"filename":"/include/em.h","start":156699,"end":162993},{"filename":"/include/cc65.h","start":162993,"end":168134},{"filename":"/include/stdbool.h","start":168134,"end":170640},{"filename":"/include/osic1p.h","start":170640,"end":173439},{"filename":"/include/stdlib.h","start":173439,"end":179438},{"filename":"/include/atari.h","start":179438,"end":201203},{"filename":"/include/_heap.h","start":201203,"end":202321},{"filename":"/include/cbm_petscii_charmap.h","start":202321,"end":212061},{"filename":"/include/conio.h","start":212061,"end":221087},{"filename":"/include/dio.h","start":221087,"end":226557},{"filename":"/include/_vic2.h","start":226557,"end":237392},{"filename":"/include/time.h","start":237392,"end":242529},{"filename":"/include/cbm510.h","start":242529,"end":249125},{"filename":"/include/atari_atascii_charmap.h","start":249125,"end":258961},{"filename":"/include/joystick.h","start":258961,"end":264102},{"filename":"/include/_suzy.h","start":264102,"end":275260},{"filename":"/include/tgi.h","start":275260,"end":286112},{"filename":"/include/serial.h","start":286112,"end":294017},{"filename":"/include/zlib.h","start":294017,"end":301129},{"filename":"/include/_atari5200os.h","start":301129,"end":305689},{"filename":"/include/stdint.h","start":305689,"end":311885},{"filename":"/include/cbm610.h","start":311885,"end":317911},{"filename":"/include/pet.h","start":317911,"end":322558},{"filename":"/include/_tia.h","start":322558,"end":325189},{"filename":"/include/ctype.h","start":325189,"end":329579},{"filename":"/include/_vdc.h","start":329579,"end":332406},{"filename":"/include/_6526.h","start":332406,"end":336368},{"filename":"/include/geos.h","start":336368,"end":339579},{"filename":"/include/atari2600.h","start":339579,"end":340628},{"filename":"/include/device.h","start":340628,"end":343840},{"filename":"/include/pce.h","start":343840,"end":348647},{"filename":"/include/apple2enh.h","start":348647,"end":353379},{"filename":"/include/cbm264.h","start":353379,"end":359658},{"filename":"/include/plus4.h","start":359658,"end":362726},{"filename":"/include/_riot.h","start":362726,"end":363774},{"filename":"/include/inttypes.h","start":363774,"end":371584},{"filename":"/include/peekpoke.h","start":371584,"end":374692},{"filename":"/include/setjmp.h","start":374692,"end":377538},{"filename":"/include/dbg.h","start":377538,"end":383313},{"filename":"/include/_antic.h","start":383313,"end":395141},{"filename":"/include/target.h","start":395141,"end":398133},{"filename":"/include/_gtia.h","start":398133,"end":411972},{"filename":"/include/stdarg.h","start":411972,"end":414885},{"filename":"/include/gamate.h","start":414885,"end":422616},{"filename":"/include/fcntl.h","start":422616,"end":426166},{"filename":"/include/sym1.h","start":426166,"end":432999},{"filename":"/include/creativision.h","start":432999,"end":436611},{"filename":"/include/telestrat.h","start":436611,"end":441466},{"filename":"/include/atmos.h","start":441466,"end":447354},{"filename":"/include/_atarios.h","start":447354,"end":488540},{"filename":"/include/cbm.h","start":488540,"end":500432},{"filename":"/include/signal.h","start":500432,"end":503773},{"filename":"/include/_sid.h","start":503773,"end":507399},{"filename":"/include/pen.h","start":507399,"end":511099},{"filename":"/incluLine truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,219 +0,0 @@
|
||||
|
||||
var Module = typeof Module !== 'undefined' ? Module : {};
|
||||
|
||||
if (!Module.expectedDataFileDownloads) {
|
||||
Module.expectedDataFileDownloads = 0;
|
||||
}
|
||||
Module.expectedDataFileDownloads++;
|
||||
(function() {
|
||||
// When running as a pthread, FS operations are proxied to the main thread, so we don't need to
|
||||
// fetch the .data bundle on the worker
|
||||
if (Module['ENVIRONMENT_IS_PTHREAD']) return;
|
||||
var loadPackage = function(metadata) {
|
||||
|
||||
var PACKAGE_PATH = '';
|
||||
if (typeof window === 'object') {
|
||||
PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
} else if (typeof process === 'undefined' && typeof location !== 'undefined') {
|
||||
// web worker
|
||||
PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
}
|
||||
var PACKAGE_NAME = '/home/pzp/8bitworkshop-compilers/output/fs/fs65-none.data';
|
||||
var REMOTE_PACKAGE_BASE = 'fs65-none.data';
|
||||
if (typeof Module['locateFilePackage'] === 'function' && !Module['locateFile']) {
|
||||
Module['locateFile'] = Module['locateFilePackage'];
|
||||
err('warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)');
|
||||
}
|
||||
var REMOTE_PACKAGE_NAME = Module['locateFile'] ? Module['locateFile'](REMOTE_PACKAGE_BASE, '') : REMOTE_PACKAGE_BASE;
|
||||
|
||||
var REMOTE_PACKAGE_SIZE = metadata['remote_package_size'];
|
||||
var PACKAGE_UUID = metadata['package_uuid'];
|
||||
|
||||
function fetchRemotePackage(packageName, packageSize, callback, errback) {
|
||||
|
||||
if (typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string') {
|
||||
require('fs').readFile(packageName, function(err, contents) {
|
||||
if (err) {
|
||||
errback(err);
|
||||
} else {
|
||||
callback(contents.buffer);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', packageName, true);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.onprogress = function(event) {
|
||||
var url = packageName;
|
||||
var size = packageSize;
|
||||
if (event.total) size = event.total;
|
||||
if (event.loaded) {
|
||||
if (!xhr.addedTotal) {
|
||||
xhr.addedTotal = true;
|
||||
if (!Module.dataFileDownloads) Module.dataFileDownloads = {};
|
||||
Module.dataFileDownloads[url] = {
|
||||
loaded: event.loaded,
|
||||
total: size
|
||||
};
|
||||
} else {
|
||||
Module.dataFileDownloads[url].loaded = event.loaded;
|
||||
}
|
||||
var total = 0;
|
||||
var loaded = 0;
|
||||
var num = 0;
|
||||
for (var download in Module.dataFileDownloads) {
|
||||
var data = Module.dataFileDownloads[download];
|
||||
total += data.total;
|
||||
loaded += data.loaded;
|
||||
num++;
|
||||
}
|
||||
total = Math.ceil(total * Module.expectedDataFileDownloads/num);
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data... (' + loaded + '/' + total + ')');
|
||||
} else if (!Module.dataFileDownloads) {
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data...');
|
||||
}
|
||||
};
|
||||
xhr.onerror = function(event) {
|
||||
throw new Error("NetworkError for: " + packageName);
|
||||
}
|
||||
xhr.onload = function(event) {
|
||||
if (xhr.status == 200 || xhr.status == 304 || xhr.status == 206 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
|
||||
var packageData = xhr.response;
|
||||
callback(packageData);
|
||||
} else {
|
||||
throw new Error(xhr.statusText + " : " + xhr.responseURL);
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
};
|
||||
|
||||
function handleError(error) {
|
||||
console.error('package error:', error);
|
||||
};
|
||||
|
||||
var fetchedCallback = null;
|
||||
var fetched = Module['getPreloadedPackage'] ? Module['getPreloadedPackage'](REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE) : null;
|
||||
|
||||
if (!fetched) fetchRemotePackage(REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE, function(data) {
|
||||
if (fetchedCallback) {
|
||||
fetchedCallback(data);
|
||||
fetchedCallback = null;
|
||||
} else {
|
||||
fetched = data;
|
||||
}
|
||||
}, handleError);
|
||||
|
||||
function runWithFS() {
|
||||
|
||||
function assert(check, msg) {
|
||||
if (!check) throw msg + new Error().stack;
|
||||
}
|
||||
Module['FS_createPath']("/", "include", true, true);
|
||||
Module['FS_createPath']("/include", "em", true, true);
|
||||
Module['FS_createPath']("/include", "geos", true, true);
|
||||
Module['FS_createPath']("/include", "tgi", true, true);
|
||||
Module['FS_createPath']("/include", "mouse", true, true);
|
||||
Module['FS_createPath']("/include", "joystick", true, true);
|
||||
Module['FS_createPath']("/include", "sys", true, true);
|
||||
Module['FS_createPath']("/", "asminc", true, true);
|
||||
Module['FS_createPath']("/", "cfg", true, true);
|
||||
Module['FS_createPath']("/", "lib", true, true);
|
||||
|
||||
/** @constructor */
|
||||
function DataRequest(start, end, audio) {
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.audio = audio;
|
||||
}
|
||||
DataRequest.prototype = {
|
||||
requests: {},
|
||||
open: function(mode, name) {
|
||||
this.name = name;
|
||||
this.requests[name] = this;
|
||||
Module['addRunDependency']('fp ' + this.name);
|
||||
},
|
||||
send: function() {},
|
||||
onload: function() {
|
||||
var byteArray = this.byteArray.subarray(this.start, this.end);
|
||||
this.finish(byteArray);
|
||||
},
|
||||
finish: function(byteArray) {
|
||||
var that = this;
|
||||
|
||||
Module['FS_createDataFile'](this.name, null, byteArray, true, true, true); // canOwn this data in the filesystem, it is a slide into the heap that will never change
|
||||
Module['removeRunDependency']('fp ' + that.name);
|
||||
|
||||
this.requests[this.name] = null;
|
||||
}
|
||||
};
|
||||
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
new DataRequest(files[i]['start'], files[i]['end'], files[i]['audio'] || 0).open('GET', files[i]['filename']);
|
||||
}
|
||||
|
||||
|
||||
function processPackageData(arrayBuffer) {
|
||||
assert(arrayBuffer, 'Loading data file failed.');
|
||||
assert(arrayBuffer instanceof ArrayBuffer, 'bad input to processPackageData');
|
||||
var byteArray = new Uint8Array(arrayBuffer);
|
||||
var curr;
|
||||
|
||||
// Reuse the bytearray from the XHR as the source for file reads.
|
||||
DataRequest.prototype.byteArray = byteArray;
|
||||
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
DataRequest.prototype.requests[files[i].filename].onload();
|
||||
}
|
||||
Module['removeRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-none.data');
|
||||
|
||||
};
|
||||
Module['addRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-none.data');
|
||||
|
||||
if (!Module.preloadResults) Module.preloadResults = {};
|
||||
|
||||
Module.preloadResults[PACKAGE_NAME] = {fromCache: false};
|
||||
if (fetched) {
|
||||
processPackageData(fetched);
|
||||
fetched = null;
|
||||
} else {
|
||||
fetchedCallback = processPackageData;
|
||||
}
|
||||
|
||||
}
|
||||
if (Module['calledRun']) {
|
||||
runWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runWithFS); // FS is not initialized yet, wait for it
|
||||
}
|
||||
|
||||
Module['removeRunDependency']('fs65-none.js.metadata');
|
||||
}
|
||||
|
||||
function runMetaWithFS() {
|
||||
Module['addRunDependency']('fs65-none.js.metadata');
|
||||
var REMOTE_METADATA_NAME = Module['locateFile'] ? Module['locateFile']('fs65-none.js.metadata', '') : 'fs65-none.js.metadata';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
loadPackage(JSON.parse(xhr.responseText));
|
||||
}
|
||||
}
|
||||
xhr.open('GET', REMOTE_METADATA_NAME, true);
|
||||
xhr.overrideMimeType('application/json');
|
||||
xhr.send(null);
|
||||
}
|
||||
|
||||
if (Module['calledRun']) {
|
||||
runMetaWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runMetaWithFS);
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{"files":[{"filename":"/include/lz4.h","start":0,"end":2641},{"filename":"/include/c64.h","start":2641,"end":9642},{"filename":"/include/_pbi.h","start":9642,"end":12785},{"filename":"/include/apple2_filetype.h","start":12785,"end":29883},{"filename":"/include/nes.h","start":29883,"end":36683},{"filename":"/include/assert.h","start":36683,"end":39683},{"filename":"/include/_6545.h","start":39683,"end":42515},{"filename":"/include/_6522.h","start":42515,"end":46296},{"filename":"/include/modload.h","start":46296,"end":51278},{"filename":"/include/unistd.h","start":51278,"end":55587},{"filename":"/include/c128.h","start":55587,"end":62105},{"filename":"/include/cx16.h","start":62105,"end":76818},{"filename":"/include/_mikey.h","start":76818,"end":82171},{"filename":"/include/c16.h","start":82171,"end":85136},{"filename":"/include/_6525.h","start":85136,"end":88546},{"filename":"/include/stdio.h","start":88546,"end":94466},{"filename":"/include/lynx.h","start":94466,"end":103027},{"filename":"/include/6502.h","start":103027,"end":108497},{"filename":"/include/string.h","start":108497,"end":113601},{"filename":"/include/atari5200.h","start":113601,"end":117655},{"filename":"/include/_vic.h","start":117655,"end":121371},{"filename":"/include/cbm_filetype.h","start":121371,"end":126320},{"filename":"/include/dirent.h","start":126320,"end":131644},{"filename":"/include/vic20.h","start":131644,"end":137148},{"filename":"/include/atari_screen_charmap.h","start":137148,"end":147122},{"filename":"/include/iso646.h","start":147122,"end":149985},{"filename":"/include/locale.h","start":149985,"end":153642},{"filename":"/include/stddef.h","start":153642,"end":156699},{"filename":"/include/em.h","start":156699,"end":162993},{"filename":"/include/cc65.h","start":162993,"end":168134},{"filename":"/include/stdbool.h","start":168134,"end":170640},{"filename":"/include/osic1p.h","start":170640,"end":173439},{"filename":"/include/stdlib.h","start":173439,"end":179438},{"filename":"/include/atari.h","start":179438,"end":201203},{"filename":"/include/_heap.h","start":201203,"end":202321},{"filename":"/include/cbm_petscii_charmap.h","start":202321,"end":212061},{"filename":"/include/conio.h","start":212061,"end":221087},{"filename":"/include/dio.h","start":221087,"end":226557},{"filename":"/include/_vic2.h","start":226557,"end":237392},{"filename":"/include/time.h","start":237392,"end":242529},{"filename":"/include/cbm510.h","start":242529,"end":249125},{"filename":"/include/atari_atascii_charmap.h","start":249125,"end":258961},{"filename":"/include/joystick.h","start":258961,"end":264102},{"filename":"/include/_suzy.h","start":264102,"end":275260},{"filename":"/include/tgi.h","start":275260,"end":286112},{"filename":"/include/serial.h","start":286112,"end":294017},{"filename":"/include/zlib.h","start":294017,"end":301129},{"filename":"/include/_atari5200os.h","start":301129,"end":305689},{"filename":"/include/stdint.h","start":305689,"end":311885},{"filename":"/include/cbm610.h","start":311885,"end":317911},{"filename":"/include/pet.h","start":317911,"end":322558},{"filename":"/include/_tia.h","start":322558,"end":325189},{"filename":"/include/ctype.h","start":325189,"end":329579},{"filename":"/include/_vdc.h","start":329579,"end":332406},{"filename":"/include/_6526.h","start":332406,"end":336368},{"filename":"/include/geos.h","start":336368,"end":339579},{"filename":"/include/atari2600.h","start":339579,"end":340628},{"filename":"/include/device.h","start":340628,"end":343840},{"filename":"/include/pce.h","start":343840,"end":348647},{"filename":"/include/apple2enh.h","start":348647,"end":353379},{"filename":"/include/cbm264.h","start":353379,"end":359658},{"filename":"/include/plus4.h","start":359658,"end":362726},{"filename":"/include/_riot.h","start":362726,"end":363774},{"filename":"/include/inttypes.h","start":363774,"end":371584},{"filename":"/include/peekpoke.h","start":371584,"end":374692},{"filename":"/include/setjmp.h","start":374692,"end":377538},{"filename":"/include/dbg.h","start":377538,"end":383313},{"filename":"/include/_antic.h","start":383313,"end":395141},{"filename":"/include/target.h","start":395141,"end":398133},{"filename":"/include/_gtia.h","start":398133,"end":411972},{"filename":"/include/stdarg.h","start":411972,"end":414885},{"filename":"/include/gamate.h","start":414885,"end":422616},{"filename":"/include/fcntl.h","start":422616,"end":426166},{"filename":"/include/sym1.h","start":426166,"end":432999},{"filename":"/include/creativision.h","start":432999,"end":436611},{"filename":"/include/telestrat.h","start":436611,"end":441466},{"filename":"/include/atmos.h","start":441466,"end":447354},{"filename":"/include/_atarios.h","start":447354,"end":488540},{"filename":"/include/cbm.h","start":488540,"end":500432},{"filename":"/include/signal.h","start":500432,"end":503773},{"filename":"/include/_sid.h","start":503773,"end":507399},{"filename":"/include/pen.h","start":507399,"end":511099},{"filename":"/incluLine truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,214 +0,0 @@
|
||||
|
||||
var Module = typeof Module !== 'undefined' ? Module : {};
|
||||
|
||||
if (!Module.expectedDataFileDownloads) {
|
||||
Module.expectedDataFileDownloads = 0;
|
||||
}
|
||||
|
||||
Module.expectedDataFileDownloads++;
|
||||
(function() {
|
||||
// Do not attempt to redownload the virtual filesystem data when in a pthread or a Wasm Worker context.
|
||||
if (Module['ENVIRONMENT_IS_PTHREAD'] || Module['$ww']) return;
|
||||
var loadPackage = function(metadata) {
|
||||
|
||||
var PACKAGE_PATH = '';
|
||||
if (typeof window === 'object') {
|
||||
PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
} else if (typeof process === 'undefined' && typeof location !== 'undefined') {
|
||||
// web worker
|
||||
PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
}
|
||||
var PACKAGE_NAME = '/home/pzp/8bitworkshop-compilers/output/fs/fs65-pce.data';
|
||||
var REMOTE_PACKAGE_BASE = 'fs65-pce.data';
|
||||
if (typeof Module['locateFilePackage'] === 'function' && !Module['locateFile']) {
|
||||
Module['locateFile'] = Module['locateFilePackage'];
|
||||
err('warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)');
|
||||
}
|
||||
var REMOTE_PACKAGE_NAME = Module['locateFile'] ? Module['locateFile'](REMOTE_PACKAGE_BASE, '') : REMOTE_PACKAGE_BASE;
|
||||
var REMOTE_PACKAGE_SIZE = metadata['remote_package_size'];
|
||||
|
||||
function fetchRemotePackage(packageName, packageSize, callback, errback) {
|
||||
if (typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string') {
|
||||
require('fs').readFile(packageName, function(err, contents) {
|
||||
if (err) {
|
||||
errback(err);
|
||||
} else {
|
||||
callback(contents.buffer);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', packageName, true);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.onprogress = function(event) {
|
||||
var url = packageName;
|
||||
var size = packageSize;
|
||||
if (event.total) size = event.total;
|
||||
if (event.loaded) {
|
||||
if (!xhr.addedTotal) {
|
||||
xhr.addedTotal = true;
|
||||
if (!Module.dataFileDownloads) Module.dataFileDownloads = {};
|
||||
Module.dataFileDownloads[url] = {
|
||||
loaded: event.loaded,
|
||||
total: size
|
||||
};
|
||||
} else {
|
||||
Module.dataFileDownloads[url].loaded = event.loaded;
|
||||
}
|
||||
var total = 0;
|
||||
var loaded = 0;
|
||||
var num = 0;
|
||||
for (var download in Module.dataFileDownloads) {
|
||||
var data = Module.dataFileDownloads[download];
|
||||
total += data.total;
|
||||
loaded += data.loaded;
|
||||
num++;
|
||||
}
|
||||
total = Math.ceil(total * Module.expectedDataFileDownloads/num);
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data... (' + loaded + '/' + total + ')');
|
||||
} else if (!Module.dataFileDownloads) {
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data...');
|
||||
}
|
||||
};
|
||||
xhr.onerror = function(event) {
|
||||
throw new Error("NetworkError for: " + packageName);
|
||||
}
|
||||
xhr.onload = function(event) {
|
||||
if (xhr.status == 200 || xhr.status == 304 || xhr.status == 206 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
|
||||
var packageData = xhr.response;
|
||||
callback(packageData);
|
||||
} else {
|
||||
throw new Error(xhr.statusText + " : " + xhr.responseURL);
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
};
|
||||
|
||||
function handleError(error) {
|
||||
console.error('package error:', error);
|
||||
};
|
||||
|
||||
var fetchedCallback = null;
|
||||
var fetched = Module['getPreloadedPackage'] ? Module['getPreloadedPackage'](REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE) : null;
|
||||
|
||||
if (!fetched) fetchRemotePackage(REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE, function(data) {
|
||||
if (fetchedCallback) {
|
||||
fetchedCallback(data);
|
||||
fetchedCallback = null;
|
||||
} else {
|
||||
fetched = data;
|
||||
}
|
||||
}, handleError);
|
||||
|
||||
function runWithFS() {
|
||||
|
||||
function assert(check, msg) {
|
||||
if (!check) throw msg + new Error().stack;
|
||||
}
|
||||
Module['FS_createPath']("/", "asminc", true, true);
|
||||
Module['FS_createPath']("/", "cfg", true, true);
|
||||
Module['FS_createPath']("/", "include", true, true);
|
||||
Module['FS_createPath']("/include", "arpa", true, true);
|
||||
Module['FS_createPath']("/include", "em", true, true);
|
||||
Module['FS_createPath']("/include", "geos", true, true);
|
||||
Module['FS_createPath']("/include", "joystick", true, true);
|
||||
Module['FS_createPath']("/include", "mouse", true, true);
|
||||
Module['FS_createPath']("/include", "sys", true, true);
|
||||
Module['FS_createPath']("/include", "tgi", true, true);
|
||||
Module['FS_createPath']("/", "lib", true, true);
|
||||
Module['FS_createPath']("/", "target", true, true);
|
||||
Module['FS_createPath']("/target", "pce", true, true);
|
||||
Module['FS_createPath']("/target/pce", "drv", true, true);
|
||||
Module['FS_createPath']("/target/pce/drv", "joy", true, true);
|
||||
|
||||
/** @constructor */
|
||||
function DataRequest(start, end, audio) {
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.audio = audio;
|
||||
}
|
||||
DataRequest.prototype = {
|
||||
requests: {},
|
||||
open: function(mode, name) {
|
||||
this.name = name;
|
||||
this.requests[name] = this;
|
||||
Module['addRunDependency']('fp ' + this.name);
|
||||
},
|
||||
send: function() {},
|
||||
onload: function() {
|
||||
var byteArray = this.byteArray.subarray(this.start, this.end);
|
||||
this.finish(byteArray);
|
||||
},
|
||||
finish: function(byteArray) {
|
||||
var that = this;
|
||||
// canOwn this data in the filesystem, it is a slide into the heap that will never change
|
||||
Module['FS_createDataFile'](this.name, null, byteArray, true, true, true);
|
||||
Module['removeRunDependency']('fp ' + that.name);
|
||||
this.requests[this.name] = null;
|
||||
}
|
||||
};
|
||||
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
new DataRequest(files[i]['start'], files[i]['end'], files[i]['audio'] || 0).open('GET', files[i]['filename']);
|
||||
}
|
||||
|
||||
function processPackageData(arrayBuffer) {
|
||||
assert(arrayBuffer, 'Loading data file failed.');
|
||||
assert(arrayBuffer.constructor.name === ArrayBuffer.name, 'bad input to processPackageData');
|
||||
var byteArray = new Uint8Array(arrayBuffer);
|
||||
var curr;
|
||||
// Reuse the bytearray from the XHR as the source for file reads.
|
||||
DataRequest.prototype.byteArray = byteArray;
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
DataRequest.prototype.requests[files[i].filename].onload();
|
||||
} Module['removeRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-pce.data');
|
||||
|
||||
};
|
||||
Module['addRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-pce.data');
|
||||
|
||||
if (!Module.preloadResults) Module.preloadResults = {};
|
||||
|
||||
Module.preloadResults[PACKAGE_NAME] = {fromCache: false};
|
||||
if (fetched) {
|
||||
processPackageData(fetched);
|
||||
fetched = null;
|
||||
} else {
|
||||
fetchedCallback = processPackageData;
|
||||
}
|
||||
|
||||
}
|
||||
if (Module['calledRun']) {
|
||||
runWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runWithFS); // FS is not initialized yet, wait for it
|
||||
}
|
||||
|
||||
Module['removeRunDependency']('fs65-pce.js.metadata');
|
||||
}
|
||||
|
||||
function runMetaWithFS() {
|
||||
Module['addRunDependency']('fs65-pce.js.metadata');
|
||||
var REMOTE_METADATA_NAME = Module['locateFile'] ? Module['locateFile']('fs65-pce.js.metadata', '') : 'fs65-pce.js.metadata';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
loadPackage(JSON.parse(xhr.responseText));
|
||||
}
|
||||
}
|
||||
xhr.open('GET', REMOTE_METADATA_NAME, true);
|
||||
xhr.overrideMimeType('application/json');
|
||||
xhr.send(null);
|
||||
}
|
||||
|
||||
if (Module['calledRun']) {
|
||||
runMetaWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runMetaWithFS);
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -1 +0,0 @@
|
||||
{"files":[{"filename":"/asminc/_file.inc","start":0,"end":464},{"filename":"/asminc/_heap.inc","start":464,"end":1349},{"filename":"/asminc/accelerator.inc","start":1349,"end":3049},{"filename":"/asminc/apple2.inc","start":3049,"end":6307},{"filename":"/asminc/apple2.mac","start":6307,"end":7595},{"filename":"/asminc/ascii_charmap.inc","start":7595,"end":14425},{"filename":"/asminc/atari.inc","start":14425,"end":62110},{"filename":"/asminc/atari.mac","start":62110,"end":63823},{"filename":"/asminc/atari2600.inc","start":63823,"end":64016},{"filename":"/asminc/atari2600_riot.inc","start":64016,"end":64400},{"filename":"/asminc/atari2600_tia.inc","start":64400,"end":65449},{"filename":"/asminc/atari5200.inc","start":65449,"end":69752},{"filename":"/asminc/atari7800.inc","start":69752,"end":70080},{"filename":"/asminc/atari7800_maria.inc","start":70080,"end":70610},{"filename":"/asminc/atari7800_riot.inc","start":70610,"end":70994},{"filename":"/asminc/atari7800_tia.inc","start":70994,"end":72043},{"filename":"/asminc/atari_antic.inc","start":72043,"end":75365},{"filename":"/asminc/atari_atascii_charmap.inc","start":75365,"end":82338},{"filename":"/asminc/atari_gtia.inc","start":82338,"end":86760},{"filename":"/asminc/atari_pokey.inc","start":86760,"end":88494},{"filename":"/asminc/atari_screen_charmap.inc","start":88494,"end":95469},{"filename":"/asminc/atmos.inc","start":95469,"end":98860},{"filename":"/asminc/c128.inc","start":98860,"end":105926},{"filename":"/asminc/c16.inc","start":105926,"end":106066},{"filename":"/asminc/c64.inc","start":106066,"end":112649},{"filename":"/asminc/cbm.mac","start":112649,"end":114085},{"filename":"/asminc/cbm510.inc","start":114085,"end":118479},{"filename":"/asminc/cbm610.inc","start":118479,"end":121083},{"filename":"/asminc/cbm_filetype.inc","start":121083,"end":122234},{"filename":"/asminc/cbm_kernal.inc","start":122234,"end":128300},{"filename":"/asminc/cbm_petscii_charmap.inc","start":128300,"end":135103},{"filename":"/asminc/cbm_screen_charmap.inc","start":135103,"end":141373},{"filename":"/asminc/cpu.mac","start":141373,"end":142310},{"filename":"/asminc/creativision.inc","start":142310,"end":144022},{"filename":"/asminc/ctype.inc","start":144022,"end":145098},{"filename":"/asminc/ctype_common.inc","start":145098,"end":151854},{"filename":"/asminc/ctypetable.inc","start":151854,"end":153425},{"filename":"/asminc/cx16.inc","start":153425,"end":167757},{"filename":"/asminc/em-error.inc","start":167757,"end":170840},{"filename":"/asminc/em-kernel.inc","start":170840,"end":175789},{"filename":"/asminc/errno.inc","start":175789,"end":177152},{"filename":"/asminc/fcntl.inc","start":177152,"end":177500},{"filename":"/asminc/gamate.inc","start":177500,"end":178914},{"filename":"/asminc/generic.mac","start":178914,"end":179851},{"filename":"/asminc/get_tv.inc","start":179851,"end":180076},{"filename":"/asminc/joy-error.inc","start":180076,"end":182961},{"filename":"/asminc/joy-kernel.inc","start":182961,"end":186964},{"filename":"/asminc/kim1.inc","start":186964,"end":188153},{"filename":"/asminc/longbranch.mac","start":188153,"end":190785},{"filename":"/asminc/lynx.inc","start":190785,"end":196537},{"filename":"/asminc/modload.inc","start":196537,"end":200557},{"filename":"/asminc/module.mac","start":200557,"end":200835},{"filename":"/asminc/mouse-kernel.inc","start":200835,"end":208535},{"filename":"/asminc/nes.inc","start":208535,"end":211341},{"filename":"/asminc/o65.inc","start":211341,"end":218738},{"filename":"/asminc/opcodes.inc","start":218738,"end":229962},{"filename":"/asminc/pce.inc","start":229962,"end":232895},{"filename":"/asminc/pet.inc","start":232895,"end":236889},{"filename":"/asminc/plus4.inc","start":236889,"end":239717},{"filename":"/asminc/ser-error.inc","start":239717,"end":243161},{"filename":"/asminc/ser-kernel.inc","start":243161,"end":249941},{"filename":"/asminc/signal.inc","start":249941,"end":252986},{"filename":"/asminc/smc.inc","start":252986,"end":261187},{"filename":"/asminc/stdio.inc","start":261187,"end":264598},{"filename":"/asminc/supervision.inc","start":264598,"end":266070},{"filename":"/asminc/sym1.inc","start":266070,"end":272980},{"filename":"/asminc/telestrat.inc","start":272980,"end":289759},{"filename":"/asminc/tgi-error.inc","start":289759,"end":293055},{"filename":"/asminc/tgi-kernel.inc","start":293055,"end":303538},{"filename":"/asminc/tgi-vectorfont.inc","start":303538,"end":307451},{"filename":"/asminc/time.inc","start":307451,"end":310909},{"filename":"/asminc/utsname.inc","start":310909,"end":313723},{"filename":"/asminc/vic20.inc","start":313723,"end":318600},{"filename":"/asminc/zeropage.inc","start":318600,"end":319319},{"filename":"/cfg/pce.cfg","start":319319,"end":321161},{"filename":"/include/6502.h","start":321161,"end":326631},{"filename":"/include/_6522.h","start":326631,"end":330412},{"filename":"/include/_6525.h","start":330412,"end":333822},{"filename":"/include/_6526.h","start":333822,"end":337784},{"filLine truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,225 +0,0 @@
|
||||
|
||||
var Module = typeof Module !== 'undefined' ? Module : {};
|
||||
|
||||
if (!Module.expectedDataFileDownloads) {
|
||||
Module.expectedDataFileDownloads = 0;
|
||||
}
|
||||
Module.expectedDataFileDownloads++;
|
||||
(function() {
|
||||
// When running as a pthread, FS operations are proxied to the main thread, so we don't need to
|
||||
// fetch the .data bundle on the worker
|
||||
if (Module['ENVIRONMENT_IS_PTHREAD']) return;
|
||||
var loadPackage = function(metadata) {
|
||||
|
||||
var PACKAGE_PATH = '';
|
||||
if (typeof window === 'object') {
|
||||
PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
} else if (typeof process === 'undefined' && typeof location !== 'undefined') {
|
||||
// web worker
|
||||
PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
}
|
||||
var PACKAGE_NAME = '/home/pzp/8bitworkshop-compilers/output/fs/fs65-vic20.data';
|
||||
var REMOTE_PACKAGE_BASE = 'fs65-vic20.data';
|
||||
if (typeof Module['locateFilePackage'] === 'function' && !Module['locateFile']) {
|
||||
Module['locateFile'] = Module['locateFilePackage'];
|
||||
err('warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)');
|
||||
}
|
||||
var REMOTE_PACKAGE_NAME = Module['locateFile'] ? Module['locateFile'](REMOTE_PACKAGE_BASE, '') : REMOTE_PACKAGE_BASE;
|
||||
|
||||
var REMOTE_PACKAGE_SIZE = metadata['remote_package_size'];
|
||||
var PACKAGE_UUID = metadata['package_uuid'];
|
||||
|
||||
function fetchRemotePackage(packageName, packageSize, callback, errback) {
|
||||
|
||||
if (typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string') {
|
||||
require('fs').readFile(packageName, function(err, contents) {
|
||||
if (err) {
|
||||
errback(err);
|
||||
} else {
|
||||
callback(contents.buffer);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', packageName, true);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.onprogress = function(event) {
|
||||
var url = packageName;
|
||||
var size = packageSize;
|
||||
if (event.total) size = event.total;
|
||||
if (event.loaded) {
|
||||
if (!xhr.addedTotal) {
|
||||
xhr.addedTotal = true;
|
||||
if (!Module.dataFileDownloads) Module.dataFileDownloads = {};
|
||||
Module.dataFileDownloads[url] = {
|
||||
loaded: event.loaded,
|
||||
total: size
|
||||
};
|
||||
} else {
|
||||
Module.dataFileDownloads[url].loaded = event.loaded;
|
||||
}
|
||||
var total = 0;
|
||||
var loaded = 0;
|
||||
var num = 0;
|
||||
for (var download in Module.dataFileDownloads) {
|
||||
var data = Module.dataFileDownloads[download];
|
||||
total += data.total;
|
||||
loaded += data.loaded;
|
||||
num++;
|
||||
}
|
||||
total = Math.ceil(total * Module.expectedDataFileDownloads/num);
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data... (' + loaded + '/' + total + ')');
|
||||
} else if (!Module.dataFileDownloads) {
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data...');
|
||||
}
|
||||
};
|
||||
xhr.onerror = function(event) {
|
||||
throw new Error("NetworkError for: " + packageName);
|
||||
}
|
||||
xhr.onload = function(event) {
|
||||
if (xhr.status == 200 || xhr.status == 304 || xhr.status == 206 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
|
||||
var packageData = xhr.response;
|
||||
callback(packageData);
|
||||
} else {
|
||||
throw new Error(xhr.statusText + " : " + xhr.responseURL);
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
};
|
||||
|
||||
function handleError(error) {
|
||||
console.error('package error:', error);
|
||||
};
|
||||
|
||||
var fetchedCallback = null;
|
||||
var fetched = Module['getPreloadedPackage'] ? Module['getPreloadedPackage'](REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE) : null;
|
||||
|
||||
if (!fetched) fetchRemotePackage(REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE, function(data) {
|
||||
if (fetchedCallback) {
|
||||
fetchedCallback(data);
|
||||
fetchedCallback = null;
|
||||
} else {
|
||||
fetched = data;
|
||||
}
|
||||
}, handleError);
|
||||
|
||||
function runWithFS() {
|
||||
|
||||
function assert(check, msg) {
|
||||
if (!check) throw msg + new Error().stack;
|
||||
}
|
||||
Module['FS_createPath']("/", "include", true, true);
|
||||
Module['FS_createPath']("/include", "em", true, true);
|
||||
Module['FS_createPath']("/include", "geos", true, true);
|
||||
Module['FS_createPath']("/include", "tgi", true, true);
|
||||
Module['FS_createPath']("/include", "mouse", true, true);
|
||||
Module['FS_createPath']("/include", "joystick", true, true);
|
||||
Module['FS_createPath']("/include", "sys", true, true);
|
||||
Module['FS_createPath']("/", "asminc", true, true);
|
||||
Module['FS_createPath']("/", "cfg", true, true);
|
||||
Module['FS_createPath']("/", "lib", true, true);
|
||||
Module['FS_createPath']("/", "target", true, true);
|
||||
Module['FS_createPath']("/target", "vic20", true, true);
|
||||
Module['FS_createPath']("/target/vic20", "drv", true, true);
|
||||
Module['FS_createPath']("/target/vic20/drv", "joy", true, true);
|
||||
Module['FS_createPath']("/target/vic20/drv", "tgi", true, true);
|
||||
Module['FS_createPath']("/target/vic20/drv", "emd", true, true);
|
||||
|
||||
/** @constructor */
|
||||
function DataRequest(start, end, audio) {
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.audio = audio;
|
||||
}
|
||||
DataRequest.prototype = {
|
||||
requests: {},
|
||||
open: function(mode, name) {
|
||||
this.name = name;
|
||||
this.requests[name] = this;
|
||||
Module['addRunDependency']('fp ' + this.name);
|
||||
},
|
||||
send: function() {},
|
||||
onload: function() {
|
||||
var byteArray = this.byteArray.subarray(this.start, this.end);
|
||||
this.finish(byteArray);
|
||||
},
|
||||
finish: function(byteArray) {
|
||||
var that = this;
|
||||
|
||||
Module['FS_createDataFile'](this.name, null, byteArray, true, true, true); // canOwn this data in the filesystem, it is a slide into the heap that will never change
|
||||
Module['removeRunDependency']('fp ' + that.name);
|
||||
|
||||
this.requests[this.name] = null;
|
||||
}
|
||||
};
|
||||
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
new DataRequest(files[i]['start'], files[i]['end'], files[i]['audio'] || 0).open('GET', files[i]['filename']);
|
||||
}
|
||||
|
||||
|
||||
function processPackageData(arrayBuffer) {
|
||||
assert(arrayBuffer, 'Loading data file failed.');
|
||||
assert(arrayBuffer instanceof ArrayBuffer, 'bad input to processPackageData');
|
||||
var byteArray = new Uint8Array(arrayBuffer);
|
||||
var curr;
|
||||
|
||||
// Reuse the bytearray from the XHR as the source for file reads.
|
||||
DataRequest.prototype.byteArray = byteArray;
|
||||
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
DataRequest.prototype.requests[files[i].filename].onload();
|
||||
}
|
||||
Module['removeRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-vic20.data');
|
||||
|
||||
};
|
||||
Module['addRunDependency']('datafile_/home/pzp/8bitworkshop-compilers/output/fs/fs65-vic20.data');
|
||||
|
||||
if (!Module.preloadResults) Module.preloadResults = {};
|
||||
|
||||
Module.preloadResults[PACKAGE_NAME] = {fromCache: false};
|
||||
if (fetched) {
|
||||
processPackageData(fetched);
|
||||
fetched = null;
|
||||
} else {
|
||||
fetchedCallback = processPackageData;
|
||||
}
|
||||
|
||||
}
|
||||
if (Module['calledRun']) {
|
||||
runWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runWithFS); // FS is not initialized yet, wait for it
|
||||
}
|
||||
|
||||
Module['removeRunDependency']('fs65-vic20.js.metadata');
|
||||
}
|
||||
|
||||
function runMetaWithFS() {
|
||||
Module['addRunDependency']('fs65-vic20.js.metadata');
|
||||
var REMOTE_METADATA_NAME = Module['locateFile'] ? Module['locateFile']('fs65-vic20.js.metadata', '') : 'fs65-vic20.js.metadata';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
loadPackage(JSON.parse(xhr.responseText));
|
||||
}
|
||||
}
|
||||
xhr.open('GET', REMOTE_METADATA_NAME, true);
|
||||
xhr.overrideMimeType('application/json');
|
||||
xhr.send(null);
|
||||
}
|
||||
|
||||
if (Module['calledRun']) {
|
||||
runMetaWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runMetaWithFS);
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{"files":[{"filename":"/include/lz4.h","start":0,"end":2641},{"filename":"/include/c64.h","start":2641,"end":9642},{"filename":"/include/_pbi.h","start":9642,"end":12785},{"filename":"/include/apple2_filetype.h","start":12785,"end":29883},{"filename":"/include/nes.h","start":29883,"end":36683},{"filename":"/include/assert.h","start":36683,"end":39683},{"filename":"/include/_6545.h","start":39683,"end":42515},{"filename":"/include/_6522.h","start":42515,"end":46296},{"filename":"/include/modload.h","start":46296,"end":51278},{"filename":"/include/unistd.h","start":51278,"end":55587},{"filename":"/include/c128.h","start":55587,"end":62105},{"filename":"/include/cx16.h","start":62105,"end":76818},{"filename":"/include/_mikey.h","start":76818,"end":82171},{"filename":"/include/c16.h","start":82171,"end":85136},{"filename":"/include/_6525.h","start":85136,"end":88546},{"filename":"/include/stdio.h","start":88546,"end":94466},{"filename":"/include/lynx.h","start":94466,"end":103027},{"filename":"/include/6502.h","start":103027,"end":108497},{"filename":"/include/string.h","start":108497,"end":113601},{"filename":"/include/atari5200.h","start":113601,"end":117655},{"filename":"/include/_vic.h","start":117655,"end":121371},{"filename":"/include/cbm_filetype.h","start":121371,"end":126320},{"filename":"/include/dirent.h","start":126320,"end":131644},{"filename":"/include/vic20.h","start":131644,"end":137148},{"filename":"/include/atari_screen_charmap.h","start":137148,"end":147122},{"filename":"/include/iso646.h","start":147122,"end":149985},{"filename":"/include/locale.h","start":149985,"end":153642},{"filename":"/include/stddef.h","start":153642,"end":156699},{"filename":"/include/em.h","start":156699,"end":162993},{"filename":"/include/cc65.h","start":162993,"end":168134},{"filename":"/include/stdbool.h","start":168134,"end":170640},{"filename":"/include/osic1p.h","start":170640,"end":173439},{"filename":"/include/stdlib.h","start":173439,"end":179438},{"filename":"/include/atari.h","start":179438,"end":201203},{"filename":"/include/_heap.h","start":201203,"end":202321},{"filename":"/include/cbm_petscii_charmap.h","start":202321,"end":212061},{"filename":"/include/conio.h","start":212061,"end":221087},{"filename":"/include/dio.h","start":221087,"end":226557},{"filename":"/include/_vic2.h","start":226557,"end":237392},{"filename":"/include/time.h","start":237392,"end":242529},{"filename":"/include/cbm510.h","start":242529,"end":249125},{"filename":"/include/atari_atascii_charmap.h","start":249125,"end":258961},{"filename":"/include/joystick.h","start":258961,"end":264102},{"filename":"/include/_suzy.h","start":264102,"end":275260},{"filename":"/include/tgi.h","start":275260,"end":286112},{"filename":"/include/serial.h","start":286112,"end":294017},{"filename":"/include/zlib.h","start":294017,"end":301129},{"filename":"/include/_atari5200os.h","start":301129,"end":305689},{"filename":"/include/stdint.h","start":305689,"end":311885},{"filename":"/include/cbm610.h","start":311885,"end":317911},{"filename":"/include/pet.h","start":317911,"end":322558},{"filename":"/include/_tia.h","start":322558,"end":325189},{"filename":"/include/ctype.h","start":325189,"end":329579},{"filename":"/include/_vdc.h","start":329579,"end":332406},{"filename":"/include/_6526.h","start":332406,"end":336368},{"filename":"/include/geos.h","start":336368,"end":339579},{"filename":"/include/atari2600.h","start":339579,"end":340628},{"filename":"/include/device.h","start":340628,"end":343840},{"filename":"/include/pce.h","start":343840,"end":348647},{"filename":"/include/apple2enh.h","start":348647,"end":353379},{"filename":"/include/cbm264.h","start":353379,"end":359658},{"filename":"/include/plus4.h","start":359658,"end":362726},{"filename":"/include/_riot.h","start":362726,"end":363774},{"filename":"/include/inttypes.h","start":363774,"end":371584},{"filename":"/include/peekpoke.h","start":371584,"end":374692},{"filename":"/include/setjmp.h","start":374692,"end":377538},{"filename":"/include/dbg.h","start":377538,"end":383313},{"filename":"/include/_antic.h","start":383313,"end":395141},{"filename":"/include/target.h","start":395141,"end":398133},{"filename":"/include/_gtia.h","start":398133,"end":411972},{"filename":"/include/stdarg.h","start":411972,"end":414885},{"filename":"/include/gamate.h","start":414885,"end":422616},{"filename":"/include/fcntl.h","start":422616,"end":426166},{"filename":"/include/sym1.h","start":426166,"end":432999},{"filename":"/include/creativision.h","start":432999,"end":436611},{"filename":"/include/telestrat.h","start":436611,"end":441466},{"filename":"/include/atmos.h","start":441466,"end":447354},{"filename":"/include/_atarios.h","start":447354,"end":488540},{"filename":"/include/cbm.h","start":488540,"end":500432},{"filename":"/include/signal.h","start":500432,"end":503773},{"filename":"/include/_sid.h","start":503773,"end":507399},{"filename":"/include/pen.h","start":507399,"end":511099},{"filename":"/incluLine truncated
|
||||
+98
-86
@@ -1,11 +1,65 @@
|
||||
|
||||
import { defineArgs, extraArgsFor, linkSymbolArgs } from "../../common/toolmeta";
|
||||
import { getRootBasePlatform } from "../../common/util";
|
||||
import { defineArgs, extraArgsFor, linkSymbolArgs, getSharedFileSystemName } from "../../common/toolmeta";
|
||||
import { CodeListingMap, WorkerError } from "../../common/workertypes";
|
||||
import { WASIRunner } from "../../common/wasi/wasishim";
|
||||
import { BuildStep, BuildStepResult, gatherFiles, staleFiles, populateFiles, fixParamsWithDefines, applyAsmProjectParams, putWorkFile, populateExtraFiles, store, populateEntry, anyTargetChanged, processEmbedDirective } from "../builder";
|
||||
import { re_crlf, makeErrorMatcher } from "../listingutils";
|
||||
import { parseCC65DbgSizes } from "./cc65dbg";
|
||||
import { loadNative, moduleInstFn, print_fn, setupFS, execMain, execToFile, emglobal, EmscriptenModule } from "../wasmutils";
|
||||
import { loadWASMBinary, ensureWasiFilesystem } from "../wasmutils";
|
||||
import { wasiFSAdapter } from "../wasiutils";
|
||||
|
||||
// the WASI builds look for their data under share/cc65 in the per-platform
|
||||
// cc65-fs-<platform>.zip, preopened at '.'
|
||||
const CC65_SHARE = 'share/cc65';
|
||||
|
||||
const wasiModules: { [tool: string]: WebAssembly.Module } = {};
|
||||
|
||||
/**
|
||||
* Run cc65, ca65 or ld65 on a fresh WASI runner layered over the platform's
|
||||
* cc65 filesystem. `populate` copies the step's inputs into the runner first.
|
||||
* Returns the runner (for reading outputs) and its stderr lines.
|
||||
*/
|
||||
async function runCC65Tool(step: BuildStep, tool: string, args: string[],
|
||||
populate: (fs: ReturnType<typeof wasiFSAdapter>) => void) {
|
||||
const fsname = getSharedFileSystemName('cc65', step.platform);
|
||||
if (!fsname || !fsname.startsWith('wasi:'))
|
||||
throw new Error("No cc65 filesystem for platform " + step.platform);
|
||||
const sharefs = await ensureWasiFilesystem(fsname.substring(5));
|
||||
if (!sharefs)
|
||||
throw new Error("Could not load cc65 filesystem " + fsname);
|
||||
if (!wasiModules[tool]) {
|
||||
wasiModules[tool] = new WebAssembly.Module(loadWASMBinary(tool));
|
||||
}
|
||||
const wasi = new WASIRunner();
|
||||
wasi.initSync(wasiModules[tool]);
|
||||
wasi.fs.setParent(sharefs);
|
||||
populate(wasiFSAdapter(wasi));
|
||||
wasi.addPreopenDirectory(".");
|
||||
wasi.setArgs([tool, ...args]);
|
||||
const errno = wasi.run();
|
||||
console.log('exec', tool, args.join(' '));
|
||||
const stdout = wasi.fds[1].getBytesAsString();
|
||||
if (stdout) console.log(stdout);
|
||||
const stderr = wasi.fds[2].getBytesAsString().split(re_crlf).filter(s => s != '');
|
||||
return { wasi, errno, stderr };
|
||||
}
|
||||
|
||||
/** Report a failed tool run that printed no parseable error message. */
|
||||
function checkExitCode(tool: string, errno: number, stderr: string[], errors: WorkerError[]) {
|
||||
if (errno && !errors.length) {
|
||||
errors.push({ line: 0, msg: tool + " exited with code " + errno + (stderr.length ? ": " + stderr.join('\n') : '') });
|
||||
}
|
||||
}
|
||||
|
||||
function readWASIOutput(wasi: WASIRunner, path: string): Uint8Array {
|
||||
const fd = wasi.fs.getFile(path);
|
||||
if (!fd) throw new Error("Missing output file " + path);
|
||||
return fd.getBytes().slice();
|
||||
}
|
||||
|
||||
function readWASIOutputString(wasi: WASIRunner, path: string): string {
|
||||
return new TextDecoder().decode(readWASIOutput(wasi, path));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -108,8 +162,7 @@ function parseCA65Listing(asmfn: string, code: string, symbols, segments, params
|
||||
return origlines;
|
||||
}
|
||||
|
||||
export function assembleCA65(step: BuildStep): BuildStepResult {
|
||||
loadNative("ca65");
|
||||
export async function assembleCA65(step: BuildStep): Promise<BuildStepResult> {
|
||||
var errors = [];
|
||||
gatherFiles(step, { mainFilePath: "main.s" });
|
||||
var objpath = step.prefix + ".o";
|
||||
@@ -121,18 +174,7 @@ export function assembleCA65(step: BuildStep): BuildStepResult {
|
||||
}
|
||||
fixParamsWithDefines(step.path, step.params);
|
||||
if (staleFiles(step, [objpath, lstpath])) {
|
||||
var objout, lstout;
|
||||
var CA65: EmscriptenModule = emglobal.ca65({
|
||||
instantiateWasm: moduleInstFn('ca65'),
|
||||
noInitialRun: true,
|
||||
//logReadFiles:true,
|
||||
print: print_fn,
|
||||
printErr: makeErrorMatcher(errors, /(.+?):(\d+): (.+)/, 2, 3, step.path, 1),
|
||||
});
|
||||
var FS = CA65.FS;
|
||||
setupFS(FS, '65-' + getRootBasePlatform(step.platform));
|
||||
populateFiles(step, FS);
|
||||
var args = ['-v', '-g', '-I', '/share/asminc', '-o', objpath, '-l', lstpath, step.path];
|
||||
var args = ['-v', '-g', '-I', CC65_SHARE + '/asminc', '-o', objpath, '-l', lstpath, step.path];
|
||||
args.unshift.apply(args, ["-D", "__8BITWORKSHOP__=1"]);
|
||||
if (step.mainfile) {
|
||||
args.unshift.apply(args, ["-D", "__MAIN__=1"]);
|
||||
@@ -144,17 +186,17 @@ export function assembleCA65(step: BuildStep): BuildStepResult {
|
||||
.concat(defineArgs('ca65', step.params.symbols && step.params.symbols.assembler))
|
||||
.concat(extraArgsFor('ca65', step.params.buildArgs));
|
||||
args.splice(args.length - 1, 0, ...extra);
|
||||
execMain(step, CA65, args);
|
||||
const { wasi, errno, stderr } = await runCC65Tool(step, 'ca65', args, (fs) => populateFiles(step, fs));
|
||||
stderr.forEach(makeErrorMatcher(errors, /(.+?):(\d+): (.+)/, 2, 3, step.path, 1));
|
||||
checkExitCode('ca65', errno, stderr, errors);
|
||||
if (errors.length) {
|
||||
let listings : CodeListingMap = {};
|
||||
// TODO? change extension to .lst
|
||||
//listings[step.path] = { lines:[], text:getWorkFileAsString(step.path) };
|
||||
return { errors, listings };
|
||||
}
|
||||
objout = FS.readFile(objpath, { encoding: 'binary' });
|
||||
lstout = FS.readFile(lstpath, { encoding: 'utf8' });
|
||||
putWorkFile(objpath, objout);
|
||||
putWorkFile(lstpath, lstout);
|
||||
putWorkFile(objpath, readWASIOutput(wasi, objpath));
|
||||
putWorkFile(lstpath, readWASIOutputString(wasi, lstpath));
|
||||
}
|
||||
return {
|
||||
linktool: "ld65",
|
||||
@@ -163,32 +205,16 @@ export function assembleCA65(step: BuildStep): BuildStepResult {
|
||||
};
|
||||
}
|
||||
|
||||
export function linkLD65(step: BuildStep): BuildStepResult {
|
||||
loadNative("ld65");
|
||||
export async function linkLD65(step: BuildStep): Promise<BuildStepResult> {
|
||||
var params = step.params;
|
||||
gatherFiles(step);
|
||||
var binpath = "main";
|
||||
if (staleFiles(step, [binpath])) {
|
||||
var errors = [];
|
||||
var LD65: EmscriptenModule = emglobal.ld65({
|
||||
instantiateWasm: moduleInstFn('ld65'),
|
||||
noInitialRun: true,
|
||||
//logReadFiles:true,
|
||||
print: print_fn,
|
||||
printErr: function (s) { errors.push({ msg: s, line: 0 }); }
|
||||
});
|
||||
var FS = LD65.FS;
|
||||
setupFS(FS, '65-' + getRootBasePlatform(step.platform));
|
||||
populateFiles(step, FS);
|
||||
populateExtraFiles(step, FS, params.extra_link_files);
|
||||
// populate .cfg file, if it is a custom one
|
||||
if (store.hasFile(params.cfgfile)) {
|
||||
populateEntry(FS, params.cfgfile, store.getFileEntry(params.cfgfile), null);
|
||||
}
|
||||
var libargs = params.libargs || [];
|
||||
var cfgfile = params.cfgfile;
|
||||
var args = ['--cfg-path', '/share/cfg',
|
||||
'--lib-path', '/share/lib',
|
||||
var args = ['--cfg-path', CC65_SHARE + '/cfg',
|
||||
'--lib-path', CC65_SHARE + '/lib',
|
||||
'-C', cfgfile,
|
||||
'-Ln', 'main.vice',
|
||||
'--dbgfile', 'main.dbg',
|
||||
@@ -197,12 +223,22 @@ export function linkLD65(step: BuildStep): BuildStepResult {
|
||||
// //#symbol ld (symbols not already merged into libargs) and //#flag ld
|
||||
args.push.apply(args, linkSymbolArgs('ld65', params.symbols && params.symbols.linker));
|
||||
args.push.apply(args, extraArgsFor('ld65', params.buildArgs));
|
||||
execMain(step, LD65, args);
|
||||
const { wasi, errno, stderr } = await runCC65Tool(step, 'ld65', args, (fs) => {
|
||||
populateFiles(step, fs);
|
||||
populateExtraFiles(step, fs, params.extra_link_files);
|
||||
// populate .cfg file, if it is a custom one
|
||||
if (store.hasFile(params.cfgfile)) {
|
||||
populateEntry(fs, params.cfgfile, store.getFileEntry(params.cfgfile), null);
|
||||
}
|
||||
});
|
||||
// any ld65 message (even a warning) fails the build
|
||||
for (let s of stderr) errors.push({ msg: s, line: 0 });
|
||||
checkExitCode('ld65', errno, stderr, errors);
|
||||
if (errors.length)
|
||||
return { errors: errors };
|
||||
var aout = FS.readFile("main", { encoding: 'binary' });
|
||||
var mapout = FS.readFile("main.map", { encoding: 'utf8' });
|
||||
var viceout = FS.readFile("main.vice", { encoding: 'utf8' });
|
||||
var aout = readWASIOutput(wasi, "main");
|
||||
var mapout = readWASIOutputString(wasi, "main.map");
|
||||
var viceout = readWASIOutputString(wasi, "main.vice");
|
||||
// correct binary for PCEngine
|
||||
if (step.platform == 'pce' && aout.length > 0x2000) {
|
||||
// move 8 KB from end to front
|
||||
@@ -232,7 +268,7 @@ export function linkLD65(step: BuildStep): BuildStepResult {
|
||||
// symbol sizes from the linker debug file
|
||||
var symbolsizes = {};
|
||||
try {
|
||||
let dbgsyms = parseCC65DbgSizes(FS.readFile("main.dbg", { encoding: 'utf8' }), params.ignore_segments);
|
||||
let dbgsyms = parseCC65DbgSizes(readWASIOutputString(wasi, "main.dbg"), params.ignore_segments);
|
||||
symbolsizes = dbgsyms.sizes;
|
||||
// labels outside CPU address space (e.g. NES CHR) would alias real addresses
|
||||
for (let name of dbgsyms.ignored) delete symbolmap[name];
|
||||
@@ -263,7 +299,7 @@ export function linkLD65(step: BuildStep): BuildStepResult {
|
||||
var listings: CodeListingMap = {};
|
||||
for (var fn of step.files) {
|
||||
if (fn.endsWith('.lst')) {
|
||||
var lstout = FS.readFile(fn, { encoding: 'utf8' });
|
||||
var lstout = readWASIOutputString(wasi, fn);
|
||||
lstout = lstout.split('\n\n')[1] || lstout; // remove header
|
||||
putWorkFile(fn, lstout);
|
||||
//const asmpath = fn.replace(/\.lst$/, '.ca65'); // TODO! could be .s
|
||||
@@ -297,51 +333,17 @@ export function linkLD65(step: BuildStep): BuildStepResult {
|
||||
}
|
||||
}
|
||||
|
||||
export function compileCC65(step: BuildStep): BuildStepResult {
|
||||
loadNative("cc65");
|
||||
export async function compileCC65(step: BuildStep): Promise<BuildStepResult> {
|
||||
var params = step.params;
|
||||
// stderr
|
||||
var re_err1 = /(.*?):(\d+): (.+)/;
|
||||
var errors: WorkerError[] = [];
|
||||
var errline = 0;
|
||||
function match_fn(s) {
|
||||
console.log(s);
|
||||
var matches = re_err1.exec(s);
|
||||
if (matches) {
|
||||
errline = parseInt(matches[2]);
|
||||
errors.push({
|
||||
line: errline,
|
||||
msg: matches[3],
|
||||
path: matches[1]
|
||||
});
|
||||
}
|
||||
}
|
||||
gatherFiles(step, { mainFilePath: "main.c" });
|
||||
var destpath = step.prefix + '.s';
|
||||
// the link step reads these params, so they have to be settled even when
|
||||
// the assembly file is up to date and nothing below runs
|
||||
fixParamsWithDefines(step.path, params);
|
||||
if (staleFiles(step, [destpath])) {
|
||||
var CC65: EmscriptenModule = emglobal.cc65({
|
||||
instantiateWasm: moduleInstFn('cc65'),
|
||||
noInitialRun: true,
|
||||
//logReadFiles:true,
|
||||
print: print_fn,
|
||||
printErr: match_fn,
|
||||
});
|
||||
var FS = CC65.FS;
|
||||
setupFS(FS, '65-' + getRootBasePlatform(step.platform));
|
||||
populateFiles(step, FS, {
|
||||
mainFilePath: step.path,
|
||||
processFn: (path, code) => {
|
||||
if (typeof code === 'string') {
|
||||
code = processEmbedDirective(code);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
});
|
||||
var args = [
|
||||
'-I', '/share/include',
|
||||
'-I', CC65_SHARE + '/include',
|
||||
'-I', '.',
|
||||
"-D", "__8BITWORKSHOP__",
|
||||
];
|
||||
@@ -357,8 +359,19 @@ export function compileCC65(step: BuildStep): BuildStepResult {
|
||||
var customArgs = params.extra_compiler_args || ['-T', '-g', '-Oirs', '-Cl', '-W', '-pointer-sign,-no-effect'];
|
||||
args = args.concat(customArgs, args);
|
||||
args.push(step.path);
|
||||
const runerr = execToFile(step, CC65, args, FS, destpath, errors);
|
||||
if (runerr) return runerr;
|
||||
const { wasi, errno, stderr } = await runCC65Tool(step, 'cc65', args, (fs) => populateFiles(step, fs, {
|
||||
mainFilePath: step.path,
|
||||
processFn: (path, code) => {
|
||||
if (typeof code === 'string') {
|
||||
code = processEmbedDirective(code);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
}));
|
||||
stderr.forEach(makeErrorMatcher(errors, /(.*?):(\d+): (.+)/, 2, 3, step.path, 1));
|
||||
checkExitCode('cc65', errno, stderr, errors);
|
||||
if (errors.length) return { errors };
|
||||
putWorkFile(destpath, readWASIOutputString(wasi, destpath));
|
||||
}
|
||||
return {
|
||||
nexttool: "ca65",
|
||||
@@ -367,4 +380,3 @@ export function compileCC65(step: BuildStep): BuildStepResult {
|
||||
files: [destpath],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -61,3 +61,15 @@ export function runWASI(wasi: WASIRunner, errors: WorkerError[]) {
|
||||
errors.push({ line: 0, msg: "" + e });
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap a WASI runner's filesystem in the Emscripten FS calls the builder's
|
||||
* populateFiles/populateExtraFiles/populateEntry use, so tools can share them.
|
||||
*/
|
||||
export function wasiFSAdapter(wasi: WASIRunner) {
|
||||
return {
|
||||
mkdir: (path: string) => wasi.fs.putDirectory(path),
|
||||
writeFile: (path: string, data: string | Uint8Array) => wasi.fs.putFile(path, data),
|
||||
utime: () => { },
|
||||
};
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
|
||||
var ca65 = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(ca65) {
|
||||
ca65 = ca65 || {};
|
||||
|
||||
var Module=typeof ca65!=="undefined"?ca65:{};var objAssign=Object.assign;var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides=objAssign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;function logExceptionOnExit(e){if(e instanceof ExitStatus)return;let toLog=e;err("exiting due to exception: "+toLog)}var fs;var nodePath;var requireNodeFS;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}requireNodeFS=function(){if(!nodePath){fs=require("fs");nodePath=require("path")}};read_=function shell_read(filename,binary){requireNodeFS();filename=nodePath["normalize"](filename);return fs.readFileSync(filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=function readAsync(filename,onload,onerror){requireNodeFS();filename=nodePath["normalize"](filename);fs.readFile(filename,function(err,data){if(err)onerror(err);else onload(data.buffer)})};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",function(reason){throw reason});quit_=((status,toThrow)=>{if(keepRuntimeAlive()){process["exitCode"]=status;throw toThrow}logExceptionOnExit(toThrow);process["exit"](status)});Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=(title=>document.title=title)}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);objAssign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx<endPtr){var u0=heap[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2Line truncated
|
||||
|
||||
|
||||
return ca65;//.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = ca65;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return ca65; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["ca65"] = ca65;
|
||||
Binary file not shown.
@@ -1,21 +0,0 @@
|
||||
|
||||
var cc65 = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(cc65) {
|
||||
cc65 = cc65 || {};
|
||||
|
||||
var Module=typeof cc65!=="undefined"?cc65:{};var objAssign=Object.assign;var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides=objAssign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;function logExceptionOnExit(e){if(e instanceof ExitStatus)return;let toLog=e;err("exiting due to exception: "+toLog)}var fs;var nodePath;var requireNodeFS;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}requireNodeFS=function(){if(!nodePath){fs=require("fs");nodePath=require("path")}};read_=function shell_read(filename,binary){requireNodeFS();filename=nodePath["normalize"](filename);return fs.readFileSync(filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=function readAsync(filename,onload,onerror){requireNodeFS();filename=nodePath["normalize"](filename);fs.readFile(filename,function(err,data){if(err)onerror(err);else onload(data.buffer)})};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",function(reason){throw reason});quit_=((status,toThrow)=>{if(keepRuntimeAlive()){process["exitCode"]=status;throw toThrow}logExceptionOnExit(toThrow);process["exit"](status)});Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=(title=>document.title=title)}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);objAssign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx<endPtr){var u0=heap[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2Line truncated
|
||||
|
||||
|
||||
return cc65;//.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = cc65;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return cc65; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["cc65"] = cc65;
|
||||
Binary file not shown.
@@ -1,21 +0,0 @@
|
||||
|
||||
var ld65 = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(ld65) {
|
||||
ld65 = ld65 || {};
|
||||
|
||||
var Module=typeof ld65!=="undefined"?ld65:{};var objAssign=Object.assign;var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides=objAssign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;function logExceptionOnExit(e){if(e instanceof ExitStatus)return;let toLog=e;err("exiting due to exception: "+toLog)}var fs;var nodePath;var requireNodeFS;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}requireNodeFS=function(){if(!nodePath){fs=require("fs");nodePath=require("path")}};read_=function shell_read(filename,binary){requireNodeFS();filename=nodePath["normalize"](filename);return fs.readFileSync(filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=function readAsync(filename,onload,onerror){requireNodeFS();filename=nodePath["normalize"](filename);fs.readFile(filename,function(err,data){if(err)onerror(err);else onload(data.buffer)})};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",function(reason){throw reason});quit_=((status,toThrow)=>{if(keepRuntimeAlive()){process["exitCode"]=status;throw toThrow}logExceptionOnExit(toThrow);process["exit"](status)});Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=(title=>document.title=title)}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);objAssign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx<endPtr){var u0=heap[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2Line truncated
|
||||
|
||||
|
||||
return ld65;//.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = ld65;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return ld65; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["ld65"] = ld65;
|
||||
Binary file not shown.
@@ -174,11 +174,6 @@ export function loadNative(modulename: string) {
|
||||
// mount the filesystem at /share
|
||||
export function setupFS(FS, name: string) {
|
||||
var WORKERFS = FS.filesystems['WORKERFS'];
|
||||
if (name === '65-vector') name = '65-none'; // TODO
|
||||
if (name === '65-atari7800') name = '65-none'; // TODO
|
||||
if (name === '65-devel') name = '65-none'; // TODO
|
||||
if (name === '65-vcs') name = '65-atari2600'; // TODO
|
||||
if (name === '65-exidy') name = '65-none'; // TODO
|
||||
if (!fsMeta[name]) throw Error("No filesystem for '" + name + "'");
|
||||
FS.mkdir('/share');
|
||||
FS.mount(WORKERFS, {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
import type { WorkerResult, WorkerMessage, WorkerError, SourceLine } from "../common/workertypes";
|
||||
import { getPreloadFSName } from "../common/toolmeta";
|
||||
import { getSharedFileSystemName } from "../common/toolmeta";
|
||||
import { store, builder, errorResult, getWorkFileAsString } from "./builder";
|
||||
import { emglobal, fsMeta, loadFilesystem, listSharedFiles, readSharedFile, ensureFilesystem, readWasiSharedFile, listWasiSharedFiles, ensureWasiFilesystem } from "./wasmutils";
|
||||
|
||||
@@ -36,9 +36,9 @@ export function setupRequireFunction() {
|
||||
export async function handleMessage(data: WorkerMessage): Promise<WorkerResult> {
|
||||
// preload file system
|
||||
if (data.preload) {
|
||||
var fs = getPreloadFSName(data.preload, data.platform);
|
||||
if (fs && !fsMeta[fs])
|
||||
loadFilesystem(fs);
|
||||
var fs0 = splitWasiFSName(getSharedFileSystemName(data.preload, data.platform) || "");
|
||||
if (fs0.wasi) await ensureWasiFilesystem(fs0.name);
|
||||
else if (fs0.name && !fsMeta[fs0.name]) loadFilesystem(fs0.name);
|
||||
return;
|
||||
}
|
||||
// read a file from a filesystem package (shared code)
|
||||
|
||||
@@ -98,20 +98,20 @@ async function doBuild(msgs, callback, outlen, nlines, nerrors, options) {
|
||||
|
||||
describe('Worker', function() {
|
||||
it('should list shared files in filesystem package', async function() {
|
||||
var msg = await queryWorker({preload_fs:'65-nes', listshared:'/include', updates:[], buildsteps:[], qid:123});
|
||||
var msg = await queryWorker({preload_fs:'wasi:cc65-fs-nes.zip', listshared:'/share/cc65/include', updates:[], buildsteps:[], qid:123});
|
||||
assert.ok(Array.isArray(msg.output));
|
||||
assert.ok(msg.output.length > 0);
|
||||
assert.ok(msg.output.includes('/include/nes.h'));
|
||||
assert.ok(msg.output.includes('share/cc65/include/nes.h'));
|
||||
assert.equal(msg.qid, 123);
|
||||
});
|
||||
it('should read a shared header from filesystem package', async function() {
|
||||
var msg = await queryWorker({preload_fs:'65-nes', readshared:'/include/nes.h', updates:[], buildsteps:[], qid:124});
|
||||
var msg = await queryWorker({preload_fs:'wasi:cc65-fs-nes.zip', readshared:'/share/cc65/include/nes.h', updates:[], buildsteps:[], qid:124});
|
||||
assert.ok(msg.output instanceof Uint8Array);
|
||||
assert.ok(msg.output.length > 100);
|
||||
assert.equal(msg.qid, 124);
|
||||
});
|
||||
it('should return null for missing shared file', async function() {
|
||||
var msg = await queryWorker({preload_fs:'65-nes', readshared:'/include/nosuchfile.h', updates:[], buildsteps:[], qid:125});
|
||||
var msg = await queryWorker({preload_fs:'wasi:cc65-fs-nes.zip', readshared:'/share/cc65/include/nosuchfile.h', updates:[], buildsteps:[], qid:125});
|
||||
assert.equal(msg.output, null);
|
||||
assert.equal(msg.qid, 125);
|
||||
});
|
||||
|
||||
@@ -296,8 +296,8 @@ describe("explicit build directives (//#symbol, //#flag, //#tooldef)", function
|
||||
describe("platform tool config resolution", function () {
|
||||
|
||||
it("resolves per-platform, root-base, and default configs", function () {
|
||||
assert.strictEqual(getPlatformToolConfig('cc65', 'nes').preloadFS, '65-nes');
|
||||
assert.strictEqual(getPlatformToolConfig('cc65', 'atari8-800').preloadFS, '65-atari8');
|
||||
assert.strictEqual(getPlatformToolConfig('cc65', 'nes').wasiFSZip, 'cc65-fs-nes.zip');
|
||||
assert.strictEqual(getPlatformToolConfig('cc65', 'atari8-800').wasiFSZip, 'cc65-fs-atari8.zip');
|
||||
assert.strictEqual(getPlatformToolConfig('sdcc').preloadFS, 'sdcc');
|
||||
assert.strictEqual(getPlatformToolConfig('dasm', 'nes'), undefined);
|
||||
});
|
||||
|
||||
@@ -60,7 +60,7 @@ describe('ToolchainSource', function () {
|
||||
});
|
||||
|
||||
it('should list and lazily search bundled header files', async function () {
|
||||
setProjectProvider(() => makeFs({ '/include/nes.h': NES_H, '/include/apple.h': APPLE_H }));
|
||||
setProjectProvider(() => makeFs({ '/share/cc65/include/nes.h': NES_H, '/share/cc65/include/apple.h': APPLE_H }));
|
||||
const ts = new ToolchainSource();
|
||||
|
||||
// First query triggers ready(), which lists and reads every header file
|
||||
@@ -70,21 +70,21 @@ describe('ToolchainSource', function () {
|
||||
const rec = hits[0].record;
|
||||
assert.strictEqual(rec.kind, 'text');
|
||||
assert.strictEqual(rec.source, 'toolchain');
|
||||
assert.strictEqual(rec.file, '/include/nes.h');
|
||||
assert.strictEqual(rec.file, '/share/cc65/include/nes.h');
|
||||
assert.ok(rec.line && rec.line > 0);
|
||||
// The two hash-flavored hits should both appear (each file is searched)
|
||||
assert.ok(hits.some(h => h.record.file === '/include/nes.h' && h.record.name.includes('VBLANK')));
|
||||
assert.ok(hits.some(h => h.record.file === '/share/cc65/include/nes.h' && h.record.name.includes('VBLANK')));
|
||||
});
|
||||
|
||||
it('should be case-insensitive', async function () {
|
||||
setProjectProvider(() => makeFs({ '/include/nes.h': NES_H }));
|
||||
setProjectProvider(() => makeFs({ '/share/cc65/include/nes.h': NES_H }));
|
||||
const ts = new ToolchainSource();
|
||||
const hits = await ts.query('vblank', 10);
|
||||
assert.ok(hits.length >= 1);
|
||||
});
|
||||
|
||||
it('should require at least 2 chars', async function () {
|
||||
setProjectProvider(() => makeFs({ '/include/nes.h': NES_H }));
|
||||
setProjectProvider(() => makeFs({ '/share/cc65/include/nes.h': NES_H }));
|
||||
const ts = new ToolchainSource();
|
||||
const hits = await ts.query('x', 10);
|
||||
assert.strictEqual(hits.length, 0);
|
||||
@@ -92,9 +92,9 @@ describe('ToolchainSource', function () {
|
||||
|
||||
it('should read every header before answering the first query', async function () {
|
||||
const fs = makeFs({
|
||||
'/include/a.h': '#define AAA 1\n',
|
||||
'/include/b.h': '#define BBB 2\n',
|
||||
'/include/tgi.h': '#define TGI_OK 1\n',
|
||||
'/share/cc65/include/a.h': '#define AAA 1\n',
|
||||
'/share/cc65/include/b.h': '#define BBB 2\n',
|
||||
'/share/cc65/include/tgi.h': '#define TGI_OK 1\n',
|
||||
});
|
||||
setProjectProvider(() => fs);
|
||||
const ts = new ToolchainSource();
|
||||
@@ -105,12 +105,12 @@ describe('ToolchainSource', function () {
|
||||
// otherwise results depend on how many times the user types.
|
||||
const hits = await ts.query('TGI', 10);
|
||||
assert.ok(hits.length >= 1, 'should index all headers on the first query');
|
||||
assert.strictEqual(hits[0].record.file, '/include/tgi.h');
|
||||
assert.strictEqual(hits[0].record.file, '/share/cc65/include/tgi.h');
|
||||
assert.strictEqual(ts['loaded'].size, 3);
|
||||
});
|
||||
|
||||
it('should rank matches near the start of the line higher', async function () {
|
||||
setProjectProvider(() => makeFs({ '/include/nes.h': NES_H }));
|
||||
setProjectProvider(() => makeFs({ '/share/cc65/include/nes.h': NES_H }));
|
||||
const ts = new ToolchainSource();
|
||||
const hits = await ts.query('PPU', 10);
|
||||
assert.ok(hits.length >= 2, 'PPU matches several lines');
|
||||
@@ -124,8 +124,8 @@ describe('ToolchainSource', function () {
|
||||
|
||||
it('should skip non-searchable file types', async function () {
|
||||
const ts = new ToolchainSource();
|
||||
assert.strictEqual((ts as any).isSearchable('/include/nes.h'), true);
|
||||
assert.strictEqual((ts as any).isSearchable('/include/nes.o'), false);
|
||||
assert.strictEqual((ts as any).isSearchable('/share/cc65/include/nes.h'), true);
|
||||
assert.strictEqual((ts as any).isSearchable('/share/cc65/include/nes.o'), false);
|
||||
assert.strictEqual((ts as any).isSearchable('/lib/binary.bin'), false);
|
||||
assert.strictEqual((ts as any).isSearchable('/scripts/makefile'), true); // no ext
|
||||
});
|
||||
|
||||
+12
-10
@@ -47,20 +47,22 @@ describe('Tool metadata registry', function () {
|
||||
});
|
||||
|
||||
it('getPreloadFSName resolves per-platform filesystems', function () {
|
||||
assert.strictEqual(getPreloadFSName('cc65', 'nes'), '65-nes');
|
||||
assert.strictEqual(getPreloadFSName('cc65', 'c64'), '65-c64');
|
||||
assert.strictEqual(getPreloadFSName('cc65', 'nonexistent'), undefined);
|
||||
assert.strictEqual(getPreloadFSName('cc65', 'nes'), undefined); // WASI zip, not preloadFS
|
||||
assert.strictEqual(getSharedFileSystemName('cc65', 'nes'), 'wasi:cc65-fs-nes.zip');
|
||||
assert.strictEqual(getSharedFileSystemName('cc65', 'c64'), 'wasi:cc65-fs-c64.zip');
|
||||
assert.strictEqual(getSharedFileSystemName('cc65', 'nonexistent'), undefined);
|
||||
assert.strictEqual(getPreloadFSName('sdcc'), 'sdcc'); // default config
|
||||
assert.strictEqual(getPreloadFSName('dasm'), undefined);
|
||||
});
|
||||
|
||||
it('getPreloadFSName resolves suffixed platform ids to their root base', function () {
|
||||
it('getSharedFileSystemName resolves suffixed platform ids to their root base', function () {
|
||||
// atari8 runs as 'atari8-800' / 'atari8-5200' / *.xlmame variants
|
||||
assert.strictEqual(getPreloadFSName('cc65', 'atari8'), '65-atari8');
|
||||
assert.strictEqual(getPreloadFSName('cc65', 'atari8-800'), '65-atari8');
|
||||
assert.strictEqual(getPreloadFSName('cc65', 'atari8-800.xlmame'), '65-atari8');
|
||||
assert.strictEqual(getPreloadFSName('cc65', 'atari8-5200'), '65-atari8');
|
||||
assert.strictEqual(getSharedFileSystemName('cc65', 'atari8-800'), '65-atari8');
|
||||
assert.strictEqual(getSharedFileSystemName('cc65', 'atari8'), 'wasi:cc65-fs-atari8.zip');
|
||||
assert.strictEqual(getSharedFileSystemName('cc65', 'atari8-800'), 'wasi:cc65-fs-atari8.zip');
|
||||
assert.strictEqual(getSharedFileSystemName('cc65', 'atari8-800.xlmame'), 'wasi:cc65-fs-atari8.zip');
|
||||
assert.strictEqual(getSharedFileSystemName('cc65', 'atari8-5200'), 'wasi:cc65-fs-atari8.zip');
|
||||
assert.strictEqual(getSharedFileSystemName('fastbasic', 'atari8-800'), 'wasi:cc65-fs-atari8.zip');
|
||||
assert.strictEqual(getSharedFileSystemName('ecs', 'nes'), 'wasi:cc65-fs-nes.zip');
|
||||
});
|
||||
|
||||
it('getSkeletonName defaults to the tool id', function () {
|
||||
@@ -137,8 +139,8 @@ describe('Tool metadata registry', function () {
|
||||
});
|
||||
|
||||
it('resolves shared filesystem names for all tools with includeDirs', function () {
|
||||
assert.equal(getSharedFileSystemName('cc65', 'nes'), 'wasi:cc65-fs-nes.zip');
|
||||
// preloadFS-backed tools
|
||||
assert.equal(getSharedFileSystemName('cc65', 'nes'), '65-nes');
|
||||
assert.equal(getSharedFileSystemName('sdcc', 'coleco'), 'sdcc');
|
||||
assert.equal(getSharedFileSystemName('bataribasic', 'vcs'), 'wasi:bb-fs.zip');
|
||||
assert.equal(getSharedFileSystemName('wiz'), 'wiz');
|
||||
|
||||
Reference in new issue
Block a user