Thursday 13 August 2015

Creating an NES Emulator From Scratch Part 2.5: CPU Code: Another Progress Update

(I changed my blogger name from Skyline_ to Aliasmk)

Hi again!
Its been a year and a week since I first posted about this project, and though its slow going, we are making progress.


Now, I know I said I'd be teaching as I go, but I found that I'm kinda learning on the fly here.. so I don't feel too qualified to teach. That said, I definitely will post research logs soon, once I know that things are going to work out.

I've implemented a shell so that testing can be done in a sandbox of sorts... you are given an instance of the CPU with a blank memory space, and you can write memory to the space and execute at an address as you would any cartridge. This will make it way easier to make sure addressing modes and opcodes are working correctly for the next stage of the project, which is actually creating the opcode instructions. The shell can also start the emulator as normal. Below is a screenshot comparing ALIAneS with Macifom's Debugger - note that (with a few exceptions) both report the same Opcodes and report the same addressing modes and operands.



You are free to build and try it yourself as always! Currently it works out of the box with OS X, probably works out of the box on Ubuntu and linux etc, and might work if you build it from the source on Windows.

Next steps:
  1. Ensure that all opcodes are being read with their correct addressmodes. There is no point continuing until this is complete.
  2. Code the instructions for each opcode. For example, LDA (load accumulator with memory) would be
    if(operation = "LDA"){
     setA(operand); //Where operand is found using relevant addressing techniques
    }
 Thats all for now. I'm still actively developing, its just real life gets in the way sometimes. See you again soon.



No comments:

Post a Comment