mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2026-10-22 07:02:37 +00:00
Start adding comparison operations to EightBit classes
This commit is contained in:
1 parent
af7679505c
commit
945fcefb36
16 files changed
+154
-34
No files matched your search
@@ -35,10 +35,14 @@ namespace EightBit {
|
||||
virtual int execute() final;
|
||||
virtual int step() final;
|
||||
|
||||
[[nodiscard]] virtual register16_t& AF() noexcept final;
|
||||
[[nodiscard]] virtual register16_t& BC() noexcept final;
|
||||
[[nodiscard]] virtual register16_t& DE() noexcept final;
|
||||
[[nodiscard]] virtual register16_t& HL() noexcept final;
|
||||
[[nodiscard]] const register16_t& AF() const noexcept final;
|
||||
[[nodiscard]] auto& AF() noexcept { return IntelProcessor::AF(); }
|
||||
[[nodiscard]] const register16_t& BC() const noexcept final;
|
||||
[[nodiscard]] auto& BC() noexcept { return IntelProcessor::BC(); }
|
||||
[[nodiscard]] const register16_t& DE() const noexcept final;
|
||||
[[nodiscard]] auto& DE() noexcept { return IntelProcessor::DE(); }
|
||||
[[nodiscard]] const register16_t& HL() const noexcept final;
|
||||
[[nodiscard]] auto& HL() noexcept { return IntelProcessor::HL(); }
|
||||
|
||||
[[nodiscard]] bool requestingIO() noexcept { return m_requestIO; }
|
||||
[[nodiscard]] bool requestingMemory() noexcept { return m_requestMemory; }
|
||||
|
||||
@@ -19,20 +19,21 @@ EightBit::Intel8080::Intel8080(Bus& bus)
|
||||
DEFINE_PIN_LEVEL_CHANGERS(DBIN, Intel8080);
|
||||
DEFINE_PIN_LEVEL_CHANGERS(WR, Intel8080);
|
||||
|
||||
EightBit::register16_t& EightBit::Intel8080::AF() noexcept {
|
||||
af.low = (af.low | Bit1) & ~(Bit5 | Bit3);
|
||||
const EightBit::register16_t& EightBit::Intel8080::AF() const noexcept {
|
||||
auto* processor = const_cast<Intel8080*>(this);
|
||||
processor->af.low = (af.low | Bit1) & ~(Bit5 | Bit3);
|
||||
return af;
|
||||
}
|
||||
|
||||
EightBit::register16_t& EightBit::Intel8080::BC() noexcept {
|
||||
const EightBit::register16_t& EightBit::Intel8080::BC() const noexcept {
|
||||
return bc;
|
||||
}
|
||||
|
||||
EightBit::register16_t& EightBit::Intel8080::DE() noexcept {
|
||||
const EightBit::register16_t& EightBit::Intel8080::DE() const noexcept {
|
||||
return de;
|
||||
}
|
||||
|
||||
EightBit::register16_t& EightBit::Intel8080::HL() noexcept {
|
||||
const EightBit::register16_t& EightBit::Intel8080::HL() const noexcept {
|
||||
return hl;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user