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

Function CmdBreakOpcode

source/Debugger/Debug.cpp:1012–1047  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1010
1011//===========================================================================
1012Update_t CmdBreakOpcode (int nArgs) // Breakpoint IFF Full-speed!
1013{
1014 if (nArgs > 1)
1015 return HelpLastCommand();
1016
1017 char sAction[ CONSOLE_WIDTH ] = "Current"; // default to display
1018
1019 if (nArgs == 1)
1020 {
1021 int iOpcode = g_aArgs[ 1] .nValue;
1022 g_iDebugBreakOnOpcode = iOpcode & 0xFF;
1023
1024 strcpy( sAction, "Setting" );
1025
1026 if (iOpcode >= NUM_OPCODES)
1027 {
1028 ConsoleBufferPushFormat( "Warning: clamping opcode: %02X", g_iDebugBreakOnOpcode );
1029 return ConsoleUpdate();
1030 }
1031 }
1032
1033 if (g_iDebugBreakOnOpcode == 0)
1034 // Show what the current break opcode is
1035 ConsoleBufferPushFormat( "%s Break on Opcode: None"
1036 , sAction
1037 );
1038 else
1039 // Show what the current break opcode is
1040 ConsoleBufferPushFormat( "%s Break on Opcode: %02X %s"
1041 , sAction
1042 , g_iDebugBreakOnOpcode
1043 , g_aOpcodes65C02[ g_iDebugBreakOnOpcode ].sMnemonic
1044 );
1045
1046 return ConsoleUpdate();
1047}
1048
1049
1050//===========================================================================

Callers

nothing calls this directly

Calls 3

HelpLastCommandFunction · 0.85
ConsoleBufferPushFormatFunction · 0.85
ConsoleUpdateFunction · 0.70

Tested by

no test coverage detected