We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b7875ca commit ad22507Copy full SHA for ad22507
chip8.cpp
@@ -38,7 +38,17 @@ void chip8::loadGame(std::string game){
38
}
39
40
void chip8::emulateCycle(){
41
- std::cout << memory[512];
+ opcode = memory[PC] << 8 | memory[PC + 1];
42
+
43
+ //switch decodes the opcode and then executes it in case body
44
+ switch(opcode & 0xF000){
45
+ case 0xA000:
46
+ IR = opcode & 0x0FFF;
47
+ PC += 2;
48
+ break;
49
+ default:
50
+ std::cout << "Unkown opcode: " << std::hex << opcode;
51
+ }
52
53
54
void chip8::setKeys(){
0 commit comments