From d50b059a17aec73a9827d703b9752d4499cdbdb7 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 3 Nov 2020 20:37:30 -0500 Subject: [PATCH] Imports 6502-esque test for decimal SBC overflow. All applicable krom tests now pass. --- Processors/6502/AllRAM/6502AllRAM.cpp | 2 +- .../65816/Implementation/65816Implementation.hpp | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Processors/6502/AllRAM/6502AllRAM.cpp b/Processors/6502/AllRAM/6502AllRAM.cpp index 34bcf8b70..81cd4d2bd 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 00645e55d..4e93ede48 100644 --- a/Processors/65816/Implementation/65816Implementation.hpp +++ b/Processors/65816/Implementation/65816Implementation.hpp @@ -865,6 +865,11 @@ template void Processor void Processor void Processor> (1 + registers_.m_shift))&0x40; + registers_.flags.overflow = (( (decimal_result ^ registers_.a.full) & (~decimal_result ^ data_buffer_.value) ) >> (1 + registers_.m_shift))&0x40; registers_.flags.set_nz(uint16_t(result), registers_.m_shift); registers_.flags.carry = ((borrow >> 16)&1)^1; LD(registers_.a, result, registers_.m_masks); @@ -901,10 +907,6 @@ template void Processor