| 494 | } |
| 495 | |
| 496 | void MainWindow::debugSync() { |
| 497 | if (!guiDebug) { |
| 498 | return; |
| 499 | } |
| 500 | |
| 501 | // Update all the changes in the core |
| 502 | cpu.registers.AF = static_cast<uint16_t>(hex2int(ui->afregView->text())); |
| 503 | cpu.registers.HL = static_cast<uint32_t>(hex2int(ui->hlregView->text())); |
| 504 | cpu.registers.DE = static_cast<uint32_t>(hex2int(ui->deregView->text())); |
| 505 | cpu.registers.BC = static_cast<uint32_t>(hex2int(ui->bcregView->text())); |
| 506 | cpu.registers.IX = static_cast<uint32_t>(hex2int(ui->ixregView->text())); |
| 507 | cpu.registers.IY = static_cast<uint32_t>(hex2int(ui->iyregView->text())); |
| 508 | |
| 509 | cpu.registers._AF = static_cast<uint16_t>(hex2int(ui->af_regView->text())); |
| 510 | cpu.registers._HL = static_cast<uint32_t>(hex2int(ui->hl_regView->text())); |
| 511 | cpu.registers._DE = static_cast<uint32_t>(hex2int(ui->de_regView->text())); |
| 512 | cpu.registers._BC = static_cast<uint32_t>(hex2int(ui->bc_regView->text())); |
| 513 | |
| 514 | cpu.registers.SPL = static_cast<uint32_t>(hex2int(ui->splregView->text())); |
| 515 | cpu.registers.SPS = static_cast<uint16_t>(hex2int(ui->spsregView->text())); |
| 516 | |
| 517 | cpu.registers.MBASE = static_cast<uint8_t>(hex2int(ui->mbregView->text())); |
| 518 | cpu.registers.I = static_cast<uint16_t>(hex2int(ui->iregView->text())); |
| 519 | uint8_t r = hex2int(ui->rregView->text()); |
| 520 | cpu.registers.R = uint8_t(r << 1 | r >> 7); |
| 521 | cpu.IM = static_cast<uint8_t>(hex2int(ui->imregView->text())); |
| 522 | cpu.IM += !!cpu.IM; |
| 523 | |
| 524 | cpu.registers.flags.Z = ui->checkZ->isChecked(); |
| 525 | cpu.registers.flags.C = ui->checkC->isChecked(); |
| 526 | cpu.registers.flags.H = ui->checkHC->isChecked(); |
| 527 | cpu.registers.flags.PV = ui->checkPV->isChecked(); |
| 528 | cpu.registers.flags.N = ui->checkN->isChecked(); |
| 529 | cpu.registers.flags.S = ui->checkS->isChecked(); |
| 530 | cpu.registers.flags._5 = ui->check5->isChecked(); |
| 531 | cpu.registers.flags._3 = ui->check3->isChecked(); |
| 532 | |
| 533 | cpu.halted = ui->checkHalted->isChecked(); |
| 534 | cpu.ADL = ui->checkADL->isChecked(); |
| 535 | cpu.MADL = ui->checkMADL->isChecked(); |
| 536 | cpu.halted = ui->checkHalted->isChecked(); |
| 537 | cpu.IEF1 = ui->checkIEF1->isChecked(); |
| 538 | cpu.IEF2 = ui->checkIEF2->isChecked(); |
| 539 | |
| 540 | debug.totalCycles = ui->cycleView->text().toLongLong() + (m_ignoreDmaCycles ? debug.dmaCycles : 0); |
| 541 | debug.flashCacheMisses = ui->flashMissesView->text().toUInt(); |
| 542 | |
| 543 | uint32_t uiPC = static_cast<uint32_t>(hex2int(ui->pcregView->text())); |
| 544 | if (cpu.registers.PC != uiPC) { |
| 545 | cpu_flush(uiPC, ui->checkADL->isChecked()); |
| 546 | } |
| 547 | |
| 548 | backlight.brightness = static_cast<uint8_t>(ui->brightnessSlider->value()); |
| 549 | backlight.factor = (310u - backlight.brightness) / 160.0f; |
| 550 | panel.gammaDirty = true; |
| 551 | |
| 552 | lcd.upbase = static_cast<uint32_t>(hex2int(ui->lcdbaseView->text())); |
| 553 | lcd.upcurr = static_cast<uint32_t>(hex2int(ui->lcdcurrView->text())); |
nothing calls this directly
no test coverage detected