Exemplo n.º 1
0
//-----------------------------------------------------------------------------
//	XBX_InitConsoleMonitor
//
//-----------------------------------------------------------------------------
void CXboxConsole::InitConsoleMonitor( bool bWaitForConnect )
{
	if ( XBX_NoXBDM() )
		return;

	// create our events
	g_xbx_dbgValidEvent = CreateEvent( XBOX_DONTCARE, TRUE, FALSE, NULL );
	g_xbx_dbgCmdCompleteEvent = CreateEvent( XBOX_DONTCARE, FALSE, FALSE, NULL );

	// register our command handler with the debug monitor
	HRESULT hr = DmRegisterCommandProcessor( XBX_DBGCOMMANDPREFIX, _DebugCommandHandler );
	if ( FAILED( hr ) )
	{
		XBX_Error( "XBX_InitConsoleMonitor: failed to register command processor" );
	}

	// user can have output bypass slave thread
	g_xbx_bDoSyncOutput = CommandLine()->FindParm( "-syncoutput" ) != 0;

	// create a slave thread to do delayed VXConsole transactions
	ThreadId_t threadID;
	g_xbx_hDebugThread = CreateSimpleThread( _DebugThreadFunc, NULL, &threadID, 16*1024 ); 
	ThreadSetDebugName( threadID, "DebugThread" );
	ThreadSetAffinity( g_xbx_hDebugThread, XBOX_PROCESSOR_5 );

	if ( bWaitForConnect )
	{
		XBX_DebugString( XBX_CLR_DEFAULT, "Waiting For VXConsole Connection...\n" );
		WaitForSingleObject( g_xbx_dbgValidEvent, INFINITE );
	}
}
Exemplo n.º 2
0
//-----------------------------------------------------------------------------
// Name: IsFastCapProfileRequested()
// Desc: Returns TRUE if a fastcap profile was requested, and resets the
// internal variable so it will return FALSE next time.
//-----------------------------------------------------------------------------
BOOL XBProfiling_IsFastCAPRequested()
{
    // Initialize the command processor if this hasn't been done yet.
    static BOOL s_Initialized = FALSE;
    if( !s_Initialized )
    {
        s_Initialized = TRUE;
        HRESULT hr = DmRegisterCommandProcessor( s_CommandPrefix, ProfileCommandHandler );
        if( FAILED(hr) )
            OutputDebugStringA( "Error registering command processor.\n" );
    }

    BOOL Result = s_FastCAPRequested;
    s_FastCAPRequested = FALSE;
    return Result;
}