2023-09-09 17:57:57 +00:00
|
|
|
#ifndef CHIP8_INSTRUCTION_HANDLER_H
|
|
|
|
#define CHIP8_INSTRUCTION_HANDLER_H
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include "chip8.h"
|
|
|
|
#include "instruction.h"
|
|
|
|
|
|
|
|
class InstructionHandler {
|
|
|
|
private:
|
2023-09-09 18:20:10 +00:00
|
|
|
typedef void (*Handler)(Chip8&, Instruction);
|
2023-09-09 17:57:57 +00:00
|
|
|
std::map<unsigned short, Handler> handlers = {};
|
2023-09-09 18:20:10 +00:00
|
|
|
static void handle0000(Chip8&, Instruction);
|
2023-09-09 17:57:57 +00:00
|
|
|
public:
|
|
|
|
InstructionHandler();
|
2023-09-09 18:20:10 +00:00
|
|
|
void handleInstruction(unsigned short, Chip8&, Instruction);
|
2023-09-09 17:57:57 +00:00
|
|
|
};
|
|
|
|
#endif //CHIP8_INSTRUCTION_HANDLER_H
|