MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / CmdGo

Function CmdGo

source/Debugger/Debug.cpp:2453–2547  ·  view source on GitHub ↗

===========================================================================

Source from the content-addressed store, hash-verified

2451
2452//===========================================================================
2453static Update_t CmdGo (int nArgs, const bool bFullSpeed)
2454{
2455 // G StopAddress [SkipAddress,Length]
2456 // Example:
2457 // G C600 FA00,FFFF
2458 // TODO: G addr1,len addr3,len
2459 // TODO: G addr1:addr2 addr3:addr4
2460
2461 const int kCmdGo = !bFullSpeed ? CMD_GO_NORMAL_SPEED : CMD_GO_FULL_SPEED;
2462
2463 g_nDebugSteps = -1;
2464 g_nDebugStepCycles = 0;
2465 g_nDebugStepStart = regs.pc;
2466 g_nDebugStepUntil = nArgs ? g_aArgs[1].nValue : -1;
2467 g_nDebugSkipStart = -1;
2468 g_nDebugSkipLen = -1;
2469
2470 if (nArgs > 4)
2471 return Help_Arg_1( kCmdGo );
2472
2473 // G StopAddress [SkipAddress,Len]
2474 // Old 1 2 2
2475 // G addr addr [, len]
2476 // New 1 2 3 4
2477 if (nArgs > 1)
2478 {
2479 int iArg = 2;
2480 g_nDebugSkipStart = g_aArgs[ iArg ].nValue;
2481
2482#if DEBUG_VAL_2
2483 WORD nAddress = g_aArgs[ iArg ].nVal2;
2484#endif
2485 int nLen = 0;
2486 int nEnd = 0;
2487
2488 if (nArgs > 2)
2489 {
2490 if (g_aArgs[ iArg + 1 ].eToken == TOKEN_COMMA)
2491 {
2492 if (nArgs > 3)
2493 {
2494 nLen = g_aArgs[ iArg + 2 ].nValue;
2495 nEnd = g_nDebugSkipStart + nLen;
2496 if (nEnd > (int) _6502_MEM_END)
2497 nEnd = _6502_MEM_END + 1;
2498 }
2499 else
2500 {
2501 return Help_Arg_1( kCmdGo );
2502 }
2503 }
2504 else
2505 if (g_aArgs[ iArg+ 1 ].eToken == TOKEN_COLON)
2506 {
2507 nEnd = g_aArgs[ iArg + 2 ].nValue + 1;
2508 }
2509 else
2510 return Help_Arg_1( kCmdGo );

Callers 4

CmdGoNormalSpeedFunction · 0.85
CmdGoFullSpeedFunction · 0.85
CmdStepOutFunction · 0.85
CmdCursorRunUntilFunction · 0.85

Calls 5

Help_Arg_1Function · 0.85
ConsoleBufferPushFormatFunction · 0.85
ConsoleBufferToDisplayFunction · 0.85
DebugEnterSteppingFunction · 0.85
SoundCore_SetFadeFunction · 0.85

Tested by

no test coverage detected