1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-05 06:05:27 +00:00

Made an attempt at OUT[I/D]R. 10 failures remaining. None of which, I guess, are due to unimplemented operations.

This commit is contained in:
Thomas Harte 2017-05-29 10:28:04 -04:00
parent ad56a9215c
commit a47b339668

View File

@ -1166,6 +1166,37 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
#undef INxR_STEP #undef INxR_STEP
#define OUTxR_STEP(incr) \
bc_.bytes.high--; \
hl_.full += (operation->type == incr) ? 1 : -1; \
\
sign_result_ = zero_result_ = bit5_result_ = bit3_result_ = bc_.bytes.high; \
subtract_flag_ = (temp8_ >> 6) & Flag::Subtract; \
\
int summation = temp8_ + hl_.bytes.low; \
if(summation > 0xff) { \
carry_flag_ = Flag::Carry; \
half_carry_flag_ = Flag::HalfCarry; \
} else { \
carry_flag_ = half_carry_flag_ = 0; \
} \
\
summation = (summation&7) ^ bc_.bytes.high; \
set_parity(summation);
case MicroOp::OUTDR:
case MicroOp::OUTIR: {
OUTxR_STEP(MicroOp::OUTIR);
REPEAT(bc_.bytes.high);
} break;
case MicroOp::OUTD:
case MicroOp::OUTI: {
OUTxR_STEP(MicroOp::OUTI);
} break;
#undef OUTxR_STEP
#pragma mark - Bit Manipulation #pragma mark - Bit Manipulation
case MicroOp::BIT: { case MicroOp::BIT: {