diff --git a/Source/Core/Common/CMakeLists.txt b/Source/Core/Common/CMakeLists.txt index 894fd38128..c7459b0853 100644 --- a/Source/Core/Common/CMakeLists.txt +++ b/Source/Core/Common/CMakeLists.txt @@ -132,7 +132,6 @@ add_library(common ScopeGuard.h SDCardUtil.cpp SDCardUtil.h - Semaphore.h SettingsHandler.cpp SettingsHandler.h SFMLHelper.cpp @@ -142,7 +141,6 @@ add_library(common SocketContext.h SpanUtils.h SPSCQueue.h - StringLiteral.h StringUtil.cpp StringUtil.h SymbolDB.cpp diff --git a/Source/Core/Common/Semaphore.h b/Source/Core/Common/Semaphore.h deleted file mode 100644 index cc87550148..0000000000 --- a/Source/Core/Common/Semaphore.h +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2016 Dolphin Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#ifdef _WIN32 - -#include - -namespace Common -{ -class Semaphore -{ -public: - Semaphore(int initial_count, int maximum_count) - { - m_handle = CreateSemaphoreA(nullptr, initial_count, maximum_count, nullptr); - } - - ~Semaphore() { CloseHandle(m_handle); } - void Wait() { WaitForSingleObject(m_handle, INFINITE); } - void Post() { ReleaseSemaphore(m_handle, 1, nullptr); } - -private: - HANDLE m_handle; -}; -} // namespace Common - -#elif defined(__APPLE__) - -#include - -namespace Common -{ -class Semaphore -{ -public: - Semaphore(int initial_count, int maximum_count) - { - m_handle = dispatch_semaphore_create(0); - for (int i = 0; i < initial_count; i++) - dispatch_semaphore_signal(m_handle); - } - ~Semaphore() { dispatch_release(m_handle); } - void Wait() { dispatch_semaphore_wait(m_handle, DISPATCH_TIME_FOREVER); } - void Post() { dispatch_semaphore_signal(m_handle); } - -private: - dispatch_semaphore_t m_handle; -}; -} // namespace Common - -#else - -#include - -namespace Common -{ -class Semaphore -{ -public: - Semaphore(int initial_count, int maximum_count) { sem_init(&m_handle, 0, initial_count); } - ~Semaphore() { sem_destroy(&m_handle); } - void Wait() { sem_wait(&m_handle); } - void Post() { sem_post(&m_handle); } - -private: - sem_t m_handle; -}; -} // namespace Common - -#endif // _WIN32 diff --git a/Source/Core/Common/StringLiteral.h b/Source/Core/Common/StringLiteral.h deleted file mode 100644 index 6da9afd24d..0000000000 --- a/Source/Core/Common/StringLiteral.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2023 Dolphin Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include - -namespace Common -{ -// A useful template for passing string literals as arguments to templates -// from: https://ctrpeach.io/posts/cpp20-string-literal-template-parameters/ -template -struct StringLiteral -{ - consteval StringLiteral(const char (&str)[N]) { std::copy_n(str, N, value); } - - char value[N]; -}; - -} // namespace Common diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index e411239d17..996b63e22b 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -71,7 +71,6 @@ add_library(core Debugger/Debugger_SymbolMap.h Debugger/Dump.cpp Debugger/Dump.h - Debugger/GCELF.h Debugger/OSThread.cpp Debugger/OSThread.h Debugger/PPCDebugInterface.cpp diff --git a/Source/Core/Core/Debugger/GCELF.h b/Source/Core/Core/Debugger/GCELF.h deleted file mode 100644 index 18faa4813e..0000000000 --- a/Source/Core/Core/Debugger/GCELF.h +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2008 Dolphin Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -// ELF File Types -#define ET_NONE 0 // No file type -#define ET_REL 1 // Relocatable file -#define ET_EXEC 2 // Executable file -#define ET_DYN 3 // Shared object file -#define ET_CORE 4 // Core file -#define ET_LOPROC 0xFF00 // Processor specific -#define ET_HIPROC 0xFFFF // Processor specific - -// ELF Machine Types -#define EM_NONE 0 // No machine -#define EM_M32 1 // AT&T WE 32100 -#define EM_SPARC 2 // SPARC -#define EM_386 3 // Intel Architecture -#define EM_68K 4 // Motorola 68000 -#define EM_88K 5 // Motorola 88000 -#define EM_860 6 // Intel 80860 -#define EM_MIPS 7 // MIPS RS3000 Big-Endian -#define EM_MIPS_RS4_BE 8 // MIPS RS4000 Big-Endian -#define EM_ARM 40 // ARM/Thumb Architecture - -// ELF Version Types -#define EV_NONE 0 // Invalid version -#define EV_CURRENT 1 // Current version - -// ELF Section Header Types -#define SHT_NULL 0 -#define SHT_PROGBITS 1 -#define SHT_SYMTAB 2 -#define SHT_STRTAB 3 -#define SHT_RELA 4 -#define SHT_HASH 5 -#define SHT_DYNAMIC 6 -#define SHT_NOTE 7 -#define SHT_NOBITS 8 -#define SHT_REL 9 -#define SHT_SHLIB 10 -#define SHT_DYNSYM 11 - -struct ELF_Header -{ - unsigned char ID[4]; - unsigned char clazz; - unsigned char data; - unsigned char version; - unsigned char pad[9]; - unsigned short e_type; // ELF file type - unsigned short e_machine; // ELF target machine - unsigned int e_version; // ELF file version number - unsigned int e_entry; - unsigned int e_phoff; - unsigned int e_shoff; - unsigned int e_flags; - unsigned short e_ehsize; - unsigned short e_phentsize; - unsigned short e_phnum; - unsigned short e_shentsize; - unsigned short e_shnum; - unsigned short e_shtrndx; -}; - -struct Program_Header -{ - unsigned int type; - unsigned int offset; - unsigned int vaddr; - unsigned int paddr; - unsigned int filesz; - unsigned int memsz; - unsigned int flags; - unsigned int align; -}; - -struct Section_Header -{ - unsigned int name; - unsigned int type; - unsigned int flags; - unsigned int addr; - unsigned int offset; - unsigned int size; - unsigned int link; - unsigned int info; - unsigned int addralign; - unsigned int entsize; -}; - -struct Symbol_Header -{ - unsigned int name; - unsigned int value; - unsigned int size; - unsigned char info; - unsigned char other; - unsigned short shndx; -}; - -struct Rela_Header -{ - unsigned int offset; - unsigned int info; - signed int addend; -}; - -const char ELFID[4] = {0x7F, 'E', 'L', 'F'}; diff --git a/Source/Core/DolphinLib.props b/Source/Core/DolphinLib.props index 9959caf60c..f1dec7b3b5 100644 --- a/Source/Core/DolphinLib.props +++ b/Source/Core/DolphinLib.props @@ -159,14 +159,12 @@ - - @@ -222,7 +220,6 @@ - @@ -633,7 +630,6 @@ - diff --git a/Source/Core/VideoBackends/OGL/CMakeLists.txt b/Source/Core/VideoBackends/OGL/CMakeLists.txt index 30c4f98ba2..d48624b7e7 100644 --- a/Source/Core/VideoBackends/OGL/CMakeLists.txt +++ b/Source/Core/VideoBackends/OGL/CMakeLists.txt @@ -1,5 +1,4 @@ add_library(videoogl - GPUTimer.h OGLBoundingBox.cpp OGLBoundingBox.h OGLConfig.cpp diff --git a/Source/Core/VideoBackends/OGL/GPUTimer.h b/Source/Core/VideoBackends/OGL/GPUTimer.h deleted file mode 100644 index 2beefa839e..0000000000 --- a/Source/Core/VideoBackends/OGL/GPUTimer.h +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2016 Dolphin Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "Common/GL/GLExtensions/GLExtensions.h" - -#ifndef GL_TIME_ELAPSED -#define GL_TIME_ELAPSED 0x88BF -#endif - -namespace OGL -{ -/* - * This class can be used to measure the time it takes for the GPU to perform a draw call - * or compute dispatch. To use: - * - * - Create an instance of GPUTimer before issuing the draw call. - * (this can be before or after any binding that needs to be done) - * - * - (optionally) call Begin(). This is not needed for a single draw call. - * - * - Issue the draw call or compute dispatch as normal. - * - * - (optionally) call End(). This is not necessary for a single draw call. - * - * - Call GetTime{Seconds,Milliseconds,Nanoseconds} to determine how long the operation - * took to execute on the GPU. - * - * NOTE: When the timer is read back, this will force a GL flush, so the more often a timer is used, - * the larger of a performance impact it will have. Only one timer can be active at any time, due to - * using GL_TIME_ELAPSED. This is not enforced by the class, however. - * - */ -class GPUTimer final -{ -public: - GPUTimer() - { - glGenQueries(1, &m_query_id); - Begin(); - } - - ~GPUTimer() - { - End(); - glDeleteQueries(1, &m_query_id); - } - - void Begin() - { - if (m_started) - glEndQuery(GL_TIME_ELAPSED); - - glBeginQuery(GL_TIME_ELAPSED, m_query_id); - m_started = true; - } - - void End() - { - if (!m_started) - return; - - glEndQuery(GL_TIME_ELAPSED); - m_started = false; - } - - double GetTimeSeconds() - { - GetResult(); - return static_cast(m_result) / 1000000000.0; - } - - double GetTimeMilliseconds() - { - GetResult(); - return static_cast(m_result) / 1000000.0; - } - - u32 GetTimeNanoseconds() - { - GetResult(); - return m_result; - } - -private: - void GetResult() - { - if (m_has_result) - return; - - if (m_started) - End(); - - glGetQueryObjectuiv(m_query_id, GL_QUERY_RESULT, &m_result); - m_has_result = true; - } - - GLuint m_query_id; - GLuint m_result = 0; - bool m_started = false; - bool m_has_result = false; -}; -} // namespace OGL