Simple Javascript C64 emulator for a web game?

Pre-breaking this out to a different topic …

I’m working on this C64 game, but I want to make an easy version for anyone to try out without installing anything. A web game version is ideal for this. So, what I need is:

  1. Some javascript C64 emulator that I can install on my web server (already set up, but very vanilla - I don’t even have JQuery or anything like that installed).

  2. Host either my .prg or disk image file on my web server, depending on what’s easier for the C64 emulator I choose. Note that my game will be a single loader, so a disk image is not necessarily necessary.

  3. Configure whatever’s needed to get the program to automatically load and start. I’d rather not emulate a 15 minute load wait, though …

Doing a search, I find quite a number of javascript C64 emulators, but I don’t have any idea which would be better or worse to choose. Anyone have any ideas? Thanks!

I suspect the one by floooh might be a good one to work with:

But it’s probably worth evaluating the source code: you want decent browser performance and good fidelity of emulation, but in your case you also want to be able to find the hooks to use it on your website the way you want to use it.

1 Like

I was once looking for one for a similar purpose (potential RetroChallenge project) and found this one promising:

(When I was testing it, it seemed to support only disk images or a proprietary snapshot format, but this seems to have improved in the meantime. Mind the drag and drop interface. If this works, there should be a provision for linking individual files, as well.)

1 Like

Thanks, so much!

I’m not sure how you’re supposed to install/maintain/use this … it doesn’t seem to be as simple as copying the “webpage” folder. But it does look like IF I can get it installed, I can autoload a prg with a simple URL something like this:

h t t p s ://floooh.github.io/tiny8bit/c64.html?file=c64/crapman_c64.prg

Looks like it conveniently handles autoloading the .prg file as well as simulating user input of R U N Enter to actually run the program after loading.

Digging around a bit, though, I’m really not sure how the heck to install the thing.

Thanks! As with the other one, I’m not sure how to install it on a web server. The documentation I’ve found so far seems to be concerned with packaging things for a Windows executable file.

I didn’t try to build it, but I was able to run it as a static site just by downloading four files:

   wget -x floooh.github.io/tiny8bit/c64.html
   wget -x floooh.github.io/tiny8bit/c64.js
   wget -x floooh.github.io/tiny8bit/c64.wasm
   wget -x floooh.github.io/tiny8bit/c64/crapman_c64.prg

I imagine you need some kind of build step to create the wasm file from sources.

1 Like

Oh wow, thanks for figuring that out! That’s abso-freaking perfect for my needs.

BTW, performance of the emulator does seem pretty spotty, at least on some of my computers which are a bit older and slower, and at higher resolutions. However, for my specific purposes this is okay. I’m currently working on a turn based roguelike/puzzle game so frame rate is not so critical. I’m also avoiding various graphics techniques which rely upon flickering between two frames because I expect most people to play via emulators with probably frame sync issues.

That said, if I return to my 3D Descent-like game, frame rate would be important. Still, even a sluggish web version would be good enough for people to get a feel for it without downloading/installing.

1 Like

I’m pretty sure, there had been a dedicated download, once. However, there’s still a license statement indicating free for private use. I guess, you’ll have to save the source and any assets and then edit the HTML-file to extract the vital parts and to adjust it to your needs.

1 Like