-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More Emglken progress. We must manually process the main args, as env…
…::args doesn't work in WASM
- Loading branch information
1 parent
33318d9
commit 9eb640a
Showing
10 changed files
with
104 additions
and
52 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 |
---|---|---|
@@ -1,18 +1,9 @@ | ||
[workspace] | ||
members = [ | ||
"emscripten_em_js", | ||
"remglk", | ||
"remglk_capi", | ||
] | ||
resolver = "2" | ||
|
||
[profile.release] | ||
lto = true | ||
|
||
[profile.dev-wasm] | ||
inherits = "dev" | ||
panic = "abort" | ||
|
||
[profile.release-wasm] | ||
inherits = "release" | ||
panic = "abort" | ||
lto = true |
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
Emglken JS library | ||
================== | ||
Copyright (c) 2024 Dannii Willis | ||
MIT licenced | ||
https://github.com/curiousdannii/emglken | ||
*/ | ||
|
||
addToLibrary({ | ||
emglken_fileref_exists(filename_ptr, filename_len) { | ||
const name = UTF8ToString(filename_ptr, filename_len) | ||
if (name === storyfile_name) { | ||
return true | ||
} | ||
return false | ||
}, | ||
|
||
emglken_fileref_read(filename_ptr, filename_len, buffer) { | ||
const name = UTF8ToString(filename_ptr, filename_len) | ||
if (name === storyfile_name) { | ||
const ptr = _malloc(storyfile_data.length) | ||
HEAP8.set(storyfile_data, ptr) | ||
{{{ makeSetValue('buffer', 0, 'ptr', 'i32') }}} | ||
{{{ makeSetValue('buffer', 4, 'storyfile_data.length', 'i32') }}} | ||
return true | ||
} | ||
return false | ||
}, | ||
}) |