/[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 62 - (show annotations) (download)
Tue Sep 7 11:08:22 2010 UTC (10 years, 1 month ago) by william
File MIME type: text/plain
File size: 5091 byte(s)
Auto Commited Import of: pcsx2-0.9.7-r3738-debug in ./trunk
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 "SysForwardDefs.h"
19
20 #include "Utilities/SafeArray.h"
21 #include "Utilities/Threading.h" // to use threading stuff, include the Threading namespace in your file.
22 #include "CDVD/CDVDaccess.h"
23
24 typedef SafeArray<u8> VmStateBuffer;
25 class BaseVUmicroCPU;
26
27 // --------------------------------------------------------------------------------------
28 // SysAllocVM
29 // --------------------------------------------------------------------------------------
30 class SysAllocVM
31 {
32 public:
33 SysAllocVM();
34 virtual ~SysAllocVM() throw();
35
36 protected:
37 void CleanupMess() throw();
38 };
39
40 // --------------------------------------------------------------------------------------
41 // SysCpuProviderPack
42 // --------------------------------------------------------------------------------------
43 class SysCpuProviderPack
44 {
45 protected:
46 ScopedPtr<BaseException> m_RecExceptionEE;
47 ScopedPtr<BaseException> m_RecExceptionIOP;
48
49 public:
50 ScopedPtr<CpuInitializerSet> CpuProviders;
51
52 SysCpuProviderPack();
53 virtual ~SysCpuProviderPack() throw();
54
55 void ApplyConfig() const;
56 BaseVUmicroCPU* getVUprovider(int whichProvider, int vuIndex) const;
57
58 bool HadSomeFailures( const Pcsx2Config::RecompilerOptions& recOpts ) const;
59
60 bool IsRecAvailable_EE() const { return !m_RecExceptionEE; }
61 bool IsRecAvailable_IOP() const { return !m_RecExceptionIOP; }
62
63 BaseException* GetException_EE() const { return m_RecExceptionEE; }
64 BaseException* GetException_IOP() const { return m_RecExceptionIOP; }
65
66 bool IsRecAvailable_MicroVU0() const;
67 bool IsRecAvailable_MicroVU1() const;
68 BaseException* GetException_MicroVU0() const;
69 BaseException* GetException_MicroVU1() const;
70
71 bool IsRecAvailable_SuperVU0() const;
72 bool IsRecAvailable_SuperVU1() const;
73 BaseException* GetException_SuperVU0() const;
74 BaseException* GetException_SuperVU1() const;
75
76 protected:
77 void CleanupMess() throw();
78 };
79
80 // GetCpuProviders - this function is not implemented by PCSX2 core -- it must be
81 // implemented by the provisioning interface.
82 extern SysCpuProviderPack& GetCpuProviders();
83
84 extern void SysLogMachineCaps(); // Detects cpu type and fills cpuInfo structs.
85 extern void SysClearExecutionCache(); // clears recompiled execution caches!
86
87 extern u8 *SysMmapEx(uptr base, u32 size, uptr bounds, const char *caller="Unnamed");
88 extern void vSyncDebugStuff( uint frame );
89 extern void NTFS_CompressFile( const wxString& file, bool compressStatus=true );
90
91 extern wxString SysGetDiscID();
92
93 // --------------------------------------------------------------------------------------
94 // PCSX2_SEH - Defines existence of "built in" Structured Exception Handling support.
95 // --------------------------------------------------------------------------------------
96 // This should be available on Windows, via Microsoft or Intel compilers (I'm pretty sure Intel
97 // supports native SEH model). GNUC in Windows, or any compiler in a non-windows platform, will
98 // need to use setjmp/longjmp instead to exit recompiled code.
99 //
100
101 //#define PCSX2_SEH 0 // use this to force disable SEH on win32, to test setjmp functionality.
102
103 #ifndef PCSX2_SEH
104 # if defined(_WIN32) && !defined(__GNUC__)
105 # define PCSX2_SEH 1
106 # else
107 # define PCSX2_SEH 0
108 # endif
109 #endif
110
111 // special macro which disables inlining on functions that require their own function stackframe.
112 // This is due to how Win32 handles structured exception handling. Linux uses signals instead
113 // of SEH, and so these functions can be inlined.
114 #ifdef _WIN32
115 # define __unique_stackframe __noinline
116 #else
117 # define __unique_stackframe
118 #endif
119
120
121 //////////////////////////////////////////////////////////////////////////////////////////
122 // Different types of message boxes that the emulator can employ from the friendly confines
123 // of it's blissful unawareness of whatever GUI it runs under. :) All message boxes exhibit
124 // blocking behavior -- they prompt the user for action and only return after the user has
125 // responded to the prompt.
126 //
127
128 namespace Msgbox
129 {
130 extern bool Alert( const wxString& text, const wxString& caption=L"PCSX2 Message", int icon=wxICON_EXCLAMATION );
131 extern bool OkCancel( const wxString& text, const wxString& caption=L"PCSX2 Message", int icon=0 );
132 extern bool YesNo( const wxString& text, const wxString& caption=L"PCSX2 Message", int icon=wxICON_QUESTION );
133
134 extern int Assertion( const wxString& text, const wxString& stacktrace );
135 }
136

  ViewVC Help
Powered by ViewVC 1.1.22