diff options
Diffstat (limited to 'src/table.hpp')
-rw-r--r-- | src/table.hpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/table.hpp b/src/table.hpp new file mode 100644 index 0000000..f1eaeb7 --- /dev/null +++ b/src/table.hpp @@ -0,0 +1,31 @@ +#ifndef TABLE_HPP_ +#define TABLE_HPP_ + +#include <functional> + +#include "chip8.hpp" + +class Chip8; + +class Table { + public: + Table(Chip8* chip8); + + private: + Chip8* chip8; + + public: + using OpcodeFunction = std::function<void()>; + OpcodeFunction table[0x10u]; + OpcodeFunction table0[0xFu]; + OpcodeFunction table8[0xFu]; + OpcodeFunction tableE[0xFu]; + OpcodeFunction tableF[0x66u]; + + void Table0(); + void Table8(); + void TableE(); + void TableF(); +}; + +#endif |