The most gross/fun part was how I made the Mac OS mouse position align with your real mouse cursor: by writing its position directly to the emulated computer's memory. Classic Mac OS held the mouse position in a few fixed global memory locations. I realised I could just write to those memory locations every few CPU cycles. I could have instead written a driver which ran inside the emulated OS to communicate with the emulator program, but this was simpler!
Your mouse hack is funny. I take it you don't implement hardware other than the CPU for the emulator?
The norm would be to disable the real mouse cursor (make it invisible) and then feed the guest mouse movement via MMIO and an IRQ. You don't need a driver because classic MacOS already has one for the emulated hardware.
PCE has very simple code, and unlike Basilisk II, doesn't make use of threads (which Emscripten didn't support at the time). Basilisk II also uses a SIGSEGV handler to catch invalid memory accesses, this would have to be coded around. I'd still like to port Basilisk II, which is feasible now due to new browser APIs, but it's a big project.
The Macintosh ROM is up to the website (e.g. archive.org) to provide, along with the disk images.
I wrote up the process and hacks that went in to making this possible here: https://jamesfriend.com.au/porting-pce-emulator-browser
The most gross/fun part was how I made the Mac OS mouse position align with your real mouse cursor: by writing its position directly to the emulated computer's memory. Classic Mac OS held the mouse position in a few fixed global memory locations. I realised I could just write to those memory locations every few CPU cycles. I could have instead written a driver which ran inside the emulated OS to communicate with the emulator program, but this was simpler!