Implementing MVP

This commit is contained in:
Anonymus Raccoon
2020-05-14 01:06:29 +02:00
parent d0e4caf12e
commit 8240fbd54c
3 changed files with 42 additions and 1 deletions
@@ -168,4 +168,21 @@ namespace ComSquare::CPU
}
return 7 * length;
}
int CPU::MVP(uint24_t params, AddressingMode)
{
uint8_t srcBank = params;
uint8_t destBank = params >> 8u;
int length = this->_registers.a + 1;
this->_registers.dbr = destBank;
while (this->_registers.a != 0xFFFF) {
uint8_t data = this->_bus->read(srcBank << 24u | this->_registers.x);
this->_bus->write(destBank << 24u | this->_registers.y, data);
this->_registers.x--;
this->_registers.y--;
this->_registers.a--;
}
return 7 * length;
}
}