MCPcopy Create free account
hub / github.com/TASEmulators/fceux / updateRegisterView

Method updateRegisterView

src/drivers/Qt/ConsoleDebugger.cpp:4214–4341  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

4212}
4213//----------------------------------------------------------------------------
4214void ConsoleDebugger::updateRegisterView(void)
4215{
4216 int stackPtr;
4217 char stmp[64];
4218 char str[32], str2[32];
4219
4220 sprintf( stmp, "%04X", X.PC );
4221
4222 pcEntry->setText( tr(stmp) );
4223
4224 sprintf( stmp, "%02X", X.A );
4225
4226 regAEntry->setText( tr(stmp) );
4227
4228 sprintf( stmp, "%02X", X.X );
4229
4230 regXEntry->setText( tr(stmp) );
4231
4232 sprintf( stmp, "%02X", X.Y );
4233
4234 regYEntry->setText( tr(stmp) );
4235
4236 sprintf( stmp, "%02X", X.P );
4237
4238 regPEntry->setText( tr(stmp) );
4239
4240 N_chkbox->setChecked( (X.P & N_FLAG) ? true : false );
4241 V_chkbox->setChecked( (X.P & V_FLAG) ? true : false );
4242 U_chkbox->setChecked( (X.P & U_FLAG) ? true : false );
4243 B_chkbox->setChecked( (X.P & B_FLAG) ? true : false );
4244 D_chkbox->setChecked( (X.P & D_FLAG) ? true : false );
4245 I_chkbox->setChecked( (X.P & I_FLAG) ? true : false );
4246 Z_chkbox->setChecked( (X.P & Z_FLAG) ? true : false );
4247 C_chkbox->setChecked( (X.P & C_FLAG) ? true : false );
4248
4249 stackPtr = X.S | 0x0100;
4250
4251 sprintf( stmp, "Stack: $%04X", stackPtr );
4252 stackFrame->setTitle( tr(stmp) );
4253 stackText->updateText();
4254
4255 // update counters
4256 int64 counter_value1 = timestampbase + (uint64)timestamp - total_cycles_base;
4257 int64 counter_value2 = timestampbase + (uint64)timestamp - delta_cycles_base;
4258
4259 if (counter_value1 < 0) // sanity check
4260 {
4261 ResetDebugStatisticsCounters();
4262 counter_value1 = 0;
4263 }
4264 if (counter_value2 < 0) // sanity check
4265 {
4266 ResetDebugStatisticsCounters();
4267 counter_value2 = 0;
4268 }
4269 sprintf(stmp, "%10llu (+%llu)", counter_value1, counter_value2);
4270 cpuCyclesVal->setText( tr(stmp) );
4271

Callers 2

resetCountersMethod · 0.45
resetDeltasMethod · 0.45

Calls 8

FCEUPPU_PeekAddressFunction · 0.85
newppu_get_scanlineFunction · 0.85
newppu_get_dotFunction · 0.85
ppu_getScrollFunction · 0.85
setTextMethod · 0.80
updateTextMethod · 0.80
trFunction · 0.50

Tested by

no test coverage detected