diff options
-rw-r--r-- | src/chip8.hpp | 17 | ||||
-rw-r--r-- | src/platform.cpp | 2 | ||||
-rw-r--r-- | src/platform.hpp | 2 |
3 files changed, 11 insertions, 10 deletions
diff --git a/src/chip8.hpp b/src/chip8.hpp index a2c4bdf..ac49053 100644 --- a/src/chip8.hpp +++ b/src/chip8.hpp @@ -12,7 +12,7 @@ class Chip8 { public: Chip8(); - public: + private: uint8_t registers[16] {}; uint8_t memory[4096] {}; @@ -24,23 +24,24 @@ class Chip8 { uint8_t delayTimer {}; uint8_t soundTimer {}; - uint8_t keypad[16] {}; - std::bitset<4096> video; - uint16_t opcode; + public: + uint8_t keypad[16] {}; + std::bitset<2048> video; + private: std::default_random_engine randGen; std::uniform_int_distribution<uint8_t> randByte; public: void LoadROM(const char* filename); - void SetupTable(); - - public: void Cycle(); - public: + private: + void SetupTable(); + + private: typedef void (Chip8::*OpcodeFunction)(); OpcodeFunction table[0x10u]; OpcodeFunction table0[0xFu]; diff --git a/src/platform.cpp b/src/platform.cpp index 2840fa1..c5fe5bf 100644 --- a/src/platform.cpp +++ b/src/platform.cpp @@ -15,7 +15,7 @@ Platform::~Platform() { SDL_Quit(); } -void Platform::Update(const std::bitset<4096>& bitset, int videoScale) { +void Platform::Update(const std::bitset<2048>& bitset, int videoScale) { SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); SDL_RenderClear(renderer); diff --git a/src/platform.hpp b/src/platform.hpp index 90df65d..9b78818 100644 --- a/src/platform.hpp +++ b/src/platform.hpp @@ -14,7 +14,7 @@ class Platform { ~Platform(); public: - void Update(const std::bitset<4096>& bitset, int videoScale); + void Update(const std::bitset<2048>& bitset, int videoScale); bool ProcessInput(uint8_t* keys); private: |