diff options
| author | Soren Jorvang <soren.jorvang@gmail.com> | 2011-02-03 21:11:06 +0000 |
|---|---|---|
| committer | Soren Jorvang <soren.jorvang@gmail.com> | 2011-02-03 21:11:06 +0000 |
| commit | 435b25fa55b56e52508776672d8fee8d407f813b (patch) | |
| tree | 116645f173af12104400d926e5f847707e385fb4 /Source/Core | |
| parent | dfe84ce0acf288157a867f0df1678930b281fd40 (diff) | |
Fix the CMake build.
Prevent the PS3 HID crash until I can debug it.
AudioUnits are enabled by default.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7052 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp | 10 | ||||
| -rw-r--r-- | Source/Core/AudioCommon/Src/Mixer.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/Core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | Source/Core/Core/Core.vcproj | 12 | ||||
| -rw-r--r-- | Source/Core/Core/Core.vcxproj | 14 | ||||
| -rw-r--r-- | Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/PHackSettings.cpp | 318 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/PHackSettings.h | 141 | ||||
| -rw-r--r-- | Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXJoystick.mm | 2 |
10 files changed, 253 insertions, 255 deletions
diff --git a/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp b/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp index a230d07a75..d09bce85f9 100644 --- a/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp +++ b/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp @@ -46,15 +46,14 @@ bool CoreAudioSound::Start() AURenderCallbackStruct callback_struct; AudioStreamBasicDescription format; ComponentDescription desc; - UInt32 enableIO = 1; + Component component; desc.componentType = kAudioUnitType_Output; desc.componentSubType = kAudioUnitSubType_DefaultOutput; desc.componentFlags = 0; desc.componentFlagsMask = 0; desc.componentManufacturer = kAudioUnitManufacturer_Apple; - - Component component = FindNextComponent(NULL, &desc); + component = FindNextComponent(NULL, &desc); if (component == NULL) { ERROR_LOG(AUDIO, "error finding audio component"); return false; @@ -66,11 +65,6 @@ bool CoreAudioSound::Start() return false; } - AudioUnitSetProperty(audioUnit, - kAudioOutputUnitProperty_EnableIO, - kAudioUnitScope_Output, 0, &enableIO, - sizeof enableIO); - FillOutASBDForLPCM(format, m_mixer->GetSampleRate(), 2, 16, 16, false, false, false); err = AudioUnitSetProperty(audioUnit, diff --git a/Source/Core/AudioCommon/Src/Mixer.cpp b/Source/Core/AudioCommon/Src/Mixer.cpp index bed8f0e21f..c8eece73c7 100644 --- a/Source/Core/AudioCommon/Src/Mixer.cpp +++ b/Source/Core/AudioCommon/Src/Mixer.cpp @@ -31,8 +31,6 @@ #include <tmmintrin.h> #endif -static const __m128i sr_mask = _mm_set_epi32(0x0C0D0E0FL, 0x08090A0BL, 0x04050607L, 0x00010203L); - // Executed from sound stream thread unsigned int CMixer::Mix(short* samples, unsigned int numSamples) { @@ -64,6 +62,10 @@ unsigned int CMixer::Mix(short* samples, unsigned int numSamples) if (m_sampleRate == 32000) { #if _M_SSE >= 0x301 + static const __m128i sr_mask = + _mm_set_epi32(0x0C0D0E0FL, 0x08090A0BL, + 0x04050607L, 0x00010203L); + if (cpu_info.bSSSE3 && !((numLeft * 2) % 8)) { for (unsigned int i = 0; i < numLeft * 2; i += 8) diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index 217bbce660..7abd2fc2d5 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -181,7 +181,7 @@ set(SRCS Src/ActionReplay.cpp Src/PowerPC/JitCommon/JitCache.cpp Src/PowerPC/JitCommon/Jit_Util.cpp) -set(LIBS bdisasm inputcommon videoogl videosoftware lua sfml-network) +set(LIBS bdisasm inputcommon videoogl videosoftware sfml-network) if(WIN32) set(SRCS ${SRCS} Src/HW/BBA-TAP/TAP_Win32.cpp Src/stdafx.cpp diff --git a/Source/Core/Core/Core.vcproj b/Source/Core/Core/Core.vcproj index b1160d3403..3164c3c034 100644 --- a/Source/Core/Core/Core.vcproj +++ b/Source/Core/Core/Core.vcproj @@ -45,7 +45,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include" + AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\SFML\include" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -116,7 +116,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include" + AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\SFML\include" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -191,7 +191,7 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" EnableFiberSafeOptimizations="false" - AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include" + AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\SFML\include" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="0" @@ -269,7 +269,7 @@ OmitFramePointers="true" EnableFiberSafeOptimizations="false" WholeProgramOptimization="false" - AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include" + AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\SFML\include" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="0" @@ -344,7 +344,7 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" EnableFiberSafeOptimizations="false" - AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include" + AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\SFML\include" PreprocessorDefinitions="NDEBUG;_LIB;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" RuntimeLibrary="0" BufferSecurityCheck="true" @@ -419,7 +419,7 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" EnableFiberSafeOptimizations="false" - AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include" + AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\SFML\include" PreprocessorDefinitions="NDEBUG;_LIB;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" RuntimeLibrary="0" BufferSecurityCheck="false" diff --git a/Source/Core/Core/Core.vcxproj b/Source/Core/Core/Core.vcxproj index ae65543a3e..3c02164ed2 100644 --- a/Source/Core/Core/Core.vcxproj +++ b/Source/Core/Core/Core.vcxproj @@ -127,7 +127,7 @@ <ClCompile> <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles> @@ -146,7 +146,7 @@ <ClCompile> <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles> @@ -167,7 +167,7 @@ <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <ShowIncludes>false</ShowIncludes> @@ -191,7 +191,7 @@ <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>DEBUGFAST;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <ShowIncludes>false</ShowIncludes> @@ -216,7 +216,7 @@ <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <ShowIncludes>false</ShowIncludes> @@ -240,7 +240,7 @@ <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>DEBUGFAST;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <ShowIncludes>false</ShowIncludes> @@ -639,4 +639,4 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> -</Project>
\ No newline at end of file +</Project> diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp index 01c6d0b8c9..b41d8b1852 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp @@ -116,7 +116,7 @@ void Jit64::reg_imm(UGeckoInstruction inst) { INSTRUCTION_START JITDISABLE(Integer) - int d = inst.RD, a = inst.RA, s = inst.RS; + u32 d = inst.RD, a = inst.RA, s = inst.RS; switch (inst.OPCD) { case 14: // addi diff --git a/Source/Core/DolphinWX/CMakeLists.txt b/Source/Core/DolphinWX/CMakeLists.txt index 8c9b882be8..6a8355fe43 100644 --- a/Source/Core/DolphinWX/CMakeLists.txt +++ b/Source/Core/DolphinWX/CMakeLists.txt @@ -7,7 +7,6 @@ set(LIBS core inputcommon common audiocommon - lua z sfml-network SDL diff --git a/Source/Core/DolphinWX/Src/PHackSettings.cpp b/Source/Core/DolphinWX/Src/PHackSettings.cpp index 7b5b4c1891..ffa3d3d779 100644 --- a/Source/Core/DolphinWX/Src/PHackSettings.cpp +++ b/Source/Core/DolphinWX/Src/PHackSettings.cpp @@ -1,159 +1,159 @@ -// Copyright (C) 2003 Dolphin Project.
-
-// 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, version 2.0.
-
-// 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 2.0 for more details.
-
-// A copy of the GPL 2.0 should have been included with the program.
-// If not, see http://www.gnu.org/licenses/
-
-// Official SVN repository and contact information can be found at
-// http://code.google.com/p/dolphin-emu/
-
-#include "PHackSettings.h"
-#include "ConfigManager.h"
-
-extern PHackData PHack_Data;
-
-BEGIN_EVENT_TABLE(CPHackSettings, wxDialog)
- EVT_CHOICE(ID_PHACK_CHOICE, CPHackSettings::SetRefresh)
- EVT_CLOSE(CPHackSettings::OnClose)
- EVT_BUTTON(wxID_OK, CPHackSettings::SavePHackData)
-END_EVENT_TABLE()
-
-CPHackSettings::CPHackSettings(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
- : wxDialog(parent, id, title, position, size, style)
-{
- CreateGUIControls();
- std::string _iniFilename;
- _iniFilename = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + "PH_PRESETS.ini";
- PHPresetsIni.Load(_iniFilename.c_str());
- //PHPresetsIni.SortSections();
- //PHPresetsIni.Save(_iniFilename.c_str());
-
- LoadPHackData();
-}
-
-CPHackSettings::~CPHackSettings()
-{
-}
-
-void CPHackSettings::CreateGUIControls()
-{
- PHackChoiceText = new wxStaticText(this, ID_PHACK_CHOICE_TEXT, _("Presets: "), wxDefaultPosition, wxDefaultSize);
- PHackChoice = new wxChoice(this, ID_PHACK_CHOICE, wxDefaultPosition, wxDefaultSize, wxArrayString(0, wxString("", *wxConvCurrent)), 0, wxDefaultValidator);
- PHackChoice->SetToolTip(_("Load preset values from hack patterns available."));
- PHackZNearText = new wxStaticText(this, ID_PHACK_ZNEAR_TEXT, _("zNear Correction: "), wxDefaultPosition, wxDefaultSize);
- PHackZNear = new wxTextCtrl(this, ID_PHACK_ZNEAR, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
- PHackZNear->SetToolTip(_("Adds the specified value to zNear Parameter.\nTwo ways to express the floating point values.\nExample: entering '\'200'\' or '\'0.0002'\' directly, it produces equal effects, the acquired value will be '\'0.0002'\'.\nValues: (0->+/-Integer) or (0->+/-FP[6 digits of precision])\n\nNOTE: Check LogWindow/Console for the acquired values."));
- PHackSZNear = new wxCheckBox(this, ID_PHACK_SZNEAR, _("(-)+zNear"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE, wxDefaultValidator);
- PHackSZNear->SetToolTip(_("Changes sign to zNear Parameter (after correction)"));
- PHackZFarText = new wxStaticText(this, ID_PHACK_ZFAR_TEXT, _("zFar Correction: "), wxDefaultPosition, wxDefaultSize);
- PHackZFar = new wxTextCtrl(this, ID_PHACK_ZFAR, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
- PHackZFar->SetToolTip(_("Adds the specified value to zFar Parameter.\nTwo ways to express the floating point values.\nExample: entering '\'200'\' or '\'0.0002'\' directly, it produces equal effects, the acquired value will be '\'0.0002'\'.\nValues: (0->+/-Integer) or (0->+/-FP[6 digits of precision])\n\nNOTE: Check LogWindow/Console for the acquired values."));
- PHackSZFar = new wxCheckBox(this, ID_PHACK_SZFAR, _("(-)+zFar"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE, wxDefaultValidator);
- PHackSZFar->SetToolTip(_("Changes sign to zFar Parameter (after correction)"));
- PHackExP = new wxCheckBox(this, ID_PHACK_EXP, _("Extra Parameter"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE, wxDefaultValidator);
- PHackExP->SetToolTip(_("Extra Parameter useful in '\'Metroid: Other M'\' only."));
-
- wxStaticBoxSizer *sbPHackSettings = new wxStaticBoxSizer(wxVERTICAL, this, _("Parameters"));
- wxFlexGridSizer *szrPHackSettings = new wxFlexGridSizer(3, 5, 5);
- sbPHackSettings->Add(szrPHackSettings, 0, wxEXPAND|wxLEFT|wxTOP, 5);
- szrPHackSettings->Add(PHackZNearText, 0, wxALIGN_CENTER_VERTICAL);
- szrPHackSettings->Add(PHackZNear, 1, wxEXPAND);
- szrPHackSettings->Add(PHackSZNear, 0, wxEXPAND|wxLEFT, 5);
- szrPHackSettings->Add(PHackZFarText, 0, wxALIGN_CENTER_VERTICAL);
- szrPHackSettings->Add(PHackZFar, 1, wxEXPAND);
- szrPHackSettings->Add(PHackSZFar, 0, wxEXPAND|wxLEFT, 5);
- szrPHackSettings->Add(PHackExP, 0, wxEXPAND|wxTOP|wxBOTTOM, 5);
-
- wxBoxSizer* sPHackButtons = new wxBoxSizer(wxHORIZONTAL);
- wxButton* bOK = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
- wxButton* bCancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
- sPHackButtons->Add(0, 0, 1, wxEXPAND, 5);
- sPHackButtons->Add(bOK, 0, wxALL, 5);
- sPHackButtons->Add(bCancel, 0, wxALL, 5);
-
- wxBoxSizer* sPHack = new wxBoxSizer(wxVERTICAL);
- sPHack->Add(PHackChoiceText, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5);
- sPHack->Add(PHackChoice, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 5);
- sPHack->Add(sbPHackSettings, 0, wxEXPAND|wxALL, 5);
- sPHack->Add(sPHackButtons, 0, wxEXPAND, 5);
-
- SetSizerAndFit(sPHack);
-}
-
-void CPHackSettings::LoadPHackData()
-{
- std::string sTemp;
- char sIndex[15];
-
- PHackChoice->Clear();
- PHackChoice->Append(_("[Custom]"));
- for (int i=0 ; ; i++)
- {
- sprintf(sIndex,"%d",i);
- if (!PHPresetsIni.Exists(sIndex, "Title"))
- break;
- PHPresetsIni.Get(sIndex, "Title", &sTemp);
- if (sTemp.empty())
- sTemp = wxString(_("(UNKNOWN)")).char_str();
- if (i == 0)
- PHackChoice->Append(wxString("-----------", *wxConvCurrent));
- PHackChoice->Append(wxString(sTemp.c_str(), *wxConvCurrent));
- }
- PHackChoice->Select(0);
-
- PHackSZNear->Set3StateValue((wxCheckBoxState)PHack_Data.PHackSZNear);
- PHackSZFar->Set3StateValue((wxCheckBoxState)PHack_Data.PHackSZFar);
- PHackExP->Set3StateValue((wxCheckBoxState)PHack_Data.PHackExP);
-
- PHackZNear->SetValue(wxString(PHack_Data.PHZNear.c_str(), *wxConvCurrent));
- PHackZFar->SetValue(wxString(PHack_Data.PHZFar.c_str(), *wxConvCurrent));
-}
-
-void CPHackSettings::SetRefresh(wxCommandEvent& event)
-{
- bool bTemp;
- std::string sTemp;
- char sIndex[15];
- int index = event.GetSelection();
- if (index > 1)
- {
- index -= 2;
- sprintf(sIndex,"%d", index);
-
- PHPresetsIni.Get(sIndex, "PH_SZNear", &bTemp);
- PHackSZNear->Set3StateValue((wxCheckBoxState)bTemp);
- PHPresetsIni.Get(sIndex, "PH_SZFar", &bTemp);
- PHackSZFar->Set3StateValue((wxCheckBoxState)bTemp);
- PHPresetsIni.Get(sIndex, "PH_ExtraParam", &bTemp);
- PHackExP->Set3StateValue((wxCheckBoxState)bTemp);
- PHPresetsIni.Get(sIndex, "PH_ZNear", &sTemp);
- PHackZNear->SetValue(wxString(sTemp.c_str(), *wxConvCurrent));
- PHPresetsIni.Get(sIndex, "PH_ZFar", &sTemp);
- PHackZFar->SetValue(wxString(sTemp.c_str(), *wxConvCurrent));
- }
-}
-
-void CPHackSettings::OnClose(wxCloseEvent& WXUNUSED (event))
-{
- Destroy();
-}
-
-void CPHackSettings::SavePHackData(wxCommandEvent& WXUNUSED (event))
-{
- PHack_Data.PHackSZNear = PHackSZNear->GetValue();
- PHack_Data.PHackSZFar = PHackSZFar->GetValue();
- PHack_Data.PHackExP = PHackExP->GetValue();
-
- PHack_Data.PHZNear = PHackZNear->GetValue().char_str();
- PHack_Data.PHZFar = PHackZFar->GetValue().char_str();
-
- AcceptAndClose();
-}
\ No newline at end of file +// Copyright (C) 2003 Dolphin Project. + +// 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, version 2.0. + +// 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 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official SVN repository and contact information can be found at +// http://code.google.com/p/dolphin-emu/ + +#include "PHackSettings.h" +#include "ConfigManager.h" + +extern PHackData PHack_Data; + +BEGIN_EVENT_TABLE(CPHackSettings, wxDialog) + EVT_CHOICE(ID_PHACK_CHOICE, CPHackSettings::SetRefresh) + EVT_CLOSE(CPHackSettings::OnClose) + EVT_BUTTON(wxID_OK, CPHackSettings::SavePHackData) +END_EVENT_TABLE() + +CPHackSettings::CPHackSettings(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style) + : wxDialog(parent, id, title, position, size, style) +{ + CreateGUIControls(); + std::string _iniFilename; + _iniFilename = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + "PH_PRESETS.ini"; + PHPresetsIni.Load(_iniFilename.c_str()); + //PHPresetsIni.SortSections(); + //PHPresetsIni.Save(_iniFilename.c_str()); + + LoadPHackData(); +} + +CPHackSettings::~CPHackSettings() +{ +} + +void CPHackSettings::CreateGUIControls() +{ + PHackChoiceText = new wxStaticText(this, ID_PHACK_CHOICE_TEXT, _("Presets: "), wxDefaultPosition, wxDefaultSize); + PHackChoice = new wxChoice(this, ID_PHACK_CHOICE, wxDefaultPosition, wxDefaultSize, wxArrayString(0, wxString("", *wxConvCurrent)), 0, wxDefaultValidator); + PHackChoice->SetToolTip(_("Load preset values from hack patterns available.")); + PHackZNearText = new wxStaticText(this, ID_PHACK_ZNEAR_TEXT, _("zNear Correction: "), wxDefaultPosition, wxDefaultSize); + PHackZNear = new wxTextCtrl(this, ID_PHACK_ZNEAR, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + PHackZNear->SetToolTip(_("Adds the specified value to zNear Parameter.\nTwo ways to express the floating point values.\nExample: entering '\'200'\' or '\'0.0002'\' directly, it produces equal effects, the acquired value will be '\'0.0002'\'.\nValues: (0->+/-Integer) or (0->+/-FP[6 digits of precision])\n\nNOTE: Check LogWindow/Console for the acquired values.")); + PHackSZNear = new wxCheckBox(this, ID_PHACK_SZNEAR, _("(-)+zNear"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE, wxDefaultValidator); + PHackSZNear->SetToolTip(_("Changes sign to zNear Parameter (after correction)")); + PHackZFarText = new wxStaticText(this, ID_PHACK_ZFAR_TEXT, _("zFar Correction: "), wxDefaultPosition, wxDefaultSize); + PHackZFar = new wxTextCtrl(this, ID_PHACK_ZFAR, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + PHackZFar->SetToolTip(_("Adds the specified value to zFar Parameter.\nTwo ways to express the floating point values.\nExample: entering '\'200'\' or '\'0.0002'\' directly, it produces equal effects, the acquired value will be '\'0.0002'\'.\nValues: (0->+/-Integer) or (0->+/-FP[6 digits of precision])\n\nNOTE: Check LogWindow/Console for the acquired values.")); + PHackSZFar = new wxCheckBox(this, ID_PHACK_SZFAR, _("(-)+zFar"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE, wxDefaultValidator); + PHackSZFar->SetToolTip(_("Changes sign to zFar Parameter (after correction)")); + PHackExP = new wxCheckBox(this, ID_PHACK_EXP, _("Extra Parameter"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE, wxDefaultValidator); + PHackExP->SetToolTip(_("Extra Parameter useful in '\'Metroid: Other M'\' only.")); + + wxStaticBoxSizer *sbPHackSettings = new wxStaticBoxSizer(wxVERTICAL, this, _("Parameters")); + wxFlexGridSizer *szrPHackSettings = new wxFlexGridSizer(3, 5, 5); + sbPHackSettings->Add(szrPHackSettings, 0, wxEXPAND|wxLEFT|wxTOP, 5); + szrPHackSettings->Add(PHackZNearText, 0, wxALIGN_CENTER_VERTICAL); + szrPHackSettings->Add(PHackZNear, 1, wxEXPAND); + szrPHackSettings->Add(PHackSZNear, 0, wxEXPAND|wxLEFT, 5); + szrPHackSettings->Add(PHackZFarText, 0, wxALIGN_CENTER_VERTICAL); + szrPHackSettings->Add(PHackZFar, 1, wxEXPAND); + szrPHackSettings->Add(PHackSZFar, 0, wxEXPAND|wxLEFT, 5); + szrPHackSettings->Add(PHackExP, 0, wxEXPAND|wxTOP|wxBOTTOM, 5); + + wxBoxSizer* sPHackButtons = new wxBoxSizer(wxHORIZONTAL); + wxButton* bOK = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + wxButton* bCancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + sPHackButtons->Add(0, 0, 1, wxEXPAND, 5); + sPHackButtons->Add(bOK, 0, wxALL, 5); + sPHackButtons->Add(bCancel, 0, wxALL, 5); + + wxBoxSizer* sPHack = new wxBoxSizer(wxVERTICAL); + sPHack->Add(PHackChoiceText, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5); + sPHack->Add(PHackChoice, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 5); + sPHack->Add(sbPHackSettings, 0, wxEXPAND|wxALL, 5); + sPHack->Add(sPHackButtons, 0, wxEXPAND, 5); + + SetSizerAndFit(sPHack); +} + +void CPHackSettings::LoadPHackData() +{ + std::string sTemp; + char sIndex[15]; + + PHackChoice->Clear(); + PHackChoice->Append(_("[Custom]")); + for (int i=0 ; ; i++) + { + sprintf(sIndex,"%d",i); + if (!PHPresetsIni.Exists(sIndex, "Title")) + break; + PHPresetsIni.Get(sIndex, "Title", &sTemp); + if (sTemp.empty()) + sTemp = wxString(_("(UNKNOWN)")).char_str(); + if (i == 0) + PHackChoice->Append(wxString("-----------", *wxConvCurrent)); + PHackChoice->Append(wxString(sTemp.c_str(), *wxConvCurrent)); + } + PHackChoice->Select(0); + + PHackSZNear->Set3StateValue((wxCheckBoxState)PHack_Data.PHackSZNear); + PHackSZFar->Set3StateValue((wxCheckBoxState)PHack_Data.PHackSZFar); + PHackExP->Set3StateValue((wxCheckBoxState)PHack_Data.PHackExP); + + PHackZNear->SetValue(wxString(PHack_Data.PHZNear.c_str(), *wxConvCurrent)); + PHackZFar->SetValue(wxString(PHack_Data.PHZFar.c_str(), *wxConvCurrent)); +} + +void CPHackSettings::SetRefresh(wxCommandEvent& event) +{ + bool bTemp; + std::string sTemp; + char sIndex[15]; + int index = event.GetSelection(); + if (index > 1) + { + index -= 2; + sprintf(sIndex,"%d", index); + + PHPresetsIni.Get(sIndex, "PH_SZNear", &bTemp); + PHackSZNear->Set3StateValue((wxCheckBoxState)bTemp); + PHPresetsIni.Get(sIndex, "PH_SZFar", &bTemp); + PHackSZFar->Set3StateValue((wxCheckBoxState)bTemp); + PHPresetsIni.Get(sIndex, "PH_ExtraParam", &bTemp); + PHackExP->Set3StateValue((wxCheckBoxState)bTemp); + PHPresetsIni.Get(sIndex, "PH_ZNear", &sTemp); + PHackZNear->SetValue(wxString(sTemp.c_str(), *wxConvCurrent)); + PHPresetsIni.Get(sIndex, "PH_ZFar", &sTemp); + PHackZFar->SetValue(wxString(sTemp.c_str(), *wxConvCurrent)); + } +} + +void CPHackSettings::OnClose(wxCloseEvent& WXUNUSED (event)) +{ + Destroy(); +} + +void CPHackSettings::SavePHackData(wxCommandEvent& WXUNUSED (event)) +{ + PHack_Data.PHackSZNear = PHackSZNear->GetValue(); + PHack_Data.PHackSZFar = PHackSZFar->GetValue(); + PHack_Data.PHackExP = PHackExP->GetValue(); + + PHack_Data.PHZNear = PHackZNear->GetValue().char_str(); + PHack_Data.PHZFar = PHackZFar->GetValue().char_str(); + + AcceptAndClose(); +} diff --git a/Source/Core/DolphinWX/Src/PHackSettings.h b/Source/Core/DolphinWX/Src/PHackSettings.h index 56f7dcdac4..4480e264e2 100644 --- a/Source/Core/DolphinWX/Src/PHackSettings.h +++ b/Source/Core/DolphinWX/Src/PHackSettings.h @@ -1,70 +1,71 @@ -// Copyright (C) 2003 Dolphin Project.
-
-// 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, version 2.0.
-
-// 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 2.0 for more details.
-
-// A copy of the GPL 2.0 should have been included with the program.
-// If not, see http://www.gnu.org/licenses/
-
-// Official SVN repository and contact information can be found at
-// http://code.google.com/p/dolphin-emu/
-
-#ifndef __PHACK_SETTINGS_h__
-#define __PHACK_SETTINGS_h__
-
-#include <wx/wx.h>
-#include <wx/spinctrl.h>
-#include "ISOProperties.h"
-
-class CPHackSettings : public wxDialog
-{
- public:
- CPHackSettings(wxWindow* parent,
- wxWindowID id = 1,
- const wxString& title = _("Custom Projection Hack Settings"),
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_DIALOG_STYLE);
- virtual ~CPHackSettings();
-
- private:
- DECLARE_EVENT_TABLE();
-
- wxChoice *PHackChoice;
- wxCheckBox *PHackSZNear;
- wxCheckBox *PHackSZFar;
- wxCheckBox *PHackExP;
- wxStaticText *PHackChoiceText;
- wxStaticText *PHackZNearText;
- wxStaticText *PHackZFarText;
- wxTextCtrl *PHackZNear;
- wxTextCtrl *PHackZFar;
-
- enum {
- ID_PHACK_CHOICE_TEXT = 1000,
- ID_PHACK_CHOICE,
- ID_PHACK_SZNEAR,
- ID_PHACK_SZFAR,
- ID_PHACK_ZNEAR_TEXT,
- ID_PHACK_ZNEAR,
- ID_PHACK_ZFAR_TEXT,
- ID_PHACK_ZFAR,
- ID_PHACK_EXP
- };
-
- IniFile PHPresetsIni;
-
- void SetRefresh(wxCommandEvent& event);
- void CreateGUIControls();
-
- void OnClose(wxCloseEvent& event);
- void SavePHackData(wxCommandEvent& event);
- void LoadPHackData();
-};
-#endif // __PHACK_SETTINGS_h__
+// Copyright (C) 2003 Dolphin Project. + +// 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, version 2.0. + +// 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 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official SVN repository and contact information can be found at +// http://code.google.com/p/dolphin-emu/ + +#ifndef __PHACK_SETTINGS_h__ +#define __PHACK_SETTINGS_h__ + +#include <wx/wx.h> +#include <wx/spinctrl.h> +#include "ISOProperties.h" + +class CPHackSettings : public wxDialog +{ + public: + CPHackSettings(wxWindow* parent, + wxWindowID id = 1, + const wxString& title = _("Custom Projection Hack Settings"), + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_DIALOG_STYLE); + virtual ~CPHackSettings(); + + private: + DECLARE_EVENT_TABLE(); + + wxChoice *PHackChoice; + wxCheckBox *PHackSZNear; + wxCheckBox *PHackSZFar; + wxCheckBox *PHackExP; + wxStaticText *PHackChoiceText; + wxStaticText *PHackZNearText; + wxStaticText *PHackZFarText; + wxTextCtrl *PHackZNear; + wxTextCtrl *PHackZFar; + + enum { + ID_PHACK_CHOICE_TEXT = 1000, + ID_PHACK_CHOICE, + ID_PHACK_SZNEAR, + ID_PHACK_SZFAR, + ID_PHACK_ZNEAR_TEXT, + ID_PHACK_ZNEAR, + ID_PHACK_ZFAR_TEXT, + ID_PHACK_ZFAR, + ID_PHACK_EXP + }; + + IniFile PHPresetsIni; + + void SetRefresh(wxCommandEvent& event); + void CreateGUIControls(); + + void OnClose(wxCloseEvent& event); + void SavePHackData(wxCommandEvent& event); + void LoadPHackData(); +}; + +#endif // __PHACK_SETTINGS_h__ diff --git a/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXJoystick.mm b/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXJoystick.mm index d37e38fa72..418e4f4ef0 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXJoystick.mm +++ b/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXJoystick.mm @@ -75,6 +75,8 @@ Joystick::Joystick(IOHIDDeviceRef device, std::string name, int index) ControlState Joystick::GetInputState( const ControllerInterface::Device::Input* const input) const { + if (input == NULL) // XXX + return 0; return ((Input*)input)->GetState(m_device); } |
