Instructions
Examine the source code of another program that emulates the same console as yours. For example, if you are working on a portable program that can emulate the Nintendo Entertainment System, study the source code of Jnes and Nesticle, two popular NESs that have been available for several years. This will give you an idea of how to approach your own emulation project.
Study the central processing unit of the console you want to emulate, then write a basic program that emulates the CPU's functioning. If you have trouble programming this, consult a finished emulator's source code again.
Create code that emulates other aspects of the console. Emulate the console's motherboard and graphics card at minimum and consider writing code to emulate the sound card as well.
Try to run a ROM image using your emulator. If the ROM runs successfully on one operating system, try it on another to test the emulator's portability.
Put the emulator online for download, then wait for feedback from those who have used it. Continue to rewrite and rerelease your emulator until you have perfected it based upon your own tests and those who download it and share feedback with you.