zpz: An Amstrad CPC emulator frontend written in zig using https://github.com/floooh/chips
zpz is an emulator frontend (basically just some zig glue code) that uses
Floooh's chip library to emulate an
Amstrad CPC 6128.
I encourage you to check out https://github.com/floooh/chips for a very well made, clean and understandable CPC emulator code base.
The emulator is accessible in your browser here: http://cpc.novidee.com.
First clone the zpz repository:
git clone [email protected]:jdmichaud/zpz.gitThen, in zpz folder, initialize the chips submodule:
git submodule init
git submodule updateNote that this will checkout a custom version of the chip folder supporting 2 disks for the CPC.
Then to build the solution:
zig buildFor best performance:
zig build -Doptimize=ReleaseSafeTo launch:
./zig-out/bin/zpz6128To load one or two disks, pass the dsk file path in the command line:
./zig-out/bin/zpz6128 /path/to/some.dsk /another/path.dskIn order to generate a wasm file do:
zig build wasm -Doptimize=ReleaseSmallThen serve the web folder:
cd web
python3 -m http.serverThe release flag is mandatory. Without it, your browser will complain of too much local variables. The release flag optimizes away some of them.