From 76299a2addbf88096c461a593ebb55a150d707f7 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 29 Mar 2021 22:58:52 -0400 Subject: [PATCH] Include AF' in Z80 state. --- Processors/Z80/State/State.cpp | 3 +++ Processors/Z80/State/State.hpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Processors/Z80/State/State.cpp b/Processors/Z80/State/State.cpp index bcba268f9..c9b90f2de 100644 --- a/Processors/Z80/State/State.cpp +++ b/Processors/Z80/State/State.cpp @@ -19,6 +19,7 @@ State::State(const ProcessorBase &src): State() { registers.bc = src.bc_.full; registers.de = src.de_.full; registers.hl = src.hl_.full; + registers.afDash = src.afDash_.full; registers.bcDash = src.bcDash_.full; registers.deDash = src.deDash_.full; registers.hlDash = src.hlDash_.full; @@ -107,6 +108,7 @@ void State::apply(ProcessorBase &target) { target.bc_.full = registers.bc; target.de_.full = registers.de; target.hl_.full = registers.hl; + target.afDash_.full = registers.afDash; target.bcDash_.full = registers.bcDash; target.deDash_.full = registers.deDash; target.hlDash_.full = registers.hlDash; @@ -177,6 +179,7 @@ State::Registers::Registers() { DeclareField(bc); DeclareField(de); DeclareField(hl); + DeclareField(afDash); DeclareField(bcDash); DeclareField(deDash); DeclareField(hlDash); diff --git a/Processors/Z80/State/State.hpp b/Processors/Z80/State/State.hpp index 3a9aa838f..f5676aa60 100644 --- a/Processors/Z80/State/State.hpp +++ b/Processors/Z80/State/State.hpp @@ -31,7 +31,7 @@ struct State: public Reflection::StructImpl { uint8_t a; uint8_t flags; uint16_t bc, de, hl; - uint16_t bcDash, deDash, hlDash; + uint16_t afDash, bcDash, deDash, hlDash; uint16_t ix, iy, ir; uint16_t program_counter, stack_pointer; uint16_t memptr;