mirror of https://github.com/PCSX2/pcsx2.git
wxgui: Fixed crash-on-exit problem in Release builds and made the console logger thread-safe (uses messages instead of direct wxFrame method invocations).
git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1529 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
94a4897624
commit
657660371c
|
@ -8,6 +8,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions="WIN32;__WXMSW__;_LIB;wxUSE_UNICODE=1"
|
||||
ExceptionHandling="2"
|
||||
CompileAs="0"
|
||||
/>
|
||||
</VisualStudioPropertySheet>
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/EHsc "
|
||||
AdditionalIncludeDirectories=""$(ProjectRootDir)\include";"$(ProjectRootDir)\include\msvc";"$(SvnRootDir)\3rdparty\zlib";"$(ProjectRootDir)\src\png""
|
||||
PreprocessorDefinitions="_DEBUG;__WXDEBUG__;wxUSE_BASE=0;wxUSE_GUI=1"
|
||||
UsePrecompiledHeader="2"
|
||||
|
@ -107,7 +106,6 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/EHsc "
|
||||
AdditionalIncludeDirectories="..\..\Include;..\..\Include\msvc;..\..\..\zlib;..\..\src\png"
|
||||
PreprocessorDefinitions="wxUSE_BASE=0;wxUSE_GUI=1"
|
||||
UsePrecompiledHeader="2"
|
||||
|
@ -171,7 +169,6 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/EHsc "
|
||||
AdditionalIncludeDirectories="..\..\Include;..\..\Include\msvc;..\..\..\zlib;..\..\src\png"
|
||||
PreprocessorDefinitions="wxUSE_BASE=0;wxUSE_GUI=1"
|
||||
UsePrecompiledHeader="2"
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/EHsc "
|
||||
AdditionalIncludeDirectories="..\..\Include;..\..\Include\msvc;..\..\..\zlib"
|
||||
PreprocessorDefinitions="wxUSE_GUI=0;wxUSE_BASE=1;NDEBUG"
|
||||
UsePrecompiledHeader="2"
|
||||
|
@ -105,7 +104,6 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/EHsc "
|
||||
AdditionalIncludeDirectories="..\..\Include;..\..\Include\msvc;..\..\..\zlib"
|
||||
PreprocessorDefinitions="_DEBUG;__WXDEBUG__;wxUSE_BASE=1;wxUSE_GUI=0"
|
||||
UsePrecompiledHeader="2"
|
||||
|
@ -170,7 +168,6 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/EHsc "
|
||||
Optimization="3"
|
||||
InlineFunctionExpansion="1"
|
||||
FavorSizeOrSpeed="2"
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/EHsc "
|
||||
AdditionalIncludeDirectories=""$(ProjectRootDir)\include";"$(ProjectRootDir)\include\msvc";"$(SvnRootDir)\3rdparty\zlib";"$(ProjectRootDir)\src\png""
|
||||
PreprocessorDefinitions="_DEBUG;__WXDEBUG__;wxUSE_BASE=0;wxUSE_GUI=1"
|
||||
UsePrecompiledHeader="2"
|
||||
|
@ -104,7 +103,6 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/EHsc "
|
||||
AdditionalIncludeDirectories="..\..\Include;..\..\Include\msvc;..\..\..\zlib;..\..\src\png"
|
||||
PreprocessorDefinitions="wxUSE_BASE=0;wxUSE_GUI=1"
|
||||
UsePrecompiledHeader="2"
|
||||
|
@ -168,7 +166,6 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/EHsc "
|
||||
AdditionalIncludeDirectories="..\..\Include;..\..\Include\msvc;..\..\..\zlib;..\..\src\png"
|
||||
PreprocessorDefinitions="wxUSE_BASE=0;wxUSE_GUI=1"
|
||||
UsePrecompiledHeader="2"
|
||||
|
|
|
@ -29,25 +29,6 @@
|
|||
|
||||
#include "Pcsx2Types.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Microsoft specific STL extensions for bounds checking and stuff: Enabled in devbuilds,
|
||||
// disabled in release builds. :)
|
||||
//
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(disable:4244) // disable warning C4244: '=' : conversion from 'big' to 'small', possible loss of data
|
||||
# ifdef PCSX2_DEVBUILD
|
||||
# undef _SECURE_SCL
|
||||
# define _SECURE_SCL 1
|
||||
# undef _SECURE_SCL_THROWS
|
||||
# define _SECURE_SCL_THROWS 1
|
||||
# else
|
||||
# undef _SECURE_SCL
|
||||
# define _SECURE_SCL 0
|
||||
# undef _SECURE_SCL_THROWS
|
||||
# define _SECURE_SCL_THROWS 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# include <intrin.h>
|
||||
#else
|
||||
|
@ -197,9 +178,10 @@
|
|||
# define PCSX2_ALIGNED16(x) __declspec(align(16)) x
|
||||
# define PCSX2_ALIGNED16_EXTERN(x) extern __declspec(align(16)) x
|
||||
|
||||
# define __naked __declspec(naked)
|
||||
# define __unused /*unused*/
|
||||
# define __noinline __declspec(noinline)
|
||||
# define __naked __declspec(naked)
|
||||
# define __unused /*unused*/
|
||||
# define __noinline __declspec(noinline)
|
||||
# define __threadlocal __declspec(thread)
|
||||
|
||||
// Don't know if there are Visual C++ equivalents of these.
|
||||
# define __hot
|
||||
|
@ -252,6 +234,7 @@ This theoretically unoptimizes. Not having much luck so far.
|
|||
# define __noinline __attribute__((noinline))
|
||||
# define __hot __attribute__((hot))
|
||||
# define __cold __attribute__((cold))
|
||||
# define __threadlocal __thread
|
||||
# define likely(x) __builtin_expect(!!(x), 1)
|
||||
# define unlikely(x) __builtin_expect(!!(x), 0)
|
||||
#endif
|
||||
|
|
|
@ -116,6 +116,7 @@ namespace Console
|
|||
extern bool __fastcall Status( const wxString& text );
|
||||
}
|
||||
|
||||
using Console::Color_Black;
|
||||
using Console::Color_Red;
|
||||
using Console::Color_Green;
|
||||
using Console::Color_Blue;
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "MemcpyFast.h"
|
||||
|
||||
extern void* __fastcall pcsx2_aligned_malloc(size_t size, size_t align);
|
||||
extern void* __fastcall pcsx2_aligned_realloc(void* handle, size_t size, size_t align);
|
||||
extern void pcsx2_aligned_free(void* pmem);
|
||||
|
|
|
@ -18,13 +18,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
//------------------------------------------------------------------
|
||||
#ifdef _MSC_VER
|
||||
#define __threadlocal __declspec(thread)
|
||||
#else
|
||||
#define __threadlocal __thread
|
||||
#endif
|
||||
|
||||
// Register counts for x86/32 mode:
|
||||
static const uint iREGCNT_XMM = 8;
|
||||
static const uint iREGCNT_GPR = 8;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="PCSX2_DEBUG"
|
||||
PreprocessorDefinitions="PCSX2_DEBUG;_SECURE_SCL_=1;_SECURE_SCL_THROWS=1"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
/>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
PreprocessorDefinitions="PCSX2_DEVEL;PCSX2_DEVBUILD;NDEBUG"
|
||||
PreprocessorDefinitions="PCSX2_DEVEL;PCSX2_DEVBUILD;NDEBUG;_SECURE_SCL_=1;_SECURE_SCL_THROWS=1"
|
||||
RuntimeLibrary="2"
|
||||
BufferSecurityCheck="false"
|
||||
/>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
WholeProgramOptimization="true"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
PreprocessorDefinitions="NDEBUG;_SECURE_SCL_=0;_SECURE_SCL_THROWS=0"
|
||||
StringPooling="true"
|
||||
MinimalRebuild="true"
|
||||
RuntimeLibrary="2"
|
||||
|
|
|
@ -80,7 +80,7 @@ FILE *_cdvdOpenMechaVer() {
|
|||
// use the bios filename to get the name of the mecha ver file
|
||||
// [TODO] : Upgrade this to use std::string!
|
||||
|
||||
strcpy(file, g_Conf.FullpathToBios().ToAscii().data() );
|
||||
strcpy(file, g_Conf->FullpathToBios().ToAscii().data() );
|
||||
|
||||
ptr = file;
|
||||
i = (int)strlen(file);
|
||||
|
@ -131,7 +131,7 @@ FILE *_cdvdOpenNVM() {
|
|||
// use the bios filename to get the name of the nvm file
|
||||
// [TODO] : Upgrade this to use std::string!
|
||||
|
||||
strcpy( file, g_Conf.FullpathToBios().ToAscii().data() );
|
||||
strcpy( file, g_Conf->FullpathToBios().ToAscii().data() );
|
||||
ptr = file;
|
||||
i = (int)strlen(file);
|
||||
|
||||
|
|
|
@ -222,4 +222,4 @@ protected:
|
|||
void LoadSave( IniInterface& ini );
|
||||
};
|
||||
|
||||
extern AppConfig g_Conf;
|
||||
extern AppConfig* g_Conf;
|
||||
|
|
|
@ -211,9 +211,9 @@ void iDumpBlock( int startpc, u8 * ptr )
|
|||
|
||||
Console::Status( "dump1 %x:%x, %x", params startpc, pc, cpuRegs.cycle );
|
||||
|
||||
g_Conf.Folders.Logs.Mkdir();
|
||||
g_Conf->Folders.Logs.Mkdir();
|
||||
AsciiFile eff(
|
||||
Path::Combine( g_Conf.Folders.Logs, wxsFormat(L"R5900dump%.8X.txt", startpc) ),
|
||||
Path::Combine( g_Conf->Folders.Logs, wxsFormat(L"R5900dump%.8X.txt", startpc) ),
|
||||
wxFile::write
|
||||
);
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ void loadBiosRom( const wxChar *ext, u8 *dest, long maxSize )
|
|||
long filesize;
|
||||
|
||||
// Try first a basic extension concatenation (normally results in something like name.bin.rom1)
|
||||
const wxString Bios( g_Conf.FullpathToBios() );
|
||||
const wxString Bios( g_Conf->FullpathToBios() );
|
||||
Bios1.Printf( L"%s.%s", Bios.c_str(), ext);
|
||||
|
||||
if( (filesize=Path::GetFileSize( Bios1 ) ) <= 0 )
|
||||
|
@ -102,7 +102,7 @@ void loadBiosRom( const wxChar *ext, u8 *dest, long maxSize )
|
|||
if( (filesize=Path::GetFileSize( Bios1 ) ) <= 0 )
|
||||
{
|
||||
// Try for the old-style method (rom1.bin)
|
||||
Bios1 = Path::Combine( g_Conf.Folders.Bios, (wxString)ext ) + L".bin";
|
||||
Bios1 = Path::Combine( g_Conf->Folders.Bios, (wxString)ext ) + L".bin";
|
||||
if( (filesize=Path::GetFileSize( Bios1 ) ) <= 0 )
|
||||
{
|
||||
Console::Notice( "Load Bios Warning: %s not found (this is not an error!)", params wxString(ext).ToAscii().data() );
|
||||
|
@ -801,7 +801,7 @@ void memReset()
|
|||
vtlb_VMap(0x00000000,0x00000000,0x20000000);
|
||||
vtlb_VMapUnmap(0x20000000,0x60000000);
|
||||
|
||||
wxString Bios( g_Conf.FullpathToBios() );
|
||||
wxString Bios( g_Conf->FullpathToBios() );
|
||||
|
||||
long filesize = Path::GetFileSize( Bios );
|
||||
if( filesize <= 0 )
|
||||
|
|
|
@ -61,7 +61,7 @@ bool MemoryCard::IsPresent( uint mcd )
|
|||
void MemoryCard::Load( uint mcd )
|
||||
{
|
||||
jASSUME( mcd < 2 );
|
||||
wxFileName fname( g_Conf.FullpathToMcd( mcd ) );
|
||||
wxFileName fname( g_Conf->FullpathToMcd( mcd ) );
|
||||
wxString str( fname.GetFullPath() );
|
||||
|
||||
if( !fname.FileExists() )
|
||||
|
|
|
@ -155,7 +155,7 @@ bool IsBIOS(const wxString& filename, wxString& description)
|
|||
uint fileOffset=0;
|
||||
romdir rd;
|
||||
|
||||
wxFileName Bios( g_Conf.Folders.Bios + filename );
|
||||
wxFileName Bios( g_Conf->Folders.Bios + filename );
|
||||
wxFile fp( Bios.GetFullPath().c_str() );
|
||||
|
||||
if( !fp.IsOpened() ) return FALSE;
|
||||
|
@ -343,7 +343,7 @@ void LoadGSState(const wxString& file)
|
|||
// file not found? try prefixing with sstates folder:
|
||||
if( !Path::IsRooted( file ) )
|
||||
{
|
||||
f = new gzLoadingState( Path::Combine( g_Conf.Folders.Savestates, file ) );
|
||||
f = new gzLoadingState( Path::Combine( g_Conf->Folders.Savestates, file ) );
|
||||
|
||||
// If this load attempt fails, then let the exception bubble up to
|
||||
// the caller to deal with...
|
||||
|
@ -386,7 +386,7 @@ char* mystrlwr( char* string )
|
|||
|
||||
static wxString GetGSStateFilename()
|
||||
{
|
||||
return Path::Combine( g_Conf.Folders.Savestates, wxsFormat( L"/%8.8X.%d.gs", ElfCRC, StatesC ) );
|
||||
return Path::Combine( g_Conf->Folders.Savestates, wxsFormat( L"/%8.8X.%d.gs", ElfCRC, StatesC ) );
|
||||
}
|
||||
|
||||
void CycleFrameLimit(int dir)
|
||||
|
@ -530,7 +530,7 @@ void ProcessFKeys(int fkey, struct KeyModifiers *keymod)
|
|||
|
||||
// note: VK_F5-VK_F7 are reserved for GS
|
||||
case 8:
|
||||
GSmakeSnapshot( g_Conf.Folders.Snapshots.ToAscii().data() );
|
||||
GSmakeSnapshot( g_Conf->Folders.Snapshots.ToAscii().data() );
|
||||
break;
|
||||
|
||||
case 9: //gsdx "on the fly" renderer switching
|
||||
|
@ -588,7 +588,7 @@ void ProcessFKeys(int fkey, struct KeyModifiers *keymod)
|
|||
name += L"_" + part2;
|
||||
|
||||
gsText.Printf( L"%s.%d.gs", name.c_str(), StatesC );
|
||||
Text = Path::Combine( g_Conf.Folders.Savestates, gsText );
|
||||
Text = Path::Combine( g_Conf->Folders.Savestates, gsText );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -627,9 +627,9 @@ void inifile_read( const char * name )
|
|||
patchnumber = 0;
|
||||
|
||||
#ifdef _WIN32
|
||||
sprintf( buffer, PATCHES_DIR "\\%s.pnach", name );
|
||||
sprintf( buffer, "patches\\%s.pnach", name );
|
||||
#else
|
||||
sprintf( buffer, PATCHES_DIR "/%s.pnach", name );
|
||||
sprintf( buffer, "patches/%s.pnach", name );
|
||||
#endif
|
||||
|
||||
f1 = fopen( buffer, "rt" );
|
||||
|
|
|
@ -34,26 +34,12 @@
|
|||
namespace Path
|
||||
{
|
||||
|
||||
#ifdef WIN32
|
||||
// Path Separator used when creating new paths.
|
||||
static const wxChar Separator( L'\\' );
|
||||
// Path separators used when breaking existing paths into parts and pieces.
|
||||
static const wxString Delimiters( L"\\/" );
|
||||
|
||||
static const wxChar SeparatorExt( L'.' );
|
||||
|
||||
#else
|
||||
static const wxChar Separator( '/');
|
||||
static const wxChar Delimiters( '/' );
|
||||
static const wxChar SeparatorExt( L'.' );
|
||||
#endif
|
||||
|
||||
static bool IsPathSeparator( wxChar src )
|
||||
{
|
||||
#ifdef WIN32
|
||||
return (src == Separator) || (src == L'/');
|
||||
return (src == wxFileName::GetPathSeparator()) || (src == L'/');
|
||||
#else
|
||||
return src == Separator;
|
||||
return src == wxFileName::GetPathSeparator();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -169,7 +155,7 @@ wxString ReplaceExtension( const wxString& src, const wxString& ext )
|
|||
{
|
||||
wxString dest;
|
||||
|
||||
int pos = src.find_last_of( SeparatorExt );
|
||||
int pos = src.find_last_of( L'.' );
|
||||
if( pos == wxString::npos || pos == 0 )
|
||||
dest = src;
|
||||
else
|
||||
|
@ -213,7 +199,7 @@ wxString GetDirectory( const wxString& src )
|
|||
// Example /this/that/something.txt -> dest == "/"
|
||||
wxString GetRootDirectory( const wxString& src )
|
||||
{
|
||||
int pos = src.find_first_of( Delimiters );
|
||||
int pos = src.find_first_of( wxFileName::GetPathSeparators() );
|
||||
if( pos == wxString::npos )
|
||||
return wxString();
|
||||
else
|
||||
|
|
|
@ -7,26 +7,6 @@
|
|||
extern char MAIN_DIR[g_MaxPath];
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Obsolete Values in wxWidgets Branch!
|
||||
// The following set of macros has been superceeded by the PathDefs and FilenameDefs namespaces,
|
||||
// and furethermore by a set of user-configurable paths in g_Conf.
|
||||
//
|
||||
#define DEFAULT_INIS_DIR "inis"
|
||||
#define DEFAULT_BIOS_DIR "bios"
|
||||
#define DEFAULT_PLUGINS_DIR "plugins"
|
||||
|
||||
#define MEMCARDS_DIR "memcards"
|
||||
#define PATCHES_DIR "patches"
|
||||
|
||||
#define SSTATES_DIR "sstates"
|
||||
#define LANGS_DIR "Langs"
|
||||
#define LOGS_DIR "logs"
|
||||
#define SNAPSHOTS_DIR "snaps"
|
||||
|
||||
#define DEFAULT_MEMCARD1 "Mcd001.ps2"
|
||||
#define DEFAULT_MEMCARD2 "Mcd002.ps2"
|
||||
|
||||
// Windows.h namespace pollution!
|
||||
#undef CreateDirectory
|
||||
|
||||
|
@ -163,12 +143,8 @@ namespace Path
|
|||
//
|
||||
namespace PathDefs
|
||||
{
|
||||
extern const wxDirName Snapshots;
|
||||
extern const wxDirName Savestates;
|
||||
extern const wxDirName MemoryCards;
|
||||
extern const wxDirName Settings;
|
||||
extern const wxDirName Plugins;
|
||||
extern const wxDirName Themes;
|
||||
// complete pathnames are returned by these functions
|
||||
// For 99% of all code, you should use these.
|
||||
|
||||
extern wxDirName GetDocuments();
|
||||
extern wxDirName GetSnapshots();
|
||||
|
@ -180,12 +156,24 @@ namespace PathDefs
|
|||
extern wxDirName GetSettings();
|
||||
extern wxDirName GetLogs();
|
||||
extern wxDirName GetThemes();
|
||||
|
||||
// Base folder names used to extend out the documents/approot folder base into a complete
|
||||
// path. These are typically for internal AppConfig use only, barring a few special cases.
|
||||
namespace Base
|
||||
{
|
||||
extern const wxDirName& Snapshots();
|
||||
extern const wxDirName& Savestates();
|
||||
extern const wxDirName& MemoryCards();
|
||||
extern const wxDirName& Settings();
|
||||
extern const wxDirName& Plugins();
|
||||
extern const wxDirName& Themes();
|
||||
}
|
||||
}
|
||||
|
||||
namespace FilenameDefs
|
||||
{
|
||||
extern wxFileName GetConfig();
|
||||
extern const wxFileName Memcard[2];
|
||||
extern const wxFileName& Memcard( int slot );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -50,7 +50,7 @@ static void PostLoadPrep()
|
|||
|
||||
wxString SaveState::GetFilename( int slot )
|
||||
{
|
||||
return (g_Conf.Folders.Savestates +
|
||||
return (g_Conf->Folders.Savestates +
|
||||
wxsFormat( L"%8.8X.%3.3d", ElfCRC, slot )).GetFullPath();
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ void SaveState::FreezeAll()
|
|||
|
||||
char descin[128];
|
||||
wxString descout;
|
||||
IsBIOS( g_Conf.FullpathToBios(), descout );
|
||||
IsBIOS( g_Conf->FullpathToBios(), descout );
|
||||
memcpy_fast( descin, descout.ToAscii().data(), 128 );
|
||||
Freeze( descin );
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ void statsOpen() {
|
|||
}
|
||||
|
||||
void statsClose() {
|
||||
/*
|
||||
time_t t;
|
||||
FILE *f;
|
||||
|
||||
|
@ -53,6 +54,7 @@ void statsClose() {
|
|||
else fprintf(f, "Recompiler Mode: VUrec1 %s, VUrec0 %s\n",
|
||||
CHECK_VU1REC ? "Enabled" : "Disabled", CHECK_VU0REC ? "Enabled" : "Disabled");
|
||||
fclose(f);
|
||||
*/
|
||||
}
|
||||
|
||||
void statsVSync() {
|
||||
|
|
|
@ -30,46 +30,66 @@ class IniInterface;
|
|||
|
||||
extern wxFileHistory* g_RecentIsoList;
|
||||
|
||||
class LogWriteEvent;
|
||||
|
||||
DECLARE_EVENT_TYPE(wxEVT_DockConsole, -1)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
class ConsoleLogFrame : public wxFrame, public NoncopyableObject
|
||||
{
|
||||
protected:
|
||||
wxTextCtrl& m_TextCtrl;
|
||||
class ColorArray : public NoncopyableObject
|
||||
{
|
||||
protected:
|
||||
SafeArray<wxTextAttr> m_table;
|
||||
wxTextAttr m_color_default;
|
||||
|
||||
public:
|
||||
ColorArray();
|
||||
const wxTextAttr& operator[]( Console::Colors coloridx ) const
|
||||
{
|
||||
return m_table[(int)coloridx];
|
||||
}
|
||||
|
||||
void SetFont( const wxFont& font );
|
||||
const wxTextAttr& Default() { return m_table[0]; }
|
||||
};
|
||||
|
||||
protected:
|
||||
wxTextCtrl& m_TextCtrl;
|
||||
ColorArray m_ColorTable;
|
||||
Console::Colors m_curcolor;
|
||||
|
||||
public:
|
||||
// ctor & dtor
|
||||
ConsoleLogFrame(MainEmuFrame *pParent, const wxString& szTitle);
|
||||
virtual ~ConsoleLogFrame();
|
||||
|
||||
virtual void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
protected:
|
||||
|
||||
// menu callbacks
|
||||
virtual void OnOpen (wxMenuEvent& event);
|
||||
virtual void OnClose(wxMenuEvent& event);
|
||||
virtual void OnSave (wxMenuEvent& event);
|
||||
virtual void OnClear(wxMenuEvent& event);
|
||||
|
||||
virtual void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
virtual void Write( const wxChar* text );
|
||||
virtual void Write( const char* text );
|
||||
|
||||
void Newline();
|
||||
void SetColor( Console::Colors color );
|
||||
void ClearColor();
|
||||
|
||||
protected:
|
||||
// use standard ids for our commands!
|
||||
enum
|
||||
{
|
||||
Menu_Close = wxID_CLOSE,
|
||||
Menu_Save = wxID_SAVE,
|
||||
Menu_Clear = wxID_CLEAR
|
||||
};
|
||||
|
||||
void OnWrite( wxCommandEvent& event );
|
||||
void OnNewline( wxCommandEvent& event );
|
||||
void OnSetTitle( wxCommandEvent& event );
|
||||
void OnDockedMove( wxCommandEvent& event );
|
||||
|
||||
// common part of OnClose() and OnCloseWindow()
|
||||
virtual void DoClose();
|
||||
|
||||
void OnMoveAround( wxMoveEvent& evt );
|
||||
void OnResize( wxSizeEvent& evt );
|
||||
|
||||
virtual void Write( const wxString& text );
|
||||
void SetColor( Console::Colors color );
|
||||
void ClearColor();
|
||||
};
|
||||
|
||||
|
||||
|
@ -121,7 +141,8 @@ class Pcsx2App : public wxApp
|
|||
{
|
||||
protected:
|
||||
MainEmuFrame* m_MainFrame;
|
||||
ConsoleLogFrame* m_ConsoleFrame;
|
||||
ConsoleLogFrame* m_ProgramLogBox;
|
||||
ConsoleLogFrame* m_Ps2ConLogBox;
|
||||
wxBitmap* m_Bitmap_Logo;
|
||||
|
||||
wxImageList m_ConfigImages;
|
||||
|
@ -152,8 +173,20 @@ public:
|
|||
return *m_MainFrame;
|
||||
}
|
||||
|
||||
ConsoleLogFrame* GetConsoleFrame() const { return m_ConsoleFrame; }
|
||||
void SetConsoleFrame( ConsoleLogFrame& frame ) { m_ConsoleFrame = &frame; }
|
||||
void ProgramLog_PostEvent( wxEvent& evt )
|
||||
{
|
||||
if( m_ProgramLogBox == NULL ) return;
|
||||
m_ProgramLogBox->GetEventHandler()->AddPendingEvent( evt );
|
||||
}
|
||||
|
||||
void ConsoleLog_PostEvent( wxEvent& evt )
|
||||
{
|
||||
if( m_Ps2ConLogBox == NULL ) return;
|
||||
m_Ps2ConLogBox->GetEventHandler()->AddPendingEvent( evt );
|
||||
}
|
||||
|
||||
//ConsoleLogFrame* GetConsoleFrame() const { return m_ProgramLogBox; }
|
||||
//void SetConsoleFrame( ConsoleLogFrame& frame ) { m_ProgramLogBox = &frame; }
|
||||
|
||||
protected:
|
||||
void ReadUserModeSettings();
|
||||
|
|
|
@ -31,25 +31,72 @@
|
|||
//
|
||||
namespace PathDefs
|
||||
{
|
||||
const wxDirName Snapshots ( L"snaps" );
|
||||
const wxDirName Savestates ( L"sstates" );
|
||||
const wxDirName MemoryCards ( L"memcards" );
|
||||
const wxDirName Settings ( L"inis" );
|
||||
const wxDirName Plugins ( L"plugins" );
|
||||
const wxDirName Logs ( L"logs" );
|
||||
const wxDirName Dumps ( L"dumps" );
|
||||
const wxDirName Themes ( L"themes" );
|
||||
namespace Base
|
||||
{
|
||||
const wxDirName& Snapshots()
|
||||
{
|
||||
static const wxDirName retval( L"snaps" );
|
||||
return retval;
|
||||
}
|
||||
|
||||
const wxDirName& Savestates()
|
||||
{
|
||||
static const wxDirName retval( L"sstates" );
|
||||
return retval;
|
||||
}
|
||||
|
||||
const wxDirName& MemoryCards()
|
||||
{
|
||||
static const wxDirName retval( L"memcards" );
|
||||
return retval;
|
||||
}
|
||||
|
||||
const wxDirName& Settings()
|
||||
{
|
||||
static const wxDirName retval( L"inis" );
|
||||
return retval;
|
||||
}
|
||||
|
||||
const wxDirName& Plugins()
|
||||
{
|
||||
static const wxDirName retval( L"plugins" );
|
||||
return retval;
|
||||
}
|
||||
|
||||
const wxDirName& Logs()
|
||||
{
|
||||
static const wxDirName retval( L"logs" );
|
||||
return retval;
|
||||
}
|
||||
|
||||
const wxDirName& Dumps()
|
||||
{
|
||||
static const wxDirName retval( L"dumps" );
|
||||
return retval;
|
||||
}
|
||||
|
||||
const wxDirName& Themes()
|
||||
{
|
||||
static const wxDirName retval( L"themes" );
|
||||
return retval;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Specifies the root folder for the application install.
|
||||
// (currently it's the CWD, but in the future I intend to move all binaries to a "bin"
|
||||
// sub folder, in which case the approot will become "..")
|
||||
const wxDirName AppRoot( "." ); // L".." );
|
||||
const wxDirName& AppRoot()
|
||||
{
|
||||
static const wxDirName retval( L"." );
|
||||
return retval;
|
||||
}
|
||||
|
||||
// Fetches the path location for user-consumable documents -- stuff users are likely to want to
|
||||
// share with other programs: screenshots, memory cards, and savestates.
|
||||
wxDirName GetDocuments()
|
||||
{
|
||||
if( g_Conf.UseAdminMode )
|
||||
if( g_Conf->UseAdminMode )
|
||||
return (wxDirName)wxGetCwd();
|
||||
else
|
||||
return (wxDirName)wxStandardPaths::Get().GetDocumentsDir() + (wxDirName)wxGetApp().GetAppName();
|
||||
|
@ -57,7 +104,7 @@ namespace PathDefs
|
|||
|
||||
wxDirName GetSnapshots()
|
||||
{
|
||||
return GetDocuments() + Snapshots;
|
||||
return GetDocuments() + Base::Snapshots();
|
||||
}
|
||||
|
||||
wxDirName GetBios()
|
||||
|
@ -67,32 +114,32 @@ namespace PathDefs
|
|||
|
||||
wxDirName GetSavestates()
|
||||
{
|
||||
return GetDocuments() + Savestates;
|
||||
return GetDocuments() + Base::Savestates();
|
||||
}
|
||||
|
||||
wxDirName GetMemoryCards()
|
||||
{
|
||||
return GetDocuments() + MemoryCards;
|
||||
return GetDocuments() + Base::MemoryCards();
|
||||
}
|
||||
|
||||
wxDirName GetPlugins()
|
||||
{
|
||||
return AppRoot + Plugins;
|
||||
return AppRoot() + Base::Plugins();
|
||||
}
|
||||
|
||||
wxDirName GetSettings()
|
||||
{
|
||||
return GetDocuments() + Settings;
|
||||
return GetDocuments() + Base::Settings();
|
||||
}
|
||||
|
||||
wxDirName GetThemes()
|
||||
{
|
||||
return AppRoot + Themes;
|
||||
return AppRoot() + Base::Themes();
|
||||
}
|
||||
|
||||
wxDirName GetLogs()
|
||||
{
|
||||
return GetDocuments() + Logs;
|
||||
return GetDocuments() + Base::Logs();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -108,11 +155,19 @@ namespace FilenameDefs
|
|||
return wxGetApp().GetAppName() + L".ini";
|
||||
}
|
||||
|
||||
const wxFileName Memcard[2] =
|
||||
const wxFileName& Memcard( int slot )
|
||||
{
|
||||
wxFileName( L"Mcd001.ps2" ),
|
||||
wxFileName( L"Mcd002.ps2" )
|
||||
};
|
||||
static const wxFileName retval[2] =
|
||||
{
|
||||
wxFileName( L"Mcd001.ps2" ),
|
||||
wxFileName( L"Mcd002.ps2" )
|
||||
};
|
||||
|
||||
if( IsDevBuild && ((uint)slot) < 2 )
|
||||
throw Exception::IndexBoundsFault( L"FilenameDefs::Memcard", slot, 2 );
|
||||
|
||||
return retval[slot];
|
||||
}
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -314,18 +369,6 @@ void AppConfig::FolderOptions::LoadSave( IniInterface& ini )
|
|||
ini.SetPath( L".." );
|
||||
}
|
||||
|
||||
const wxString g_PluginNames[] =
|
||||
{
|
||||
L"CDVD",
|
||||
L"GS",
|
||||
L"PAD1",
|
||||
L"PAD2",
|
||||
L"SPU2",
|
||||
L"USB",
|
||||
L"FW",
|
||||
L"DEV9"
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
const wxFileName& AppConfig::FilenameOptions::operator[]( PluginsEnum_t pluginidx ) const
|
||||
{
|
||||
|
@ -339,7 +382,18 @@ void AppConfig::FilenameOptions::LoadSave( IniInterface& ini )
|
|||
{
|
||||
ini.SetPath( L"Filenames" );
|
||||
|
||||
const wxFileName pc( L"Please Configure" );
|
||||
static const wxFileName pc( L"Please Configure" );
|
||||
static const wxString g_PluginNames[] =
|
||||
{
|
||||
L"CDVD",
|
||||
L"GS",
|
||||
L"PAD1",
|
||||
L"PAD2",
|
||||
L"SPU2",
|
||||
L"USB",
|
||||
L"FW",
|
||||
L"DEV9"
|
||||
};
|
||||
|
||||
for( int i=0; i<PluginId_Count; ++i )
|
||||
{
|
||||
|
|
|
@ -19,15 +19,28 @@
|
|||
#include "PrecompiledHeader.h"
|
||||
#include "App.h"
|
||||
#include "MainFrame.h"
|
||||
#include "Utilities/Console.h"
|
||||
#include "DebugTools/Debug.h"
|
||||
|
||||
#include <wx/file.h>
|
||||
#include <wx/textfile.h>
|
||||
|
||||
// This code was 'borrowed' from wxWidgets and then heavily modified to suite
|
||||
// our needs. I would have used some crafty subclassing instead except who
|
||||
// ever wrote the code of wxWidgets had a peculiar love of the 'private' keyword,
|
||||
// thus killing any possibility of subclassing in a useful manner.
|
||||
// This code was 'borrowed' from wxWidgets built in console log class and then heavily
|
||||
// modified to suite our needs. I would have used some crafty subclassing instead except
|
||||
// who ever wrote the code of wxWidgets had a peculiar love of the 'private' keyword,
|
||||
// thus killing any possibility of subclassing in a useful manner. (sigh)
|
||||
|
||||
|
||||
DECLARE_EVENT_TYPE(wxEVT_LOG_Write, -1)
|
||||
DECLARE_EVENT_TYPE(wxEVT_LOG_Newline, -1)
|
||||
DECLARE_EVENT_TYPE(wxEVT_SetTitleText, -1)
|
||||
|
||||
DEFINE_EVENT_TYPE(wxEVT_LOG_Write)
|
||||
DEFINE_EVENT_TYPE(wxEVT_LOG_Newline)
|
||||
DEFINE_EVENT_TYPE(wxEVT_SetTitleText)
|
||||
DEFINE_EVENT_TYPE(wxEVT_DockConsole)
|
||||
|
||||
using Console::Colors;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// pass an uninitialized file object, the function will ask the user for the
|
||||
|
@ -72,22 +85,44 @@ static bool OpenLogFile(wxFile& file, wxString& filename, wxWindow *parent)
|
|||
return file.Create(filename);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// ------------------------------------------------------------------------
|
||||
ConsoleLogFrame::ColorArray::ColorArray() :
|
||||
m_table( 8 )
|
||||
{
|
||||
// Standard R, G, B format:
|
||||
new (&m_table[Color_Black]) wxTextAttr( wxColor( 0, 0, 0 ) );
|
||||
new (&m_table[Color_Red]) wxTextAttr( wxColor( 128, 0, 0 ) );
|
||||
new (&m_table[Color_Green]) wxTextAttr( wxColor( 0, 128, 0 ) );
|
||||
new (&m_table[Color_Blue]) wxTextAttr( wxColor( 0, 0, 128 ) );
|
||||
new (&m_table[Color_Yellow])wxTextAttr( wxColor( 180, 180, 0 ) );
|
||||
new (&m_table[Color_Cyan]) wxTextAttr( wxColor( 0, 160, 160 ) );
|
||||
new (&m_table[Color_Magenta])wxTextAttr( wxColor( 160, 0, 160 ) );
|
||||
new (&m_table[Color_White]) wxTextAttr( wxColor( 160, 160, 160 ) );
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::ColorArray::SetFont( const wxFont& font )
|
||||
{
|
||||
for( int i=0; i<8; ++i )
|
||||
m_table[i].SetFont( font );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
ConsoleLogFrame::ConsoleLogFrame(MainEmuFrame *parent, const wxString& title) :
|
||||
wxFrame(parent, wxID_ANY, title),
|
||||
m_TextCtrl( *new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
wxFrame(parent, wxID_ANY, title)
|
||||
, m_TextCtrl( *new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_MULTILINE | wxHSCROLL | wxTE_READONLY | wxTE_RICH2 ) )
|
||||
, m_ColorTable()
|
||||
, m_curcolor( Color_Black )
|
||||
{
|
||||
m_TextCtrl.SetBackgroundColour( wxColor( 238, 240, 248 ) ); //wxColor( 48, 48, 64 ) );
|
||||
|
||||
// create menu
|
||||
wxMenuBar *pMenuBar = new wxMenuBar;
|
||||
wxMenu *pMenu = new wxMenu;
|
||||
pMenu->Append(Menu_Save, L"&Save...", L"Save log contents to file");
|
||||
pMenu->Append(Menu_Clear, L"C&lear", L"Clear the log contents");
|
||||
pMenu->Append(wxID_SAVE, L"&Save...", _("Save log contents to file"));
|
||||
pMenu->Append(wxID_CLEAR, L"C&lear", _("Clear the log contents"));
|
||||
pMenu->AppendSeparator();
|
||||
pMenu->Append(Menu_Close, L"&Close",L"Close this window");
|
||||
pMenu->Append(wxID_CLOSE, L"&Close", _("Close this window"));
|
||||
|
||||
pMenuBar->Append(pMenu, L"&Log");
|
||||
SetMenuBar(pMenuBar);
|
||||
|
@ -95,14 +130,31 @@ ConsoleLogFrame::ConsoleLogFrame(MainEmuFrame *parent, const wxString& title) :
|
|||
// status bar for menu prompts
|
||||
CreateStatusBar();
|
||||
ClearColor();
|
||||
|
||||
// Sync with configuration settings:
|
||||
|
||||
wxASSERT_MSG( g_Conf != NULL, L"Console Log Frames must be created AFTER the configuration has been loaded" );
|
||||
if( g_Conf != NULL )
|
||||
{
|
||||
SetSize( wxRect( g_Conf->ConLogBox.DisplayPosition, g_Conf->ConLogBox.DisplaySize ) );
|
||||
Show( g_Conf->ConLogBox.Visible );
|
||||
}
|
||||
|
||||
Connect( Menu_Close, wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( ConsoleLogFrame::OnClose ) );
|
||||
Connect( Menu_Save, wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( ConsoleLogFrame::OnSave ) );
|
||||
Connect( Menu_Clear, wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( ConsoleLogFrame::OnClear ) );
|
||||
// Bind Events:
|
||||
|
||||
Connect( wxID_OPEN, wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( ConsoleLogFrame::OnOpen ) );
|
||||
Connect( wxID_CLOSE, wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( ConsoleLogFrame::OnClose ) );
|
||||
Connect( wxID_SAVE, wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( ConsoleLogFrame::OnSave ) );
|
||||
Connect( wxID_CLEAR, wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( ConsoleLogFrame::OnClear ) );
|
||||
|
||||
Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler(ConsoleLogFrame::OnCloseWindow) );
|
||||
Connect( wxEVT_MOVE, wxMoveEventHandler(ConsoleLogFrame::OnMoveAround) );
|
||||
Connect( wxEVT_SIZE, wxSizeEventHandler(ConsoleLogFrame::OnResize) );
|
||||
|
||||
Connect( wxEVT_LOG_Write, wxCommandEventHandler(ConsoleLogFrame::OnWrite) );
|
||||
Connect( wxEVT_LOG_Newline, wxCommandEventHandler(ConsoleLogFrame::OnNewline) );
|
||||
Connect( wxEVT_SetTitleText, wxCommandEventHandler(ConsoleLogFrame::OnSetTitle) );
|
||||
Connect( wxEVT_DockConsole, wxCommandEventHandler(ConsoleLogFrame::OnDockedMove) );
|
||||
}
|
||||
|
||||
ConsoleLogFrame::~ConsoleLogFrame() { }
|
||||
|
@ -112,18 +164,24 @@ void ConsoleLogFrame::OnMoveAround( wxMoveEvent& evt )
|
|||
// Docking check! If the window position is within some amount
|
||||
// of the main window, enable docking.
|
||||
|
||||
wxPoint topright( GetParent()->GetRect().GetTopRight() );
|
||||
wxRect snapzone( topright - wxSize( 8,8 ), wxSize( 16,16 ) );
|
||||
|
||||
if( snapzone.Contains( GetPosition() ) )
|
||||
SetPosition( topright + wxSize( 1,0 ) );
|
||||
if( wxFrame* main = wxGetApp().GetMainWindow() )
|
||||
{
|
||||
wxPoint topright( main->GetRect().GetTopRight() );
|
||||
wxRect snapzone( topright - wxSize( 8,8 ), wxSize( 16,16 ) );
|
||||
|
||||
g_Conf->ConLogBox.AutoDock = snapzone.Contains( GetPosition() );
|
||||
if( g_Conf->ConLogBox.AutoDock )
|
||||
{
|
||||
SetPosition( topright + wxSize( 1,0 ) );
|
||||
g_Conf->ConLogBox.AutoDock = true;
|
||||
}
|
||||
}
|
||||
evt.Skip();
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::OnResize( wxSizeEvent& evt )
|
||||
{
|
||||
g_Conf.ConLogBox.DisplaySize = GetSize();
|
||||
g_Conf->ConLogBox.DisplaySize = GetSize();
|
||||
evt.Skip();
|
||||
}
|
||||
|
||||
|
@ -131,12 +189,27 @@ void ConsoleLogFrame::DoClose()
|
|||
{
|
||||
// instead of closing just hide the window to be able to Show() it later
|
||||
Show(false);
|
||||
if( GetParent() != NULL )
|
||||
wxStaticCast( GetParent(), MainEmuFrame )->OnLogBoxHidden();
|
||||
if( wxFrame* main = wxGetApp().GetMainWindow() )
|
||||
wxStaticCast( main, MainEmuFrame )->OnLogBoxHidden();
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::OnClose(wxMenuEvent& WXUNUSED(event)) { DoClose(); }
|
||||
void ConsoleLogFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) { DoClose(); }
|
||||
void ConsoleLogFrame::OnOpen(wxMenuEvent& WXUNUSED(event))
|
||||
{
|
||||
Show(true);
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::OnClose( wxMenuEvent& event )
|
||||
{
|
||||
|
||||
DoClose();
|
||||
}
|
||||
void ConsoleLogFrame::OnCloseWindow(wxCloseEvent& event)
|
||||
{
|
||||
if( event.CanVeto() )
|
||||
DoClose();
|
||||
else
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::OnSave(wxMenuEvent& WXUNUSED(event))
|
||||
{
|
||||
|
@ -169,38 +242,43 @@ void ConsoleLogFrame::OnClear(wxMenuEvent& WXUNUSED(event))
|
|||
m_TextCtrl.Clear();
|
||||
}
|
||||
|
||||
static const wxTextAttr tbl_color_codes[] =
|
||||
void ConsoleLogFrame::SetColor( Colors color )
|
||||
{
|
||||
// Standard R, G, B format:
|
||||
wxTextAttr( wxColor( 0, 0, 0 ) ),
|
||||
wxTextAttr( wxColor( 128, 0, 0 ) ),
|
||||
wxTextAttr( wxColor( 0,128, 0 ) ),
|
||||
wxTextAttr( wxColor( 180,180, 0 ) ),
|
||||
wxTextAttr( wxColor( 0, 0,128 ) ),
|
||||
wxTextAttr( wxColor( 0,160,160 ) ),
|
||||
wxTextAttr( wxColor( 160,160,160 ) )
|
||||
};
|
||||
|
||||
static const wxTextAttr color_default( wxColor( 0, 0, 0 ) );
|
||||
|
||||
// Note: SetColor currently does not work on Win32, but I suspect it *should* work when
|
||||
// we enable unicode compilation. (I really hope!)
|
||||
void ConsoleLogFrame::SetColor( Console::Colors color )
|
||||
{
|
||||
m_TextCtrl.SetDefaultStyle( tbl_color_codes[(int)color] );
|
||||
m_TextCtrl.SetDefaultStyle( m_ColorTable[color] );
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::ClearColor()
|
||||
{
|
||||
m_TextCtrl.SetDefaultStyle( color_default );
|
||||
m_TextCtrl.SetDefaultStyle( m_ColorTable.Default() );
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::Newline()
|
||||
void ConsoleLogFrame::OnWrite( wxCommandEvent& event )
|
||||
{
|
||||
Write( L"\n");
|
||||
Colors color = (Colors)event.GetExtraLong();
|
||||
|
||||
if( color != m_curcolor )
|
||||
m_TextCtrl.SetDefaultStyle( m_ColorTable[m_curcolor=color] );
|
||||
|
||||
Write( event.GetString() );
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::Write( const wxChar* text )
|
||||
void ConsoleLogFrame::OnNewline( wxCommandEvent& event )
|
||||
{
|
||||
Write( L"\n" );
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::OnSetTitle( wxCommandEvent& event )
|
||||
{
|
||||
SetTitle( event.GetString() );
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::OnDockedMove( wxCommandEvent& event )
|
||||
{
|
||||
if( g_Conf != NULL )
|
||||
SetPosition( g_Conf->ConLogBox.DisplayPosition );
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::Write( const wxString& text )
|
||||
{
|
||||
// remove selection (WriteText is in fact ReplaceSelection)
|
||||
#ifdef __WXMSW__
|
||||
|
@ -211,70 +289,67 @@ void ConsoleLogFrame::Write( const wxChar* text )
|
|||
m_TextCtrl.AppendText( text );
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::Write( const char* text )
|
||||
{
|
||||
// remove selection (WriteText is in fact ReplaceSelection)
|
||||
#ifdef __WXMSW__
|
||||
wxTextPos nLen = m_TextCtrl.GetLastPosition();
|
||||
m_TextCtrl.SetSelection(nLen, nLen);
|
||||
#endif
|
||||
|
||||
m_TextCtrl.AppendText( wxString::FromAscii(text) );
|
||||
}
|
||||
|
||||
namespace Console
|
||||
{
|
||||
__threadlocal Colors th_CurrentColor = Color_Black;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
void __fastcall SetTitle( const wxString& title )
|
||||
{
|
||||
if( ConsoleLogFrame* FrameHandle = wxGetApp().GetConsoleFrame() )
|
||||
FrameHandle->SetTitle( title );
|
||||
wxCommandEvent evt( wxEVT_SetTitleText );
|
||||
evt.SetString( title );
|
||||
wxGetApp().ProgramLog_PostEvent( evt );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
void __fastcall SetColor( Colors color )
|
||||
{
|
||||
if( ConsoleLogFrame* FrameHandle = wxGetApp().GetConsoleFrame() )
|
||||
FrameHandle->SetColor( color );
|
||||
th_CurrentColor = color;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
void ClearColor()
|
||||
{
|
||||
if( ConsoleLogFrame* FrameHandle = wxGetApp().GetConsoleFrame() )
|
||||
FrameHandle->ClearColor();
|
||||
th_CurrentColor = Color_Black;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
bool Newline()
|
||||
{
|
||||
if( ConsoleLogFrame* FrameHandle = wxGetApp().GetConsoleFrame() )
|
||||
FrameHandle->Newline();
|
||||
|
||||
if( emuLog != NULL )
|
||||
fputs( "\n", emuLog );
|
||||
|
||||
wxCommandEvent evt( wxEVT_LOG_Newline );
|
||||
wxGetApp().ProgramLog_PostEvent( evt );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
bool __fastcall Write( const char* fmt )
|
||||
{
|
||||
if( ConsoleLogFrame* FrameHandle = wxGetApp().GetConsoleFrame() )
|
||||
FrameHandle->Write( fmt );
|
||||
|
||||
if( emuLog != NULL )
|
||||
fputs( fmt, emuLog );
|
||||
|
||||
wxCommandEvent evt( wxEVT_LOG_Write );
|
||||
evt.SetString( wxString::FromAscii( fmt ) );
|
||||
evt.SetExtraLong( th_CurrentColor );
|
||||
wxGetApp().ProgramLog_PostEvent( evt );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
bool __fastcall Write( const wxString& fmt )
|
||||
{
|
||||
if( ConsoleLogFrame* FrameHandle = wxGetApp().GetConsoleFrame() )
|
||||
FrameHandle->Write( fmt );
|
||||
|
||||
if( emuLog != NULL )
|
||||
fputs( fmt.ToAscii().data(), emuLog );
|
||||
|
||||
wxCommandEvent evt( wxEVT_LOG_Write );
|
||||
evt.SetString( fmt );
|
||||
evt.SetExtraLong( th_CurrentColor );
|
||||
wxGetApp().ProgramLog_PostEvent( evt );
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ Dialogs::ConfigurationDialog::~ConfigurationDialog()
|
|||
|
||||
bool Dialogs::ConfigurationDialog::ApplySettings()
|
||||
{
|
||||
AppConfig confcopy( g_Conf );
|
||||
AppConfig confcopy( *g_Conf );
|
||||
|
||||
int pagecount = m_listbook.GetPageCount();
|
||||
for( int i=0; i<pagecount; ++i )
|
||||
|
@ -79,9 +79,9 @@ bool Dialogs::ConfigurationDialog::ApplySettings()
|
|||
if( !panel->Apply( confcopy ) ) return false;
|
||||
}
|
||||
|
||||
g_Conf = confcopy;
|
||||
g_Conf.Apply();
|
||||
g_Conf.Save();
|
||||
*g_Conf = confcopy;
|
||||
g_Conf->Apply();
|
||||
g_Conf->Save();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ wxMenu* MainEmuFrame::MakeIsoMenu()
|
|||
|
||||
// Add in the recent files!
|
||||
|
||||
/*const StringListNode* cruise = g_Conf.RecentIsos;
|
||||
/*const StringListNode* cruise = g_Conf->RecentIsos;
|
||||
|
||||
int i = 0;
|
||||
int threshold = 15;
|
||||
|
@ -117,8 +117,11 @@ wxMenu* MainEmuFrame::MakeIsoMenu()
|
|||
mnuIso->Append( Menu_Iso_Recent+i, Path::GetFilename( ellipsized ), *cruise->item );
|
||||
}*/
|
||||
|
||||
g_RecentIsoList->UseMenu( mnuIso );
|
||||
g_RecentIsoList->AddFilesToMenu( mnuIso );
|
||||
if( g_RecentIsoList != NULL )
|
||||
{
|
||||
g_RecentIsoList->UseMenu( mnuIso );
|
||||
g_RecentIsoList->AddFilesToMenu( mnuIso );
|
||||
}
|
||||
return mnuIso;
|
||||
}
|
||||
|
||||
|
@ -156,22 +159,45 @@ void MainEmuFrame::PopulatePadMenu()
|
|||
m_menuPad.Append( Menu_Pad_Advanced, _T("Advanced..."), wxEmptyString, wxITEM_NORMAL );
|
||||
}
|
||||
|
||||
#define ConnectMenu( id, handler ) \
|
||||
Connect( id, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainEmuFrame::handler) )
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Close out the console log windows along with the main emu window.
|
||||
// Note: This event only happens after a close event has occured and was *not* veto'd. Ie,
|
||||
// it means it's time to provide an unconditional closure of said window.
|
||||
//
|
||||
void MainEmuFrame::OnCloseWindow(wxCloseEvent& evt)
|
||||
{
|
||||
wxCloseEvent conevt( wxEVT_CLOSE_WINDOW );
|
||||
conevt.SetCanVeto( false ); // tells the console to close rather than hide
|
||||
wxGetApp().ProgramLog_PostEvent( conevt );
|
||||
evt.Skip();
|
||||
}
|
||||
|
||||
void MainEmuFrame::OnMoveAround( wxMoveEvent& evt )
|
||||
{
|
||||
if( g_Conf.ConLogBox.AutoDock )
|
||||
m_logbox.SetPosition( g_Conf.ConLogBox.DisplayPosition = GetPosition() + wxSize( GetSize().x, 0 ) );
|
||||
if( g_Conf->ConLogBox.AutoDock )
|
||||
{
|
||||
g_Conf->ConLogBox.DisplayPosition = GetPosition() + wxSize( GetSize().x, 0 );
|
||||
|
||||
// Send the move event our window ID, which allows the logbox to know that this
|
||||
// move event comes from us, and needs a special handler.
|
||||
wxCommandEvent evt( wxEVT_DockConsole );
|
||||
wxGetApp().ConsoleLog_PostEvent( evt );
|
||||
}
|
||||
|
||||
//evt.Skip();
|
||||
}
|
||||
|
||||
void MainEmuFrame::OnLogBoxHidden()
|
||||
{
|
||||
g_Conf->ConLogBox.Visible = false;
|
||||
m_MenuItem_Console.Check( false );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
void MainEmuFrame::ConnectMenus()
|
||||
{
|
||||
Connect( wxEVT_MOVE, wxMoveEventHandler(MainEmuFrame::OnMoveAround) );
|
||||
#define ConnectMenu( id, handler ) \
|
||||
Connect( id, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainEmuFrame::handler) )
|
||||
|
||||
ConnectMenu( Menu_Config_Settings, Menu_ConfigSettings_Click );
|
||||
ConnectMenu( Menu_RunWithoutDisc, Menu_RunWithoutDisc_Click );
|
||||
|
@ -180,42 +206,33 @@ void MainEmuFrame::ConnectMenus()
|
|||
|
||||
Connect( wxID_FILE1, wxID_FILE1+20, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainEmuFrame::Menu_IsoRecent_Click) );
|
||||
|
||||
ConnectMenu( Menu_RunELF, Menu_OpenELF_Click );
|
||||
ConnectMenu( Menu_Run_Exit, Menu_Exit_Click );
|
||||
ConnectMenu( Menu_RunELF, Menu_OpenELF_Click );
|
||||
ConnectMenu( Menu_Run_Exit, Menu_Exit_Click );
|
||||
|
||||
ConnectMenu( Menu_SuspendExec, Menu_Suspend_Click );
|
||||
ConnectMenu( Menu_ResumeExec, Menu_Resume_Click );
|
||||
ConnectMenu( Menu_Reset, Menu_Reset_Click );
|
||||
ConnectMenu( Menu_SuspendExec, Menu_Suspend_Click );
|
||||
ConnectMenu( Menu_ResumeExec, Menu_Resume_Click );
|
||||
ConnectMenu( Menu_Reset, Menu_Reset_Click );
|
||||
|
||||
ConnectMenu( Menu_State_LoadOther, Menu_LoadStateOther_Click );
|
||||
ConnectMenu( Menu_State_SaveOther, Menu_SaveStateOther_Click );
|
||||
ConnectMenu( Menu_State_LoadOther, Menu_LoadStateOther_Click );
|
||||
ConnectMenu( Menu_State_SaveOther, Menu_SaveStateOther_Click );
|
||||
|
||||
ConnectMenu( Menu_Config_Gamefixes, Menu_Gamefixes_Click );
|
||||
ConnectMenu( Menu_Config_SpeedHacks, Menu_Speedhacks_Click );
|
||||
ConnectMenu( Menu_Config_Gamefixes, Menu_Gamefixes_Click );
|
||||
ConnectMenu( Menu_Config_SpeedHacks,Menu_Speedhacks_Click );
|
||||
|
||||
|
||||
ConnectMenu( Menu_Debug_Open, Menu_Debug_Open_Click );
|
||||
ConnectMenu( Menu_Debug_MemoryDump, Menu_Debug_MemoryDump_Click );
|
||||
ConnectMenu( Menu_Debug_Logging, Menu_Debug_Logging_Click );
|
||||
ConnectMenu( Menu_Debug_Open, Menu_Debug_Open_Click );
|
||||
ConnectMenu( Menu_Debug_MemoryDump, Menu_Debug_MemoryDump_Click );
|
||||
ConnectMenu( Menu_Debug_Logging, Menu_Debug_Logging_Click );
|
||||
|
||||
ConnectMenu( Menu_Console, Menu_ShowConsole );
|
||||
ConnectMenu( Menu_Console, Menu_ShowConsole );
|
||||
|
||||
ConnectMenu( Menu_About, Menu_ShowAboutBox );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
void MainEmuFrame::OnLogBoxHidden()
|
||||
{
|
||||
g_Conf.ConLogBox.Visible = false;
|
||||
m_MenuItem_Console.Check( false );
|
||||
ConnectMenu( Menu_About, Menu_ShowAboutBox );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
MainEmuFrame::MainEmuFrame(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
|
||||
wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE & ~(wxMAXIMIZE_BOX | wxRESIZE_BORDER) ),
|
||||
|
||||
m_logbox( this, L"PCSX2 Log" ),
|
||||
|
||||
m_statusbar( *CreateStatusBar(2, 0) ),
|
||||
m_background( this, wxID_ANY, wxGetApp().GetLogoBitmap() ),
|
||||
|
||||
|
@ -237,9 +254,6 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, int id, const wxString& title, cons
|
|||
|
||||
m_MenuItem_Console( *new wxMenuItem( &m_menuMisc, Menu_Console, L"Show Console", wxEmptyString, wxITEM_CHECK ) )
|
||||
{
|
||||
|
||||
wxGetApp().SetConsoleFrame( m_logbox );
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Initial menubar setup. This needs to be done first so that the menu bar's visible size
|
||||
// can be factored into the window size (which ends up being background+status+menus)
|
||||
|
@ -279,33 +293,30 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, int id, const wxString& title, cons
|
|||
wxRect screenzone( wxPoint(), wxGetDisplaySize() );
|
||||
|
||||
// Use default window position if the configured windowpos is invalid (partially offscreen)
|
||||
if( g_Conf.MainGuiPosition == wxDefaultPosition || !screenzone.Contains( wxRect( g_Conf.MainGuiPosition, GetSize() ) ) )
|
||||
g_Conf.MainGuiPosition = GetPosition();
|
||||
if( g_Conf->MainGuiPosition == wxDefaultPosition || !screenzone.Contains( wxRect( g_Conf->MainGuiPosition, GetSize() ) ) )
|
||||
g_Conf->MainGuiPosition = GetPosition();
|
||||
else
|
||||
SetPosition( g_Conf.MainGuiPosition );
|
||||
SetPosition( g_Conf->MainGuiPosition );
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Sort out the console log window position (must be done after fitting the window
|
||||
// sizer, to ensure correct 'docked mode' positioning).
|
||||
|
||||
g_Conf.ConLogBox.DisplaySize.Set(
|
||||
std::min( std::max( g_Conf.ConLogBox.DisplaySize.GetWidth(), 160 ), screenzone.GetWidth() ),
|
||||
std::min( std::max( g_Conf.ConLogBox.DisplaySize.GetHeight(), 160 ), screenzone.GetHeight() )
|
||||
g_Conf->ConLogBox.DisplaySize.Set(
|
||||
std::min( std::max( g_Conf->ConLogBox.DisplaySize.GetWidth(), 160 ), screenzone.GetWidth() ),
|
||||
std::min( std::max( g_Conf->ConLogBox.DisplaySize.GetHeight(), 160 ), screenzone.GetHeight() )
|
||||
);
|
||||
|
||||
if( g_Conf.ConLogBox.AutoDock )
|
||||
if( g_Conf->ConLogBox.AutoDock )
|
||||
{
|
||||
g_Conf.ConLogBox.DisplayPosition = GetPosition() + wxSize( GetSize().x, 0 );
|
||||
g_Conf->ConLogBox.DisplayPosition = GetPosition() + wxSize( GetSize().x, 0 );
|
||||
}
|
||||
else if( g_Conf.ConLogBox.DisplayPosition != wxDefaultPosition )
|
||||
else if( g_Conf->ConLogBox.DisplayPosition != wxDefaultPosition )
|
||||
{
|
||||
if( !screenzone.Contains( wxRect( g_Conf.ConLogBox.DisplayPosition, wxSize( 75, 150 ) ) ) )
|
||||
g_Conf.ConLogBox.DisplayPosition = wxDefaultPosition;
|
||||
if( !screenzone.Contains( wxRect( g_Conf->ConLogBox.DisplayPosition, wxSize( 75, 150 ) ) ) )
|
||||
g_Conf->ConLogBox.DisplayPosition = wxDefaultPosition;
|
||||
}
|
||||
|
||||
m_logbox.SetSize( wxRect( g_Conf.ConLogBox.DisplayPosition, g_Conf.ConLogBox.DisplaySize ) );
|
||||
m_logbox.Show( g_Conf.ConLogBox.Visible );
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
m_menuRun.Append(Menu_BootIso, _("Run ISO"), MakeIsoMenu(), _("Performs a complete bootup sequence (recommended for best compat)"));
|
||||
|
@ -376,11 +387,11 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, int id, const wxString& title, cons
|
|||
m_menuDebug.Append(Menu_Debug_MemoryDump, _T("Memory Dump..."), wxEmptyString, wxITEM_NORMAL);
|
||||
m_menuDebug.Append(Menu_Debug_Logging, _T("Logging..."), wxEmptyString, wxITEM_NORMAL);
|
||||
|
||||
ConnectMenus();
|
||||
|
||||
m_MenuItem_Console.Check( g_Conf.ConLogBox.Visible );
|
||||
m_MenuItem_Console.Check( g_Conf->ConLogBox.Visible );
|
||||
|
||||
//g_RecentIsoList->AddFileToHistory( L"fail.iso" );
|
||||
ConnectMenus();
|
||||
Connect( wxEVT_MOVE, wxMoveEventHandler (MainEmuFrame::OnMoveAround) );
|
||||
Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler(MainEmuFrame::OnCloseWindow) );
|
||||
}
|
||||
|
||||
void MainEmuFrame::Menu_ConfigSettings_Click(wxCommandEvent &event)
|
||||
|
@ -451,15 +462,19 @@ void MainEmuFrame::Menu_Debug_MemoryDump_Click(wxCommandEvent &event)
|
|||
|
||||
void MainEmuFrame::Menu_Debug_Logging_Click(wxCommandEvent &event)
|
||||
{
|
||||
LogOptionsDialog( this, wxID_ANY ).ShowModal();
|
||||
//LogOptionsDialog( this, wxID_ANY ).ShowModal();
|
||||
}
|
||||
|
||||
void MainEmuFrame::Menu_ShowConsole(wxCommandEvent &event)
|
||||
{
|
||||
m_logbox.Show( g_Conf.ConLogBox.Visible = event.IsChecked() );
|
||||
// Use messages to relay open/close commands (thread-safe)
|
||||
|
||||
g_Conf->ConLogBox.Visible = event.IsChecked();
|
||||
wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED, g_Conf->ConLogBox.Visible ? wxID_OPEN : wxID_CLOSE );
|
||||
wxGetApp().ProgramLog_PostEvent( evt );
|
||||
}
|
||||
|
||||
void MainEmuFrame::Menu_ShowAboutBox(wxCommandEvent &event)
|
||||
{
|
||||
AboutBoxDialog( this, wxID_ANY ).ShowModal();
|
||||
//AboutBoxDialog( this, wxID_ANY ).ShowModal();
|
||||
}
|
||||
|
|
|
@ -130,7 +130,6 @@ protected:
|
|||
void ConnectMenus();
|
||||
|
||||
protected:
|
||||
ConsoleLogFrame m_logbox;
|
||||
wxStatusBar& m_statusbar;
|
||||
wxStaticBitmap m_background;
|
||||
|
||||
|
@ -154,8 +153,9 @@ protected:
|
|||
// Menu Options for the Main Window! :D
|
||||
|
||||
protected:
|
||||
void OnCloseWindow(wxCloseEvent& evt);
|
||||
void OnMoveAround( wxMoveEvent& evt );
|
||||
|
||||
|
||||
void Menu_ConfigSettings_Click(wxCommandEvent &event);
|
||||
void Menu_RunWithoutDisc_Click(wxCommandEvent &event);
|
||||
void Menu_IsoBrowse_Click(wxCommandEvent &event);
|
||||
|
|
|
@ -76,23 +76,23 @@ void Panels::PathsPanel::MyBasePanel::AddDirPicker( wxBoxSizer& sizer, const wxD
|
|||
Panels::PathsPanel::StandardPanel::StandardPanel( wxWindow& parent, int id ) :
|
||||
MyBasePanel( parent, id )
|
||||
{
|
||||
AddDirPicker( s_main, g_Conf.Folders.Bios, PathDefs::GetBios,
|
||||
AddDirPicker( s_main, g_Conf->Folders.Bios, PathDefs::GetBios,
|
||||
_("Bios:"), _("Select folder with PS2 Bios"), Msg_Tooltips_Bios );
|
||||
|
||||
s_main.AddSpacer( BetweenFolderSpace );
|
||||
AddDirPicker( s_main, g_Conf.Folders.Savestates, PathDefs::GetSavestates,
|
||||
AddDirPicker( s_main, g_Conf->Folders.Savestates, PathDefs::GetSavestates,
|
||||
_("Savestates:"), _("Select folder for Savestates"), Msg_Tooltips_Savestates );
|
||||
|
||||
s_main.AddSpacer( BetweenFolderSpace );
|
||||
AddDirPicker( s_main, g_Conf.Folders.Snapshots, PathDefs::GetSnapshots,
|
||||
AddDirPicker( s_main, g_Conf->Folders.Snapshots, PathDefs::GetSnapshots,
|
||||
_("Snapshots:"), _("Select a folder for Snapshots"), Msg_Tooltips_Snapshots );
|
||||
|
||||
s_main.AddSpacer( BetweenFolderSpace );
|
||||
AddDirPicker( s_main, g_Conf.Folders.Logs, PathDefs::GetLogs,
|
||||
AddDirPicker( s_main, g_Conf->Folders.Logs, PathDefs::GetLogs,
|
||||
_("Logs/Dumps:" ), _("Select a folder for logs/dumps"), Msg_Tooltips_Logs );
|
||||
|
||||
s_main.AddSpacer( BetweenFolderSpace );
|
||||
AddDirPicker( s_main, g_Conf.Folders.MemoryCards, PathDefs::GetMemoryCards,
|
||||
AddDirPicker( s_main, g_Conf->Folders.MemoryCards, PathDefs::GetMemoryCards,
|
||||
_("Memorycards:"), _("Select a default Memorycards folder"), Msg_Tooltips_Memorycards );
|
||||
|
||||
s_main.AddSpacer( 5 );
|
||||
|
@ -107,11 +107,11 @@ Panels::PathsPanel::AdvancedPanel::AdvancedPanel( wxWindow& parent, int id ) :
|
|||
wxStaticBoxSizer& advanced = *new wxStaticBoxSizer( wxVERTICAL, this, _("Advanced") );
|
||||
AddStaticText( advanced, pxE(Msg_Dialog_AdvancedPaths), 420, wxALIGN_CENTRE );
|
||||
|
||||
AddDirPicker( advanced, g_Conf.Folders.Plugins, PathDefs::GetPlugins,
|
||||
AddDirPicker( advanced, g_Conf->Folders.Plugins, PathDefs::GetPlugins,
|
||||
_("Plugins:"), _("Select folder for PCSX2 plugins"), Msg_Tooltips_PluginsPath );
|
||||
|
||||
advanced.AddSpacer( BetweenFolderSpace );
|
||||
AddDirPicker( advanced, g_Conf.Folders.Settings, PathDefs::GetSettings,
|
||||
AddDirPicker( advanced, g_Conf->Folders.Settings, PathDefs::GetSettings,
|
||||
_("Settings:"), _("Select a folder for PCSX2 settings/inis"), Msg_Tooltips_SettingsPath );
|
||||
|
||||
wxStaticBoxSizer& s_diag = *new wxStaticBoxSizer( wxVERTICAL, this, _("Default folder mode") );
|
||||
|
|
|
@ -212,7 +212,7 @@ Panels::PluginSelectorPanel::PluginSelectorPanel( wxWindow& parent ) :
|
|||
BaseApplicableConfigPanel( &parent )
|
||||
, m_FileList()
|
||||
, m_StatusPanel( *new StatusPanel( this,
|
||||
wxDir::GetAllFiles( g_Conf.Folders.Plugins.ToString(), &m_FileList, wxsFormat( L"*%s", wxDynamicLibrary::GetDllExt()), wxDIR_FILES )
|
||||
wxDir::GetAllFiles( g_Conf->Folders.Plugins.ToString(), &m_FileList, wxsFormat( L"*%s", wxDynamicLibrary::GetDllExt()), wxDIR_FILES )
|
||||
) )
|
||||
, m_ComboBoxes( *new ComboBoxPanel( this ) )
|
||||
, m_Uninitialized( true )
|
||||
|
@ -259,7 +259,7 @@ bool Panels::PluginSelectorPanel::Apply( AppConfig& conf )
|
|||
if( sel == wxNOT_FOUND ) continue;
|
||||
|
||||
wxFileName relative( m_FileList[(int)m_ComboBoxes.Get(i).GetClientData(sel)] );
|
||||
relative.MakeRelativeTo( g_Conf.Folders.Plugins.ToString() );
|
||||
relative.MakeRelativeTo( g_Conf->Folders.Plugins.ToString() );
|
||||
conf.BaseFilenames.Plugins[tbl_PluginInfo[i].id] = relative.GetFullPath();
|
||||
}
|
||||
|
||||
|
@ -353,10 +353,10 @@ void Panels::PluginSelectorPanel::OnProgress( wxCommandEvent& evt )
|
|||
);
|
||||
|
||||
wxFileName left( m_FileList[evtidx] );
|
||||
wxFileName right( g_Conf.FullpathTo(tbl_PluginInfo[i].id) );
|
||||
wxFileName right( g_Conf->FullpathTo(tbl_PluginInfo[i].id) );
|
||||
|
||||
left.MakeRelativeTo( g_Conf.Folders.Plugins.ToString() );
|
||||
right.MakeRelativeTo( g_Conf.Folders.Plugins.ToString() );
|
||||
left.MakeRelativeTo( g_Conf->Folders.Plugins.ToString() );
|
||||
right.MakeRelativeTo( g_Conf->Folders.Plugins.ToString() );
|
||||
|
||||
if( left == right )
|
||||
m_ComboBoxes.Get(i).SetSelection( sel );
|
||||
|
|
|
@ -178,7 +178,7 @@ const wxChar* __fastcall pxExpandMsg( ExpandedMsgEnum key )
|
|||
{
|
||||
const HashedExpansionPair& data( m_EnglishExpansions[key] );
|
||||
|
||||
int curlangid = wxLocale::GetLanguageInfo( g_Conf.LanguageId )->Language;
|
||||
int curlangid = wxLocale::GetLanguageInfo( g_Conf->LanguageId )->Language;
|
||||
if( IsEnglish( curlangid ) )
|
||||
return data.Expanded;
|
||||
|
||||
|
|
|
@ -28,11 +28,12 @@
|
|||
|
||||
IMPLEMENT_APP(Pcsx2App)
|
||||
|
||||
AppConfig g_Conf;
|
||||
AppConfig* g_Conf = NULL;
|
||||
wxFileHistory* g_RecentIsoList = NULL;
|
||||
|
||||
Pcsx2App::Pcsx2App() :
|
||||
m_ConsoleFrame( NULL )
|
||||
m_ProgramLogBox( NULL )
|
||||
, m_Ps2ConLogBox( NULL )
|
||||
, m_ConfigImages( 32, 32 )
|
||||
, m_ConfigImagesAreLoaded( false )
|
||||
, m_ToolbarImages( NULL )
|
||||
|
@ -62,7 +63,7 @@ void Pcsx2App::ReadUserModeSettings()
|
|||
// Ensure proper scoping (IniLoader gets closed prior to delete)
|
||||
{
|
||||
IniLoader loader( *conf_usermode );
|
||||
g_Conf.LoadSaveUserMode( loader );
|
||||
g_Conf->LoadSaveUserMode( loader );
|
||||
}
|
||||
|
||||
delete conf_usermode;
|
||||
|
@ -74,7 +75,7 @@ void Pcsx2App::ReadUserModeSettings()
|
|||
//
|
||||
bool Pcsx2App::TryOpenConfigCwd()
|
||||
{
|
||||
wxDirName inipath_cwd( (wxDirName)wxGetCwd() + PathDefs::Settings );
|
||||
wxDirName inipath_cwd( (wxDirName)wxGetCwd() + PathDefs::Base::Settings() );
|
||||
if( !inipath_cwd.IsReadable() ) return false;
|
||||
|
||||
wxString inifile_cwd( Path::Combine( inipath_cwd, FilenameDefs::GetConfig() ) );
|
||||
|
@ -128,9 +129,10 @@ bool Pcsx2App::OnCmdLineParsed(wxCmdLineParser& parser)
|
|||
bool Pcsx2App::OnInit()
|
||||
{
|
||||
wxInitAllImageHandlers();
|
||||
|
||||
wxApp::OnInit();
|
||||
|
||||
g_Conf = new AppConfig();
|
||||
|
||||
i18n_InitPlainEnglish();
|
||||
wxLocale::AddCatalogLookupPathPrefix( wxGetCwd() );
|
||||
|
||||
|
@ -156,12 +158,18 @@ bool Pcsx2App::OnInit()
|
|||
wxConfigBase::Get()->SetRecordDefaults();
|
||||
}
|
||||
|
||||
g_Conf.Load();
|
||||
g_Conf.Apply();
|
||||
g_Conf->Load();
|
||||
g_Conf->Apply();
|
||||
|
||||
m_ProgramLogBox = new ConsoleLogFrame( NULL, L"PCSX2 Program Log" );
|
||||
m_Ps2ConLogBox = m_ProgramLogBox;
|
||||
//m_Ps2ConLogBox = new ConsoleLogFrame( NULL, L"PS2 Console Log" );
|
||||
|
||||
m_MainFrame = new MainEmuFrame( NULL, wxID_ANY, wxEmptyString );
|
||||
SetTopWindow( m_MainFrame );
|
||||
SetExitOnFrameDelete( true );
|
||||
m_MainFrame->Show();
|
||||
|
||||
|
||||
// Check to see if the user needs to perform initial setup:
|
||||
|
||||
|
@ -169,7 +177,7 @@ bool Pcsx2App::OnInit()
|
|||
const wxString pc( L"Please Configure" );
|
||||
for( int pidx=0; pidx<Plugin_Count; ++pidx )
|
||||
{
|
||||
if( g_Conf.BaseFilenames[(PluginsEnum_t)pidx] == pc )
|
||||
if( g_Conf->BaseFilenames[(PluginsEnum_t)pidx] == pc )
|
||||
{
|
||||
needsConfigured = true;
|
||||
break;
|
||||
|
@ -186,7 +194,7 @@ bool Pcsx2App::OnInit()
|
|||
|
||||
int Pcsx2App::OnExit()
|
||||
{
|
||||
g_Conf.Save();
|
||||
g_Conf->Save();
|
||||
return wxApp::OnExit();
|
||||
}
|
||||
|
||||
|
@ -230,11 +238,11 @@ const wxBitmap& Pcsx2App::GetLogoBitmap()
|
|||
return *m_Bitmap_Logo;
|
||||
|
||||
wxFileName mess;
|
||||
bool useTheme = (g_Conf.DeskTheme != L"default");
|
||||
bool useTheme = (g_Conf->DeskTheme != L"default");
|
||||
|
||||
if( useTheme )
|
||||
{
|
||||
wxDirName theme( PathDefs::GetThemes() + g_Conf.DeskTheme );
|
||||
wxDirName theme( PathDefs::GetThemes() + g_Conf->DeskTheme );
|
||||
wxFileName zipped( theme.GetFilename() );
|
||||
|
||||
zipped.SetExt( L"zip" );
|
||||
|
@ -272,11 +280,11 @@ wxImageList& Pcsx2App::GetImgList_Config()
|
|||
if( !m_ConfigImagesAreLoaded )
|
||||
{
|
||||
wxFileName mess;
|
||||
bool useTheme = (g_Conf.DeskTheme != L"default");
|
||||
bool useTheme = (g_Conf->DeskTheme != L"default");
|
||||
|
||||
if( useTheme )
|
||||
{
|
||||
wxDirName theme( PathDefs::GetThemes() + g_Conf.DeskTheme );
|
||||
wxDirName theme( PathDefs::GetThemes() + g_Conf->DeskTheme );
|
||||
mess = theme.ToString();
|
||||
}
|
||||
|
||||
|
@ -288,7 +296,7 @@ wxImageList& Pcsx2App::GetImgList_Config()
|
|||
#undef FancyLoadMacro
|
||||
#define FancyLoadMacro( name ) \
|
||||
{ \
|
||||
EmbeddedImage<png_ConfigIcon_##name> temp( g_Conf.Listbook_ImageSize, g_Conf.Listbook_ImageSize ); \
|
||||
EmbeddedImage<png_ConfigIcon_##name> temp( g_Conf->Listbook_ImageSize, g_Conf->Listbook_ImageSize ); \
|
||||
m_ImageId.Config.name = m_ConfigImages.Add( LoadImageAny( \
|
||||
img, useTheme, mess, L"ConfigIcon_" wxT(#name), temp ) \
|
||||
); \
|
||||
|
@ -309,14 +317,14 @@ wxImageList& Pcsx2App::GetImgList_Toolbars()
|
|||
{
|
||||
if( m_ToolbarImages == NULL )
|
||||
{
|
||||
const int imgSize = g_Conf.Toolbar_ImageSize ? 64 : 32;
|
||||
const int imgSize = g_Conf->Toolbar_ImageSize ? 64 : 32;
|
||||
m_ToolbarImages = new wxImageList( imgSize, imgSize );
|
||||
wxFileName mess;
|
||||
bool useTheme = (g_Conf.DeskTheme != L"default");
|
||||
bool useTheme = (g_Conf->DeskTheme != L"default");
|
||||
|
||||
if( useTheme )
|
||||
{
|
||||
wxDirName theme( PathDefs::GetThemes() + g_Conf.DeskTheme );
|
||||
wxDirName theme( PathDefs::GetThemes() + g_Conf->DeskTheme );
|
||||
mess = theme.ToString();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets=".\vsprops\common.vsprops;..\..\..\common\vsprops\BaseProperties.vsprops;..\..\..\common\vsprops\3rdpartyDeps.vsprops;..\..\..\common\vsprops\pthreads.vsprops;.\vsprops\devbuild.vsprops;..\..\..\common\vsprops\CodeGen_Debug.vsprops;..\..\..\common\vsprops\IncrementalLinking.vsprops"
|
||||
UseOfMFC="0"
|
||||
|
@ -99,7 +98,6 @@
|
|||
</Configuration>
|
||||
<Configuration
|
||||
Name="Devel|Win32"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets=".\vsprops\common.vsprops;..\..\..\common\vsprops\BaseProperties.vsprops;..\..\..\common\vsprops\3rdpartyDeps.vsprops;.\vsprops\devbuild.vsprops;..\..\..\common\vsprops\pthreads.vsprops;..\..\..\common\vsprops\CodeGen_Devel.vsprops;..\..\..\common\vsprops\IncrementalLinking.vsprops"
|
||||
UseOfMFC="0"
|
||||
|
@ -180,7 +178,6 @@
|
|||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets=".\vsprops\common.vsprops;..\..\..\common\vsprops\BaseProperties.vsprops;..\..\..\common\vsprops\3rdpartyDeps.vsprops;..\..\..\common\vsprops\pthreads.vsprops;..\..\..\common\vsprops\CodeGen_Release.vsprops"
|
||||
UseOfMFC="0"
|
||||
|
|
|
@ -153,9 +153,9 @@ static void iIopDumpBlock( int startpc, u8 * ptr )
|
|||
int numused, count;
|
||||
|
||||
Console::WriteLn( "dump1 %x:%x, %x", params startpc, psxpc, psxRegs.cycle );
|
||||
g_Conf.Folders.Logs.Mkdir();
|
||||
g_Conf->Folders.Logs.Mkdir();
|
||||
|
||||
wxString filename( Path::Combine( g_Conf.Folders.Logs, wxsFormat( L"psxdump%.8X.txt", startpc ) ) );
|
||||
wxString filename( Path::Combine( g_Conf->Folders.Logs, wxsFormat( L"psxdump%.8X.txt", startpc ) ) );
|
||||
AsciiFile f( filename, wxFile::write );
|
||||
|
||||
/*for ( i = startpc; i < s_nEndBlock; i += 4 ) {
|
||||
|
|
|
@ -568,9 +568,9 @@ void SuperVUDumpBlock(list<VuBaseBlock*>& blocks, int vuindex)
|
|||
u32 *mem;
|
||||
u32 i;
|
||||
|
||||
g_Conf.Folders.Logs.Mkdir();
|
||||
g_Conf->Folders.Logs.Mkdir();
|
||||
AsciiFile eff(
|
||||
Path::Combine( g_Conf.Folders.Logs, wxsFormat(L"svu%cdump%.4X.txt", s_vu?L'0':L'1', s_pFnHeader->startpc) ),
|
||||
Path::Combine( g_Conf->Folders.Logs, wxsFormat(L"svu%cdump%.4X.txt", s_vu?L'0':L'1', s_pFnHeader->startpc) ),
|
||||
wxFile::write
|
||||
);
|
||||
|
||||
|
|
|
@ -92,8 +92,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Include", "Include", "{0FAD
|
|||
common\include\PS2Etypes.h = common\include\PS2Etypes.h
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "setup", "setup\setup.vdproj", "{14259DC9-2A12-4B05-A7D7-23C1A9FFEA03}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxBase28", "3rdparty\wxWidgets\build\msw\wx_base_2008.vcproj", "{48AD7E0A-25B1-4974-A1E3-03F8C438D34F}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{C34487AF-228A-4D11-8E50-27803DF76873} = {C34487AF-228A-4D11-8E50-27803DF76873}
|
||||
|
@ -479,18 +477,6 @@ Global
|
|||
{CDD9DB83-3BD9-4ED8-BB83-399A2F65F022}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{CDD9DB83-3BD9-4ED8-BB83-399A2F65F022}.Release|Win32.Build.0 = Release|Win32
|
||||
{CDD9DB83-3BD9-4ED8-BB83-399A2F65F022}.Release|x64.ActiveCfg = Release|Win32
|
||||
{14259DC9-2A12-4B05-A7D7-23C1A9FFEA03}.Debug|Win32.ActiveCfg = Release
|
||||
{14259DC9-2A12-4B05-A7D7-23C1A9FFEA03}.Debug|x64.ActiveCfg = Release
|
||||
{14259DC9-2A12-4B05-A7D7-23C1A9FFEA03}.Devel|Win32.ActiveCfg = Release
|
||||
{14259DC9-2A12-4B05-A7D7-23C1A9FFEA03}.Devel|x64.ActiveCfg = Release
|
||||
{14259DC9-2A12-4B05-A7D7-23C1A9FFEA03}.Release SSE2|Win32.ActiveCfg = Release
|
||||
{14259DC9-2A12-4B05-A7D7-23C1A9FFEA03}.Release SSE2|x64.ActiveCfg = Release
|
||||
{14259DC9-2A12-4B05-A7D7-23C1A9FFEA03}.Release SSE4|Win32.ActiveCfg = Release
|
||||
{14259DC9-2A12-4B05-A7D7-23C1A9FFEA03}.Release SSE4|x64.ActiveCfg = Release
|
||||
{14259DC9-2A12-4B05-A7D7-23C1A9FFEA03}.Release SSSE3|Win32.ActiveCfg = Release
|
||||
{14259DC9-2A12-4B05-A7D7-23C1A9FFEA03}.Release SSSE3|x64.ActiveCfg = Release
|
||||
{14259DC9-2A12-4B05-A7D7-23C1A9FFEA03}.Release|Win32.ActiveCfg = Release
|
||||
{14259DC9-2A12-4B05-A7D7-23C1A9FFEA03}.Release|x64.ActiveCfg = Release
|
||||
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
|
|
|
@ -85,7 +85,6 @@
|
|||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\..\..\..\common\vsprops\plugin_svnroot.vsprops;..\..\..\..\common\vsprops\BaseProperties.vsprops;..\..\..\..\common\vsprops\3rdpartyDeps.vsprops;..\..\..\..\common\vsprops\CodeGen_Release.vsprops"
|
||||
UseOfMFC="0"
|
||||
|
|
|
@ -402,6 +402,8 @@
|
|||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
>
|
||||
<Tool
|
||||
|
|
|
@ -295,7 +295,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="SPU2X_DEVBUILD;FLOAT_SAMPLES;DEBUG_FAST;_USRDLL"
|
||||
PreprocessorDefinitions="wxUSE_GUI=0;SPU2X_DEVBUILD;FLOAT_SAMPLES;DEBUG_FAST;_USRDLL"
|
||||
ExceptionHandling="2"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "analog.h"
|
||||
#include "analog.h"
|
||||
|
||||
PADAnalog g_lanalog[NUM_OF_PADS], g_ranalog[NUM_OF_PADS];
|
||||
|
||||
namespace Analog
|
||||
|
|
|
@ -15,11 +15,14 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define NUM_OF_PADS 2
|
||||
#define NUM_OF_PADS 2
|
||||
|
||||
#include "zeropad.h"
|
||||
namespace Analog
|
||||
#include "zeropad.h"
|
||||
|
||||
namespace Analog
|
||||
{
|
||||
extern void Init();
|
||||
extern u8 Pad(int padvalue, u8 i);
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
#ifndef __PAD_H__
|
||||
#define __PAD_H__
|
||||
|
||||
#define PADdefs
|
||||
#include "PS2Edefs.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
|
@ -40,9 +43,6 @@
|
|||
#include <pthread.h>
|
||||
using namespace std;
|
||||
|
||||
#define PADdefs
|
||||
#include "PS2Edefs.h"
|
||||
|
||||
#ifdef __LINUX__
|
||||
#include "joystick.h"
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue