Re-ordered the MSVC folder structure to split PCSX2 into two definitive sections: [App]Host and [Emu]Core (the bracketed names indicate the "long" versions which are generally used in the code to differentiate the functions and classes). If the tentative layout is good then I'll sort the files on SVN to match that layout.

(note: Patch.cpp/Patch.h is still the odd child out in this commit, as it's destiny is to become a plugin)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1804 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-09-12 02:58:22 +00:00
parent 76045a4722
commit b638f52809
38 changed files with 2420 additions and 2517 deletions

View File

@ -18,6 +18,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="..\DefaultProjectRootDir.vsprops;..\3rdpartyDLL.vsprops;..\..\common\vsprops\CodeGen_Debug.vsprops;..\..\common\vsprops\IncrementalLinking.vsprops"
CharacterSet="2"

View File

@ -18,7 +18,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="4"
InheritedPropertySheets=".\ProjectRootDir.vsprops;..\..\..\3rdparty.vsprops;.\Common.vsprops;..\..\..\3rdpartyDLL.vsprops;..\..\..\..\common\vsprops\CodeGen_Release.vsprops"
InheritedPropertySheets=".\ProjectRootDir.vsprops;..\..\..\3rdparty.vsprops;.\Common.vsprops;..\..\..\..\common\vsprops\CodeGen_Release.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"

View File

@ -127,10 +127,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\include\wx\setup.h"
>
</File>
<File
RelativePath="..\..\include\wx\msw\setup.h"
>
@ -165,6 +161,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\include\wx\setup.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"

View File

@ -68,6 +68,7 @@
<Unit filename="../../include/Utilities/Dependencies.h" />
<Unit filename="../../include/Utilities/Exceptions.h" />
<Unit filename="../../include/Utilities/General.h" />
<Unit filename="../../include/Utilities/HashMap.h" />
<Unit filename="../../include/Utilities/MemcpyFast.h" />
<Unit filename="../../include/Utilities/Path.h" />
<Unit filename="../../include/Utilities/RedtapeWindows.h" />
@ -82,6 +83,7 @@
<Unit filename="../../src/Utilities/AlignedMalloc.cpp" />
<Unit filename="../../src/Utilities/Console.cpp" />
<Unit filename="../../src/Utilities/Exceptions.cpp" />
<Unit filename="../../src/Utilities/HashTools.cpp" />
<Unit filename="../../src/Utilities/Linux/LnxHostSys.cpp" />
<Unit filename="../../src/Utilities/Linux/LnxMisc.cpp" />
<Unit filename="../../src/Utilities/Linux/LnxThreads.cpp" />

View File

@ -39,8 +39,7 @@
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
PreprocessorDefinitions="_LIB"
ExceptionHandling="2"
/>
<Tool
@ -95,9 +94,7 @@
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
PreprocessorDefinitions="_LIB"
ExceptionHandling="2"
/>
<Tool
@ -152,9 +149,7 @@
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
PreprocessorDefinitions="_LIB"
ExceptionHandling="2"
/>
<Tool
@ -206,6 +201,10 @@
RelativePath="..\..\src\Utilities\Exceptions.cpp"
>
</File>
<File
RelativePath="..\..\src\Utilities\HashTools.cpp"
>
</File>
<File
RelativePath="..\..\src\Utilities\x86\MemcpyFast.cpp"
>
@ -380,6 +379,10 @@
RelativePath="..\..\include\Utilities\General.h"
>
</File>
<File
RelativePath="..\..\include\Utilities\HashMap.h"
>
</File>
<File
RelativePath="..\..\include\intrin_x86.h"
>
@ -437,12 +440,6 @@
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>

View File

@ -59,7 +59,7 @@ template< u16 data, typename T >
static __forceinline void memset16_obj( T& obj )
{
if( (sizeof(T) & 0x3) != 0 )
_memset_16_unaligned( &obj, data, sizeof( T ) );
_memset16_unaligned( &obj, data, sizeof( T ) );
else
memset32_obj<data + (data<<16)>( obj );
}

View File

@ -66,3 +66,18 @@ __forceinline void pcsx2_aligned_free(void* pmem)
AlignedMallocHeader* header = (AlignedMallocHeader*)((uptr)pmem - headsize);
free( header->baseptr );
}
// ----------------------------------------------------------------------------
// And for lack of a better home ...
// Special unaligned memset used when all other optimized memsets fail (it's called from
// memzero_obj and stuff).
void _memset16_unaligned( void* dest, u16 data, size_t size )
{
jASSUME( (size & 0x1) == 0 );
u16* dst = (u16*)dest;
for(int i=size; i; --i, ++dst )
*dst = data;
}

