diff options
| author | degasus <wickmarkus@web.de> | 2012-12-27 10:36:54 +0100 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2012-12-27 10:36:54 +0100 |
| commit | 316a33d1e68ab47b2870345a04bb9dfd4f383f28 (patch) | |
| tree | 03b40807def9787df30976ecb53f09d6c6084c13 /Source/Core/Common | |
| parent | 53398ca5d8bc6e73a726c9d803db5a956c22cf6a (diff) | |
| parent | 94116bf89c917309b7e7b2a2b46bf2f43f3219db (diff) | |
Merge branch 'master' into GLSL-master
Conflicts:
Source/Core/DolphinWX/Src/VideoConfigDiag.h
Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h
Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp
Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/Src/CDUtils.cpp | 1 | ||||
| -rw-r--r-- | Source/Core/Common/Src/CPUDetect.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Common/Src/Common.h | 5 | ||||
| -rw-r--r-- | Source/Core/Common/Src/CommonPaths.h | 1 | ||||
| -rw-r--r-- | Source/Core/Common/Src/DebugInterface.h | 2 | ||||
| -rw-r--r-- | Source/Core/Common/Src/FileUtil.cpp | 15 | ||||
| -rw-r--r-- | Source/Core/Common/Src/MathUtil.h | 2 | ||||
| -rw-r--r-- | Source/Core/Common/Src/Setup.h | 41 | ||||
| -rw-r--r-- | Source/Core/Common/Src/Thread.cpp | 1 | ||||
| -rw-r--r-- | Source/Core/Common/Src/Timer.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/Common/Src/Timer.h | 1 | ||||
| -rw-r--r-- | Source/Core/Common/Src/VideoBackendBase.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/Common/Src/VideoBackendBase.h | 8 | ||||
| -rw-r--r-- | Source/Core/Common/Src/x64Analyzer.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/Common/Src/x64Emitter.cpp | 2 |
15 files changed, 28 insertions, 71 deletions
diff --git a/Source/Core/Common/Src/CDUtils.cpp b/Source/Core/Common/Src/CDUtils.cpp index 4496302e46..42aa9bfe34 100644 --- a/Source/Core/Common/Src/CDUtils.cpp +++ b/Source/Core/Common/Src/CDUtils.cpp @@ -3,6 +3,7 @@ #include "CDUtils.h" #include "Common.h" +#include <memory> // for std::unique_ptr #ifdef _WIN32 #include <windows.h> #elif __APPLE__ diff --git a/Source/Core/Common/Src/CPUDetect.cpp b/Source/Core/Common/Src/CPUDetect.cpp index 93e9d25087..65cd6dbd0b 100644 --- a/Source/Core/Common/Src/CPUDetect.cpp +++ b/Source/Core/Common/Src/CPUDetect.cpp @@ -173,9 +173,7 @@ void CPUInfo::Detect() if (max_ex_fn >= 0x80000001) { // Check for more features. __cpuid(cpu_id, 0x80000001); - bool cmp_legacy = false; if (cpu_id[2] & 1) bLAHFSAHF64 = true; - if (cpu_id[2] & 2) cmp_legacy = true; //wtf is this? if ((cpu_id[3] >> 29) & 1) bLongMode = true; } diff --git a/Source/Core/Common/Src/Common.h b/Source/Core/Common/Src/Common.h index 960bf75559..884a1e6c16 100644 --- a/Source/Core/Common/Src/Common.h +++ b/Source/Core/Common/Src/Common.h @@ -60,11 +60,6 @@ private: #undef STACKALIGN #define STACKALIGN __attribute__((__force_align_arg_pointer__)) #endif -// We use wxWidgets on OS X only if it is version 2.9+ with Cocoa support. -#ifdef __WXOSX_COCOA__ -#define HAVE_WX 1 -#define USE_WX 1 // Use wxGLCanvas -#endif #elif defined _WIN32 diff --git a/Source/Core/Common/Src/CommonPaths.h b/Source/Core/Common/Src/CommonPaths.h index decf2aef97..430a0c0cd8 100644 --- a/Source/Core/Common/Src/CommonPaths.h +++ b/Source/Core/Common/Src/CommonPaths.h @@ -128,6 +128,7 @@ #define WII_EUR_SETTING "setting-eur.txt" #define WII_USA_SETTING "setting-usa.txt" #define WII_JAP_SETTING "setting-jpn.txt" +#define WII_KOR_SETTING "setting-kor.txt" #define GECKO_CODE_HANDLER "codehandler.bin" diff --git a/Source/Core/Common/Src/DebugInterface.h b/Source/Core/Common/Src/DebugInterface.h index 15c58e4f57..317cd0bb43 100644 --- a/Source/Core/Common/Src/DebugInterface.h +++ b/Source/Core/Common/Src/DebugInterface.h @@ -30,7 +30,7 @@ public: virtual void step() {} virtual void runToBreakpoint() {} virtual void breakNow() {} - virtual void insertBLR(unsigned int /*address*/, unsigned int) {} + virtual void insertBLR(unsigned int /*address*/, unsigned int /*value*/) {} virtual void showJitResults(unsigned int /*address*/) {}; virtual int getColor(unsigned int /*address*/){return 0xFFFFFFFF;} virtual std::string getDescription(unsigned int /*address*/) = 0; diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 4650c6e1ba..77290528a6 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -299,7 +299,7 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename) ERROR_LOG(COMMON, "Copy: failed reading from source, %s --> %s: %s", srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg()); - return false; + goto bail; } } @@ -310,13 +310,19 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename) ERROR_LOG(COMMON, "Copy: failed writing to output, %s --> %s: %s", srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg()); - return false; + goto bail; } } // close flushs fclose(input); fclose(output); return true; +bail: + if (input) + fclose(input); + if (output) + fclose(output); + return false; #endif } @@ -643,13 +649,12 @@ std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath) if (paths[D_USER_IDX].empty()) { #ifdef _WIN32 - // TODO: use GetExeDirectory() here instead of ROOT_DIR so that if the cwd is changed we still have the correct paths? - paths[D_USER_IDX] = ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP; + paths[D_USER_IDX] = GetExeDirectory() + DIR_SEP USERDATA_DIR DIR_SEP; #else if (File::Exists(ROOT_DIR DIR_SEP USERDATA_DIR)) paths[D_USER_IDX] = ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP; else - paths[D_USER_IDX] = std::string(getenv("HOME")) + DIR_SEP DOLPHIN_DATA_DIR DIR_SEP; + paths[D_USER_IDX] = std::string(getenv("HOME") ? getenv("HOME") : getenv("PWD")) + DIR_SEP DOLPHIN_DATA_DIR DIR_SEP; #endif INFO_LOG(COMMON, "GetUserPath: Setting user directory to %s:", paths[D_USER_IDX].c_str()); diff --git a/Source/Core/Common/Src/MathUtil.h b/Source/Core/Common/Src/MathUtil.h index a6290ff602..c5f613ada1 100644 --- a/Source/Core/Common/Src/MathUtil.h +++ b/Source/Core/Common/Src/MathUtil.h @@ -117,6 +117,8 @@ struct Rectangle Rectangle(T theLeft, T theTop, T theRight, T theBottom) : left(theLeft), top(theTop), right(theRight), bottom(theBottom) { } + + bool operator==(const Rectangle& r) { return left==r.left && top==r.top && right==r.right && bottom==r.bottom; } T GetWidth() const { return abs(right - left); } T GetHeight() const { return abs(bottom - top); } diff --git a/Source/Core/Common/Src/Setup.h b/Source/Core/Common/Src/Setup.h deleted file mode 100644 index c0faec3059..0000000000 --- a/Source/Core/Common/Src/Setup.h +++ /dev/null @@ -1,41 +0,0 @@ -// 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 _SETUP_H_ -#define _SETUP_H_ - -// ----------------------------------------------------------------------------------------------------- -// File description: -// Compilation settings. I avoid placing this in Common.h or some place where lots of files needs -// to be rebuilt if any of these settings are changed. I'd rather have it in as few files as possible. -// This file can be kept on the ignore list in your SVN program. It allows local optional settings -// depending on what works on your computer. -// ----------------------------------------------------------------------------------------------------- - -// ----------------------------------------------------------------------------------------------------- -// Settings: - -// This may remove sound artifacts in Wario Land Shake It and perhaps other games -//#define SETUP_AVOID_SOUND_ARTIFACTS - -// Build with playback rerecording options -//#define RERECORDING - -// ----------------------------------------------------------------------------------------------------- - -#endif // _SETUP_H_ - diff --git a/Source/Core/Common/Src/Thread.cpp b/Source/Core/Common/Src/Thread.cpp index ce91aac651..73f83c204f 100644 --- a/Source/Core/Common/Src/Thread.cpp +++ b/Source/Core/Common/Src/Thread.cpp @@ -15,7 +15,6 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#include "Setup.h" #include "Thread.h" #include "Common.h" diff --git a/Source/Core/Common/Src/Timer.cpp b/Source/Core/Common/Src/Timer.cpp index 087f8fcead..b1beed2066 100644 --- a/Source/Core/Common/Src/Timer.cpp +++ b/Source/Core/Common/Src/Timer.cpp @@ -97,12 +97,6 @@ void Timer::AddTimeDifference() m_StartTime += GetTimeDifference(); } -// Wind back the starting time to a custom time -void Timer::WindBackStartingTime(u64 WindBack) -{ - m_StartTime += WindBack; -} - // Get the time elapsed since the Start() u64 Timer::GetTimeElapsed() { diff --git a/Source/Core/Common/Src/Timer.h b/Source/Core/Common/Src/Timer.h index a638920409..152d4c60e6 100644 --- a/Source/Core/Common/Src/Timer.h +++ b/Source/Core/Common/Src/Timer.h @@ -35,7 +35,6 @@ public: // The time difference is always returned in milliseconds, regardless of alternative internal representation u64 GetTimeDifference(); void AddTimeDifference(); - void WindBackStartingTime(u64 WindBack); static void IncreaseResolution(); static void RestoreResolution(); diff --git a/Source/Core/Common/Src/VideoBackendBase.cpp b/Source/Core/Common/Src/VideoBackendBase.cpp index 339cb016c1..62bb42997f 100644 --- a/Source/Core/Common/Src/VideoBackendBase.cpp +++ b/Source/Core/Common/Src/VideoBackendBase.cpp @@ -22,7 +22,9 @@ #include "../../../Plugins/Plugin_VideoDX9/Src/VideoBackend.h" #include "../../../Plugins/Plugin_VideoDX11/Src/VideoBackend.h" #endif +#ifndef USE_GLES #include "../../../Plugins/Plugin_VideoOGL/Src/VideoBackend.h" +#endif #include "../../../Plugins/Plugin_VideoSoftware/Src/VideoBackend.h" std::vector<VideoBackend*> g_available_video_backends; @@ -41,7 +43,7 @@ static bool IsGteVista() VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL); - return VerifyVersionInfo(&osvi, VER_MAJORVERSION, dwlConditionMask); + return VerifyVersionInfo(&osvi, VER_MAJORVERSION, dwlConditionMask) != FALSE; } #endif @@ -52,7 +54,9 @@ void VideoBackend::PopulateList() if (IsGteVista()) g_available_video_backends.push_back(new DX11::VideoBackend); #endif +#ifndef USE_GLES g_available_video_backends.push_back(new OGL::VideoBackend); +#endif g_available_video_backends.push_back(new SW::VideoSoftware); g_video_backend = g_available_video_backends.front(); diff --git a/Source/Core/Common/Src/VideoBackendBase.h b/Source/Core/Common/Src/VideoBackendBase.h index d09288ebc7..311fa66104 100644 --- a/Source/Core/Common/Src/VideoBackendBase.h +++ b/Source/Core/Common/Src/VideoBackendBase.h @@ -137,6 +137,8 @@ public: // the implementation needs not do synchronization logic, because calls to it are surrounded by PauseAndLock now virtual void DoState(PointerWrap &p) = 0; + + virtual void CheckInvalidState() = 0; }; extern std::vector<VideoBackend*> g_available_video_backends; @@ -176,9 +178,15 @@ class VideoBackendHardware : public VideoBackend void PauseAndLock(bool doLock, bool unpauseOnUnlock=true); void DoState(PointerWrap &p); + + bool m_invalid; + +public: + void CheckInvalidState(); protected: void InitializeShared(); + void InvalidState(); }; #endif diff --git a/Source/Core/Common/Src/x64Analyzer.cpp b/Source/Core/Common/Src/x64Analyzer.cpp index 2ea3e9a512..66a2fe217f 100644 --- a/Source/Core/Common/Src/x64Analyzer.cpp +++ b/Source/Core/Common/Src/x64Analyzer.cpp @@ -31,12 +31,9 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc info.hasImmediate = false; info.isMemoryWrite = false; - int addressSize = 8; u8 modRMbyte = 0; u8 sibByte = 0; bool hasModRM = false; - bool hasSIBbyte = false; - bool hasDisplacement = false; int displacementSize = 0; @@ -47,7 +44,6 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc } else if (*codePtr == 0x67) { - addressSize = 4; codePtr++; } @@ -113,7 +109,6 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc info.otherReg = (sibByte & 7); if (rex & 2) info.scaledReg += 8; if (rex & 1) info.otherReg += 8; - hasSIBbyte = true; } else { @@ -122,7 +117,6 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc } if (mrm.mod == 1 || mrm.mod == 2) { - hasDisplacement = true; if (mrm.mod == 1) displacementSize = 1; else diff --git a/Source/Core/Common/Src/x64Emitter.cpp b/Source/Core/Common/Src/x64Emitter.cpp index d4bd1adabf..19e96478d1 100644 --- a/Source/Core/Common/Src/x64Emitter.cpp +++ b/Source/Core/Common/Src/x64Emitter.cpp @@ -870,7 +870,6 @@ void XEmitter::BTC(int bits, OpArg dest, OpArg index) {WriteBitTest(bits, dest, //shift can be either imm8 or cl void XEmitter::SHRD(int bits, OpArg dest, OpArg src, OpArg shift) { - bool writeImm = false; if (dest.IsImm()) { _assert_msg_(DYNA_REC, 0, "SHRD - can't use imms as destination"); @@ -901,7 +900,6 @@ void XEmitter::SHRD(int bits, OpArg dest, OpArg src, OpArg shift) void XEmitter::SHLD(int bits, OpArg dest, OpArg src, OpArg shift) { - bool writeImm = false; if (dest.IsImm()) { _assert_msg_(DYNA_REC, 0, "SHLD - can't use imms as destination"); |
