I was thinking of writing a 6502 emulator as a personal exercise and I was wondering how other emulators handle a particular aspect of the emulation. If it was successful I would begin on a NES EMU, another personal exercise.
Is it done cycle-by-cycle or is it done instruction-by-instruction?
Thanks guys
Most 6502 emulators work instruction-by-instruction, though newer ones are emulating the individual cycles along the way (but not allowing the core to stop in the middle of an instruction) for better synchronization.
Thanks for the quick reply.
I find it odd that it would be unable to pause during an instruction. From the documentation about the processor I've read it seems that it would be an easy thing to do especially if an array of function pointers were used.
I think I will start with instruction-by-instruction and see where that takes me.
I have been working on it, i've taken care of most of the ground work. Now its time to consider how opcode are decoded and executed. My mind has raced with a few ideas but nothing that seems effective and efficient enough for the large amount of work involved. So now I'm wondering if there is a resource that discusses CPU emulation as a general topic. Any suggestion will be appreciated.