View File

@ -25,11 +25,45 @@ wxString GetTranslation( const char* msg )
return wxGetTranslation( wxString::FromAscii(msg).c_str() );
}
// ------------------------------------------------------------------------
// Force DevAssert to *not* inline for devel/debug builds (allows using breakpoints to trap
// assertions), and force it to inline for release builds (optimizes it out completely since
// IsDevBuild is false). Since Devel builds typically aren't enabled with Global Optimization/
// LTCG, this currently isn't even necessary. But might as well, in case we decide at a later
// date to re-enable LTCG for devel.
//
#ifdef PCSX2_DEVBUILD
# define DEVASSERT_INLINE __noinline
#else
# define DEVASSERT_INLINE __forceinline
#endif
//////////////////////////////////////////////////////////////////////////////////////////
// Assertion tool for Devel builds, intended for sanity checking and/or bounds checking
// variables in areas which are not performance critical.
//
// How it works: This function throws an exception of type Exception::AssertionFailure if
// the assertion conditional is false. Typically for the end-user, this exception is handled
// by the general handler, which (should eventually) create some state dumps and other
// information for troubleshooting purposes.
//
// From a debugging environment, you can trap your DevAssert by either breakpointing the
// exception throw below, or by adding either Exception::AssertionFailure or
// Exception::LogicError to your First-Chance Exception catch list (Visual Studio, under
// the Debug->Exceptions menu/dialog).
//
DEVASSERT_INLINE void DevAssert( bool condition, const char* msg )
{
if( IsDevBuild && !condition )
{
throw Exception::LogicError( msg );
}
}
//////////////////////////////////////////////////////////////////////////////////////////
//
namespace Exception
{
// ------------------------------------------------------------------------
BaseException::~BaseException() throw() {}
void BaseException::InitBaseEx( const wxString& msg_eng, const wxString& msg_xlt )

View File

@ -7,7 +7,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="PCSX2_DEBUG;_SECURE_SCL_=1;_SECURE_SCL_THROWS=1"
PreprocessorDefinitions="PCSX2_DEBUG;PCSX2_DEVBUILD;_SECURE_SCL_=1;_SECURE_SCL_THROWS=1"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
/>

View File

@ -8,7 +8,7 @@
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SvnRootDir)\common\include\$(ProjectName)&quot;;&quot;$(SvnRootDir)\common\include&quot;;&quot;$(SvnRootDir)\3rdparty\wxWidgets\include&quot;"
AdditionalIncludeDirectories="&quot;$(SvnRootDir)\common\include\$(ProjectName)&quot;;&quot;$(SvnRootDir)\common\include&quot;;&quot;$(SvnRootDir)\3rdparty\wxWidgets\include&quot;;&quot;$(SvnRootDir)\3rdparty&quot;"
PreprocessorDefinitions="__WIN32__;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
StructMemberAlignment="5"
RuntimeTypeInfo="false"

View File

@ -36,5 +36,10 @@
#include "Elfheader.h"
#include "Patch.h"
extern bool EmulationInProgress();
// Some homeless externs. This is as good a spot as any for now...
extern bool EmulationInProgress();
extern void SetCPUState(u32 sseMXCSR, u32 sseVUMXCSR);
extern u32 g_sseVUMXCSR, g_sseMXCSR;

View File

