← Back to context

Comment by wren6991

7 hours ago

> PSP games running in the browser without an emulator. The game's MIPS machine code is translated ahead of time into C++, compiled to WebAssembly, and linked against a small reimplementation of the PSP's operating system and graphics chip that draws with WebGL2.

Feels slightly pedantic to point this out, but this describes an emulation stack. A lot of emulators are already doing some kind of lift+JIT on the target's machine code (just not through WASM)

Most people would say that Ahead-of-time (AOT) compilation or static recompilation is not considered traditional emulation.

  • We called emulation back in the last century and it hasn't changed.

    The original hardware doesn't exist on the target system.

    Taking a famous example out of many others I could have reached for,

    > Emulation had been around for a while as a concept, but FX!32 went one stage further. It analyzed the way programs worked and, after the program ran, used binary translation to produce dynamic-link library (DLL) files of native Alpha code that the application could execute the next time it ran. This way even in the early 1.0 release, the FX!32 achieved speeds for Win32 x86 applications that ran 40-50% as fast as native x86 code, with a 70% speed projected as likely with improved optimization. Version 1.5, released by Compaq in 1999, added support for the Alpha 21264 (EV6) CPU, including emulation of Intel's MMX instruction set.

    https://en.wikipedia.org/wiki/FX!32

That's almost what WINE does which is, apparently, not an emulator. Small reimplementation of Windows userspace and translates DirectX to Vulkan/OpenGL. So if I do x86 -> ARM binary translation AOT and run that with WINE, is it an emulator?

I think of an emulator as a separate project/product typically. Perhaps that's what they are saying?

  • Yeah, maybe that's the difference. I was trying to probe the semantics, not so much a "gotcha". Parts of this stack are quite bespoke for this one game.