Log In  


I'm building a cozy game using Godot, and wanted to add a feature where users can pick up a PICO-8 cartridge and run the PICO-8 runtime + cartridge. Godot compiles to run cross-platform, so I figured that the best attempt to get this to work would be running a WASM file.

It seems like WASM support for PICO-8 exporter is experimental? The exporter produces .js and .wasm, so it seems that the WASM executable was intended to be called by the Javascript code. I briefly attempted to wire GDScript to call the WASM file, but the interface functions calls are not straightforward or documented anywhere.

Would love any input regarding running WASM and/or emulation in a Godot environment where the host machine may be arbitrary.



I just took a look at the insides of the .js file from an export. I'm pretty sure it works by copying an existing build of the pico-8 engine made using emscripten with SDL support, then overwriting the portion that contains the cart data. I don't know if Godot uses SDL for the web export, but I would expect most of the important part to be in the wasm file anyway. Regardless, I think trying to the run the .js file, whether with wasm or not, would be a better approach.

That said, if you're trying to build your game without using the web export for Godot, then it might be hard to use either the .js or wasm file because of their reliance on emscripten.


Thanks kimiyoribaka.

Did some reading about Emscripten. Emscripten can export standalone WASM, but by default it is exported to run with the Emscripten JS runtime.

I may be able to get something running by sandboxing a Node.js runtime in Godot to run the .js file assuming that the file doesn't rely on browser APIs.


there's a pico8 emulator in love2d which may give you some inspiration.

https://github.com/picolove/picolove


you should check with zep, I am not sure it is allowed by the license to reuse and redistribute the pico-8 runtime compiled by emscripten



[Please log in to post a comment]