Skip to content

Commit

Permalink
wasmproxy: Not working
Browse files Browse the repository at this point in the history
  • Loading branch information
okuoku committed Jan 13, 2021
1 parent c279e1e commit 188c77d
Show file tree
Hide file tree
Showing 5 changed files with 692 additions and 8 deletions.
6 changes: 4 additions & 2 deletions jstestapp/dlltest/rt.c
Expand Up @@ -11,13 +11,15 @@ static uintptr_t cb_wasm_boot_allocate_memory = 0;
static uintptr_t cb_wasm_boot_allocate_table = 0;
static uintptr_t cb_wasm_boot_grow_memory = 0;

static void
__declspec(dllexport)
void
short_circuit(const uint64_t* in, uint64_t* out){
nccc_call_t cb = (nccc_call_t)(uintptr_t)in[0];
cb(&in[1], out);
}

static void
__declspec(dllexport)
void
shufflecall_ptr(uint64_t* cmd0, uint64_t* ret, uint64_t cmdoffset,
const void* p0, const void* p1, const void* p2, const void* p3){
uint64_t* cmd = &cmd0[cmdoffset];
Expand Down
8 changes: 6 additions & 2 deletions jstestapp/index.js
Expand Up @@ -6,11 +6,11 @@ const BOOTWASM = "app4/webgl.wasm";
const APPFS_DIR = "app4/appfs";
*/

/*
const BOOTPROTOCOL = "plain";
const BOOTSTRAP = "app/example_emscripten_opengl3.js";
const BOOTWASM = "app/example_emscripten_opengl3.wasm";
*/
const BOOTARGS = [];
const APPFS_DIR = false;

/*
const BOOTPROTOCOL = "godot";
Expand All @@ -20,11 +20,13 @@ const GODOT_ARGS = ["--main-pack","webgl.pck"]; // target path
const APPFS_DIR = "app5/appfs";
*/

/*
const BOOTPROTOCOL = "plain";
const BOOTSTRAP = "app6/pp.dosbox-x.js";
const BOOTWASM = "app6/dosbox-x.wasm";
const BOOTARGS = ["-conf", "/appfs/conf"];
const APPFS_DIR = "app6/appfs";
*/

const process = require("process");
const fs = require("fs");
Expand All @@ -34,6 +36,7 @@ const audioctx_mini = require("./audioctx-mini.js");
const performance = require('perf_hooks').performance;
const storage = require("./storage.js");
const EmuCanvas = require("./emucanvas.js");
//const WebAssembly = require("./wasmproxy.js");

const nav = {};
const doc = {};
Expand Down Expand Up @@ -487,6 +490,7 @@ wnd.document.addEventListener = fake_aEL(1, "Document"); // specialHTMLTargets[1
wnd.document.getElementById = fake_gEBI;
wnd.document.createElement = fake_cEl;
wnd.addEventListener = fake_aEL(0, "Window"); // specialHTMLTargets[2]
//wnd.removeEventListener = fake_rEL(0, "Window");
wnd.navigator.userAgent = "bogus";
wnd.navigator.appVersion = "bogus";

Expand Down

0 comments on commit 188c77d

Please sign in to comment.