starman said:
Since you've obviously made an emulator, pointers on how to get started?
Well, actually, this is based on another emulator, so I can not take credit for it. I didn't start it from scratch, so I can't really claim to know all that goes into it.
I do know, though, from some other projects and this one, that it takes an in-depth knowledge of the hardware. If you wanted to write an emulator, you would want to first study the documents and instruction sets of the main CPU (or CPUs).
To emulate the CPU, you would need to keep track of all the CPU's registers and modify them appropriately for each instruction that you emulate.
For each instruction, you would need to read in the instruction and operands, and then emulate that instruction (properly modifying any registers/memory/etc. that the real hardware would).
Many CPUs have a fixed-size instruction-set, and that makes emulation easier. What I mean is that every opcode is the same size (like maybe 4 bytes). That allows you to read 4 bytes, and then operate, repeat.
The NGPC's instruction set is variable-sized, so it is harder (slower) to emulate. You need to read some (and maybe do some operations), and then figure out how much more you need to read.
For the instructions, you need to first figure out what instruction you are emulating and then probally call a function that would emulate that instruction. You could do this with a switch statement, a jump table, or something else.
Also, to emulate an entire system, you have to also emulate the memory map and any other hardware that might be included. In many systems, if you write to one address, that might be main memory, but another address might be the screen. You have to emulate this behavior also. You could do this by making functions that is responsible for all memory writes and reads and fill them with tests to see what address is being accessed and operate accordingly.
Anyway, this is just the basics from a non-expert. I hope it helps a little.