floooh / chips-test

Tests and sample code for https://github.com/floooh/chips
MIT License
387 stars 46 forks source link

How to self host one of these emus? #22

Closed kimboslice99 closed 2 years ago

kimboslice99 commented 2 years ago

Forgive my ignorance but, how can I host one of these myself?

floooh commented 2 years ago

Easiest way is grab the required files from the sample webpage repository:

https://github.com/floooh/tiny8bit

For instance for the Amstrad CPC you'd need the files cpc.html, cpc.wasm and cpc.js, throw them into the same webserver directory together with the game image files, and then in a browser navigate to the cpc.html file (optionally with "URL arguments" to load and launch the game image, see the URLs on the tiny8bit page as example).

The emulator can also be hosted in an iframe, see this blog post for example: https://floooh.github.io/2019/01/05/wasm-embedding.html

(I just noticed that the old emulator used in that blog post doesn't work on M1 Macs, because of the 120Hz frame rate, the recent emulators have fixed this issue though).