mirror of
https://github.com/tdinucci/6502-emulator.git
synced 2024-09-29 10:54:27 +00:00
25 lines
652 B
C
25 lines
652 B
C
|
#ifndef INC_6502_EMULATOR_OPCODE_HANDLER_DIRECTORY_H
|
||
|
#define INC_6502_EMULATOR_OPCODE_HANDLER_DIRECTORY_H
|
||
|
|
||
|
#include "../program.h"
|
||
|
#include "opcode-handler.h"
|
||
|
#include <unordered_map>
|
||
|
#include <vector>
|
||
|
#include <memory>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
class OpcodeHandlerDirectory {
|
||
|
public:
|
||
|
explicit OpcodeHandlerDirectory(shared_ptr<Program> program, shared_ptr<RegisterManager> reg_man);
|
||
|
|
||
|
shared_ptr<OpcodeHandler> get_handler(uint8_t opcode);
|
||
|
private:
|
||
|
unique_ptr<unordered_map<uint8_t, shared_ptr<OpcodeHandler>>> handlers;
|
||
|
|
||
|
void register_handler(shared_ptr<OpcodeHandler> handler);
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif //INC_6502_EMULATOR_OPCODE_HANDLER_DIRECTORY_H
|