diff --git a/sources/APU/APU.cpp b/sources/APU/APU.cpp index dacb563..ced139b 100644 --- a/sources/APU/APU.cpp +++ b/sources/APU/APU.cpp @@ -656,7 +656,7 @@ namespace ComSquare::APU case 0xEA: return this->NOT1(this->_getAbsoluteBit()); case 0xEB: - return this->MOV(this->_getDirectAddr(), this->_internalRegisters.y, 3); + return this->MOV(this->_internalRead(this->_getDirectAddr()), this->_internalRegisters.y, 3); case 0xEC: return this->MOV(this->_getAbsoluteAddr(), this->_internalRegisters.y, 4); case 0xED: diff --git a/sources/APU/Instructions/16bitDataTransmission.cpp b/sources/APU/Instructions/16bitDataTransmission.cpp index cfa8009..5a28ce6 100644 --- a/sources/APU/Instructions/16bitDataTransmission.cpp +++ b/sources/APU/Instructions/16bitDataTransmission.cpp @@ -11,9 +11,11 @@ namespace ComSquare::APU uint24_t addr2 = addr + 1 + (this->_internalRegisters.p ? 0x0100 : 0); 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); } else { diff --git a/sources/CPU/CPU.cpp b/sources/CPU/CPU.cpp index e507265..a6dec27 100644 --- a/sources/CPU/CPU.cpp +++ b/sources/CPU/CPU.cpp @@ -209,7 +209,7 @@ namespace ComSquare::CPU unsigned CPU::update() { unsigned cycles = 0; - const unsigned maxCycles = 0x17; + const unsigned maxCycles = 0x0C; for (int i = 0; i < 8; i++) { if (!(this->_internalRegisters.dmaEnableRegister & (0xF << i)))