updated wiz.wasm

This commit is contained in:
Steven Hugg 2022-01-22 20:17:47 -06:00
parent 48eb75882b
commit 0345834bb5
5 changed files with 69 additions and 60 deletions

Binary file not shown.

View File

@ -6,16 +6,17 @@
}
Module.expectedDataFileDownloads++;
(function() {
var loadPackage = function(metadata) {
// 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;
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 location !== 'undefined') {
// worker
} else if (typeof process === 'undefined' && typeof location !== 'undefined') {
// web worker
PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
} else {
throw 'using preloaded data can only be done on a web page or in a web worker';
}
var PACKAGE_NAME = '/home/pzp/8bitworkshop-compilers/output/fs/fswiz.data';
var REMOTE_PACKAGE_BASE = 'fswiz.data';
@ -29,6 +30,18 @@
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';
@ -97,61 +110,58 @@
function assert(check, msg) {
if (!check) throw msg + new Error().stack;
}
Module['FS_createPath']('/', 'common', true, true);
Module['FS_createPath']('/common', 'snes', true, true);
Module['FS_createPath']('/common', 'gg', true, true);
Module['FS_createPath']('/common', 'nes', true, true);
Module['FS_createPath']('/common', 'msx', true, true);
Module['FS_createPath']('/common', 'pce', true, true);
Module['FS_createPath']('/common', 'gb', true, true);
Module['FS_createPath']('/common', '2600', true, true);
Module['FS_createPath']('/common', 'spc', true, true);
Module['FS_createPath']("/", "common", true, true);
Module['FS_createPath']("/common", "snes", true, true);
Module['FS_createPath']("/common", "gg", true, true);
Module['FS_createPath']("/common", "nes", true, true);
Module['FS_createPath']("/common", "msx", true, true);
Module['FS_createPath']("/common", "pce", true, true);
Module['FS_createPath']("/common", "gb", true, true);
Module['FS_createPath']("/common", "2600", true, true);
Module['FS_createPath']("/common", "spc", 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;
/** @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']).open('GET', files[i]['filename']);
}
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;
// copy the entire loaded file into a spot in the heap. Files will refer to slices in that. They cannot be freed though
// (we may be allocating before malloc is ready, during startup).
var ptr = Module['getMemory'](byteArray.length);
Module['HEAPU8'].set(byteArray, ptr);
DataRequest.prototype.byteArray = Module['HEAPU8'].subarray(ptr, ptr+byteArray.length);
// 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) {

View File

@ -1 +1 @@
{"remote_package_size":222931,"package_uuid":"138b64f7-0a64-4b41-bae4-c3b17a5945ff","files":[{"end":2959,"filename":"/common/snes/icd2.wiz","audio":0,"start":0},{"end":5901,"filename":"/common/snes/img2snes.py","audio":0,"start":2959},{"end":7500,"filename":"/common/snes/minirpg_sprites.png","audio":0,"start":5901},{"end":8103,"filename":"/common/snes/hello_tiles_compact.png","audio":0,"start":7500},{"end":9639,"filename":"/common/snes/hello_tiles_compact.chr","audio":0,"start":8103},{"end":10276,"filename":"/common/snes/hello_tiles.png","audio":0,"start":9639},{"end":18468,"filename":"/common/snes/hello_tiles.chr","audio":0,"start":10276},{"end":42055,"filename":"/common/snes/snes.wiz","audio":0,"start":18468},{"end":50247,"filename":"/common/snes/minirpg_sprites.chr","audio":0,"start":42055},{"end":56476,"filename":"/common/gg/sms.wiz","audio":0,"start":50247},{"end":58075,"filename":"/common/gg/minirpg_sprites.png","audio":0,"start":56476},{"end":58712,"filename":"/common/gg/hello_tiles.png","audio":0,"start":58075},{"end":61571,"filename":"/common/gg/img2gg8.py","audio":0,"start":58712},{"end":69763,"filename":"/common/gg/hello_tiles.chr","audio":0,"start":61571},{"end":73777,"filename":"/common/gg/img2gg16.py","audio":0,"start":69763},{"end":81969,"filename":"/common/gg/minirpg_sprites.chr","audio":0,"start":73777},{"end":86065,"filename":"/common/nes/scroller_tiles.chr","audio":0,"start":81969},{"end":87662,"filename":"/common/nes/minirpg_sprites.png","audio":0,"start":86065},{"end":88099,"filename":"/common/nes/hello_tiles.png","audio":0,"start":87662},{"end":90452,"filename":"/common/nes/img2chr.py","audio":0,"start":88099},{"end":94548,"filename":"/common/nes/hello_tiles.chr","audio":0,"start":90452},{"end":95391,"filename":"/common/nes/scroller_tiles.png","audio":0,"start":94548},{"end":96073,"filename":"/common/nes/bobble_tiles.png","audio":0,"start":95391},{"end":115162,"filename":"/common/nes/nes.wiz","audio":0,"start":96073},{"end":119258,"filename":"/common/nes/bobble_tiles.chr","audio":0,"start":115162},{"end":123354,"filename":"/common/nes/minirpg_sprites.chr","audio":0,"start":119258},{"end":125583,"filename":"/common/msx/img2msx16.py","audio":0,"start":123354},{"end":126076,"filename":"/common/msx/hello_tiles.png","audio":0,"start":125583},{"end":128124,"filename":"/common/msx/hello_tiles.chr","audio":0,"start":126076},{"end":130353,"filename":"/common/msx/img2msx8.py","audio":0,"start":128124},{"end":144050,"filename":"/common/msx/msx.wiz","audio":0,"start":130353},{"end":156730,"filename":"/common/pce/pce.wiz","audio":0,"start":144050},{"end":158329,"filename":"/common/pce/minirpg_sprites.png","audio":0,"start":156730},{"end":158966,"filename":"/common/pce/hello_tiles.png","audio":0,"start":158329},{"end":167158,"filename":"/common/pce/hello_tiles.chr","audio":0,"start":158966},{"end":170075,"filename":"/common/pce/img2pce8.py","audio":0,"start":167158},{"end":178267,"filename":"/common/pce/minirpg_sprites.chr","audio":0,"start":170075},{"end":181106,"filename":"/common/gb/bcd.wiz","audio":0,"start":178267},{"end":183925,"filename":"/common/gb/joy.wiz","audio":0,"start":181106},{"end":200923,"filename":"/common/gb/gb.wiz","audio":0,"start":183925},{"end":202249,"filename":"/common/gb/oam.wiz","audio":0,"start":200923},{"end":204600,"filename":"/common/gb/math.wiz","audio":0,"start":202249},{"end":207787,"filename":"/common/gb/sgb_util.wiz","audio":0,"start":204600},{"end":209229,"filename":"/common/gb/memory.wiz","audio":0,"start":207787},{"end":210279,"filename":"/common/gb/gbc_util.wiz","audio":0,"start":209229},{"end":216179,"filename":"/common/2600/vcs.wiz","audio":0,"start":210279},{"end":222931,"filename":"/common/spc/spc.wiz","audio":0,"start":216179}]}
{"files":[{"filename":"/common/snes/icd2.wiz","start":0,"end":2959},{"filename":"/common/snes/img2snes.py","start":2959,"end":5920},{"filename":"/common/snes/minirpg_sprites.png","start":5920,"end":7519},{"filename":"/common/snes/hello_tiles_compact.png","start":7519,"end":8122},{"filename":"/common/snes/hello_tiles_compact.chr","start":8122,"end":9658},{"filename":"/common/snes/hello_tiles.png","start":9658,"end":10295},{"filename":"/common/snes/hello_tiles.chr","start":10295,"end":18487},{"filename":"/common/snes/snes.wiz","start":18487,"end":42074},{"filename":"/common/snes/minirpg_sprites.chr","start":42074,"end":50266},{"filename":"/common/gg/sms.wiz","start":50266,"end":56495},{"filename":"/common/gg/minirpg_sprites.png","start":56495,"end":58094},{"filename":"/common/gg/hello_tiles.png","start":58094,"end":58731},{"filename":"/common/gg/img2gg8.py","start":58731,"end":61609},{"filename":"/common/gg/hello_tiles.chr","start":61609,"end":69801},{"filename":"/common/gg/img2gg16.py","start":69801,"end":73816},{"filename":"/common/gg/minirpg_sprites.chr","start":73816,"end":82008},{"filename":"/common/nes/scroller_tiles.chr","start":82008,"end":86104},{"filename":"/common/nes/minirpg_sprites.png","start":86104,"end":87701},{"filename":"/common/nes/hello_tiles.png","start":87701,"end":88138},{"filename":"/common/nes/img2chr.py","start":88138,"end":90528},{"filename":"/common/nes/hello_tiles.chr","start":90528,"end":94624},{"filename":"/common/nes/scroller_tiles.png","start":94624,"end":95467},{"filename":"/common/nes/bobble_tiles.png","start":95467,"end":96149},{"filename":"/common/nes/nes.wiz","start":96149,"end":115238},{"filename":"/common/nes/bobble_tiles.chr","start":115238,"end":119334},{"filename":"/common/nes/minirpg_sprites.chr","start":119334,"end":123430},{"filename":"/common/msx/img2msx16.py","start":123430,"end":125505},{"filename":"/common/msx/hello_tiles.png","start":125505,"end":125998},{"filename":"/common/msx/hello_tiles.chr","start":125998,"end":128046},{"filename":"/common/msx/img2msx8.py","start":128046,"end":130360},{"filename":"/common/msx/msx.wiz","start":130360,"end":185578},{"filename":"/common/pce/pce.wiz","start":185578,"end":198258},{"filename":"/common/pce/minirpg_sprites.png","start":198258,"end":199857},{"filename":"/common/pce/hello_tiles.png","start":199857,"end":200494},{"filename":"/common/pce/hello_tiles.chr","start":200494,"end":208686},{"filename":"/common/pce/img2pce8.py","start":208686,"end":211606},{"filename":"/common/pce/minirpg_sprites.chr","start":211606,"end":219798},{"filename":"/common/gb/bcd.wiz","start":219798,"end":222637},{"filename":"/common/gb/joy.wiz","start":222637,"end":225456},{"filename":"/common/gb/gb.wiz","start":225456,"end":242454},{"filename":"/common/gb/oam.wiz","start":242454,"end":243780},{"filename":"/common/gb/math.wiz","start":243780,"end":246131},{"filename":"/common/gb/sgb_util.wiz","start":246131,"end":249318},{"filename":"/common/gb/memory.wiz","start":249318,"end":250760},{"filename":"/common/gb/gbc_util.wiz","start":250760,"end":251810},{"filename":"/common/2600/vcs.wiz","start":251810,"end":257710},{"filename":"/common/spc/spc.wiz","start":257710,"end":264462}],"remote_package_size":264462,"package_uuid":"f357339c-3604-4f7c-b827-41c09e93a3b5"}

File diff suppressed because one or more lines are too long

Binary file not shown.