Fixed a missunderstanding of the pbr use

This commit is contained in:
Anonymus Raccoon
2020-03-26 23:54:10 +01:00
parent 80ebfa8064
commit c9a40be3e2
7 changed files with 95 additions and 62 deletions
+11 -2
View File
@@ -195,12 +195,21 @@ namespace ComSquare::CPU
}
}
uint8_t CPU::readPC()
{
uint8_t ret = this->_bus->read(this->_registers.pac);
this->_registers.pc++;
return ret;
}
unsigned CPU::update()
{
unsigned cycles = 0;
for (int i = 0; i < 0xFF; i++)
cycles += this->_executeInstruction(this->_bus->read(this->_registers.pac++));
for (int i = 0; i < 0xFF; i++) {
cycles += this->_executeInstruction(this->readPC());
this->_registers.pc++;
}
return cycles;
}