From db0da4b7413197fb7296e6da2736fff4ff5db3cd Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 22 Mar 2019 19:34:17 -0400 Subject: [PATCH] Improves get/set state. --- .../Implementation/68000Implementation.hpp | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Processors/68000/Implementation/68000Implementation.hpp b/Processors/68000/Implementation/68000Implementation.hpp index 5319f0cd8..786f47cf5 100644 --- a/Processors/68000/Implementation/68000Implementation.hpp +++ b/Processors/68000/Implementation/68000Implementation.hpp @@ -313,7 +313,15 @@ template ProcessorState Processor void Processor: stack_pointers_[0].full = state.user_stack_pointer; stack_pointers_[1].full = state.supervisor_stack_pointer; - // TODO: update address[7], once there's a status word to discern the mode this processor should now be in. + carry_flag_ = state.status & 0x0001; + overflow_flag_ = state.status & 0x0002; + zero_flag_ = (state.status & 0x0004) ^ 0x0004; + negative_flag_ = state.status & 0x0008; + extend_flag_ = state.status & 0x0010; + + is_supervisor_ = (state.status >> 13) & 1; + address_[7] = stack_pointers_[is_supervisor_]; + + // TODO: rest of status word: interrupt level, trace flag. }