Implemented 0x7XKK
parent
80053eeda7
commit
84a3f0bda5
|
@ -54,6 +54,11 @@ private:
|
|||
* Handles Chip8 instruction 0x6000
|
||||
*/
|
||||
static void handle6000(Chip8&, Instruction);
|
||||
|
||||
/**
|
||||
* Handles Chip8 instruction 0x7000
|
||||
*/
|
||||
static void handle7000(Chip8&, Instruction);
|
||||
public:
|
||||
InstructionHandler();
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ InstructionHandler::InstructionHandler() {
|
|||
this->handlers[0x4000] = handle4000;
|
||||
this->handlers[0x5000] = handle5000;
|
||||
this->handlers[0x6000] = handle6000;
|
||||
this->handlers[0x7000] = handle7000;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -121,3 +122,13 @@ void InstructionHandler::handle5000(Chip8& chip8, Instruction instruction) {
|
|||
void InstructionHandler::handle6000(Chip8& chip8, Instruction instruction) {
|
||||
chip8.setRegister(instruction.x(), instruction.kk());
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the 0x7XKK Chip8 instruction which is used to add the value KK to register V[x] and set the result in register V[x].
|
||||
*
|
||||
* @param chip8 The Chip8 instance
|
||||
* @param instruction The Instruction instance
|
||||
*/
|
||||
void InstructionHandler::handle7000(Chip8& chip8, Instruction instruction) {
|
||||
chip8.setRegister(instruction.x(), chip8.getRegister(instruction.x()) + instruction.kk());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue