3 Emulate the CPU - cpe7/chip8 GitHub Wiki

Part 3: Emulate the CPU - handling sequences of opcodes with your virtual processor.

[REQ #2] The emulator shall be capable of executing a Chip-8 ROM without crashing.

11/10/14: Beginning core functionality of the emulator, including defining CPU components - RAM and Registers. Then define behavior of instructions and interaction with Registers.

Refactored Part 2 slightly to encapsulate into classes and modularize.

  • Created new class myCPU to hold 'components' of CPU to be emulated - at first memory and registers (including stack).
  • Used well defined class for the Stack class from the reference "data structures Demystified" by Jim Keogh and Ken Davidson.

11/11/14 - 11/13/14:

  • Added method to load ROM file into 'RAM' member variables (separate from disassembler method)
  • Created new method to 'emulate' CPU/Chip-8 Interpretter called 'emulator'
  • Interpret all OpCodes (except Display and Keyboard) and progress through ROM
  • Remaining items:
    1. Simulate Display and accept Keyboard input
    2. Simulate Delay and Sound Timers
    3. Determine how/when to 'exit' emulation and break out of interpretter

11/13/14 (PM):


11/15/14: Updated program to take ROM filename as input.


11/16/14: Refactored myCPU class by removing dissassembler function and moved into its own CUtility class.