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
@@ -15,8 +15,7 @@ namespace ComSquare::APU
if (this->_internalRegisters.h || (this->_internalRegisters.a & 0x0Fu) > 0x09) {
this->_internalRegisters.a += 0x06;
}
this->_internalRegisters.n = this->_internalRegisters.a & 0x80u;
this->_internalRegisters.z = !this->_internalRegisters.a;
this->_setNZflags(this->_internalRegisters.a);
return 3;
}
@@ -29,8 +28,7 @@ namespace ComSquare::APU
if (!this->_internalRegisters.h || (this->_internalRegisters.a & 0x0Fu) > 0x09) {
this->_internalRegisters.a -= 0x06;
}
this->_internalRegisters.n = this->_internalRegisters.a & 0x80u;
this->_internalRegisters.z = !this->_internalRegisters.a;
this->_setNZflags(this->_internalRegisters.a);
return 3;
}
}