From a806f173ced79e2fabfed6a7688d24e3ae5585e7 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Thu, 1 Sep 2022 18:13:32 +0200 Subject: [PATCH] Emulator: Add getters for CPU registers --- src/cpu.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cpu.h b/src/cpu.h index f472498..d12a42a 100644 --- a/src/cpu.h +++ b/src/cpu.h @@ -102,6 +102,10 @@ public: // ------------------------------------- + uint32_t a() const { return m_a; } + uint32_t b() const { return m_b; } + uint32_t c() const { return m_c; } + uint32_t af() const { return (m_cf << 4 | m_hf << 5 | m_nf << 6 | m_zf << 7) | m_a << 8; } uint32_t bc() const { return m_c | m_b << 8; } uint32_t de() const { return m_e | m_d << 8; } @@ -109,6 +113,11 @@ public: uint32_t pc() const { return m_pc; } uint32_t sp() const { return m_sp; } + uint32_t zf() const { return m_zf; } + uint32_t nf() const { return m_nf; } + uint32_t hf() const { return m_hf; } + uint32_t cf() const { return m_cf; } + void setBC(uint32_t value); void setDE(uint32_t value); void setHL(uint32_t value);