Adding 8-bit Increment & Decrement Operations

Creating a generic function to set Negative and Zero flags with a value
This commit is contained in:
Melefo
2020-02-26 13:12:42 +01:00
parent 5033b949f9
commit 2776be601e
10 changed files with 157 additions and 24 deletions
@@ -16,8 +16,7 @@ namespace ComSquare::APU
this->_internalRegisters.a = value;
else
this->_internalWrite(operand, value);
this->_internalRegisters.n = value & 0x80u;
this->_internalRegisters.z = !value;
this->_setNZflags(value);
return cycles;
}
@@ -46,8 +45,7 @@ namespace ComSquare::APU
this->_internalRegisters.a = result;
else
this->_internalWrite(operand, result);
this->_internalRegisters.n = result & 0x80u;
this->_internalRegisters.z = !result;
this->_setNZflags(result);
return cycles;
}
@@ -69,8 +67,7 @@ namespace ComSquare::APU
int APU::XCN()
{
this->_internalRegisters.a = (this->_internalRegisters.a >> 4u) | (this->_internalRegisters.a << 4u);
this->_internalRegisters.n = this->_internalRegisters.a & 0x80u;
this->_internalRegisters.z = !this->_internalRegisters.a;
this->_setNZflags(this->_internalRegisters.a);
return 5;
}
}