summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorRachel Bryk <RachelBryk@gmail.com>2013-08-15 09:00:04 -0400
committerRachel Bryk <RachelBryk@gmail.com>2013-08-15 09:00:04 -0400
commit6d67ea2fdabab5b4daff88409dcb746fab52b483 (patch)
treebec0234d1b07915570ca3296b109ab4eb2fd2868 /Source/Core/Common
parentf51cb0b7eb9c0f261abd3f5d68707ba1f93e3888 (diff)
parentd16f089e88f63931d792cb4b2fca05747ed8c90a (diff)
Merge remote-tracking branch 'origin/master' into wiimote-netplay
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/CMakeLists.txt1
-rw-r--r--Source/Core/Common/Common.vcxproj4
-rw-r--r--Source/Core/Common/Common.vcxproj.filters4
-rw-r--r--Source/Core/Common/Src/ArmCPUDetect.cpp6
-rw-r--r--Source/Core/Common/Src/ExtendedTrace.cpp3
-rw-r--r--Source/Core/Common/Src/IniFile.cpp54
-rw-r--r--Source/Core/Common/Src/IniFile.h3
-rw-r--r--Source/Core/Common/Src/MemArena.cpp44
-rw-r--r--Source/Core/Common/Src/StringUtil.cpp37
-rw-r--r--Source/Core/Common/Src/VideoBackendBase.cpp80
-rw-r--r--Source/Core/Common/Src/VideoBackendBase.h185
-rw-r--r--Source/Core/Common/make_scmrev.h.js4
12 files changed, 79 insertions, 346 deletions
diff --git a/Source/Core/Common/CMakeLists.txt b/Source/Core/Common/CMakeLists.txt
index 480a08a0fc..0a1a26e530 100644
--- a/Source/Core/Common/CMakeLists.txt
+++ b/Source/Core/Common/CMakeLists.txt
@@ -20,7 +20,6 @@ set(SRCS Src/BreakPoints.cpp
Src/Thread.cpp
Src/Timer.cpp
Src/Version.cpp
- Src/VideoBackendBase.cpp
Src/x64ABI.cpp
Src/x64Analyzer.cpp
Src/x64Emitter.cpp
diff --git a/Source/Core/Common/Common.vcxproj b/Source/Core/Common/Common.vcxproj
index 822fafe74b..2982a5c720 100644
--- a/Source/Core/Common/Common.vcxproj
+++ b/Source/Core/Common/Common.vcxproj
@@ -195,7 +195,6 @@
<ClCompile Include="Src\Thread.cpp" />
<ClCompile Include="Src\Timer.cpp" />
<ClCompile Include="Src\Version.cpp" />
- <ClCompile Include="Src\VideoBackendBase.cpp" />
<ClCompile Include="Src\x64ABI.cpp" />
<ClCompile Include="Src\x64Analyzer.cpp" />
<ClCompile Include="Src\x64CPUDetect.cpp" />
@@ -250,7 +249,6 @@
<ClInclude Include="Src\Thread.h" />
<ClInclude Include="Src\Thunk.h" />
<ClInclude Include="Src\Timer.h" />
- <ClInclude Include="Src\VideoBackendBase.h" />
<ClInclude Include="Src\x64ABI.h" />
<ClInclude Include="Src\x64Analyzer.h" />
<ClInclude Include="Src\x64Emitter.h" />
@@ -261,4 +259,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project> \ No newline at end of file
+</Project>
diff --git a/Source/Core/Common/Common.vcxproj.filters b/Source/Core/Common/Common.vcxproj.filters
index d427b70cdd..ae434219fd 100644
--- a/Source/Core/Common/Common.vcxproj.filters
+++ b/Source/Core/Common/Common.vcxproj.filters
@@ -23,7 +23,6 @@
<ClCompile Include="Src\Thread.cpp" />
<ClCompile Include="Src\Timer.cpp" />
<ClCompile Include="Src\Version.cpp" />
- <ClCompile Include="Src\VideoBackendBase.cpp" />
<ClCompile Include="Src\x64Analyzer.cpp" />
<ClCompile Include="Src\x64Emitter.cpp" />
<ClCompile Include="Src\LogManager.cpp">
@@ -92,7 +91,6 @@
<ClInclude Include="Src\Thread.h" />
<ClInclude Include="Src\Thunk.h" />
<ClInclude Include="Src\Timer.h" />
- <ClInclude Include="Src\VideoBackendBase.h" />
<ClInclude Include="Src\x64Analyzer.h" />
<ClInclude Include="Src\x64Emitter.h" />
<ClInclude Include="Src\Log.h">
@@ -134,4 +132,4 @@
<UniqueIdentifier>{f078f36e-a0ff-4cd0-95f8-476100d68e68}</UniqueIdentifier>
</Filter>
</ItemGroup>
-</Project> \ No newline at end of file
+</Project>
diff --git a/Source/Core/Common/Src/ArmCPUDetect.cpp b/Source/Core/Common/Src/ArmCPUDetect.cpp
index a04c88834f..ef49d6efb1 100644
--- a/Source/Core/Common/Src/ArmCPUDetect.cpp
+++ b/Source/Core/Common/Src/ArmCPUDetect.cpp
@@ -68,6 +68,9 @@ unsigned char GetCPUImplementer()
sscanf(implementer_string, "0x%02hhx", &implementer);
break;
}
+
+ free(implementer_string);
+
return implementer;
}
@@ -92,6 +95,9 @@ unsigned short GetCPUPart()
sscanf(part_string, "0x%03hx", &part);
break;
}
+
+ free(part_string);
+
return part;
}
diff --git a/Source/Core/Common/Src/ExtendedTrace.cpp b/Source/Core/Common/Src/ExtendedTrace.cpp
index 85057639a5..08740c3c95 100644
--- a/Source/Core/Common/Src/ExtendedTrace.cpp
+++ b/Source/Core/Common/Src/ExtendedTrace.cpp
@@ -136,7 +136,6 @@ static BOOL GetModuleNameFromAddress( UINT address, LPTSTR lpszModule )
static BOOL GetFunctionInfoFromAddresses( ULONG fnAddress, ULONG stackAddress, LPTSTR lpszSymbol )
{
BOOL ret = FALSE;
- DWORD dwDisp = 0;
DWORD dwSymSize = 10000;
TCHAR lpszUnDSymbol[BUFFERSIZE]=_T("?");
CHAR lpszNonUnicodeUnDSymbol[BUFFERSIZE]="?";
@@ -153,9 +152,11 @@ static BOOL GetFunctionInfoFromAddresses( ULONG fnAddress, ULONG stackAddress, L
// Get symbol info for IP
#ifndef _M_X64
+ DWORD dwDisp = 0;
if ( SymGetSymFromAddr( GetCurrentProcess(), (ULONG)fnAddress, &dwDisp, pSym ) )
#else
//makes it compile but hell im not sure if this works...
+ DWORD64 dwDisp = 0;
if ( SymGetSymFromAddr( GetCurrentProcess(), (ULONG)fnAddress, (PDWORD64)&dwDisp, pSym ) )
#endif
{
diff --git a/Source/Core/Common/Src/IniFile.cpp b/Source/Core/Common/Src/IniFile.cpp
index 0b265543de..2eca8df929 100644
--- a/Source/Core/Common/Src/IniFile.cpp
+++ b/Source/Core/Common/Src/IniFile.cpp
@@ -20,45 +20,30 @@
namespace {
-static void ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut, std::string* commentOut)
+static void ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut)
{
- int FirstEquals = (int)line.find("=", 0);
- int FirstCommentChar = -1;
-
- // Comments
- if (FirstCommentChar < 0)
- FirstCommentChar =
- (int)line.find("#", FirstEquals > 0 ? FirstEquals : 0);
- if (FirstCommentChar < 0 && line[0] == ';')
- FirstCommentChar = 0;
+ if (line[0] == '#')
+ return;
- // Allow preservation of spacing before comment
- if (FirstCommentChar > 0)
- {
- while (line[FirstCommentChar - 1] == ' ' || line[FirstCommentChar - 1] == 9) // 9 == tab
- {
- FirstCommentChar--;
- }
- }
+ int FirstEquals = (int)line.find("=", 0);
- if ((FirstEquals >= 0) && ((FirstCommentChar < 0) || (FirstEquals < FirstCommentChar)))
+ if (FirstEquals >= 0)
{
// Yes, a valid line!
*keyOut = StripSpaces(line.substr(0, FirstEquals));
- if (commentOut) *commentOut = FirstCommentChar > 0 ? line.substr(FirstCommentChar) : std::string("");
- if (valueOut) *valueOut = StripQuotes(StripSpaces(line.substr(FirstEquals + 1, FirstCommentChar - FirstEquals - 1)));
+ if (valueOut) *valueOut = StripQuotes(StripSpaces(line.substr(FirstEquals + 1, std::string::npos)));
}
}
}
-std::string* IniFile::Section::GetLine(const char* key, std::string* valueOut, std::string* commentOut)
+std::string* IniFile::Section::GetLine(const char* key, std::string* valueOut)
{
for (std::vector<std::string>::iterator iter = lines.begin(); iter != lines.end(); ++iter)
{
std::string& line = *iter;
std::string lineKey;
- ParseLine(line, &lineKey, valueOut, commentOut);
+ ParseLine(line, &lineKey, valueOut);
if (!strcasecmp(lineKey.c_str(), key))
return &line;
}
@@ -67,12 +52,12 @@ std::string* IniFile::Section::GetLine(const char* key, std::string* valueOut, s
void IniFile::Section::Set(const char* key, const char* newValue)
{
- std::string value, commented;
- std::string* line = GetLine(key, &value, &commented);
+ std::string value;
+ std::string* line = GetLine(key, &value);
if (line)
{
// Change the value - keep the key and comment
- *line = StripSpaces(key) + " = " + newValue + commented;
+ *line = StripSpaces(key) + " = " + newValue;
}
else
{
@@ -91,7 +76,7 @@ void IniFile::Section::Set(const char* key, const std::string& newValue, const s
bool IniFile::Section::Get(const char* key, std::string* value, const char* defaultValue)
{
- std::string* line = GetLine(key, value, 0);
+ std::string* line = GetLine(key, value);
if (!line)
{
if (defaultValue)
@@ -224,7 +209,7 @@ bool IniFile::Section::Exists(const char *key) const
for (std::vector<std::string>::const_iterator iter = lines.begin(); iter != lines.end(); ++iter)
{
std::string lineKey;
- ParseLine(*iter, &lineKey, NULL, NULL);
+ ParseLine(*iter, &lineKey, NULL);
if (!strcasecmp(lineKey.c_str(), key))
return true;
}
@@ -233,7 +218,7 @@ bool IniFile::Section::Exists(const char *key) const
bool IniFile::Section::Delete(const char *key)
{
- std::string* line = GetLine(key, 0, 0);
+ std::string* line = GetLine(key, 0);
for (std::vector<std::string>::iterator liter = lines.begin(); liter != lines.end(); ++liter)
{
if (line == &*liter)
@@ -313,7 +298,7 @@ bool IniFile::DeleteKey(const char* sectionName, const char* key)
Section* section = GetSection(sectionName);
if (!section)
return false;
- std::string* line = section->GetLine(key, 0, 0);
+ std::string* line = section->GetLine(key, 0);
for (std::vector<std::string>::iterator liter = section->lines.begin(); liter != section->lines.end(); ++liter)
{
if (line == &(*liter))
@@ -335,7 +320,7 @@ bool IniFile::GetKeys(const char* sectionName, std::vector<std::string>& keys) c
for (std::vector<std::string>::const_iterator liter = section->lines.begin(); liter != section->lines.end(); ++liter)
{
std::string key;
- ParseLine(*liter, &key, 0, 0);
+ ParseLine(*liter, &key, 0);
keys.push_back(key);
}
return true;
@@ -421,11 +406,6 @@ bool IniFile::Load(const char* filename)
// New section!
std::string sub = line.substr(1, endpos - 1);
sections.push_back(Section(sub));
-
- if (endpos + 1 < line.size())
- {
- sections[sections.size() - 1].comment = line.substr(endpos + 1);
- }
}
}
else
@@ -459,7 +439,7 @@ bool IniFile::Save(const char* filename)
if (section.name != "")
{
- out << "[" << section.name << "]" << section.comment << std::endl;
+ out << "[" << section.name << "]" << std::endl;
}
for (std::vector<std::string>::const_iterator liter = section.lines.begin(); liter != section.lines.end(); ++liter)
diff --git a/Source/Core/Common/Src/IniFile.h b/Source/Core/Common/Src/IniFile.h
index 10e1cfdbb9..bad26ca090 100644
--- a/Source/Core/Common/Src/IniFile.h
+++ b/Source/Core/Common/Src/IniFile.h
@@ -25,7 +25,7 @@ public:
bool Exists(const char *key) const;
bool Delete(const char *key);
- std::string* GetLine(const char* key, std::string* valueOut, std::string* commentOut);
+ std::string* GetLine(const char* key, std::string* valueOut);
void Set(const char* key, const char* newValue);
void Set(const char* key, const std::string& newValue, const std::string& defaultValue);
@@ -70,7 +70,6 @@ public:
protected:
std::vector<std::string> lines;
std::string name;
- std::string comment;
};
bool Load(const char* filename);
diff --git a/Source/Core/Common/Src/MemArena.cpp b/Source/Core/Common/Src/MemArena.cpp
index 487788dc45..7be7c98c89 100644
--- a/Source/Core/Common/Src/MemArena.cpp
+++ b/Source/Core/Common/Src/MemArena.cpp
@@ -20,6 +20,7 @@
#include <linux/ashmem.h>
#endif
#endif
+#include <set>
#if defined(__APPLE__)
static const char* ram_temp_file = "/tmp/gc_mem.tmp";
@@ -214,27 +215,7 @@ static bool Memory_TryBase(u8 *base, const MemoryView *views, int num_views, u32
bail:
// Argh! ERROR! Free what we grabbed so far so we can try again.
- for (int j = 0; j <= i; j++)
- {
- SKIP(flags, views[i].flags);
- if (views[j].out_ptr_low && *views[j].out_ptr_low)
- {
- arena->ReleaseView(*views[j].out_ptr_low, views[j].size);
- *views[j].out_ptr_low = NULL;
- }
- if (*views[j].out_ptr)
- {
-#ifdef _M_X64
- arena->ReleaseView(*views[j].out_ptr, views[j].size);
-#else
- if (!(views[j].flags & MV_MIRROR_PREVIOUS))
- {
- arena->ReleaseView(*views[j].out_ptr, views[j].size);
- }
-#endif
- *views[j].out_ptr = NULL;
- }
- }
+ MemoryMap_Shutdown(views, i+1, flags, arena);
return false;
}
@@ -300,15 +281,20 @@ u8 *MemoryMap_Setup(const MemoryView *views, int num_views, u32 flags, MemArena
void MemoryMap_Shutdown(const MemoryView *views, int num_views, u32 flags, MemArena *arena)
{
+ std::set<void*> freeset;
for (int i = 0; i < num_views; i++)
{
- SKIP(flags, views[i].flags);
- if (views[i].out_ptr_low && *views[i].out_ptr_low)
- arena->ReleaseView(*views[i].out_ptr_low, views[i].size);
- if (*views[i].out_ptr && (views[i].out_ptr_low && *views[i].out_ptr != *views[i].out_ptr_low))
- arena->ReleaseView(*views[i].out_ptr, views[i].size);
- *views[i].out_ptr = NULL;
- if (views[i].out_ptr_low)
- *views[i].out_ptr_low = NULL;
+ const MemoryView* view = &views[i];
+ u8** outptrs[2] = {view->out_ptr_low, view->out_ptr};
+ for (int j = 0; j < 2; j++)
+ {
+ u8** outptr = outptrs[j];
+ if (outptr && *outptr && !freeset.count(*outptr))
+ {
+ arena->ReleaseView(*outptr, view->size);
+ freeset.insert(*outptr);
+ *outptr = NULL;
+ }
+ }
}
}
diff --git a/Source/Core/Common/Src/StringUtil.cpp b/Source/Core/Common/Src/StringUtil.cpp
index 99bc2ae6ca..25885552ef 100644
--- a/Source/Core/Common/Src/StringUtil.cpp
+++ b/Source/Core/Common/Src/StringUtil.cpp
@@ -34,7 +34,39 @@ bool AsciiToHex(const char* _szValue, u32& result)
bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list args)
{
- int writtenCount = vsnprintf(out, outsize, format, args);
+ int writtenCount;
+
+#ifdef _WIN32
+ // You would think *printf are simple, right? Iterate on each character,
+ // if it's a format specifier handle it properly, etc.
+ //
+ // Nooooo. Not according to the C standard.
+ //
+ // According to the C99 standard (7.19.6.1 "The fprintf function")
+ // The format shall be a multibyte character sequence
+ //
+ // Because some character encodings might have '%' signs in the middle of
+ // a multibyte sequence (SJIS for example only specifies that the first
+ // byte of a 2 byte sequence is "high", the second byte can be anything),
+ // printf functions have to decode the multibyte sequences and try their
+ // best to not screw up.
+ //
+ // Unfortunately, on Windows, the locale for most languages is not UTF-8
+ // as we would need. Notably, for zh_TW, Windows chooses EUC-CN as the
+ // locale, and completely fails when trying to decode UTF-8 as EUC-CN.
+ //
+ // On the other hand, the fix is simple: because we use UTF-8, no such
+ // multibyte handling is required as we can simply assume that no '%' char
+ // will be present in the middle of a multibyte sequence.
+ //
+ // This is why we lookup an ANSI (cp1252) locale here and use _vsnprintf_l.
+ static locale_t c_locale = NULL;
+ if (!c_locale)
+ c_locale = _create_locale(LC_ALL, ".1252");
+ writtenCount = _vsnprintf_l(out, outsize, format, c_locale, args);
+#else
+ writtenCount = vsnprintf(out, outsize, format, args);
+#endif
if (writtenCount > 0 && writtenCount < outsize)
{
@@ -58,10 +90,9 @@ std::string StringFromFormat(const char* format, ...)
va_start(args, format);
required = _vscprintf(format, args);
buf = new char[required + 1];
- vsnprintf(buf, required, format, args);
+ CharArrayFromFormatV(buf, required + 1, format, args);
va_end(args);
- buf[required] = '\0';
std::string temp = buf;
delete[] buf;
#else
diff --git a/Source/Core/Common/Src/VideoBackendBase.cpp b/Source/Core/Common/Src/VideoBackendBase.cpp
deleted file mode 100644
index 99bce01156..0000000000
--- a/Source/Core/Common/Src/VideoBackendBase.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2013 Dolphin Emulator Project
-// Licensed under GPLv2
-// Refer to the license.txt file included.
-
-#include "VideoBackendBase.h"
-
-// TODO: ugly
-#ifdef _WIN32
-#include "../../../Plugins/Plugin_VideoDX9/Src/VideoBackend.h"
-#include "../../../Plugins/Plugin_VideoDX11/Src/VideoBackend.h"
-#endif
-#if !defined(USE_GLES) || USE_GLES3
-#include "../../../Plugins/Plugin_VideoOGL/Src/VideoBackend.h"
-#endif
-#include "../../../Plugins/Plugin_VideoSoftware/Src/VideoBackend.h"
-
-std::vector<VideoBackend*> g_available_video_backends;
-VideoBackend* g_video_backend = NULL;
-static VideoBackend* s_default_backend = NULL;
-
-#ifdef _WIN32
-// http://msdn.microsoft.com/en-us/library/ms725491.aspx
-static bool IsGteVista()
-{
- OSVERSIONINFOEX osvi;
- DWORDLONG dwlConditionMask = 0;
-
- ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
- osvi.dwMajorVersion = 6;
-
- VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
-
- return VerifyVersionInfo(&osvi, VER_MAJORVERSION, dwlConditionMask) != FALSE;
-}
-#endif
-
-void VideoBackend::PopulateList()
-{
- VideoBackend* backends[4] = { NULL };
-
- // D3D11 > OGL > D3D9 > SW
-#ifdef _WIN32
- g_available_video_backends.push_back(backends[2] = new DX9::VideoBackend);
- if (IsGteVista())
- g_available_video_backends.push_back(backends[0] = new DX11::VideoBackend);
-#endif
-#if !defined(USE_GLES) || USE_GLES3
- g_available_video_backends.push_back(backends[1] = new OGL::VideoBackend);
-#endif
- g_available_video_backends.push_back(backends[3] = new SW::VideoSoftware);
-
- for (int i = 0; i < 4; ++i)
- {
- if (backends[i])
- {
- s_default_backend = g_video_backend = backends[i];
- break;
- }
- }
-}
-
-void VideoBackend::ClearList()
-{
- while (!g_available_video_backends.empty())
- {
- delete g_available_video_backends.back();
- g_available_video_backends.pop_back();
- }
-}
-
-void VideoBackend::ActivateBackend(const std::string& name)
-{
- if (name.length() == 0) // If NULL, set it to the default backend (expected behavior)
- g_video_backend = s_default_backend;
-
- for (std::vector<VideoBackend*>::const_iterator it = g_available_video_backends.begin(); it != g_available_video_backends.end(); ++it)
- if (name == (*it)->GetName())
- g_video_backend = *it;
-}
diff --git a/Source/Core/Common/Src/VideoBackendBase.h b/Source/Core/Common/Src/VideoBackendBase.h
deleted file mode 100644
index 9c591d05a5..0000000000
--- a/Source/Core/Common/Src/VideoBackendBase.h
+++ /dev/null
@@ -1,185 +0,0 @@
-// Copyright 2013 Dolphin Emulator Project
-// Licensed under GPLv2
-// Refer to the license.txt file included.
-
-#ifndef VIDEO_BACKEND_H_
-#define VIDEO_BACKEND_H_
-
-#include <string>
-#include <vector>
-
-#include "ChunkFile.h"
-#include "../../VideoCommon/Src/PerfQueryBase.h"
-
-typedef void (*writeFn16)(const u16,const u32);
-typedef void (*writeFn32)(const u32,const u32);
-typedef void (*readFn16)(u16&, const u32);
-
-
-enum FieldType
-{
- FIELD_PROGRESSIVE = 0,
- FIELD_UPPER,
- FIELD_LOWER
-};
-
-enum EFBAccessType
-{
- PEEK_Z = 0,
- POKE_Z,
- PEEK_COLOR,
- POKE_COLOR
-};
-
-struct SCPFifoStruct
-{
- // fifo registers
- volatile u32 CPBase;
- volatile u32 CPEnd;
- u32 CPHiWatermark;
- u32 CPLoWatermark;
- volatile u32 CPReadWriteDistance;
- volatile u32 CPWritePointer;
- volatile u32 CPReadPointer;
- volatile u32 CPBreakpoint;
- volatile u32 SafeCPReadPointer;
- // Super Monkey Ball Adventure require this.
- // Because the read&check-PEToken-loop stays in its JITed block I suppose.
- // So no possiblity to ack the Token irq by the scheduler until some sort of PPC watchdog do its mess.
- volatile u16 PEToken;
-
- volatile u32 bFF_GPLinkEnable;
- volatile u32 bFF_GPReadEnable;
- volatile u32 bFF_BPEnable;
- volatile u32 bFF_BPInt;
- volatile u32 bFF_Breakpoint;
-
- volatile u32 CPCmdIdle;
- volatile u32 CPReadIdle;
-
- volatile u32 bFF_LoWatermarkInt;
- volatile u32 bFF_HiWatermarkInt;
-
- volatile u32 bFF_LoWatermark;
- volatile u32 bFF_HiWatermark;
-
- // for GP watchdog hack
- volatile u32 Fake_GPWDToken; // cicular incrementer
- volatile u32 isGpuReadingData;
-};
-
-class VideoBackend
-{
-public:
- virtual ~VideoBackend() {}
-
- virtual void EmuStateChange(EMUSTATE_CHANGE) = 0;
-
- virtual void UpdateFPSDisplay(const char*) = 0;
-
- virtual unsigned int PeekMessages() = 0;
-
- virtual bool Initialize(void *&) = 0;
- virtual void Shutdown() = 0;
- virtual void RunLoop(bool enable) = 0;
-
- virtual std::string GetName() = 0;
- virtual std::string GetDisplayName() { return GetName(); }
-
- virtual void ShowConfig(void*) {}
-
- virtual void Video_Prepare() = 0;
- virtual void Video_EnterLoop() = 0;
- virtual void Video_ExitLoop() = 0;
- virtual void Video_Cleanup() = 0; // called from gl/d3d thread
-
- virtual void Video_BeginField(u32, FieldType, u32, u32) = 0;
- virtual void Video_EndField() = 0;
-
- virtual u32 Video_AccessEFB(EFBAccessType, u32, u32, u32) = 0;
- virtual u32 Video_GetQueryResult(PerfQueryType type) = 0;
-
- virtual void Video_AddMessage(const char* pstr, unsigned int milliseconds) = 0;
- virtual void Video_ClearMessages() = 0;
- virtual bool Video_Screenshot(const char* filename) = 0;
-
- virtual void Video_SetRendering(bool bEnabled) = 0;
-
- virtual void Video_GatherPipeBursted() = 0;
-
- virtual bool Video_IsPossibleWaitingSetDrawDone() = 0;
- virtual bool Video_IsHiWatermarkActive() = 0;
- virtual void Video_AbortFrame() = 0;
-
- virtual readFn16 Video_CPRead16() = 0;
- virtual writeFn16 Video_CPWrite16() = 0;
- virtual readFn16 Video_PERead16() = 0;
- virtual writeFn16 Video_PEWrite16() = 0;
- virtual writeFn32 Video_PEWrite32() = 0;
-
- static void PopulateList();
- static void ClearList();
- static void ActivateBackend(const std::string& name);
-
- // waits until is paused and fully idle, and acquires a lock on that state.
- // or, if doLock is false, releases a lock on that state and optionally unpauses.
- // calls must be balanced and non-recursive (once with doLock true, then once with doLock false).
- virtual void PauseAndLock(bool doLock, bool unpauseOnUnlock=true) = 0;
-
- // 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;
-extern VideoBackend* g_video_backend;
-
-// inherited by dx9/dx11/ogl backends
-class VideoBackendHardware : public VideoBackend
-{
- void RunLoop(bool enable);
- bool Initialize(void *&) { InitializeShared(); return true; }
-
- void EmuStateChange(EMUSTATE_CHANGE);
-
- void Video_EnterLoop();
- void Video_ExitLoop();
- void Video_BeginField(u32, FieldType, u32, u32);
- void Video_EndField();
-
- u32 Video_AccessEFB(EFBAccessType, u32, u32, u32);
- u32 Video_GetQueryResult(PerfQueryType type);
-
- void Video_AddMessage(const char* pstr, unsigned int milliseconds);
- void Video_ClearMessages();
- bool Video_Screenshot(const char* filename);
-
- void Video_SetRendering(bool bEnabled);
-
- void Video_GatherPipeBursted();
-
- bool Video_IsPossibleWaitingSetDrawDone();
- bool Video_IsHiWatermarkActive();
- void Video_AbortFrame();
-
- readFn16 Video_CPRead16();
- writeFn16 Video_CPWrite16();
- readFn16 Video_PERead16();
- writeFn16 Video_PEWrite16();
- writeFn32 Video_PEWrite32();
-
- 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/make_scmrev.h.js b/Source/Core/Common/make_scmrev.h.js
index 82f6394c2b..f2978987dc 100644
--- a/Source/Core/Common/make_scmrev.h.js
+++ b/Source/Core/Common/make_scmrev.h.js
@@ -58,8 +58,8 @@ var describe = GetFirstStdOutLine(gitexe + cmd_describe);
var branch = GetFirstStdOutLine(gitexe + cmd_branch);
var isMaster = +("master" == branch);
-// remove hash from description
-describe = describe.replace(/-[^-]+(-dirty)?$/, '$1');
+// remove hash (and trailing "-0" if needed) from description
+describe = describe.replace(/(-0)?-[^-]+(-dirty)?$/, '$2');
var out_contents =
"#define SCM_REV_STR \"" + revision + "\"\n" +