2009-09-08 12:08:10 +00:00
|
|
|
/* PCSX2 - PS2 Emulator for PCs
|
|
|
|
* Copyright (C) 2002-2009 PCSX2 Dev Team
|
|
|
|
*
|
|
|
|
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU Lesser General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
2009-07-03 00:49:40 +00:00
|
|
|
*
|
2009-09-08 12:08:10 +00:00
|
|
|
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
2009-07-03 00:49:40 +00:00
|
|
|
*
|
2009-09-08 12:08:10 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along with PCSX2.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
2009-07-03 00:49:40 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "StringHelpers.h"
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Console Namespace -- For printing messages to the console.
|
|
|
|
//
|
|
|
|
// SysPrintf is depreciated; We should phase these in over time.
|
|
|
|
//
|
|
|
|
namespace Console
|
|
|
|
{
|
|
|
|
enum Colors
|
|
|
|
{
|
|
|
|
Color_Black = 0,
|
|
|
|
Color_Red,
|
|
|
|
Color_Green,
|
|
|
|
Color_Yellow,
|
|
|
|
Color_Blue,
|
|
|
|
Color_Magenta,
|
|
|
|
Color_Cyan,
|
|
|
|
Color_White
|
|
|
|
};
|
|
|
|
|
|
|
|
// va_args version of WriteLn, mostly for internal use only.
|
|
|
|
extern void __fastcall _WriteLn( Colors color, const char* fmt, va_list args );
|
|
|
|
|
|
|
|
extern void __fastcall SetTitle( const wxString& title );
|
|
|
|
|
|
|
|
// Changes the active console color.
|
|
|
|
// This color will be unset by calls to colored text methods
|
|
|
|
// such as ErrorMsg and Notice.
|
|
|
|
extern void __fastcall SetColor( Colors color );
|
|
|
|
|
|
|
|
// Restores the console color to default (usually low-intensity white on Win32)
|
|
|
|
extern void ClearColor();
|
|
|
|
|
|
|
|
// The following Write functions return bool so that we can use macros to exclude
|
|
|
|
// them from different build types. The return values are always zero.
|
|
|
|
|
|
|
|
// Writes a newline to the console.
|
|
|
|
extern bool Newline();
|
|
|
|
|
|
|
|
// Writes a line of colored text to the console, with automatic newline appendage.
|
|
|
|
// The console color is reset to default when the operation is complete.
|
2009-09-08 05:37:40 +00:00
|
|
|
extern bool WriteLn( Colors color, const char* fmt, ... );
|
2009-07-03 00:49:40 +00:00
|
|
|
|
|
|
|
// Writes a formatted message to the console, with appended newline.
|
2009-09-08 05:37:40 +00:00
|
|
|
extern bool WriteLn( const char* fmt, ... );
|
2009-07-03 00:49:40 +00:00
|
|
|
|
|
|
|
// Writes a line of colored text to the console (no newline).
|
|
|
|
// The console color is reset to default when the operation is complete.
|
2009-09-08 05:37:40 +00:00
|
|
|
extern bool Write( Colors color, const char* fmt, ... );
|
2009-07-03 00:49:40 +00:00
|
|
|
|
|
|
|
// Writes a formatted message to the console (no newline)
|
2009-09-08 05:37:40 +00:00
|
|
|
extern bool Write( const char* fmt, ... );
|
2009-07-03 00:49:40 +00:00
|
|
|
|
|
|
|
// Displays a message in the console with red emphasis.
|
|
|
|
// Newline is automatically appended.
|
2009-09-08 05:37:40 +00:00
|
|
|
extern bool Error( const char* fmt, ... );
|
2009-07-03 00:49:40 +00:00
|
|
|
|
|
|
|
// Displays a message in the console with yellow emphasis.
|
|
|
|
// Newline is automatically appended.
|
2009-09-08 05:37:40 +00:00
|
|
|
extern bool Notice( const char* fmt, ... );
|
2009-07-03 00:49:40 +00:00
|
|
|
|
|
|
|
// Displays a message in the console with yellow emphasis.
|
|
|
|
// Newline is automatically appended.
|
2009-09-08 05:37:40 +00:00
|
|
|
extern bool Status( const char* fmt, ... );
|
2009-07-03 00:49:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
extern bool __fastcall Write( const wxString& text );
|
|
|
|
extern bool __fastcall Write( Colors color, const wxString& text );
|
|
|
|
extern bool __fastcall WriteLn( const wxString& text );
|
|
|
|
extern bool __fastcall WriteLn( Colors color, const wxString& text );
|
|
|
|
|
|
|
|
extern bool __fastcall Error( const wxString& text );
|
|
|
|
extern bool __fastcall Notice( const wxString& text );
|
|
|
|
extern bool __fastcall Status( const wxString& text );
|
|
|
|
}
|
|
|
|
|
2009-07-16 09:58:17 +00:00
|
|
|
using Console::Color_Black;
|
2009-07-03 00:49:40 +00:00
|
|
|
using Console::Color_Red;
|
|
|
|
using Console::Color_Green;
|
|
|
|
using Console::Color_Blue;
|
|
|
|
using Console::Color_Magenta;
|
|
|
|
using Console::Color_Cyan;
|
|
|
|
using Console::Color_Yellow;
|
|
|
|
using Console::Color_White;
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// DevCon / DbgCon
|
|
|
|
|
|
|
|
#ifdef PCSX2_DEVBUILD
|
|
|
|
# define DevCon Console
|
|
|
|
# define DevMsg MsgBox
|
|
|
|
#else
|
|
|
|
# define DevCon 0&&Console
|
|
|
|
# define DevMsg
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef PCSX2_DEBUG
|
|
|
|
# define DbgCon Console
|
|
|
|
#else
|
|
|
|
# define DbgCon 0&&Console
|
|
|
|
#endif
|