Hatari in Javascript via emscripten

NeXTComputers.org -> The Lounge

Title: Hatari in Javascript via emscripten
Post by: itomato on November 24, 2015, 08:37:43 PM
http://absencehq.de/union/

What's good for Hatari is good for Previous, yeah?
Title: Hatari in Javascript via emscripten
Post by: eagle on November 25, 2015, 01:03:44 PM
Wow, that's neat.
Title: Re: Hatari in Javascript via emscripten
Post by: itomato on August 22, 2023, 05:58:04 AM
I was coming to post what is basically the same thing: http://absencehq.de/atariaviary/?c1mb=0&c2mb=0&c4mb=1&cste=1&cffwd=0&chd=0&id=267497

So now 8 years (?!) later I am taking another crack at transpiling Previous 2.9 with Emscripten, made some quick progress with the help of ChatGPT (it builds but that's about it) so now I'm scraping the internet for other successful Emscripten Hatari ports. There are official instructions for compiling with Emscripten - next for me.

There are a number of changes I needed to make to the slirp and ditool code to get it compiled and linked. I guess a diff is in order. Anybody interested can find the CMakeList.txt (and probably the Js and Wasm files here) https://github.com/itomato/Emprevious3
Title: Re: Hatari in Javascript via emscripten
Post by: itomato on August 23, 2023, 06:28:19 AM
An example is built in embuild/src/ here: https://github.com/itomato/Emprevious3/tree/main/embuild/src

You can serve this directory with Python's HTTP Server like so: python3 -m http.server -d embuild/src/

Notes

This only builds on ARM64 currently. Add the X86_64 arch back in CMakeLists.txt if you want to build there.

Bugs

It currently throws OOM errors loading the WASM. Not sure if enabling dynamic growth and setting an initial allocation is the fix.

PRs welcome.

Go to top  Forum index