From c01bc784b9e0edf73569be5c52529af56f892d8a Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 9 Oct 2020 22:21:55 -0400 Subject: [PATCH] Slightly reduces branching. --- Processors/6502/AllRAM/6502AllRAM.cpp | 2 +- .../65816/Implementation/65816Implementation.hpp | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Processors/6502/AllRAM/6502AllRAM.cpp b/Processors/6502/AllRAM/6502AllRAM.cpp index cbd8e6b36..723bc98b6 100644 --- a/Processors/6502/AllRAM/6502AllRAM.cpp +++ b/Processors/6502/AllRAM/6502AllRAM.cpp @@ -11,7 +11,7 @@ #include #include -#define BE_NOISY +//#define BE_NOISY using namespace CPU::MOS6502; diff --git a/Processors/65816/Implementation/65816Implementation.hpp b/Processors/65816/Implementation/65816Implementation.hpp index 54fd9e835..4d567dd9f 100644 --- a/Processors/65816/Implementation/65816Implementation.hpp +++ b/Processors/65816/Implementation/65816Implementation.hpp @@ -185,21 +185,12 @@ template void Processor::run_for(const Cycles continue; case OperationCopyAToData: - if(m_flag()) { - data_buffer_.size = 1; - data_buffer_.value = a_.halves.low; - } else { - data_buffer_.size = 2; - data_buffer_.value = a_.full; - } + data_buffer_.value = a_.full & m_masks_[1]; + data_buffer_.size = 2 - m_flag(); continue; case OperationCopyDataToA: - if(m_flag()) { - a_.halves.low = data_buffer_.value; - } else { - a_.full = data_buffer_.value; - } + a_.full = (a_.full & m_masks_[0]) + (data_buffer_.value & m_masks_[1]); continue; case OperationCopyPBRToData: