From ae4726b18f3efdd5bfd07b3cc3d70717703e63bd Mon Sep 17 00:00:00 2001 From: Adrian Conlon <98398945+AdrianConlon@users.noreply.github.com> Date: Sat, 23 Mar 2024 10:13:13 +0000 Subject: [PATCH] Fix NES CPU, based on 6502 changes --- Ricoh2A03/inc/Ricoh2A03.h | 4 ++-- Ricoh2A03/src/Ricoh2A03.cpp | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Ricoh2A03/inc/Ricoh2A03.h b/Ricoh2A03/inc/Ricoh2A03.h index 1264900..d32ee6d 100644 --- a/Ricoh2A03/inc/Ricoh2A03.h +++ b/Ricoh2A03/inc/Ricoh2A03.h @@ -11,7 +11,7 @@ namespace EightBit { virtual ~Ricoh2A03() = default; protected: - virtual uint8_t sub(uint8_t operand, int borrow) noexcept final; - virtual uint8_t add(uint8_t operand, int carry) noexcept final; + uint8_t sub(uint8_t operand, int borrow) noexcept final; + void adc() noexcept final; }; } \ No newline at end of file diff --git a/Ricoh2A03/src/Ricoh2A03.cpp b/Ricoh2A03/src/Ricoh2A03.cpp index b63690c..f99fa76 100644 --- a/Ricoh2A03/src/Ricoh2A03.cpp +++ b/Ricoh2A03/src/Ricoh2A03.cpp @@ -6,11 +6,9 @@ EightBit::Ricoh2A03::Ricoh2A03(Bus& bus) } uint8_t EightBit::Ricoh2A03::sub(uint8_t operand, int borrow) noexcept { - const auto data = BUS().DATA(); - return MOS6502::sub_b(operand ,data, borrow); + return MOS6502::sub_b(operand, borrow); } -uint8_t EightBit::Ricoh2A03::add(uint8_t operand, int carry) noexcept { - const auto data = BUS().DATA(); - return MOS6502::add_b(operand, data, carry); +void EightBit::Ricoh2A03::adc() noexcept { + MOS6502::adc_b(); }