build_and_run - vc64web/virtualc64web GitHub Wiki

how to build and run it in a web browser

  • install emsdk
  • make sure emsdk is in PATH (e.g. on unix with source emsdk_env.sh)
  • clone this repository into a folder
  • cd into that folder
  • optional: copy c64-roms (four .bin files) into subfolder roms (this is optional ... missing roms can be loaded into emulator while running it)
  • mkdir b
  • emcmake cmake -S . -B b
  • cd b
  • make run
  • open your browser and head to http://localhost:8080/

note: make run starts an webserver with URL base path pointing to the folder where the build resides.

  • make clean cleans the build
  • make publish copies only those files which are needed by the browser to run into a separate PUBLISH_FOLDER. The PUBLISH_FOLDER is defined inside the Makefile.

these are effectively the files on https://github.com/vc64web/vc64web.github.io it is the place where the official build is published to

  • index.html the html page which renders the UI and starts the loading of the vC64.js/wasm

  • vC64.wasm the VirtualC64 emulator core

  • vC64.js the Emscripten generated javascript stub for the vC64.wasm

  • sw.js the serviceworker which installs the app localy into the browser cache

  • ...

you might want to know how to package that all up and bundle it with your favourite C64 title ... then head to the next chapter

how to build a standalone version of your c64 prg and run it in the browser using the player