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:
- Simulate Display and accept Keyboard input
- Simulate Delay and Sound Timers
- Determine how/when to 'exit' emulation and break out of interpretter
11/13/14 (PM):
- Contemplating design for Delay Timer and Sound Timers. Considering threads or interrupts. It possibly might be fast enough to check each loop iteration. Also for the Sound Timer, using the "audible bell" (escape sequence \a).
- http://en.cppreference.com/w/cpp/language/escape
- http://cboard.cprogramming.com/cplusplus-programming/52392-producing-beep-sound-cplusplus.html
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.