@ -17,6 +17,7 @@
#include "Common.h"
#include "CDVD/IsoFSdrv.h"
#include "DebugTools/Debug.h"
using namespace std;
@ -608,3 +609,79 @@ void loadElfFile(const wxString& filename)
return;
}
// return value:
// 0 - Invalid or unknown disc.
// 1 - PS1 CD
// 2 - PS2 CD
int GetPS2ElfName( wxString& name )
{
int f;
char buffer[g_MaxPath];//if a file is longer...it should be shorter :D
char *pos;
TocEntry tocEntry;
IsoFS_init();
// check if the file exists
if (IsoFS_findFile("SYSTEM.CNF;1", &tocEntry) != TRUE){
Console::Status("GetElfName: SYSTEM.CNF not found; invalid cd image or no disc present.");
return 0;//could not find; not a PS/PS2 cdvd
}
f=IsoFS_open("SYSTEM.CNF;1", 1);
IsoFS_read(f, buffer, g_MaxPath);
IsoFS_close(f);
buffer[tocEntry.fileSize]='\0';
pos=strstr(buffer, "BOOT2");
if (pos==NULL){
pos=strstr(buffer, "BOOT");
if (pos==NULL) {
Console::Error("PCSX2 Boot Error: This is not a Playstation or PS2 game!");
return 0;
}
return 1;
}
pos+=strlen("BOOT2");
while (pos && *pos && pos<&buffer[g_MaxPath]
&& (*pos<'A' || (*pos>'Z' && *pos<'a') || *pos>'z'))
pos++;
if (!pos || *pos==0)
return 0;
// the filename is everything up to the first CR/LF/tab.. ?
// Or up to any whitespace? (I'm opting for first CRLF/tab, although the old code
// apparently stopped on spaces too) --air
name = wxStringTokenizer( wxString::FromAscii( pos ) ).GetNextToken();
#ifdef PCSX2_DEVBUILD
FILE *fp;
int i;
fp = fopen("System.map", "r");
if( fp == NULL ) return 2;
u32 addr;
Console::WriteLn("Loading System.map...");
while (!feof(fp)) {
fseek(fp, 8, SEEK_CUR);
buffer[0] = '0'; buffer[1] = 'x';
for (i=2; i<10; i++) buffer[i] = fgetc(fp); buffer[i] = 0;
addr = strtoul(buffer, (char**)NULL, 0);
fseek(fp, 3, SEEK_CUR);
for (i=0; i<g_MaxPath; i++) {
buffer[i] = fgetc(fp);
if (buffer[i] == '\n' || buffer[i] == 0) break;
}
if (buffer[i] == 0) break;
buffer[i] = 0;
R5900::disR5900AddSym(addr, buffer);
}
fclose(fp);
#endif
return 2;
}

View File

@ -24,6 +24,8 @@ extern unsigned int args_ptr;
extern void loadElfFile(const wxString& filename);
extern u32 loadElfCRC(const char *filename);
extern void ElfApplyPatches();
extern int GetPS2ElfName( wxString& dest );
extern u32 ElfCRC;

View File

@ -621,79 +621,3 @@ void SaveState::gsFreeze()
Freeze(CSRw);
mtgsFreeze();
}
#ifdef PCSX2_DEVBUILD
struct GSStatePacket
{
u32 type;
vector<u8> mem;
};
// runs the GS
// (this should really be part of the AppGui)
void RunGSState( gzLoadingState& f )
{
u32 newfield;
list< GSStatePacket > packets;
while( !f.Finished() )
{
int type, size;
f.Freeze( type );
if( type != GSRUN_VSYNC ) f.Freeze( size );
packets.push_back(GSStatePacket());
GSStatePacket& p = packets.back();
p.type = type;
if( type != GSRUN_VSYNC ) {
p.mem.resize(size*16);
f.FreezeMem( &p.mem[0], size*16 );
}
}
list<GSStatePacket>::iterator it = packets.begin();
g_SaveGSStream = 3;
// first extract the data
while(1) {
switch(it->type) {
case GSRUN_TRANS1:
GSgifTransfer1((u32*)&it->mem[0], 0);
break;
case GSRUN_TRANS2:
GSgifTransfer2((u32*)&it->mem[0], it->mem.size()/16);
break;
case GSRUN_TRANS3:
GSgifTransfer3((u32*)&it->mem[0], it->mem.size()/16);
break;
case GSRUN_VSYNC:
// flip
newfield = (*(u32*)(PS2MEM_GS+0x1000)&0x2000) ? 0 : 0x2000;
*(u32*)(PS2MEM_GS+0x1000) = (*(u32*)(PS2MEM_GS+0x1000) & ~(1<<13)) | newfield;
GSvsync(newfield);
// fixme : Process pending app messages here.
//SysUpdate();
if( g_SaveGSStream != 3 )
return;
break;
jNO_DEFAULT
}
++it;
if( it == packets.end() )
it = packets.begin();
}
}
#endif
//#undef GIFchain

