Start using "base" as means to access base-class.

This commit is contained in:
Adrian Conlon 2024-03-16 14:23:05 +00:00
parent f19e67875e
commit 1c2b116a42
8 changed files with 16 additions and 0 deletions

View File

@ -14,6 +14,8 @@ namespace EightBit {
void pokeWord(register16_t address, register16_t value) noexcept final; void pokeWord(register16_t address, register16_t value) noexcept final;
protected: protected:
using base = BigEndianProcessor;
BigEndianProcessor(Bus& memory) noexcept; BigEndianProcessor(Bus& memory) noexcept;
[[nodiscard]] register16_t getWord() override; [[nodiscard]] register16_t getWord() override;

View File

@ -70,6 +70,8 @@ namespace EightBit {
: Device(rhs) {} : Device(rhs) {}
protected: protected:
using base = Chip;
Chip() noexcept = default; Chip() noexcept = default;
}; };
} }

View File

@ -22,6 +22,8 @@ namespace EightBit {
} }
protected: protected:
using base = ClockedChip;
ClockedChip() noexcept = default; ClockedChip() noexcept = default;
constexpr void resetCycles() noexcept { m_cycles = 0; } constexpr void resetCycles() noexcept { m_cycles = 0; }

View File

@ -114,6 +114,8 @@ namespace EightBit {
[[nodiscard]] constexpr bool powered() const noexcept { return raised(POWER()); } [[nodiscard]] constexpr bool powered() const noexcept { return raised(POWER()); }
protected: protected:
using base = Device;
Device() noexcept {}; Device() noexcept {};
}; };
} }

View File

@ -80,6 +80,8 @@ namespace EightBit {
DECLARE_PIN_OUTPUT(HALT) DECLARE_PIN_OUTPUT(HALT)
protected: protected:
using base = IntelProcessor;
IntelProcessor(Bus& bus); IntelProcessor(Bus& bus);
template<class T> [[nodiscard]] static constexpr uint8_t adjustSign(uint8_t f, const uint8_t value) noexcept { template<class T> [[nodiscard]] static constexpr uint8_t adjustSign(uint8_t f, const uint8_t value) noexcept {

View File

@ -14,6 +14,8 @@ namespace EightBit {
void pokeWord(register16_t address, register16_t value) noexcept final; void pokeWord(register16_t address, register16_t value) noexcept final;
protected: protected:
using base = LittleEndianProcessor;
LittleEndianProcessor(Bus& memory) noexcept; LittleEndianProcessor(Bus& memory) noexcept;
[[nodiscard]] register16_t getWord() override; [[nodiscard]] register16_t getWord() override;

View File

@ -39,6 +39,8 @@ namespace EightBit {
DECLARE_PIN_INPUT(INT) DECLARE_PIN_INPUT(INT)
protected: protected:
using base = Processor;
Processor(Bus& memory) noexcept; Processor(Bus& memory) noexcept;
[[nodiscard]] constexpr auto& opcode() noexcept { return m_opcode; } [[nodiscard]] constexpr auto& opcode() noexcept { return m_opcode; }

View File

@ -15,6 +15,7 @@ public:
private: private:
using handle_t = std::coroutine_handle<promise_type>; using handle_t = std::coroutine_handle<promise_type>;
public:
class promise_type final { class promise_type final {
private: private:
T value_; T value_;
@ -42,6 +43,7 @@ private:
[[nodiscard]] constexpr auto& exception() noexcept { return exception_; }; [[nodiscard]] constexpr auto& exception() noexcept { return exception_; };
}; };
private:
handle_t h_; handle_t h_;
private: private: