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

Method updateRegisterView

src/drivers/sdl/debugger.cpp:474–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474void debuggerWin_t::updateRegisterView(void)
475{
476 int stackPtr;
477 char stmp[64];
478 char str[32], str2[32];
479 std::string stackLine;
480
481 sprintf( stmp, "%04X", X.PC );
482
483 gtk_entry_set_text( GTK_ENTRY(pc_entry), stmp );
484
485 sprintf( stmp, "%02X", X.A );
486
487 gtk_entry_set_text( GTK_ENTRY(A_entry), stmp );
488
489 sprintf( stmp, "%02X", X.X );
490
491 gtk_entry_set_text( GTK_ENTRY(X_entry), stmp );
492
493 sprintf( stmp, "%02X", X.Y );
494
495 gtk_entry_set_text( GTK_ENTRY(Y_entry), stmp );
496
497 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( P_N_chkbox ), (X.P & N_FLAG) ? TRUE : FALSE );
498 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( P_V_chkbox ), (X.P & V_FLAG) ? TRUE : FALSE );
499 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( P_U_chkbox ), (X.P & U_FLAG) ? TRUE : FALSE );
500 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( P_B_chkbox ), (X.P & B_FLAG) ? TRUE : FALSE );
501 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( P_D_chkbox ), (X.P & D_FLAG) ? TRUE : FALSE );
502 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( P_I_chkbox ), (X.P & I_FLAG) ? TRUE : FALSE );
503 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( P_Z_chkbox ), (X.P & Z_FLAG) ? TRUE : FALSE );
504 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( P_C_chkbox ), (X.P & C_FLAG) ? TRUE : FALSE );
505
506 stackPtr = X.S | 0x0100;
507
508 sprintf( stmp, "Stack: %04X", stackPtr );
509 gtk_frame_set_label( GTK_FRAME(stack_frame), stmp );
510
511 stackPtr++;
512
513 if ( stackPtr <= 0x01FF )
514 {
515 sprintf( stmp, "%02X", GetMem(stackPtr) );
516
517 stackLine.assign( stmp );
518
519 for (int i = 1; i < 128; i++)
520 {
521 //tmp = ((tmp+1)|0x0100)&0x01FF; //increment and fix pointer to $0100-$01FF range
522 stackPtr++;
523 if (stackPtr > 0x1FF)
524 break;
525 if ((i & 7) == 0)
526 sprintf( stmp, ",\r\n%02X", GetMem(stackPtr) );
527 else
528 sprintf( stmp, ",%02X", GetMem(stackPtr) );
529
530 stackLine.append( stmp );
531 }

Callers

nothing calls this directly

Calls 5

GetMemFunction · 0.85
FCEUPPU_PeekAddressFunction · 0.85
newppu_get_scanlineFunction · 0.85
newppu_get_dotFunction · 0.85

Tested by

no test coverage detected