If You Wrote An Emulator In Unity Could You In Theory Convert Code Between Chipsets?

If you consider Just in Time compiler technology and Emulation would it be possible to write an Emulator then port the resulting code and translate retro games to modern hardware.

I would think this would take a number of steps with Unity…

  • The emulated machine code is converted into actions in C# by the Emulator.
  • The generated C# code is captured.
  • The generated C# code is compiled to a new target platform.

This assumes that the Emulator maps all machine code to good C# code.

Would this be possible with current MS C# and Unity development tools or is something more needed?

In theory retro games could be ported to Unity and take advantage of modern hardware via the burst compiler…

Well Emulation is wasteful as instructions need to translated to native code, therefore if you can emulate translate then make native the game it will be more performant and power efficient.

That doesn’t answer the broader question of “why?”

Closing because… Really!?!