5 ms·
I did the initial work of porting this emulator to the browser (most credit should go to the original emulator author however: http://hampa.ch/pce http://hampa.
by mambodog 10y ago
I did the initial work of porting this emulator to the browser (most credit should go to the original emulator author however: http://hampa.ch/pce http://hampa.ch/pce).
I wrote up the process and hacks that went in to making this possible here: https://jamesfriend.com.au/porting-pce-emulator-browser 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!
- macrael 10y agoSadly it's not working for me, seems to be off by half. The emulated mouse is always at x/2 y/2 compared to the real mouse pointer.
- mambodog 10y agoInteresting. What browser are you using?
- fiddlerwoaroof 10y agoIs this a Retina display issue, perhaps?
- db48x 10y agoI believe Chrome misreports the mouse position if you zoom the page, or if you have a hidpi display. Care to share more details?
- macrael 10y agoThis was in Safari on a retina mac book pro
- wiredfool 10y agoheh. Enterprising pranksters could also rewrite those locations using an init. I believe gravity mouse was the name of it.
- programd 10y agoAwsome! I need to finish that game of Fool's Errand [1] I started a quarter century ago and doing it on a modern machine seems just wrong. 1. http://www.thefoolandhismoney.com/02-FE/index.htm http://www.thefoolandhismoney.com/02-FE/index.htm
- krallja 10y agoI see that most of the work you did on PCE.js is 3-4 years old at this point. What happened in the meantime? Why did you choose PCE over (e.g.) Basilisk II? How do you provide the Macintosh ROM?
- mambodog 10y agoPCE 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.
- tropo 10y agoWhat about Executor and syn68k from ARDI? It got open sourced. You'd get something like MacOS system 6.0.7 or 7.0.0 running on an emulated 68LC040. At the very least, that gets you a ROM.
- dmolony 10y agoI tried it out on a MacBookPro, and the tap to click function on the trackpad appears to not be working. A physical trackpad click works though.
- deleted 10y ago[deleted]
- tropo 10y agoYour 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.