/[pcsx2_0.9.7]/trunk/pcsx2/gui/Panels/GameFixesPanel.cpp
ViewVC logotype

Contents of /trunk/pcsx2/gui/Panels/GameFixesPanel.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 280 - (show annotations) (download)
Thu Dec 23 12:02:12 2010 UTC (9 years, 2 months ago) by william
File size: 4541 byte(s)
re-commit (had local access denied errors when committing)
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 #include "PrecompiledHeader.h"
17 #include "App.h"
18 #include "ConfigurationPanels.h"
19
20 using namespace pxSizerFlags;
21
22 Panels::GameFixesPanel::GameFixesPanel( wxWindow* parent )
23 : BaseApplicableConfigPanel( parent )
24 {
25 wxStaticBoxSizer& groupSizer = *new wxStaticBoxSizer( wxVERTICAL, this, _("Gamefixes") );
26
27 // NOTE: Order of checkboxes must match the order of the bits in the GamefixOptions structure!
28 // NOTE2: Don't make this static, because translations can change at run-time :)
29
30 struct CheckTextMess
31 {
32 wxString label, tooltip;
33 };
34
35 const CheckTextMess check_text[GamefixId_COUNT] =
36 {
37 {
38 _("VU Add Hack - Fixes Tri-Ace games boot crash."),
39 _("Games that need this hack to boot:\n * Star Ocean 3\n * Radiata Stories\n * Valkyrie Profile 2")
40 },
41 {
42 _("VU Clip Flag Hack - For Persona games (SuperVU recompiler only!)"),
43 wxEmptyString
44 },
45 {
46 _("FPU Compare Hack - For Digimon Rumble Arena 2."),
47 wxEmptyString
48 },
49 {
50 _("FPU Multiply Hack - For Tales of Destiny."),
51 wxEmptyString
52 },
53 {
54 _("FPU Negative Div Hack - For Gundam games."),
55 wxEmptyString
56 },
57 {
58 _("VU XGkick Hack - For Erementar Gerad."),
59 wxEmptyString
60 },
61 {
62 _("FFX videos fix - Fixes bad graphics overlay in FFX videos."),
63 wxEmptyString
64 },
65 {
66 _("EE timing hack - Multi purpose hack. Try if all else fails."),
67 pxEt( "!ContextTip:Gamefixes:EE Timing Hack",
68 L"Known to affect following games:\n"
69 L" * Digital Devil Saga (Fixes FMV and crashes)\n"
70 L" * SSX (Fixes bad graphics and crashes)\n"
71 L" * Resident Evil: Dead Aim (Causes garbled textures)"
72 )
73 },
74 {
75 _("Skip MPEG hack - Skips videos/FMVs in games to avoid game hanging/freezes."),
76 wxEmptyString
77 },
78 {
79 _("OPH Flag hack - Try if your game freezes showing the same frame."),
80 pxEt( "!ContextTip:Gamefixes:OPH Flag hack",
81 L"Known to affect following games:\n"
82 L" * Bleach Blade Battler\n"
83 L" * Growlanser II and III\n"
84 L" * Wizardry"
85 )
86 }
87 };
88
89 for( int i=0; i<GamefixId_COUNT; ++i )
90 {
91 groupSizer += (m_checkbox[i] = new pxCheckBox( this, check_text[i].label ));
92 m_checkbox[i]->SetToolTip( check_text[i].tooltip );
93 }
94
95 m_check_Enable = new pxCheckBox( this, _("Enable game fixes"),
96 pxE( "!Panel:Gamefixes:Compat Warning",
97 L"Gamefixes can fix wrong emulation in some games. However "
98 L"it can cause compatibility or performance issues in other games. You "
99 L"will need to turn off fixes manually when changing games."
100 )
101 );
102
103 m_check_Enable->SetToolTip(_("The safest way to make sure that all game fixes are completely disabled.")).SetSubPadding( 1 );
104 m_check_Enable->SetValue( g_Conf->EnableGameFixes );
105
106 *this += m_check_Enable | StdExpand();
107 *this += groupSizer | pxCenter;
108
109
110 Connect( m_check_Enable->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GameFixesPanel::OnEnable_Toggled ) );
111
112 EnableStuff();
113 }
114
115 void Panels::GameFixesPanel::Apply()
116 {
117 g_Conf->EnableGameFixes = m_check_Enable->GetValue();
118
119 Pcsx2Config::GamefixOptions& opts( g_Conf->EmuOptions.Gamefixes );
120 for (GamefixId i=GamefixId_FIRST; i < pxEnumEnd; ++i)
121 opts.Set((GamefixId)i, m_checkbox[i]->GetValue());
122
123 // make sure the user's command line specifications are disabled (if present).
124 wxGetApp().Overrides.ApplyCustomGamefixes = false;
125 }
126
127 void Panels::GameFixesPanel::EnableStuff()
128 {
129 for (GamefixId i=GamefixId_FIRST; i < pxEnumEnd; ++i)
130 m_checkbox[i]->Enable(m_check_Enable->GetValue());
131 }
132
133 void Panels::GameFixesPanel::OnEnable_Toggled( wxCommandEvent& evt )
134 {
135 EnableStuff();
136 evt.Skip();
137 }
138
139 void Panels::GameFixesPanel::AppStatusEvent_OnSettingsApplied()
140 {
141 const Pcsx2Config::GamefixOptions& opts( g_Conf->EmuOptions.Gamefixes );
142 for (GamefixId i=GamefixId_FIRST; i < pxEnumEnd; ++i)
143 m_checkbox[i]->SetValue( opts.Get((GamefixId)i) );
144 }

  ViewVC Help
Powered by ViewVC 1.1.22