/[pcsx2_0.9.7]/branch/r3113_0.9.7_beta_reference/pcsx2/System.h
ViewVC logotype

Contents of /branch/r3113_0.9.7_beta_reference/pcsx2/System.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 174 - (show annotations) (download)
Mon Sep 13 17:24:24 2010 UTC (9 years, 11 months ago) by william
File MIME type: text/plain
File size: 6973 byte(s)
merge r171-173 from https://svn.netsolutions.dnsalias.com/websvn/ps2/pcsx2/pcsx2_0.9.7/branch/debug/0.X/0.9.X/0.9.7/r3113
-- pick up:
* local versioning support from trunk
* get rig of annoying warnings
1 /* PCSX2 - PS2 Emulator for PCs
2 * Copyright (C) 2002-2010 PCSX2 Dev Team
3 *
4 * PCSX2 is free software: you can redistribute it and/or modify it under the terms
5 * of the GNU Lesser General Public License as published by the Free Software Found-
6 * ation, either version 3 of the License, or (at your option) any later version.
7 *
8 * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10 * PURPOSE. See the GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License along with PCSX2.
13 * If not, see <http://www.gnu.org/licenses/>.
14 */
15
16 #pragma once
17
18 #include "Utilities/SafeArray.h"
19 #include "Utilities/Threading.h" // to use threading stuff, include the Threading namespace in your file.
20 #include "CDVD/CDVDaccess.h"
21
22 static const int PCSX2_VersionHi = 0;
23 static const int PCSX2_VersionMid = 9;
24 static const int PCSX2_VersionLo = 7;
25
26 class SysCoreThread;
27 class CpuInitializerSet;
28
29 typedef SafeArray<u8> VmStateBuffer;
30
31 // --------------------------------------------------------------------------------------
32 // SysCoreAllocations class
33 // --------------------------------------------------------------------------------------
34 class SysCoreAllocations
35 {
36 protected:
37 ScopedPtr<CpuInitializerSet> CpuProviders;
38
39 bool m_RecSuccessEE:1;
40 bool m_RecSuccessIOP:1;
41
42 public:
43 SysCoreAllocations();
44 virtual ~SysCoreAllocations() throw();
45
46 void SelectCpuProviders() const;
47
48 bool HadSomeFailures( const Pcsx2Config::RecompilerOptions& recOpts ) const;
49
50 bool IsRecAvailable_EE() const { return m_RecSuccessEE; }
51 bool IsRecAvailable_IOP() const { return m_RecSuccessIOP; }
52
53 bool IsRecAvailable_MicroVU0() const;
54 bool IsRecAvailable_MicroVU1() const;
55
56 bool IsRecAvailable_SuperVU0() const;
57 bool IsRecAvailable_SuperVU1() const;
58
59 protected:
60 void CleanupMess() throw();
61 };
62
63 // GetSysCoreAlloc - this function is not implemented by PCSX2 core -- it must be
64 // implemented by the provisioning interface.
65 extern SysCoreAllocations& GetSysCoreAlloc();
66
67 extern void SysLogMachineCaps(); // Detects cpu type and fills cpuInfo structs.
68 extern void SysClearExecutionCache(); // clears recompiled execution caches!
69
70
71 extern u8 *SysMmapEx(uptr base, u32 size, uptr bounds, const char *caller="Unnamed");
72 extern void vSyncDebugStuff( uint frame );
73 extern void NTFS_CompressFile( const wxString& file, bool compressStatus=true );
74
75 // --------------------------------------------------------------------------------------
76 // PCSX2_SEH - Defines existence of "built in" Structured Exception Handling support.
77 // --------------------------------------------------------------------------------------
78 // This should be available on Windows, via Microsoft or Intel compilers (I'm pretty sure Intel
79 // supports native SEH model). GNUC in Windows, or any compiler in a non-windows platform, will
80 // need to use setjmp/longjmp instead to exit recompiled code.
81 //
82
83 //#define PCSX2_SEH 0 // use this to force disable SEH on win32, to test setjmp functionality.
84
85 #ifndef PCSX2_SEH
86 # if defined(_WIN32) && !defined(__GNUC__)
87 # define PCSX2_SEH 1
88 # else
89 # define PCSX2_SEH 0
90 # endif
91 #endif
92
93 // special macro which disables inlining on functions that require their own function stackframe.
94 // This is due to how Win32 handles structured exception handling. Linux uses signals instead
95 // of SEH, and so these functions can be inlined.
96 #ifdef _WIN32
97 # define __unique_stackframe __noinline
98 #else
99 # define __unique_stackframe
100 #endif
101
102
103 //////////////////////////////////////////////////////////////////////////////////////////
104 // Different types of message boxes that the emulator can employ from the friendly confines
105 // of it's blissful unawareness of whatever GUI it runs under. :) All message boxes exhibit
106 // blocking behavior -- they prompt the user for action and only return after the user has
107 // responded to the prompt.
108 //
109
110 namespace Msgbox
111 {
112 extern bool Alert( const wxString& text, const wxString& caption=L"PCSX2 Message", int icon=wxICON_EXCLAMATION );
113 extern bool OkCancel( const wxString& text, const wxString& caption=L"PCSX2 Message", int icon=0 );
114 extern bool YesNo( const wxString& text, const wxString& caption=L"PCSX2 Message", int icon=wxICON_QUESTION );
115
116 extern int Assertion( const wxString& text, const wxString& stacktrace );
117 }
118
119 // BEGIN: SUPPORT FOR LOCAL VERSIONING
120 #include "svnrev.h"
121 #include <wx/wx.h>
122 static const int PCSX2_UPSTREAM_REVISION=3113;
123 static const int PCSX2_LOCAL_REVISION=SVN_REV;
124 static const char* PCSX2_LOCAL_TAG="";
125 __forceinline const char* _PCSX2_PRODUCT_VERSION() {
126 int version_size = (strlen("0.0.0"));
127 char majorBuffer[255];
128 char minorBuffer[255];
129 char buildBuffer[255];
130 char* MAJOR = itoa(PCSX2_VersionHi,majorBuffer,10);
131 char* MINOR = itoa(PCSX2_VersionMid,minorBuffer,10);
132 char* BUILD = itoa(PCSX2_VersionLo,buildBuffer,10);
133 char* ret = (char*)malloc(version_size);
134 for (int i=0; i<version_size; i++) {
135 ret[i] = 0; // Initialize all elements to zero.
136 }
137 strcat(ret,MAJOR);
138 strcat(ret,".");
139 strcat(ret,MINOR);
140 strcat(ret,".");
141 strcat(ret,BUILD);
142 return ret;
143 }
144 __forceinline const char* _PCSX2_UPSTREAM_VERSION() {
145 int version_size = (strlen("0.0.0.0000"));
146 char buffer[255];
147 char* REVISION = itoa(PCSX2_UPSTREAM_REVISION,buffer,10);
148 char* ret = (char*)malloc(version_size);
149 for (int i=0; i<version_size; i++) {
150 ret[i] = 0; // Initialize all elements to zero.
151 }
152 strcat(ret,_PCSX2_PRODUCT_VERSION());
153 strcat(ret,".");
154 strcat(ret,REVISION);
155 return ret;
156 }
157 __forceinline const char* _PCSX2_LOCAL_VERSION() {
158 int version_size = (strlen("0.0.0.0000"));
159 char buffer[255];
160 char* REVISION = itoa(PCSX2_LOCAL_REVISION,buffer,10);
161 char* ret = (char*)malloc(version_size);
162 for (int i=0; i<version_size; i++) {
163 ret[i] = 0; // Initialize all elements to zero.
164 }
165 strcat(ret,_PCSX2_PRODUCT_VERSION());
166 strcat(ret,".");
167 strcat(ret,REVISION);
168 if ( PCSX2_LOCAL_TAG != "" ) { strcat(ret,"-"); strcat(ret,PCSX2_LOCAL_TAG); }
169 return ret;
170 }
171 __forceinline const char* _PCSX2_FULL_VERSION() {
172 int version_size = (strlen("0.0.0.0000 (0.0.0.0000)"));
173 char* ret = (char*)malloc(version_size);
174 for (int i=0; i<version_size; i++) {
175 ret[i] = 0; // Initialize all elements to zero.
176 }
177 strcat(ret,"v");
178 strcat(ret,_PCSX2_UPSTREAM_VERSION());
179 strcat(ret," (");
180 strcat(ret,"v");
181 strcat(ret,_PCSX2_LOCAL_VERSION());
182 strcat(ret,")");
183 return ret;
184 }
185 #define PCSX2_PRODUCT_VERSION() (const char*)_PCSX2_PRODUCT_VERSION()
186 #define PCSX2_UPSTREAM_VERSION() (const char*)_PCSX2_UPSTREAM_VERSION()
187 #define PCSX2_LOCAL_VERSION() (const char*)_PCSX2_LOCAL_VERSION()
188 #define PCSX2_FULL_VERSION() (const char*)_PCSX2_FULL_VERSION()
189 #define wxPCSX2_FULL_VERSION() wxString(wxString::FromAscii(PCSX2_FULL_VERSION()))
190 // END: SUPPORT FOR LOCAL VERSIONING

  ViewVC Help
Powered by ViewVC 1.1.22