Implementing instructions cycles

This commit is contained in:
AnonymusRaccoon
2020-02-11 17:39:06 +01:00
parent bc808bd424
commit 8addb29610
5 changed files with 65 additions and 29 deletions
@@ -7,7 +7,7 @@
namespace ComSquare::CPU
{
int CPU::ADC(uint24_t valueAddr)
unsigned CPU::ADC(uint24_t valueAddr)
{
unsigned value = this->_bus->read(valueAddr) + this->_registers.p.c;
if (this->_registers.p.m)
@@ -25,6 +25,6 @@ namespace ComSquare::CPU
this->_registers.a %= 0x100;
this->_registers.p.z = this->_registers.a == 0;
this->_registers.p.n = this->_registers.a & negativeMask;
return (0);
return this->_extraMemoryCycles + !this->_registers.p.m;
}
}