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 git@github.com:jdmichaud/zpz.git
Then, in zpz
folder, initialize the chips submodule:
git submodule init
git submodule update
Note that this will checkout a custom version of the chip folder supporting 2 disks for the CPC.
Then to build the solution:
zig build
For best performance:
zig build -Doptimize=ReleaseSafe
To launch:
./zig-out/bin/zpz6128
To load one or two disks, pass the dsk
file path in the command line:
./zig-out/bin/zpz6128 /path/to/some.dsk /another/path.dsk
In order to generate a wasm file do:
zig build wasm -Doptimize=ReleaseSmall
Then serve the web folder:
cd web
python3 -m http.server
The release flag is mandatory. Without it, your browser will complain of too much local variables. The release flag optimizes away some of them.