Here's a project that also does this to ensure cycle-accuracy for their emulator: https://github.com/dbalsom/arduinoX86