mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-04-09 17:37:45 +00:00
Make better use of modern c++
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
44c6a8c3d1
commit
5eedbe1225
@ -8,7 +8,7 @@ namespace EightBit {
|
||||
|
||||
class BigEndianProcessor : public Processor {
|
||||
public:
|
||||
~BigEndianProcessor() = default;
|
||||
virtual ~BigEndianProcessor() = default;
|
||||
|
||||
register16_t peekWord(register16_t address) final;
|
||||
void pokeWord(register16_t address, register16_t value) final;
|
||||
|
@ -66,9 +66,9 @@ namespace EightBit {
|
||||
[[nodiscard]] static constexpr auto promoteNibble(const int value) { return value << 4; }
|
||||
[[nodiscard]] static constexpr auto demoteNibble(const int value) { return highNibble(value); }
|
||||
|
||||
virtual ~Chip();
|
||||
virtual ~Chip() = default;
|
||||
|
||||
protected:
|
||||
Chip();
|
||||
Chip() = default;
|
||||
};
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
namespace EightBit {
|
||||
class ClockedChip : public Chip {
|
||||
public:
|
||||
~ClockedChip() {};
|
||||
virtual ~ClockedChip() = default;
|
||||
|
||||
Signal<EventArgs> Ticked;
|
||||
|
||||
|
@ -72,13 +72,13 @@ namespace EightBit {
|
||||
static void match(PinLevel& line, bool condition) noexcept { condition ? raise(line) : lower(line); }
|
||||
static void match(PinLevel& out, PinLevel in) noexcept { out = in; }
|
||||
|
||||
virtual ~Device() {};
|
||||
virtual ~Device() = default;
|
||||
|
||||
[[nodiscard]] bool powered() noexcept { return raised(POWER()); }
|
||||
|
||||
DECLARE_PIN_INPUT(POWER)
|
||||
|
||||
protected:
|
||||
Device() noexcept {};
|
||||
Device() noexcept = default;
|
||||
};
|
||||
}
|
||||
|
@ -11,8 +11,6 @@ namespace EightBit {
|
||||
public:
|
||||
enum class AccessType { Unknown, Reading, Writing };
|
||||
|
||||
InputOutput() = default;
|
||||
|
||||
[[nodiscard]] size_t size() const noexcept override;
|
||||
[[nodiscard]] uint8_t peek(uint16_t address) const override;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <utility>
|
||||
|
||||
namespace EightBit {
|
||||
class IntelHexFile {
|
||||
class IntelHexFile final {
|
||||
public:
|
||||
IntelHexFile(std::string path);
|
||||
|
||||
|
@ -34,7 +34,7 @@ namespace EightBit {
|
||||
}
|
||||
};
|
||||
|
||||
~IntelProcessor() = default;
|
||||
virtual ~IntelProcessor() = default;
|
||||
|
||||
[[nodiscard]] const auto& getDecodedOpcode(const size_t i) const noexcept {
|
||||
return m_decodedOpcodes.at(i);
|
||||
|
@ -8,7 +8,7 @@ namespace EightBit {
|
||||
|
||||
class LittleEndianProcessor : public Processor {
|
||||
public:
|
||||
~LittleEndianProcessor() = default;
|
||||
virtual ~LittleEndianProcessor() = default;
|
||||
|
||||
register16_t peekWord(register16_t address) final;
|
||||
void pokeWord(register16_t address, register16_t value) final;
|
||||
|
@ -7,7 +7,7 @@ namespace EightBit {
|
||||
|
||||
class Memory;
|
||||
|
||||
struct MemoryMapping {
|
||||
struct MemoryMapping final {
|
||||
|
||||
enum class AccessLevel { Unknown, ReadOnly, WriteOnly, ReadWrite };
|
||||
|
||||
|
@ -15,7 +15,7 @@ namespace EightBit {
|
||||
// x: sign extend this b-bit number to r
|
||||
[[nodiscard]] static int8_t signExtend(int b, uint8_t x) noexcept;
|
||||
|
||||
~Processor() = default;
|
||||
virtual ~Processor() = default;
|
||||
|
||||
[[nodiscard]] auto& PC() noexcept { return m_pc; }
|
||||
|
||||
|
@ -1,6 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "Chip.h"
|
||||
|
||||
EightBit::Chip::Chip() {}
|
||||
|
||||
EightBit::Chip::~Chip() {}
|
@ -178,7 +178,6 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BigEndianProcessor.cpp" />
|
||||
<ClCompile Include="Bus.cpp" />
|
||||
<ClCompile Include="Chip.cpp" />
|
||||
<ClCompile Include="Device.cpp" />
|
||||
<ClCompile Include="EventArgs.cpp" />
|
||||
<ClCompile Include="InputOutput.cpp" />
|
||||
|
@ -103,9 +103,6 @@
|
||||
<ClCompile Include="BigEndianProcessor.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Chip.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Rom.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
Loading…
x
Reference in New Issue
Block a user