diff --git a/LR35902/inc/LR35902.h b/LR35902/inc/LR35902.h index 24fcd87..2912830 100644 --- a/LR35902/inc/LR35902.h +++ b/LR35902/inc/LR35902.h @@ -182,8 +182,6 @@ namespace EightBit { bool jumpConditionalFlag(uint8_t& f, int flag); bool callConditionalFlag(uint8_t& f, int flag); - void sbc(uint8_t& f, register16_t& operand, register16_t value); - void adc(uint8_t& f, register16_t& operand, register16_t value); void add(uint8_t& f, register16_t& operand, register16_t value); static void add(uint8_t& f, uint8_t& operand, uint8_t value, int carry = 0); diff --git a/LR35902/src/LR35902.cpp b/LR35902/src/LR35902.cpp index 023a31e..18a51b8 100644 --- a/LR35902/src/LR35902.cpp +++ b/LR35902/src/LR35902.cpp @@ -132,34 +132,6 @@ bool EightBit::LR35902::callConditionalFlag(uint8_t& f, int flag) { #pragma region 16-bit arithmetic -void EightBit::LR35902::sbc(uint8_t& f, register16_t& operand, register16_t value) { - - auto before = operand; - - auto carry = (f & CF) >> 4; - auto result = before.word - value.word - carry; - operand.word = result; - - clearFlag(f, ZF, operand.word); - adjustHalfCarrySub(f, before.high, value.high, operand.high); - setFlag(f, NF); - setFlag(f, CF, result & Bit16); -} - -void EightBit::LR35902::adc(uint8_t& f, register16_t& operand, register16_t value) { - - auto before = operand; - - auto carry = (f & CF) >> 4; - auto result = before.word + value.word + carry; - operand.word = result; - - clearFlag(f, ZF, result); - adjustHalfCarryAdd(f, before.high, value.high, operand.high); - clearFlag(f, NF); - setFlag(f, CF, result & Bit16); -} - void EightBit::LR35902::add(uint8_t& f, register16_t& operand, register16_t value) { auto before = operand;