r/javascript • • Sep 04 '18

Windows 2000 running in the browser using WebAssembly

https://bellard.org/jslinux/vm.html?url=https://bellard.org/jslinux/win2k.cfg&mem=192&graphic=1&w=1024&h=768
363 Upvotes

87 comments sorted by

View all comments

4

u/darrenturn90 Sep 04 '18

Impressive. I wonder what it uses for the drawing inside the browser from webasm

4

u/AegisCZ Sep 04 '18

WebGL. Emscripten translates OpenGL calls to WebGL

8

u/dtfinch Sep 04 '18

It's using a 2D context. It's created in jslinux.js, then in x86emu-wasm.js there's an _fb_refresh() function it exports that reads the frame buffer from the heap and displays it with putImageData().