Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
5.0 KiB

  1. #ifndef PS3_CONSOLE_H
  2. #define PS3_CONSOLE_H
  3. #include <cell/cell_fs.h>
  4. #include "ps3_platform.h"
  5. #include <sysutil/sysutil_sysconf.h>
  6. #include "ps3/ps3_vxconsole.h"
  7. #include "ps3/ps3_core.h"
  8. #include "tier0/dbg.h"
  9. #if 0
  10. //-- The following, subject to being moved somewhere more sensible - DL
  11. #define PS3_SYSUTIL_CALLBACK_SLOT 0
  12. #define SOUND_SYSUTIL_CALLBACK_SLOT 1
  13. bool PS3_RegisterSysUtilCallback( void );
  14. bool PS3_RegisterDiscChangeCallback( void );
  15. void PS3_UnRegisterSysUtilCallback( void );
  16. void PS3_UnRegisterDiscChangeCallback( void );
  17. void PS3_CheckSysUtilCallback( void );
  18. int PS3_OpenSystemConfigurationDialog(CellSysconfType iConfType,CellSysconfCallback pCallBack, void * pUserData );
  19. void PS3_CloseSystemConfigurationDialog();
  20. void PS3_CleanSystemConfigurationDialog();
  21. //--
  22. #endif
  23. /*
  24. //void PS3_SendRemoteCommand( const char* dbgCommand, bool bAsync );
  25. bool PS3_DebugString( unsigned int color, const char* format, ... );
  26. bool PS3_IsConsoleConnected();
  27. void PS3_InitConsoleMonitor( bool bWaitForConnect = false );
  28. int XBX_rAddCommands(int numCommands, const char* commands[], const char* help[]);
  29. //updates the status of the console connection and handles new messages
  30. void PS3_UpdateConsoleMonitor();
  31. //language settings
  32. const char* PS3_GetLanguageString( void );
  33. bool PS3_IsLocalized( void );
  34. */
  35. // for integration with vxconsole profile bars:
  36. #define XBX_MAX_PROFILE_COUNTERS 64
  37. #define XMAKECOLOR( r, g, b ) ((unsigned int)(((unsigned char)(r)|((unsigned int)((unsigned char)(g))<<8))|(((unsigned int)(unsigned char)(b))<<16)))
  38. class IPS3Console
  39. {
  40. public:
  41. // // // X360 console interface
  42. virtual void SendRemoteCommand( const char *dbgCommand, bool bAsync ) = 0;
  43. virtual void SendPrefixedDECIMessage( const char *prefix, const char *message, bool async ) = 0;
  44. virtual void DebugString( unsigned int color, const char *format, ... ) = 0;
  45. virtual bool IsConsoleConnected() = 0;
  46. virtual void InitConsoleMonitor( bool bWaitForConnect = false ) = 0;
  47. virtual void DisconnectConsoleMonitor() = 0;
  48. virtual void FlushDebugOutput() = 0;
  49. virtual bool GetXboxName( char *, unsigned * ) = 0;
  50. virtual void CrashDump( bool ) = 0;
  51. virtual void CrashDumpFullHeap( bool ) = 0;
  52. virtual void DumpDllInfo( const char *pBasePath ) = 0;
  53. // virtual void OutputDebugString( const char * ) = 0;
  54. virtual bool IsDebuggerPresent() = 0;
  55. virtual int SetProfileAttributes( const char *pProfileName, int numCounters, const char *names[], COLORREF colors[] ) = 0;
  56. virtual void SetProfileData( const char *pProfileName, int numCounters, unsigned int *counters ) = 0;
  57. virtual int MemDump( const char *pDumpFileName ) = 0;
  58. virtual int TimeStampLog( float time, const char *pString ) = 0;
  59. virtual int MaterialList( int nMaterials, const xMaterialList_t *pXMaterialList ) = 0;
  60. virtual int TextureList( int nTextures, const xTextureList_t *pXTextureList ) = 0;
  61. virtual int SoundList( int nSounds, const xSoundList_t *pXSoundList ) = 0;
  62. virtual int MapInfo( const xMapInfo_t *pXMapInfo ) = 0;
  63. virtual int AddCommands( int numCommands, const char *commands[], const char* help[] ) = 0;
  64. virtual int ModelList( int nModels, const xModelList_t *pList ) = 0;
  65. virtual int DataCacheList( int nItems, const xDataCacheItem_t* pItems ) = 0;
  66. virtual int VProfNodeList( int nItems, const xVProfNodeItem_t *pItems ) = 0;
  67. virtual int TraceComplete( void ) = 0;
  68. virtual int BugReporter( void ) = 0;
  69. virtual bool SendBinaryData( const void *pData, int iDataSize, bool bAsync = true, DWORD dwSyncTimout = 15000 ) = 0; //returns false if sync call timed out or not connected. Otherwise true
  70. virtual int SyncDvdDevCache() = 0;
  71. virtual int SyncShaderCache() = 0;
  72. virtual int Version( int nVersion ) = 0;
  73. // // // PS3 specific
  74. // manually send a frame buffer across the DECI wire because the VRAM capture comes with all
  75. // sorts of untenable encumberances
  76. virtual void TransmitScreenshot( char *pFrameBuffer, uint32 uWidth, uint32 uHeight, uint32 uPitch, uint32 uColorFmt ) = 0;
  77. // send an arbitrary blob of data of a given length. You have to supply the prefix yourself (avoids an unnecessary additional copy).
  78. virtual int SendBinaryDECI( const uint8 *dbgCommand, uint length, bool bHaltOnError = true ) = 0;
  79. // a function that receives fake xbox messages
  80. typedef void (*fRemoteCommandSink_t)(const char *pRemoteCommandBuffer);
  81. // synchronous message pumping, could make an async thread in the future if necessary
  82. virtual void PumpMessage( fRemoteCommandSink_t ) = 0; // pump up to ONE remote command message synchronously
  83. // Add delegates that are called when the console is connected/disconnected to VXConsole
  84. typedef void (*fOnConnectDelegate_t)( void );
  85. typedef void (*fOnDisconnectDelegate_t)( void );
  86. virtual void AddOnConnectDelegate( fOnConnectDelegate_t pOnConnectDelegate ) = 0;
  87. virtual void AddOnDisconnectDelegate( fOnDisconnectDelegate_t pOnDisconnectDelegate ) = 0;
  88. };
  89. PLATFORM_INTERFACE IPS3Console *g_pValvePS3Console;
  90. PLATFORM_INTERFACE void ValvePS3ConsoleInit();
  91. PLATFORM_INTERFACE void ValvePS3ConsoleShutdown();
  92. #endif //PS3_CONSOLE_H