View File

@ -351,5 +351,7 @@ extern gzSavingState* g_fGSSave;
#endif
extern void SaveGSState(const wxString& file);
extern void LoadGSState(const wxString& file);
extern void RunGSState(gzLoadingState& f);

152
pcsx2/GSState.cpp Normal file
View File

@ -0,0 +1,152 @@
/* 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.
*
* 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.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
#include "GS.h"
void SaveGSState(const wxString& file)
{
if( g_SaveGSStream ) return;
Console::WriteLn( "Saving GS State..." );
Console::WriteLn( wxsFormat( L"\t%s", file.c_str() ) );
g_fGSSave = new gzSavingState( file );
g_SaveGSStream = 1;
g_nLeftGSFrames = 2;
g_fGSSave->Freeze( g_nLeftGSFrames );
}
void LoadGSState(const wxString& file)
{
int ret;
gzLoadingState* f;
Console::Status( "Loading GS State..." );
try
{
f = new gzLoadingState( file );
}
catch( Exception::FileNotFound& )
{
// file not found? try prefixing with sstates folder:
if( !Path::IsRelative( 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...
}
}
// Always set gsIrq callback -- GS States are always exclusionary of MTGS mode
GSirqCallback( gsIrq );
ret = GSopen(&pDsp, "PCSX2", 0);
if (ret != 0)
{
delete f;
throw Exception::PluginOpenError( PluginId_GS );
}
ret = PADopen((void *)&pDsp);
f->Freeze(g_nLeftGSFrames);
f->gsFreeze();
f->FreezePlugin( "GS", gsSafeFreeze );
RunGSState( *f );
delete( f );
g_plugins->Close( PluginId_GS );
g_plugins->Close( PluginId_PAD );
}
struct GSStatePacket
{
u32 type;
std::vector<u8> mem;
};
// runs the GS
// (this should really be part of the AppGui)
void RunGSState( gzLoadingState& f )
{
u32 newfield;
std::list< GSStatePacket > packets;
while( !f.Finished() )
{
int type, size;
f.Freeze( type );
if( type != GSRUN_VSYNC ) f.Freeze( size );
packets.push_back(GSStatePacket());
GSStatePacket& p = packets.back();
p.type = type;
if( type != GSRUN_VSYNC ) {
p.mem.resize(size*16);
f.FreezeMem( &p.mem[0], size*16 );
}
}
std::list<GSStatePacket>::iterator it = packets.begin();
g_SaveGSStream = 3;
// first extract the data
while(1) {
switch(it->type) {
case GSRUN_TRANS1:
GSgifTransfer1((u32*)&it->mem[0], 0);
break;
case GSRUN_TRANS2:
GSgifTransfer2((u32*)&it->mem[0], it->mem.size()/16);
break;
case GSRUN_TRANS3:
GSgifTransfer3((u32*)&it->mem[0], it->mem.size()/16);
break;
case GSRUN_VSYNC:
// flip
newfield = (*(u32*)(PS2MEM_GS+0x1000)&0x2000) ? 0 : 0x2000;
*(u32*)(PS2MEM_GS+0x1000) = (*(u32*)(PS2MEM_GS+0x1000) & ~(1<<13)) | newfield;
GSvsync(newfield);
// fixme : Process pending app messages here.
//SysUpdate();
if( g_SaveGSStream != 3 )
return;
break;
jNO_DEFAULT
}
++it;
if( it == packets.end() )
it = packets.begin();
}
}

View File

@ -165,9 +165,8 @@
<Unit filename="../FiFo.cpp" />
<Unit filename="../GS.cpp" />
<Unit filename="../GS.h" />
<Unit filename="../GSstate.cpp" />
<Unit filename="../Gif.cpp" />
<Unit filename="../HashMap.h" />
<Unit filename="../HashTools.cpp" />
<Unit filename="../HostGui.h" />
<Unit filename="../Hw.cpp" />
<Unit filename="../Hw.h" />
@ -209,8 +208,6 @@
<Unit filename="../Memory.h" />
<Unit filename="../MemoryCard.cpp" />
<Unit filename="../MemoryCard.h" />
<Unit filename="../Misc.cpp" />
<Unit filename="../Misc.h" />
<Unit filename="../NakedAsm.h" />
<Unit filename="../Patch.cpp" />
<Unit filename="../Patch.h" />
@ -271,6 +268,7 @@
<Unit filename="../gui/AppAssert.cpp" />
<Unit filename="../gui/AppConfig.cpp" />
<Unit filename="../gui/AppConfig.h" />
<Unit filename="../gui/AppMain.cpp" />
<Unit filename="../gui/AppRes.cpp" />
<Unit filename="../gui/CheckedStaticBox.cpp" />
<Unit filename="../gui/CheckedStaticBox.h" />
@ -370,7 +368,6 @@
<Unit filename="../gui/Saveslots.cpp" />
<Unit filename="../gui/i18n.cpp" />
<Unit filename="../gui/i18n.h" />
<Unit filename="../gui/main.cpp" />
<Unit filename="../gui/wxHelpers.cpp" />
<Unit filename="../gui/wxHelpers.h" />
<Unit filename="../ps2/BiosTools.cpp" />

View File

@ -1,244 +0,0 @@
/* 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.
*
* 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.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
#ifdef _WIN32
#include "RDebug/deci2.h"
#else
#include <sys/time.h>
#endif
#include <ctype.h>
#include <wx/file.h>
#include "IopCommon.h"
#include "HostGui.h"
#include "CDVD/IsoFSdrv.h"
#include "VUmicro.h"
#include "VU.h"
#include "iCore.h"
//#include "sVU_zerorec.h"
#include "BaseblockEx.h" // included for devbuild block dumping (which may or may not work anymore?)
#include "GS.h"
#include "COP0.h"
#include "Cache.h"
#include "AppConfig.h"
using namespace std;
using namespace R5900;
struct KeyModifiers keymodifiers = {false, false, false, false};
extern wxString strgametitle;
// ------------------------------------------------------------------------
// Force DevAssert to *not* inline for devel/debug builds (allows using breakpoints to trap
// assertions), and force it to inline for release builds (optimizes it out completely since
// IsDevBuild is false). Since Devel builds typically aren't enabled with Global Optimization/
// LTCG, this currently isn't even necessary. But might as well, in case we decide at a later
// date to re-enable LTCG for devel.
//
#ifdef PCSX2_DEVBUILD
# define DEVASSERT_INLINE __noinline
#else
# define DEVASSERT_INLINE __forceinline
#endif
//////////////////////////////////////////////////////////////////////////////////////////
// Assertion tool for Devel builds, intended for sanity checking and/or bounds checking
// variables in areas which are not performance critical.
//
// How it works: This function throws an exception of type Exception::AssertionFailure if
// the assertion conditional is false. Typically for the end-user, this exception is handled
// by the general handler, which (should eventually) create some state dumps and other
// information for troubleshooting purposes.
//
// From a debugging environment, you can trap your DevAssert by either breakpointing the
// exception throw below, or by adding either Exception::AssertionFailure or
// Exception::LogicError to your First-Chance Exception catch list (Visual Studio, under
// the Debug->Exceptions menu/dialog).
//
DEVASSERT_INLINE void DevAssert( bool condition, const char* msg )
{
if( IsDevBuild && !condition )
{
throw Exception::LogicError( msg );
}
}
// return value:
// 0 - Invalid or unknown disc.
// 1 - PS1 CD
// 2 - PS2 CD
int GetPS2ElfName( wxString& name )
{
int f;
char buffer[g_MaxPath];//if a file is longer...it should be shorter :D
char *pos;
TocEntry tocEntry;
IsoFS_init();
// check if the file exists
if (IsoFS_findFile("SYSTEM.CNF;1", &tocEntry) != TRUE){
Console::Status("GetElfName: SYSTEM.CNF not found; invalid cd image or no disc present.");
return 0;//could not find; not a PS/PS2 cdvd
}
f=IsoFS_open("SYSTEM.CNF;1", 1);
IsoFS_read(f, buffer, g_MaxPath);
IsoFS_close(f);
buffer[tocEntry.fileSize]='\0';
pos=strstr(buffer, "BOOT2");
if (pos==NULL){
pos=strstr(buffer, "BOOT");
if (pos==NULL) {
Console::Error("PCSX2 Boot Error: This is not a Playstation or PS2 game!");
return 0;
}
return 1;
}
pos+=strlen("BOOT2");
while (pos && *pos && pos<&buffer[g_MaxPath]
&& (*pos<'A' || (*pos>'Z' && *pos<'a') || *pos>'z'))
pos++;
if (!pos || *pos==0)
return 0;
// the filename is everything up to the first CR/LF/tab.. ?
// Or up to any whitespace? (I'm opting for first CRLF/tab, although the old code
// apparently stopped on spaces too) --air
name = wxStringTokenizer( wxString::FromAscii( pos ) ).GetNextToken();
#ifdef PCSX2_DEVBUILD
FILE *fp;
int i;
fp = fopen("System.map", "r");
if( fp == NULL ) return 2;
u32 addr;
Console::WriteLn("Loading System.map...");
while (!feof(fp)) {
fseek(fp, 8, SEEK_CUR);
buffer[0] = '0'; buffer[1] = 'x';
for (i=2; i<10; i++) buffer[i] = fgetc(fp); buffer[i] = 0;
addr = strtoul(buffer, (char**)NULL, 0);
fseek(fp, 3, SEEK_CUR);
for (i=0; i<g_MaxPath; i++) {
buffer[i] = fgetc(fp);
if (buffer[i] == '\n' || buffer[i] == 0) break;
}
if (buffer[i] == 0) break;
buffer[i] = 0;
disR5900AddSym(addr, buffer);
}
fclose(fp);
#endif
return 2;
}
#ifdef PCSX2_DEVBUILD
void SaveGSState(const wxString& file)
{
if( g_SaveGSStream ) return;
Console::WriteLn( "Saving GS State..." );
Console::WriteLn( wxsFormat( L"\t%s", file.c_str() ) );
g_fGSSave = new gzSavingState( file );
g_SaveGSStream = 1;
g_nLeftGSFrames = 2;
g_fGSSave->Freeze( g_nLeftGSFrames );
}
void LoadGSState(const wxString& file)
{
int ret;
gzLoadingState* f;
Console::Status( "Loading GS State..." );
try
{
f = new gzLoadingState( file );
}
catch( Exception::FileNotFound& )
{
// file not found? try prefixing with sstates folder:
if( !Path::IsRelative( 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...
}
}
// Always set gsIrq callback -- GS States are always exclusionary of MTGS mode
GSirqCallback( gsIrq );
ret = GSopen(&pDsp, "PCSX2", 0);
if (ret != 0)
{
delete f;
throw Exception::PluginOpenError( PluginId_GS );
}
ret = PADopen((void *)&pDsp);
f->Freeze(g_nLeftGSFrames);
f->gsFreeze();
f->FreezePlugin( "GS", gsSafeFreeze );
RunGSState( *f );
delete( f );
g_plugins->Close( PluginId_GS );
g_plugins->Close( PluginId_PAD );
}
#endif
char* mystrlwr( char* string )
{
assert( string != NULL );
while ( 0 != ( *string++ = (char)tolower( *string ) ) );
return string;
}
void _memset16_unaligned( void* dest, u16 data, size_t size )
{
jASSUME( (size & 0x1) == 0 );
u16* dst = (u16*)dest;
for(int i=size; i; --i, ++dst )
*dst = data;
}

View File

@ -1,42 +0,0 @@
/* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2009 Pcsx2 Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#pragma once
struct KeyModifiers
{
bool control;
bool alt;
bool shift;
bool capslock;
};
extern struct KeyModifiers keymodifiers;
// Per ChickenLiver, this is being used to pass the GS plugins window handle to the Pad plugins.
// So a rename to pDisplay is in the works, but it will not, in fact, be removed.
extern uptr pDsp; //Used in GS, MTGS, Plugins, Misc
extern int GetPS2ElfName( wxString& dest ); // Used in Misc, System, Linux, CDVD
// Not sure what header these should go in. Probably not this one.
void SetCPUState(u32 sseMXCSR, u32 sseVUMXCSR);
extern u32 g_sseVUMXCSR, g_sseMXCSR;
void SaveGSState(const wxString& file);
void LoadGSState(const wxString& file);

View File

@ -238,3 +238,6 @@ extern PluginManager* PluginManager_Create( const wxChar* (&folders)[PluginId_Co
extern PluginManagerBase& GetPluginManager();
// Per ChickenLiver, this is being used to pass the GS plugins window handle to the Pad plugins.
// So a rename to pDisplay is in the works, but it will not, in fact, be removed.
extern uptr pDsp;

View File

@ -17,7 +17,6 @@
#include "Utilities/SafeArray.h"
#include "Utilities/Threading.h" // to use threading stuff, include the Threading namespace in your file.
#include "Misc.h"
#include "CDVD/CDVDaccess.h"
static const int PCSX2_VersionHi = 0;

View File

@ -351,5 +351,3 @@ extern void OpenPlugins();
extern wxRect wxGetDisplayArea();
extern bool pxIsValidWindowPosition( const wxWindow& window, const wxPoint& windowPos );
extern void ProcessFKeys(int fkey, struct KeyModifiers *keymod);

View File

@ -21,6 +21,7 @@
#include "Dialogs/ModalPopups.h"
#include "Utilities/ScopedPtr.h"
#include "Utilities/HashMap.h"
#include <wx/cmdline.h>
#include <wx/stdpaths.h>
@ -197,8 +198,6 @@ sptr AppEmuThread::ExecuteTask()
wxFrame* Pcsx2App::GetMainWindow() const { return m_MainFrame; }
#include "HashMap.h"
void Pcsx2App::OpenWizardConsole()
{
if( !IsDebugBuild ) return;

View File

@ -14,7 +14,6 @@
*/
#include "PrecompiledHeader.h"
#include "Misc.h"
#include "App.h"
#include "Dialogs/ModalPopups.h"
#include "wxHelpers.h"

