18 lines
478 B
C++
18 lines
478 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)(const Chip8&, Instruction);
|
|
std::map<unsigned short, Handler> handlers = {};
|
|
static void handle0000(const Chip8&, Instruction);
|
|
public:
|
|
InstructionHandler();
|
|
void handleInstruction(unsigned short, const Chip8&, Instruction);
|
|
};
|
|
#endif //CHIP8_INSTRUCTION_HANDLER_H
|