Wow, it's an in-depth topic. The basics of cycle counting is that you will need to know how many clock cycles each CPU opcode takes to execute. Referring to the CPU's actual documentation will tell you that. So every time you emulate them, you have the add the clock cycles to a counter. From there you determine when to fire your interrupts. And once you run enough cycles (based on the MHz clock speed of the processor), you will know that when it's time to draw your frame.
The actual ROM program (the one you emulate) instructs the sound/graphics/other hardware by either sending software service commands or by writing to specific locations in memory. From there your emulator reacts accordingly by updating the state of the emulated graphics hardware, or performs some action. Like in SNES, writing to certain registers in memory triggers a data transfer to the graphic's Video RAM. Then, when it's time to draw your frame, you simply render to the screen based on the current state of the emulated graphics hardware, and all the bitmaps / textures supplied by the game.
The same idea applies to sound with a few exceptions - sound has to be generated fast enough so that it can be continuous, otherwise the player will hear clicks, pops or other horrible artifacts.
And save states? You basically take current hardware state (CPU registers, current clock cycle, graphics registers, sound hardware registers, memory, and everything that can change and affect emulation) and save it to storage. Then load it up again later to continue the emulator for where it was previously.
That's the general idea, but the devil is in all the details, and it can get quite crazy, because the console hardware (both graphics, sound and CPU) may have some bugs itself, and sometimes your emulator has to emulate these bugs for it to work correctly for some games. It's a tough job.
It took many years for Snes9x to reach version 1.43 with close to full compatibility, and more to reach version 1.5+. But if you want to try, for a start, it's a good idea to take a look at source codes for the emulator for simpler machines, like NES, or Atari and see how they work.
Depending on what console you want to emulate, you have to really understand the hardware very very well. The internet is your friend here. For my SNES needs, I go to
http://wiki.superfamicom.org/snes/show/65816+Reference (and of course the source code for Snes9x v1.43 was the primary source) You have to look for yours.
--------------------- MERGED ---------------------------
Oh ok, I stopped at 1-3. I'll go back and try tonight. Thanks!