18 lines
460 B
C++
18 lines
460 B
C++
#ifndef CHIP8_INSTRUCTION_HANDLER_H
|
|
#define CHIP8_INSTRUCTION_HANDLER_H
|
|
|
|
#include <map>
|
|
#include "chip8.h"
|
|
#include "instruction.h"
|
|
|
|
class InstructionHandler {
|
|
private:
|
|
typedef void (*Handler)(Chip8&, Instruction);
|
|
std::map<unsigned short, Handler> handlers = {};
|
|
static void handle0000(Chip8&, Instruction);
|
|
public:
|
|
InstructionHandler();
|
|
void handleInstruction(unsigned short, Chip8&, Instruction);
|
|
};
|
|
#endif //CHIP8_INSTRUCTION_HANDLER_H
|