-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: bones_was_here <[email protected]>
- Loading branch information
1 parent
8e5df4e
commit e9c4587
Showing
3 changed files
with
105 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,7 @@ jobs: | |
cd .. | ||
# fail if there's any warnings | ||
export CC="cc" | ||
#export CC="cc" | ||
make emscripten-release | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,63 @@ | ||
//current command in ascii decimal | ||
let currentcmd = [0,0,0] | ||
let currentfile = ""; | ||
const sleep = ms => new Promise(r => setTimeout(r,ms)); | ||
Module['print'] = function(text){console.log(text);} | ||
const sleep = ms => new Promise(r => setTimeout(r, ms)); | ||
|
||
Module['print'] = function(text) { console.log(text); } | ||
|
||
Module['preRun'] = function() | ||
{ | ||
|
||
function stdin(){return 10}; | ||
var stdout = null; | ||
var stderr = null; | ||
FS.init(stdin,stdout,stderr); | ||
FS.mount(IDBFS,{},"/home/web_user/"); | ||
FS.symlink("/home/web_user","/save"); | ||
|
||
function stdin() { return 10 }; | ||
var stdout = null; | ||
var stderr = null; | ||
FS.init(stdin, stdout, stderr); | ||
FS.mount(IDBFS, {}, "/home/web_user/"); | ||
FS.symlink("/home/web_user", "/save"); | ||
} | ||
|
||
Module['noInitialRun'] = true | ||
|
||
document.addEventListener('click', (ev) => { | ||
console.log("event is captured only once."); | ||
args = [] | ||
if(window.location.href.indexOf("file://") > -1) | ||
{ | ||
try | ||
{ | ||
args = args.concat(prompt("Enter command line arguments").split(" ")) | ||
} catch (error) | ||
{ | ||
console.log("Error: ",error); | ||
console.log("Failed to concat extra arguments (likely passed nothing for the argument)") | ||
} | ||
|
||
console.log("event is captured only once."); | ||
args = [] | ||
if(window.location.href.indexOf("file://") > -1) | ||
{ | ||
try | ||
{ | ||
args = args.concat(prompt("Enter command line arguments").split(" ")) | ||
} | ||
catch (error) | ||
{ | ||
console.log("Error: ", error); | ||
console.log("Failed to concat extra arguments (likely passed nothing for the argument)") | ||
} | ||
} | ||
else | ||
{ | ||
parms = new URLSearchParams(window.location.search); | ||
try | ||
{ | ||
args = args.concat(parms.get("args").split(" ")) | ||
} | ||
catch (error) | ||
{ | ||
console.log("Error: ", error); | ||
console.log("Failed to concat extra arguments (likely passed nothing for the argument)") | ||
} | ||
} | ||
|
||
} else | ||
{ | ||
parms = new URLSearchParams(window.location.search); | ||
try | ||
{ | ||
args = args.concat(parms.get("args").split(" ")) | ||
} catch (error) | ||
{ | ||
console.log("Error: ",error); | ||
console.log("Failed to concat extra arguments (likely passed nothing for the argument)") | ||
} | ||
|
||
} | ||
FS.syncfs(true,function(){ | ||
if(FS.analyzePath("/preload/runhere").exists){ | ||
FS.symlink("/preload","/home/web_user/games"); | ||
args = args.concat(["-basedir","/home/web_user/games"]) | ||
} | ||
else{ | ||
args = args.concat(["-basedir","/home/web_user/"]) | ||
} | ||
|
||
Module.callMain(args); | ||
}); | ||
|
||
}, { once: true }); | ||
FS.syncfs(true, function() | ||
{ | ||
if(FS.analyzePath("/preload/runhere").exists) | ||
{ | ||
FS.symlink("/preload", "/home/web_user/games"); | ||
args = args.concat(["-basedir", "/home/web_user/games"]) | ||
} | ||
else | ||
{ | ||
args = args.concat(["-basedir", "/home/web_user/"]) | ||
} | ||
|
||
|
||
Module.callMain(args); | ||
}); | ||
}, { once: true }); |