Fxing MOVW, fixing 0xEB MOV

Adding better temporary CPU-APU synchro
This commit is contained in:
Melefo
2020-05-27 19:17:37 +02:00
parent 73b84b1925
commit 0ee4575512
3 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -656,7 +656,7 @@ namespace ComSquare::APU
case 0xEA: case 0xEA:
return this->NOT1(this->_getAbsoluteBit()); return this->NOT1(this->_getAbsoluteBit());
case 0xEB: case 0xEB:
return this->MOV(this->_getDirectAddr(), this->_internalRegisters.y, 3); return this->MOV(this->_internalRead(this->_getDirectAddr()), this->_internalRegisters.y, 3);
case 0xEC: case 0xEC:
return this->MOV(this->_getAbsoluteAddr(), this->_internalRegisters.y, 4); return this->MOV(this->_getAbsoluteAddr(), this->_internalRegisters.y, 4);
case 0xED: case 0xED:
@@ -11,9 +11,11 @@ namespace ComSquare::APU
uint24_t addr2 = addr + 1 + (this->_internalRegisters.p ? 0x0100 : 0); uint24_t addr2 = addr + 1 + (this->_internalRegisters.p ? 0x0100 : 0);
if (to_ya) { if (to_ya) {
uint16_t value = ((this->_internalRead(addr2) << 8u) | this->_internalRead(addr)); uint8_t tmp = this->_internalRead(addr2);
uint16_t value = (tmp << 8) | this->_internalRead(addr);
this->_internalRegisters.ya = value; this->_internalRegisters.a = value;
this->_internalRegisters.y = (value >> 8);
this->_setNZflags(value); this->_setNZflags(value);
} }
else { else {
+1 -1
View File
@@ -209,7 +209,7 @@ namespace ComSquare::CPU
unsigned CPU::update() unsigned CPU::update()
{ {
unsigned cycles = 0; unsigned cycles = 0;
const unsigned maxCycles = 0x17; const unsigned maxCycles = 0x0C;
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
if (!(this->_internalRegisters.dmaEnableRegister & (0xF << i))) if (!(this->_internalRegisters.dmaEnableRegister & (0xF << i)))