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

Function FCEUD_DebugBreakpoint

src/drivers/Qt/ConsoleDebugger.cpp:4574–4654  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

4572}
4573//----------------------------------------------------------------------------
4574void FCEUD_DebugBreakpoint( int bpNum )
4575{
4576
4577 if ( !nes_shm->runEmulator || !bpDebugEnable )
4578 {
4579 return;
4580 }
4581 lastBpIdx = bpNum;
4582 waitingAtBp = true;
4583 bpNotifyReq = true;
4584
4585 if (bpNum == BREAK_TYPE_CYCLES_EXCEED)
4586 {
4587 if ( breakOnCycleOneShot )
4588 {
4589 break_on_cycles = false;
4590 }
4591 else
4592 {
4593 if ( breakOnCycleMode )
4594 {
4595 long long int totalCount = timestampbase + (uint64)timestamp - total_cycles_base;
4596
4597 if (totalCount < 0) // sanity check
4598 {
4599 ResetDebugStatisticsCounters();
4600 totalCount = 0;
4601 }
4602 break_cycles_limit = totalCount + breakOnCycleRelVal;
4603 //printf("Increasing Cycles Limit by: %llu to: %llu\n", breakOnCycleRelVal, break_cycles_limit );
4604 }
4605 }
4606 }
4607 else if (bpNum == BREAK_TYPE_INSTRUCTIONS_EXCEED)
4608 {
4609 if ( breakOnInstrOneShot )
4610 {
4611 break_on_instructions = false;
4612 }
4613 else
4614 {
4615 if ( breakOnInstrMode )
4616 {
4617 break_instructions_limit = total_instructions + breakOnInstrRelVal;
4618 }
4619 }
4620 }
4621 hexEditorUpdateMemoryValues(true);
4622 hexEditorRequestUpdateAll();
4623
4624 printf("Breakpoint Hit: %i \n", bpNum );
4625
4626 FCEU_WRAPPER_UNLOCK();
4627
4628 while ( nes_shm->runEmulator && bpDebugEnable &&
4629 FCEUI_EmulationPaused() && !FCEUI_EmulationFrameStepped())
4630 {
4631 // HACK: break when Frame Advance is pressed

Callers

nothing calls this directly

Calls 8

FCEUI_EmulationPausedFunction · 0.85
FCEUI_SetEmulationPausedFunction · 0.85
msleepFunction · 0.85

Tested by

no test coverage detected