3 ms·
Can anyone comment on how hard is it to go from here to writing your own NES emulator?
by krat0sprakhar 10y ago
Can anyone comment on how hard is it to go from here to writing your own NES emulator?
- Retr0spectrum 10y agoThere isn't much of a skill intersection really, other than the relatively simple process of decoding opcodes. If you want to write a NES emulator, I'd suggest starting with writing a CHIP-8 emulator.
- khedoros1 10y agoNES emulator: Look up the ROM header format (iNES is still popular and common). That'll tell you how to find the entry point for the code. Find a document describing the memory map. That'll tell you where RAM, ROM, IO ports, etc go in the address space. Find an m6502 opcode reference. It'll also describe the registers and addressing modes in the CPU. At that point, you've got enough to read the ROM into memory and start interpreting opcodes, even if you implement them one at a time as they come up. The CPU is just going to be reading and writing data to its registers and the memory map, so it's pretty straightforward. Pretty quick, you'll run into a point where it expects some bit of external hardware results (usually reading from 0x2002 to query for the VBlank signal). That's the domain of the Picture Processing Unit. Start with simulating the VBlank flag, and go from there. The PPU is fun, and if you've gotten this far, you'll be in a good position to figure things out without a guide tutorial. There's a whole ton of documentation out there, and explanations about every aspect of the NES' hardware.