started docs on cpu
This commit is contained in:
parent
7c424b3137
commit
dfef02df47
2 changed files with 91 additions and 30 deletions
|
@ -53,14 +53,13 @@ uint8_t CPU::Tick()
|
|||
RESET_DEBUG_STRING();
|
||||
APPEND_DEBUG_STRING(std::setw(4) << pc.Raw << " ");
|
||||
|
||||
// Implement instructions
|
||||
pastPCs.push_back(pc.Raw);
|
||||
if (pastPCs.size() > 50)
|
||||
pastPCs.pop_front();
|
||||
|
||||
Byte opcode = Read(pc.Raw++);
|
||||
currentInstruction = &(InstructionTable[opcode]);
|
||||
|
||||
pastPCs.push_back(currentInstruction);
|
||||
if (pastPCs.size() > 50)
|
||||
pastPCs.pop_front();
|
||||
|
||||
if (currentInstruction->Operation == nullptr || currentInstruction->Mode == nullptr)
|
||||
{
|
||||
LOG_DEBUG_ERROR("Unknown instruction {0:02X} at ${1:04X}", opcode, pc.Raw);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue