| 5241 | |
| 5242 | |
| 5243 | size_t Util_GetDebuggerText ( char* &pText_ ) |
| 5244 | { |
| 5245 | char *pBeg = &g_aTextScreen[0]; |
| 5246 | char *pEnd = &g_aTextScreen[0]; |
| 5247 | |
| 5248 | g_nTextScreen = 0; |
| 5249 | memset( pBeg, 0, sizeof( g_aTextScreen ) ); |
| 5250 | |
| 5251 | memset( g_aDebuggerVirtualTextScreen, 0, sizeof( g_aDebuggerVirtualTextScreen ) ); |
| 5252 | DebugDisplay(); |
| 5253 | |
| 5254 | for ( int y = 0; y < DEBUG_VIRTUAL_TEXT_HEIGHT; y++ ) |
| 5255 | { |
| 5256 | for ( int x = 0; x < DEBUG_VIRTUAL_TEXT_WIDTH; x++ ) |
| 5257 | { |
| 5258 | char c = g_aDebuggerVirtualTextScreen[y][x]; |
| 5259 | if ( (c < 0x20) || (c >= 0x7F) ) |
| 5260 | c = ' '; // convert null to spaces to keep everything non-proptional |
| 5261 | *pEnd++ = c; |
| 5262 | } |
| 5263 | #ifdef _WIN32 |
| 5264 | *pEnd++ = 0x0D; // CR // Windows inserts extra char |
| 5265 | #endif |
| 5266 | *pEnd++ = 0x0A; // LF // OSX, Linux |
| 5267 | } |
| 5268 | |
| 5269 | *pEnd = 0; |
| 5270 | g_nTextScreen = (int) (pEnd - pBeg); |
| 5271 | |
| 5272 | pText_ = pBeg; |
| 5273 | return g_nTextScreen; |
| 5274 | } |
| 5275 | |
| 5276 | size_t Util_GetTextScreen ( char* &pText_ ) |
| 5277 | { |