I have written a few 6502 and Z80 and 680000 emulators over the years of my career for different machines. And also ported MAME and a few other open source emulators to consoles. I think I am most proud of the Atari VCS emulator with the 6502 recompiler I wrote the the SONY PSX and the Gameboy Advance. Though I was also quite happy with getting my Atari VCS emulator running on the SONY PS2, emulating six separate games at once on a rotating cube. Writing an emulator teaches you quite a bit about machine architecture and optimization strategies.