diff --git a/src/cpu.h b/src/cpu.h index e654430..05e4a7d 100644 --- a/src/cpu.h +++ b/src/cpu.h @@ -7,7 +7,7 @@ #pragma once -#include // int8_t, uint8_t, uint16_t, uint32_t +#include // int8_t, uint8_t, uint32_t #include "processing-unit.h" @@ -38,18 +38,18 @@ public: private: // Registers - uint8_t m_a { 0 }; // Accumulator - uint16_t m_bc { 0 }; // BC - uint16_t m_de { 0 }; // DE - uint16_t m_hl { 0 }; // HL - uint16_t m_sp { 0 }; // Stack Pointer - uint16_t m_pc { 0 }; // Program Counter + uint32_t m_a { 0 }; // Accumulator + uint32_t m_bc { 0 }; // BC + uint32_t m_de { 0 }; // DE + uint32_t m_hl { 0 }; // HL + uint32_t m_sp { 0 }; // Stack Pointer + uint32_t m_pc { 0 }; // Program Counter // Flags - uint8_t m_z { 0 }; // Zero flag - uint8_t m_n { 0 }; // Subtraction flag (BCD) - uint8_t m_h { 0 }; // Half Carry flag (BCD) - uint8_t m_c { 0 }; // Carry flag + uint32_t m_z { 0 }; // Zero flag + uint32_t m_n { 0 }; // Subtraction flag (BCD) + uint32_t m_h { 0 }; // Half Carry flag (BCD) + uint32_t m_c { 0 }; // Carry flag int8_t m_wait_cycles { 0 }; }; diff --git a/src/emu.cpp b/src/emu.cpp index fb92574..7214a5d 100644 --- a/src/emu.cpp +++ b/src/emu.cpp @@ -1,4 +1,4 @@ -#include // uint8_t, uint32_t +#include // uint32_t #include "cpu.h" #include "emu.h" @@ -42,7 +42,7 @@ void Emu::writeMemory(const char* memory_space, uint32_t location, uint32_t valu m_memory_spaces[memory_space][location] = value; } -uint8_t Emu::readMemory(const char* memory_space, uint32_t location) +uint32_t Emu::readMemory(const char* memory_space, uint32_t location) { return m_memory_spaces[memory_space][location]; } diff --git a/src/emu.h b/src/emu.h index 52edb84..56ff81f 100644 --- a/src/emu.h +++ b/src/emu.h @@ -1,6 +1,6 @@ #pragma once -#include // uint8_t, uint32_t +#include // uint32_t #include #include @@ -20,15 +20,14 @@ public: void addMemorySpace(const char* name, uint32_t size); void writeMemory(const char* memory_space, uint32_t location, uint32_t value); - - uint8_t readMemory(const char* memory_space, uint32_t location); + uint32_t readMemory(const char* memory_space, uint32_t location); private: - uint32_t m_frequency = 0; - double m_timestep = 0; - uint32_t m_cycle = 0; - double m_cycle_time = 0; - double m_previous_time = 0; + uint32_t m_frequency { 0 }; + double m_timestep { 0 }; + uint32_t m_cycle { 0 }; + double m_cycle_time { 0 }; + double m_previous_time { 0 }; ruc::Timer m_timer;