summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2015-02-10 19:56:10 +0100
committer hap <happppp@users.noreply.github.com>2015-02-10 19:56:10 +0100
commitdcf589f3042f8ab40868b2559ea6cbe0875a150b (patch)
tree25eeba98125e1b67988ef585ea56b10abb0403fc /src/emu
parenteab6156360035ff3b50a2ab35904f60de447fb87 (diff)
added ADC, ADS, RAR
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/cpu/ucom4/ucom4op.inc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/emu/cpu/ucom4/ucom4op.inc b/src/emu/cpu/ucom4/ucom4op.inc
index ed989b427b0..05abd2f4a49 100644
--- a/src/emu/cpu/ucom4/ucom4op.inc
+++ b/src/emu/cpu/ucom4/ucom4op.inc
@@ -180,13 +180,16 @@ void ucom4_cpu_device::op_ad()
void ucom4_cpu_device::op_adc()
{
// ADC: Add RAM and carry to ACC, store Carry F/F
- op_illegal();
+ m_acc += ram_r() + m_carry_f;
+ m_carry_f = m_acc >> 4 & 1;
+ m_acc &= 0xf;
}
void ucom4_cpu_device::op_ads()
{
// ADS: Add RAM and carry to ACC, store Carry F/F, skip next on carry
- op_illegal();
+ op_adc();
+ m_skip = (m_carry_f != 0);
}
void ucom4_cpu_device::op_daa()
@@ -673,7 +676,9 @@ void ucom4_cpu_device::op_rar()
if (!check_op_43()) return;
// RAR: Rotate ACC Right through Carry F/F
- op_illegal();
+ UINT8 c = m_acc & 1;
+ m_acc = m_acc >> 1 | m_carry_f << 3;
+ m_carry_f = c;
}