1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-08-20 18:27:33 +00:00

Eliminated another conditional. Albeit a very predictable one.

This commit is contained in:
Thomas Harte
2017-05-30 22:15:43 -04:00
parent dfb5057342
commit b5c1773d59

View File

@@ -178,7 +178,7 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
uint8_t parity_overflow_result_; // the parity/overflow flag is set if the corresponding bit of parity_overflow_result_ is set uint8_t parity_overflow_result_; // the parity/overflow flag is set if the corresponding bit of parity_overflow_result_ is set
uint8_t subtract_flag_; // contains a copy of the subtract flag in isolation uint8_t subtract_flag_; // contains a copy of the subtract flag in isolation
uint8_t carry_result_; // the carry flag is set if bit 0 of carry_result_ is set uint8_t carry_result_; // the carry flag is set if bit 0 of carry_result_ is set
bool is_halted_; uint8_t halt_mask_;
int number_of_cycles_; int number_of_cycles_;
@@ -634,7 +634,7 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
public: public:
Processor() : MicroOpScheduler(), Processor() : MicroOpScheduler(),
is_halted_(false), halt_mask_(0xff),
sp_(0xffff), sp_(0xffff),
pc_(0x0000), pc_(0x0000),
a_(0xff), a_(0xff),
@@ -704,7 +704,7 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
case MicroOp::DecodeOperation: case MicroOp::DecodeOperation:
r_ = (r_ & 0x80) | ((r_ + current_instruction_page_->r_step_) & 0x7f); r_ = (r_ & 0x80) | ((r_ + current_instruction_page_->r_step_) & 0x7f);
pc_.full++; pc_.full++;
decode_operation(is_halted_ ? 0x00 : operation_); decode_operation(operation_ & halt_mask_);
break; break;
case MicroOp::Increment16: (*(uint16_t *)operation->source)++; break; case MicroOp::Increment16: (*(uint16_t *)operation->source)++; break;
@@ -1397,7 +1397,7 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
break; break;
case MicroOp::HALT: case MicroOp::HALT:
is_halted_ = true; halt_mask_ = 0x00;
break; break;
#pragma mark - Internal bookkeeping #pragma mark - Internal bookkeeping
@@ -1586,7 +1586,7 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
Gets the value of the HALT output line. Gets the value of the HALT output line.
*/ */
bool get_halt_line() { bool get_halt_line() {
return is_halted_; return halt_mask_ == 0x00;
} }
}; };