Implementing the XCE instruction

This commit is contained in:
Anonymus Raccoon
2020-02-25 23:05:15 +01:00
parent 8dbaea89ed
commit 4da96894ae
5 changed files with 56 additions and 1 deletions
@@ -150,4 +150,18 @@ namespace ComSquare::CPU
this->_registers.p.z = this->_registers.y == 0;
this->_registers.p.n = this->_registers.y & 0x8000u;
}
void CPU::XCE()
{
bool oldCarry = this->_registers.p.c;
this->_registers.p.c = this->_isEmulationMode;
this->_isEmulationMode = oldCarry;
if (!this->_isEmulationMode) {
this->_registers.p.m = true;
this->_registers.p.x_b = true;
this->_registers.xh = 0;
this->_registers.yh = 0;
}
}
}