Chip8-CPP/include/chip8.h

28 lines
613 B
C++

#ifndef CHIP8_CHIP8_H
#define CHIP8_CHIP8_H
#include <string>
#include <stack>
#include "display.h"
class InstructionHandler;
class Chip8 {
private:
unsigned char memory[0xFFF] = {};
unsigned char v[0x10] = {};
std::stack<unsigned short> stack{};
unsigned short pc;
Display display;
InstructionHandler* instructionHandler;
public:
Chip8();
~Chip8();
void loadRom(const std::string&);
[[nodiscard]] Display getDisplay() const;
void emulateCycle();
[[nodiscard]] unsigned short popFromStack();
void setProgramCounter(unsigned short);
};
#endif //CHIP8_CHIP8_H