1/14/2023 0 Comments Basilisk ii g3 romWhere the EM_ASM_ macro is used to call this JS function to copy the contents of the video framebuffer to a SharedArrayBuffer. Emscripten provides an implementation of SDL for the browser, but this implementation isn't designed to run in a web worker, so I've hacked the emulator's video output code to write to the SharedArrayBuffer instead of calling SDL APIs. The original emulator codebase makes use of SDL (a cross-platform set of video/audio/input APIs). This allows the simulation to be more smooth, as the emulator thread can just focus on simulating the Macintosh computer, and leave the tasks of displaying the contents of the video framebuffer and playing audio up to the main (browser) thread. Communication with the main thread happens by reading and writing data in SharedArrayBuffers which are shared between the main browser thread and the worker, allowing the emulator's main loop to run continuously without ever yielding to the event loop. The emulator code is compiled with Emscripten and run in a Web Worker. Anyway, let's get into the gory technical details of how it works. The Basilisk II port is the culmination of both of these things. Since then browser technologies have advanced, and I've learned a lot more about emulation (in part by making a simulated computer of my own). I've been hoping to get it running for some time, and previously made an attempt back in 2013, before switching to focus on the PCE emulator. I recently ported the Basilisk II Classic Macintosh emulator to run in a web browser. Basilisk II Classic Macintosh emulator in the browser.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |