diff --git a/Z80/HarteTest_Z80/HarteTest_Z80.vcxproj b/Z80/HarteTest_Z80/HarteTest_Z80.vcxproj index d96a928..e9e2891 100644 --- a/Z80/HarteTest_Z80/HarteTest_Z80.vcxproj +++ b/Z80/HarteTest_Z80/HarteTest_Z80.vcxproj @@ -83,6 +83,7 @@ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true stdcpp20 + Use Console @@ -98,6 +99,7 @@ false AdvancedVectorExtensions Fast + Use true @@ -110,6 +112,7 @@ _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true stdcpp20 + Use Console @@ -125,6 +128,7 @@ false AdvancedVectorExtensions Fast + Use true @@ -154,8 +158,18 @@ - - + + NotUsing + NotUsing + NotUsing + NotUsing + + + Create + Create + Create + Create + diff --git a/Z80/HarteTest_Z80/array_t.h b/Z80/HarteTest_Z80/array_t.h index a4e583a..d870376 100644 --- a/Z80/HarteTest_Z80/array_t.h +++ b/Z80/HarteTest_Z80/array_t.h @@ -1,5 +1,9 @@ #pragma once +#include +#include +#include + #include "simdjson/simdjson.h" class array_t { diff --git a/Z80/HarteTest_Z80/checker_t.h b/Z80/HarteTest_Z80/checker_t.h index 55399b9..ef45a89 100644 --- a/Z80/HarteTest_Z80/checker_t.h +++ b/Z80/HarteTest_Z80/checker_t.h @@ -2,6 +2,9 @@ #include #include +#include +#include +#include #include diff --git a/Z80/HarteTest_Z80/stdafx.h b/Z80/HarteTest_Z80/stdafx.h index f75aadb..3ec3b63 100644 --- a/Z80/HarteTest_Z80/stdafx.h +++ b/Z80/HarteTest_Z80/stdafx.h @@ -2,17 +2,12 @@ #define SIMDJSON_DISABLE_DEPRECATED_API -#include #include #include -#include #include -#include +#include #include -#include -#include #include -#include #include #include #include diff --git a/Z80/inc/Z80.h b/Z80/inc/Z80.h index 7031f2c..64e9441 100644 --- a/Z80/inc/Z80.h +++ b/Z80/inc/Z80.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include diff --git a/Z80/src/stdafx.h b/Z80/src/stdafx.h index 3bc81dd..23a1b62 100644 --- a/Z80/src/stdafx.h +++ b/Z80/src/stdafx.h @@ -4,18 +4,21 @@ #include #include -#include #include #include #include #include +#include #include #include #include +#include #include #include +#include #include +#include diff --git a/inc/BigEndianProcessor.h b/inc/BigEndianProcessor.h index 8d0155a..700973d 100644 --- a/inc/BigEndianProcessor.h +++ b/inc/BigEndianProcessor.h @@ -7,6 +7,9 @@ namespace EightBit { class Bus; class BigEndianProcessor : public Processor { + + using base = Processor; + public: virtual ~BigEndianProcessor() noexcept = default; BigEndianProcessor(const BigEndianProcessor& rhs) noexcept; @@ -25,7 +28,7 @@ namespace EightBit { void fetchInto(register16_t& into) noexcept final; - void pushShort(register16_t value) noexcept final; + void pushShort(register16_t value) noexcept override; void popInto(register16_t& into) noexcept final; }; } diff --git a/inc/Bus.h b/inc/Bus.h index d804e9e..6821541 100644 --- a/inc/Bus.h +++ b/inc/Bus.h @@ -11,6 +11,9 @@ namespace EightBit { class Bus : public Mapper { + + using base = Mapper; + public: virtual ~Bus() noexcept = default; diff --git a/inc/Chip.h b/inc/Chip.h index 7b6bd78..4c809f0 100644 --- a/inc/Chip.h +++ b/inc/Chip.h @@ -18,6 +18,9 @@ namespace EightBit { class Chip : public Device { + + using base = Device; + public: enum Bits { Bit0 = 1, @@ -143,7 +146,7 @@ namespace EightBit { } Chip(const Chip& rhs) noexcept - : Device(rhs) {} + : base(rhs) {} protected: Chip() noexcept = default; diff --git a/inc/ClockedChip.h b/inc/ClockedChip.h index 7b8a620..59d4a92 100644 --- a/inc/ClockedChip.h +++ b/inc/ClockedChip.h @@ -6,6 +6,9 @@ namespace EightBit { class ClockedChip : public Chip { + + using base = Chip; + public: ClockedChip(const ClockedChip& rhs) noexcept; bool operator==(const ClockedChip& rhs) const noexcept; diff --git a/inc/IntelProcessor.h b/inc/IntelProcessor.h index 62b48ad..9f12dc0 100644 --- a/inc/IntelProcessor.h +++ b/inc/IntelProcessor.h @@ -14,6 +14,9 @@ namespace EightBit { class Bus; class IntelProcessor : public LittleEndianProcessor { + + using base = LittleEndianProcessor; + public: struct opcode_decoded_t { diff --git a/inc/LittleEndianProcessor.h b/inc/LittleEndianProcessor.h index a42d928..c1a2120 100644 --- a/inc/LittleEndianProcessor.h +++ b/inc/LittleEndianProcessor.h @@ -7,6 +7,9 @@ namespace EightBit { class Bus; class LittleEndianProcessor : public Processor { + + using base = Processor; + public: virtual ~LittleEndianProcessor() noexcept = default; LittleEndianProcessor(const LittleEndianProcessor& rhs) noexcept; @@ -25,7 +28,7 @@ namespace EightBit { void fetchInto(register16_t& into) noexcept final; - void pushShort(register16_t value) noexcept final; + void pushShort(register16_t value) noexcept override; void popInto(register16_t& into) noexcept final; }; } diff --git a/inc/MemoryMapping.h b/inc/MemoryMapping.h index 0e22b80..e8d82a4 100644 --- a/inc/MemoryMapping.h +++ b/inc/MemoryMapping.h @@ -4,6 +4,7 @@ #include #include #include + #include "Chip.h" namespace EightBit { diff --git a/inc/PortEventArgs.h b/inc/PortEventArgs.h index 50c9381..377e06c 100644 --- a/inc/PortEventArgs.h +++ b/inc/PortEventArgs.h @@ -5,6 +5,9 @@ namespace EightBit { class PortEventArgs final : public EventArgs { + + using base = EventArgs; + private: register16_t _port; diff --git a/inc/Processor.h b/inc/Processor.h index 4d74351..4eb46f4 100644 --- a/inc/Processor.h +++ b/inc/Processor.h @@ -10,6 +10,9 @@ namespace EightBit { class Processor : public ClockedChip { + + using base = ClockedChip; + public: Signal ExecutingInstruction; Signal ExecutedInstruction; diff --git a/inc/Ram.h b/inc/Ram.h index cf3b4a4..33f6fa2 100644 --- a/inc/Ram.h +++ b/inc/Ram.h @@ -6,6 +6,9 @@ namespace EightBit { // The RAM class is everything the ROM class is, plus // it's externally 'reference'able and 'poke'able. class Ram : public Rom { + + using base = Rom; + public: Ram(size_t size = 0) noexcept; virtual ~Ram() noexcept = default; diff --git a/inc/Rom.h b/inc/Rom.h index 6ca9ce0..a2de0c2 100644 --- a/inc/Rom.h +++ b/inc/Rom.h @@ -12,6 +12,9 @@ namespace EightBit { // Nothing over and above the interface is exposed to users // of the ROM class. class Rom : public Memory { + + using base = Memory; + private: std::vector m_bytes; diff --git a/inc/Signal.h b/inc/Signal.h index 3f38029..5569d22 100644 --- a/inc/Signal.h +++ b/inc/Signal.h @@ -2,6 +2,7 @@ #include #include + #include "EventArgs.h" namespace EightBit { diff --git a/inc/UnusedMemory.h b/inc/UnusedMemory.h index f843371..2b52429 100644 --- a/inc/UnusedMemory.h +++ b/inc/UnusedMemory.h @@ -12,6 +12,9 @@ namespace EightBit { // *always* returns the same value, from whichever location // is being read. class UnusedMemory final : public Memory { + + using base = Memory; + public: UnusedMemory(uint16_t size, uint8_t value) noexcept; diff --git a/src/BigEndianProcessor.cpp b/src/BigEndianProcessor.cpp index ff6ebcc..8883868 100644 --- a/src/BigEndianProcessor.cpp +++ b/src/BigEndianProcessor.cpp @@ -2,10 +2,10 @@ #include "../inc/BigEndianProcessor.h" EightBit::BigEndianProcessor::BigEndianProcessor(Bus& memory) noexcept -: Processor(memory) {} +: base(memory) {} EightBit::BigEndianProcessor::BigEndianProcessor(const BigEndianProcessor& rhs) noexcept -: Processor(rhs) {} +: base(rhs) {} EightBit::register16_t EightBit::BigEndianProcessor::peekShort(uint16_t address) noexcept { const auto high = BUS().peek(address); diff --git a/src/ClockedChip.cpp b/src/ClockedChip.cpp index 39e4603..4f449a8 100644 --- a/src/ClockedChip.cpp +++ b/src/ClockedChip.cpp @@ -2,12 +2,12 @@ #include "../inc/ClockedChip.h" EightBit::ClockedChip::ClockedChip(const ClockedChip& rhs) noexcept -: Chip(rhs) { +: base(rhs) { m_cycles = rhs.m_cycles; } bool EightBit::ClockedChip::operator==(const EightBit::ClockedChip& rhs) const noexcept { return - Chip::operator==(rhs) + base::operator==(rhs) && cycles() == rhs.cycles(); } diff --git a/src/IntelProcessor.cpp b/src/IntelProcessor.cpp index 78a03ad..659ae9a 100644 --- a/src/IntelProcessor.cpp +++ b/src/IntelProcessor.cpp @@ -5,7 +5,7 @@ std::array EightBit::IntelProcessor::m_halfCarryTableAdd = { { 0, 0, 1, std::array EightBit::IntelProcessor::m_halfCarryTableSub = { { 0, 1, 1, 1, 0, 0, 0, 1 } }; EightBit::IntelProcessor::IntelProcessor(Bus& bus) noexcept -: LittleEndianProcessor(bus) { +: base(bus) { for (int i = 0; i < 0x100; ++i) m_decodedOpcodes.at(i) = i; @@ -17,7 +17,7 @@ EightBit::IntelProcessor::IntelProcessor(Bus& bus) noexcept } EightBit::IntelProcessor::IntelProcessor(const IntelProcessor& rhs) noexcept -: LittleEndianProcessor(rhs), +: base(rhs), m_sp(rhs.m_sp), m_memptr(rhs.m_memptr) { HALT() = rhs.HALT(); @@ -30,13 +30,13 @@ void EightBit::IntelProcessor::resetRegisterSet() noexcept { DEFINE_PIN_LEVEL_CHANGERS(HALT, IntelProcessor); void EightBit::IntelProcessor::handleRESET() noexcept { - Processor::handleRESET(); + base::handleRESET(); disableInterrupts(); - Processor::jump(0); + base::jump(0); } void EightBit::IntelProcessor::handleINT() noexcept { - Processor::handleINT(); + base::handleINT(); raiseHALT(); disableInterrupts(); } @@ -51,7 +51,7 @@ void EightBit::IntelProcessor::pop() noexcept { EightBit::register16_t& EightBit::IntelProcessor::incrementPC() noexcept { if (proceeding()) - Processor::incrementPC(); + base::incrementPC(); return PC(); } @@ -61,12 +61,12 @@ uint8_t EightBit::IntelProcessor::fetchInstruction() noexcept { } void EightBit::IntelProcessor::getShort() noexcept { - LittleEndianProcessor::getShort(); + base::getShort(); MEMPTR() = BUS().ADDRESS(); } void EightBit::IntelProcessor::setShort(const register16_t value) noexcept { - LittleEndianProcessor::setShort(value); + base::setShort(value); MEMPTR() = BUS().ADDRESS(); } @@ -104,7 +104,7 @@ void EightBit::IntelProcessor::jumpRelative(const int8_t offset) noexcept { } void EightBit::IntelProcessor::ret() noexcept { - LittleEndianProcessor::ret(); + base::ret(); MEMPTR() = PC(); } @@ -114,7 +114,7 @@ void EightBit::IntelProcessor::jumpIndirect() noexcept { } void EightBit::IntelProcessor::jump() noexcept { - Processor::jump(MEMPTR()); + base::jump(MEMPTR()); } void EightBit::IntelProcessor::callIndirect() noexcept { @@ -150,7 +150,7 @@ bool EightBit::IntelProcessor::operator==(const EightBit::IntelProcessor& rhs) c auto& left = const_cast(*this); auto& right = const_cast(rhs); return - LittleEndianProcessor::operator==(rhs) + base::operator==(rhs) && left.HALT() == right.HALT() && left.MEMPTR() == right.MEMPTR() && left.SP() == right.SP() diff --git a/src/LittleEndianProcessor.cpp b/src/LittleEndianProcessor.cpp index 9a9ed36..ac07f53 100644 --- a/src/LittleEndianProcessor.cpp +++ b/src/LittleEndianProcessor.cpp @@ -2,10 +2,10 @@ #include "../inc/LittleEndianProcessor.h" EightBit::LittleEndianProcessor::LittleEndianProcessor(Bus& memory) noexcept -: Processor(memory) {} +: base(memory) {} EightBit::LittleEndianProcessor::LittleEndianProcessor(const LittleEndianProcessor& rhs) noexcept -: Processor(rhs) {} +: base(rhs) {} EightBit::register16_t EightBit::LittleEndianProcessor::peekShort(uint16_t address) noexcept { const auto low = BUS().peek(address); diff --git a/src/Processor.cpp b/src/Processor.cpp index 5670e36..841aff4 100644 --- a/src/Processor.cpp +++ b/src/Processor.cpp @@ -6,7 +6,7 @@ EightBit::Processor::Processor(Bus& bus) noexcept } EightBit::Processor::Processor(const Processor& rhs) noexcept -: ClockedChip(rhs), +: base(rhs), m_bus(rhs.m_bus), m_opcode(rhs.m_opcode), m_pc(rhs.m_pc), @@ -157,7 +157,7 @@ void EightBit::Processor::ret() noexcept { bool EightBit::Processor::operator==(const EightBit::Processor& rhs) const noexcept { return - ClockedChip::operator==(rhs) + base::operator==(rhs) && RESET() == rhs.RESET() && INT() == rhs.INT() && PC() == rhs.PC(); diff --git a/src/Ram.cpp b/src/Ram.cpp index 3943eca..e3c9acf 100644 --- a/src/Ram.cpp +++ b/src/Ram.cpp @@ -2,8 +2,8 @@ #include "../inc/Ram.h" EightBit::Ram::Ram(const size_t size) noexcept -: Rom(size) {} +: base(size) {} void EightBit::Ram::poke(const uint16_t address, const uint8_t value) noexcept { - Rom::poke(address, value); + base::poke(address, value); } diff --git a/src/stdafx.h b/src/stdafx.h index 3442d95..66a3c97 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -5,28 +5,31 @@ #include #include #include -#include #include #include #include -#include +#include #include #include #include #include -#include +#include +#include #include #include #include #include -#include #ifdef _MSC_VER -#include +# include #endif #ifdef __GNUG__ # include #endif + +#if !(defined(_MSC_VER) || defined(__GNUG__)) +# include +#endif