View File

@ -14,7 +14,6 @@
*/
#include "PrecompiledHeader.h"
#include "Misc.h"
#include "System.h"
#include "App.h"

View File

@ -16,7 +16,6 @@
#include "PrecompiledHeader.h"
#include "ConfigurationPanels.h"
#include "Misc.h"
#include "System.h"
using namespace wxHelpers;

File diff suppressed because it is too large Load Diff

View File

@ -50,3 +50,4 @@ void SetCPUState(u32 sseMXCSR, u32 sseVUMXCSR)
#endif
//g_sseVUMXCSR = g_sseMXCSR|0x6000;
}

View File

@ -17,6 +17,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="..\..\..\..\common\vsprops\plugin_svnroot.vsprops;..\..\..\..\common\vsprops\BaseProperties.vsprops;..\..\..\..\common\vsprops\3rdpartyDeps.vsprops;..\..\..\..\common\vsprops\CodeGen_Debug.vsprops"
UseOfMFC="0"

View File

@ -20,6 +20,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets=".\ProjectRootDir.vsprops;..\..\common\vsprops\BaseProperties.vsprops;..\..\common\vsprops\CodeGen_Debug.vsprops"
UseOfMFC="0"

View File

@ -265,6 +265,7 @@
</Configuration>
<Configuration
Name="Debug|Win32"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="..\..\..\..\common\vsprops\plugin_svnroot.vsprops;..\..\..\..\common\vsprops\BaseProperties.vsprops;..\..\..\..\common\vsprops\3rdpartyDeps.vsprops;..\..\..\..\common\vsprops\CodeGen_Debug.vsprops;..\..\..\..\common\vsprops\IncrementalLinking.vsprops"
UseOfMFC="0"