Ah good memories. I did a similar thing for a commercial computer system way back, which allowed us to move to x86 systems but still run all the 8-bit 8080 software(quite a lot at the time) on the newer machines. It really wasn’t that difficult as the x86 used a similar model for flags, so it was really a matter of decoding the 8080 instruction and then mapping it to the equivalent 8086 instruction(s). As I recall, the emulator run at about the same speed as the real hardware. The OS mapping was equally simple, as CP/M and CP/M 86 mapped 1:1 for OS calls.
Happy days .. when 256K was a LOT of RAM :)