/[pcsx2_0.9.7]/trunk/pcsx2/System.h
ViewVC logotype

Contents of /trunk/pcsx2/System.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31 - (show annotations) (download)
Tue Sep 7 03:24:11 2010 UTC (9 years, 5 months ago) by william
File MIME type: text/plain
File size: 4425 byte(s)
committing r3113 initial commit again...
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

  ViewVC Help
Powered by ViewVC 1.1.22