Fixing APU debugger buttons

Fixing APU MOV instruction
This commit is contained in:
Melefo
2020-03-20 14:12:16 +01:00
parent 2b5575590a
commit e0e1611043
3 changed files with 7 additions and 10 deletions
@@ -9,12 +9,10 @@ namespace ComSquare::APU
{
int APU::MOV(uint24_t memFrom, uint8_t &regTo, int cycles, bool incrementX)
{
uint8_t data = this->_internalRead(memFrom);
regTo = data;
regTo = memFrom;
if (incrementX)
this->_internalRegisters.x++;
this->_setNZflags(data);
this->_setNZflags(regTo);
return cycles;
}
+4 -4
View File
@@ -20,8 +20,8 @@ namespace ComSquare::Debugger
this->setAttribute(Qt::WA_QuitOnClose, false);
this->_ui.setupUi(this);
//QMainWindow::connect(this->_ui.resumeButton, SIGNAL(clicked()), this, SLOT(APUDebug::pause()));
//QMainWindow::connect(this->_ui.stepButton, SIGNAL(clicked()), this, SLOT(APUDebug::step()));
QMainWindow::connect(this->_ui.resumeButton, &QPushButton::clicked, this, &APUDebug::pause);
QMainWindow::connect(this->_ui.stepButton, &QPushButton::clicked, this, &APUDebug::step);
this->show();
this->_updatePanel();
}
@@ -475,7 +475,7 @@ namespace ComSquare::Debugger
int APUDebug::_executeInstruction()
{
if (this->_isPaused)
return 0;
return 0xFF;
if (this->_isStepping) {
this->_isStepping = false;
this->_isPaused = true;
@@ -494,7 +494,7 @@ namespace ComSquare::Debugger
}
if (this->_isPaused)
return;
return APU::update(cycles);
APU::update(cycles);
} catch (InvalidOpcode &e) {
this->pause();
this->_ui.logger->append(e.what());
+1 -2
View File
@@ -1256,9 +1256,8 @@ Test(VIIIDataTransmission, MovMemToReg)
apu->_internalRegisters.x = 0x23;
apu->_internalRegisters.a = 0x44;
apu->_internalWrite(0x23, 0x56);
result = apu->MOV(apu->_getIndexXAddr(), apu->_internalRegisters.a, 4, true);
cr_assert_eq(result, 4);
cr_assert_eq(apu->_internalRegisters.x, 0x24);
cr_assert_eq(apu->_internalRegisters.a, 0x56);
cr_assert_eq(apu->_internalRegisters.a, 0x23);
}