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.

52 lines
800 B

  1. //========= Copyright � , Valve Corporation, All rights reserved. ============//
  2. #ifndef DBGINPUT_HDR
  3. #define DBGINPUT_HDR
  4. #include "threadtools.h"
  5. #ifdef _PS3
  6. #include "sys/tty.h"
  7. #endif
  8. class CDebugInputThread: public CThread
  9. {
  10. public:
  11. CThreadMutex m_mx;
  12. CUtlString m_inputString;
  13. bool m_bStop;
  14. CDebugInputThread()
  15. {
  16. m_bStop = false;
  17. }
  18. ~CDebugInputThread()
  19. {
  20. }
  21. void Stop()
  22. {
  23. m_bStop = true;
  24. CThread::Stop();
  25. }
  26. virtual int Run( void )
  27. {
  28. #ifdef _PS3
  29. char buf[1000];
  30. uint read;
  31. while( !m_bStop && CELL_OK == sys_tty_read( SYS_TTYP3 , buf, sizeof(buf) - 1, &read ) )
  32. {
  33. m_mx.Lock();
  34. buf[ MIN( read, sizeof( buf ) - 1 ) ] = '\0';
  35. m_inputString = buf;
  36. m_mx.Unlock();
  37. }
  38. #endif
  39. return 0;
  40. }
  41. };
  42. extern CDebugInputThread * g_pDebugInputThread;
  43. #endif