Remove Globals.h

This commit is contained in:
Henrik Rydgård 2017-08-31 17:13:18 +02:00
parent ff3d799871
commit 6a1fa728d8
67 changed files with 99 additions and 193 deletions

View File

@ -140,7 +140,6 @@ if(APPLE)
find_library(COCOA_LIBRARY Cocoa)
endif()
# Needed for Globals.h
include_directories("${CMAKE_SOURCE_DIR}")
if(USING_EGL)
@ -1604,7 +1603,6 @@ add_library(${CoreLibName} ${CoreLinkType}
Core/Util/ppge_atlas.h
${CORE_NEON}
${GPU_SOURCES}
Globals.h
git-version.cpp
ext/disarm.cpp
git-version.cpp)

View File

@ -37,6 +37,7 @@
#include <type_traits>
#include "Common.h"
#include "Swap.h"
#include "FileUtil.h"
template <class T>

View File

@ -38,8 +38,11 @@ protected:
size_t region_size;
};
template<class T> class CodeBlock : public CodeBlockCommon, public T, NonCopyable {
template<class T> class CodeBlock : public CodeBlockCommon, public T {
private:
CodeBlock(const CodeBlock &) = delete;
void operator=(const CodeBlock &) = delete;
// A privately used function to set the executable RAM space to something invalid.
// For debugging usefulness it should be used to set the RAM to a host specific breakpoint instruction
virtual void PoisonMemory(int offset) = 0;

View File

@ -20,7 +20,6 @@
// DO NOT EVER INCLUDE <windows.h> directly _or indirectly_ from this file
// since it slows down the build a lot.
#include <stdlib.h>
#include <stdarg.h>
#ifdef _MSC_VER
@ -36,19 +35,16 @@
#define STACKALIGN
// An inheritable class to disallow the copy constructor and operator= functions
class NonCopyable {
protected:
NonCopyable() {}
private:
NonCopyable(const NonCopyable&);
void operator=(const NonCopyable&);
};
#include "Log.h"
#include "CommonTypes.h"
#include "CommonFuncs.h"
#ifndef DISALLOW_COPY_AND_ASSIGN
#define DISALLOW_COPY_AND_ASSIGN(t) \
t(const t &other) = delete; \
void operator =(const t &other) = delete;
#endif
#ifdef __APPLE__
// The Darwin ABI requires that stack frames be aligned to 16-byte boundaries.
// This is only needed on i386 gcc - x86_64 already aligns to 16 bytes.
@ -101,5 +97,3 @@ private:
# define _M_SSE 0x200
# endif
#endif
#include "Swap.h"

View File

@ -25,6 +25,7 @@
#if !defined(_WIN32)
#include <unistd.h>
#include <errno.h>

View File

@ -124,14 +124,17 @@ const std::string &GetExeDirectory();
// simple wrapper for cstdlib file functions to
// hopefully will make error checking easier
// and make forgetting an fclose() harder
class IOFile : NonCopyable {
class IOFile {
public:
IOFile();
IOFile(std::FILE* file);
IOFile(const std::string& filename, const char openmode[]);
~IOFile();
// Prevent copies.
IOFile(const IOFile &) = delete;
void operator=(const IOFile &) = delete;
bool Open(const std::string& filename, const char openmode[]);
bool Close();
@ -189,9 +192,6 @@ public:
}
private:
IOFile& operator=(const IOFile&) /*= delete*/;
IOFile(const IOFile&) /*= delete*/;
std::FILE *m_file;
bool m_good;
};

View File

@ -1,6 +1,8 @@
#pragma once
#include <cstring>
#include <vector>
#include "ext/xxhash.h"
#include "Common/CommonFuncs.h"

View File

@ -103,11 +103,15 @@ struct LogChannel {
class ConsoleListener;
class LogManager : NonCopyable {
class LogManager {
private:
LogManager();
~LogManager();
// Prevent copies.
LogManager(const LogManager &) = delete;
void operator=(const LogManager &) = delete;
LogChannel log_[LogTypes::NUMBER_OF_LOGS];
FileLogListener *fileLog_ = nullptr;
ConsoleListener *consoleLog_ = nullptr;

View File

@ -17,6 +17,10 @@
#pragma once
#include <cstdlib>
#include "Common/CommonTypes.h"
// Android
#if defined(__ANDROID__)
#include <sys/endian.h>

View File

@ -19,6 +19,7 @@
#include "Common/Common.h"
#include "Common/CommonTypes.h"
#include "Common/Swap.h"
class PointerWrap;

View File

@ -18,6 +18,8 @@
#pragma once
#include <string>
#include "Common/Swap.h"
#include "Core/Dialog/PSPDialog.h"
#define SCE_UTILITY_MSGDIALOG_OPTION_ERRORSOUND 0x00000000

View File

@ -18,6 +18,7 @@
#pragma once
#include "Common/Common.h"
#include "Common/Swap.h"
///////////////////////
// ELF Header Constants

View File

@ -19,6 +19,7 @@
#pragma once
#include "Common/Common.h"
#include "Common/Swap.h"
enum PBPSubFile {
PBP_PARAM_SFO,

View File

@ -5,6 +5,7 @@ extern "C"
#include "ext/libkirk/kirk_engine.h"
}
#include "Common/Common.h"
#include "Common/Swap.h"
#include "Core/ELF/PrxDecrypter.h"
#define ROUNDUP16(x) (((x)+15)&~15)

View File

@ -22,6 +22,7 @@
#include <mutex>
#include "Common/Common.h"
#include "Common/Swap.h"
#include "Core/Loaders.h"
class DiskCachingFileLoaderCache;

View File

@ -17,6 +17,7 @@
#include "Common/FileUtil.h"
#include "Common/Swap.h"
#include "Core/Loaders.h"
#include "Core/FileSystems/BlockDevices.h"
#include <cstdio>

View File

@ -20,6 +20,8 @@
#include <vector>
#include <map>
#include <algorithm>
#include "Common/CommonTypes.h"
#include "Core/HLE/sceKernelThread.h"
namespace HLEKernel

View File

@ -18,7 +18,6 @@
#include <atomic>
#include <mutex>
#include "Globals.h" // only for clamp_s16
#include "Common/CommonTypes.h"
#include "Common/ChunkFile.h"
#include "Common/FixedSizeQueue.h"

View File

@ -19,13 +19,13 @@
#include <cmath>
#include <mutex>
#include "Globals.h"
#include "Core/HLE/HLE.h"
#include "Core/HLE/FunctionWrappers.h"
#include "Core/MIPS/MIPS.h"
#include "Core/CoreTiming.h"
#include "Core/MemMapHelpers.h"
#include "Common/ChunkFile.h"
#include "Core/Util/AudioFormat.h" // for clamp_u8
#include "Core/HLE/sceCtrl.h"
#include "Core/HLE/sceDisplay.h"
#include "Core/HLE/sceKernel.h"

View File

@ -20,12 +20,11 @@
#include <map>
#include "Common/Common.h"
#include "Common/CommonTypes.h"
#include "Common/Swap.h"
class PointerWrap;
enum
{
enum {
SCE_KERNEL_ERROR_OK = 0,
SCE_KERNEL_ERROR_ALREADY = 0x80000020,
SCE_KERNEL_ERROR_BUSY = 0x80000021,

View File

@ -15,12 +15,12 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
// This code is part shamelessly "inspired" from JPSCP.
#include <map>
#include <algorithm>
#include <memory>
#include "Common/Swap.h"
#include "Core/HLE/sceMpeg.h"
#include "Core/HLE/sceKernelModule.h"
#include "Core/HLE/sceKernelThread.h"

View File

@ -18,6 +18,7 @@
#pragma once
#include "Common/Common.h"
#include "Common/Swap.h"
class PointerWrap;

View File

@ -15,18 +15,18 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include <algorithm>
#include "base/basictypes.h"
#include "profiler/profiler.h"
#include "Globals.h"
#include "Core/MemMapHelpers.h"
#include "Core/HLE/sceAtrac.h"
#include "Core/Config.h"
#include "Core/Reporting.h"
#include "Core/Util/AudioFormat.h"
#include "SasAudio.h"
#include <algorithm>
// #define AUDIO_TO_FILE
static const u8 f[16][2] = {

View File

@ -18,9 +18,8 @@
#include <stdint.h>
#include "base/basictypes.h"
#include "Globals.h"
#include "Core/HW/SasReverb.h"
#include "Core/Util/AudioFormat.h"
// This is under the assumption that the reverb used in Sas is the same as the PSX SPU reverb.

View File

@ -39,8 +39,8 @@
#include "Core/Config.h"
#include "Core/HW/StereoResampler.h"
#include "Core/HLE/__sceAudio.h"
#include "Core/Util/AudioFormat.h" // for clamp_u8
#include "Core/System.h"
#include "Globals.h"
#ifdef _M_SSE
#include <emmintrin.h>

View File

@ -27,6 +27,7 @@
// Includes
#include "Common/Common.h"
#include "Common/CommonTypes.h"
#include "Common/Swap.h"
#include "Core/Opcode.h"
// PPSSPP is very aggressive about trying to do memory accesses directly, for speed.

View File

@ -19,7 +19,6 @@
#include "Common/CPUDetect.h"
#include "Core/Util/AudioFormat.h"
#include "Core/Util/AudioFormatNEON.h"
#include "Globals.h"
#ifdef _M_SSE
#include <emmintrin.h>

View File

@ -19,7 +19,33 @@
#include "ppsspp_config.h"
#include "Common/Common.h"
#include "Globals.h"
#include "Common/CommonTypes.h"
#define IS_LITTLE_ENDIAN (*(const u16 *)"\0\xff" >= 0x100)
static inline u8 clamp_u8(int i) {
#if PPSSPP_ARCH(ARM) && !defined(_MSC_VER)
asm("usat %0, #8, %1" : "=r"(i) : "r"(i));
#else
if (i > 255)
return 255;
if (i < 0)
return 0;
#endif
return i;
}
static inline s16 clamp_s16(int i) {
#if PPSSPP_ARCH(ARM) && !defined(_MSC_VER)
asm("ssat %0, #16, %1" : "=r"(i) : "r"(i));
#else
if (i > 32767)
return 32767;
if (i < -32768)
return -32768;
#endif
return i;
}
static inline s16 ApplySampleVolume(s16 sample, int vol) {
#if PPSSPP_ARCH(ARM) && !defined(_MSC_VER)

View File

@ -18,6 +18,7 @@
#pragma once
#include "Common/CommonTypes.h"
#include "Common/Swap.h"
#include "GPU/Math3D.h"
#include "GPU/ge_constants.h"

View File

@ -25,6 +25,7 @@ enum CheckAlphaResult {
};
#include "Common/Common.h"
#include "Common/Swap.h"
#include "Core/MemMap.h"
#include "GPU/ge_constants.h"
#include "GPU/Common/TextureDecoderNEON.h"

View File

@ -28,6 +28,7 @@
#include "Core/HDRemaster.h"
#include "Core/Reporting.h"
#include "Core/MIPS/JitCommon/JitCommon.h"
#include "Core/Util/AudioFormat.h" // for clamp_u8
#include "GPU/Common/ShaderCommon.h"
#include "GPU/GPUState.h"
#include "GPU/ge_constants.h"

View File

@ -37,7 +37,6 @@
#else
#include "Common/FakeEmitter.h"
#endif
#include "Globals.h"
// DecVtxFormat - vertex formats for PC
// Kind of like a D3D VertexDeclaration.

View File

@ -27,8 +27,6 @@
// Also provides facilities for drawing and later converting raw
// pixel data.
#include "Globals.h"
#include "GPU/GPUCommon.h"
#include "GPU/Common/FramebufferCommon.h"
#include "Core/Config.h"

View File

@ -22,7 +22,6 @@
#include <d3d11.h>
#include "base/basictypes.h"
#include "Globals.h"
#include "GPU/Common/ShaderCommon.h"
#include "GPU/Common/ShaderId.h"
#include "GPU/Common/ShaderUniforms.h"

View File

@ -27,8 +27,6 @@
// Also provides facilities for drawing and later converting raw
// pixel data.
#include "Globals.h"
#include "GPU/GPUCommon.h"
#include "GPU/Common/FramebufferCommon.h"
#include "Core/Config.h"

View File

@ -21,7 +21,6 @@
#include <cstdint>
#include "base/basictypes.h"
#include "Globals.h"
#include "GPU/Directx9/VertexShaderGeneratorDX9.h"
#include "GPU/Directx9/PixelShaderGeneratorDX9.h"
#include "GPU/Common/ShaderCommon.h"

View File

@ -21,7 +21,6 @@
#include <d3d9.h>
#include "../Globals.h"
#include "GPU/GPU.h"
#include "GPU/GPUInterface.h"
#include "GPU/Directx9/TextureScalerDX9.h"

View File

@ -17,8 +17,6 @@
#pragma once
#include "Globals.h"
#include "GPU/Common/ShaderID.h"
namespace DX9 {

View File

@ -17,8 +17,6 @@
#pragma once
#include "Globals.h"
struct ShaderID;
bool GenerateFragmentShader(const ShaderID &id, char *buffer);

View File

@ -26,11 +26,9 @@
// Also provides facilities for drawing and later converting raw
// pixel data.
#include "Globals.h"
#include "Core/Config.h"
#include "GPU/GPUCommon.h"
#include "GPU/Common/FramebufferCommon.h"
#include "Core/Config.h"
struct GLSLProgram;
class TextureCacheGLES;

View File

@ -17,9 +17,9 @@
#pragma once
#include "base/basictypes.h"
#include "Globals.h"
#include <vector>
#include "base/basictypes.h"
#include "Common/Hashmaps.h"
#include "GPU/Common/ShaderCommon.h"
#include "GPU/Common/ShaderId.h"

View File

@ -21,7 +21,6 @@
#include "gfx_es2/gpu_features.h"
#include "gfx/gl_common.h"
#include "Globals.h"
#include "GPU/GPUInterface.h"
#include "GPU/GPUState.h"
#include "GPU/GLES/TextureScalerGLES.h"

View File

@ -21,6 +21,7 @@
#include <string>
#include <vector>
#include "Common/Swap.h"
#include "GPU/GPU.h"
#include "Core/MemMap.h"
#include "GPU/ge_constants.h"

View File

@ -19,10 +19,10 @@
#include <cmath>
#include "Globals.h"
#include "Common/Common.h"
#include "Common/Swap.h"
#include "GPU/GPU.h"
#include "GPU/ge_constants.h"
#include "Common/Common.h"
#include "GPU/Common/ShaderCommon.h"
class PointerWrap;

View File

@ -18,9 +18,8 @@
#pragma once
#include <cmath>
#include "Globals.h"
#include "Common/Common.h"
#include "Common/Common.h"
#include "math/fast/fast_matrix.h"
#if defined(_M_SSE)

View File

@ -18,8 +18,6 @@
#pragma once
#include "Globals.h"
struct ShaderID;
bool GenerateVulkanGLSLFragmentShader(const ShaderID &id, char *buffer);

View File

@ -21,7 +21,6 @@
#include "base/basictypes.h"
#include "Common/Hashmaps.h"
#include "Globals.h"
#include "Common/Vulkan/VulkanMemory.h"
#include "GPU/Common/ShaderCommon.h"
#include "GPU/Common/ShaderId.h"

View File

@ -20,7 +20,6 @@
#include <map>
#include "Common/Hashmaps.h"
#include "Globals.h"
#include "GPU/GPUInterface.h"
#include "GPU/GPUState.h"
#include "Common/Vulkan/VulkanContext.h"

View File

@ -1,63 +0,0 @@
// Copyright (c) 2012- PPSSPP 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 or later versions.
// 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 git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#pragma once
#include <cstdio>
#include <cstring>
#include <vector>
#include <string>
#include <utility>
#include "ppsspp_config.h"
#include "Common/Log.h"
#include "Common/CommonTypes.h"
#define IS_LITTLE_ENDIAN (*(const u16 *)"\0\xff" >= 0x100)
#define IS_BIG_ENDIAN (*(const u16 *)"\0\xff" < 0x100)
static inline u8 clamp_u8(int i) {
#if PPSSPP_ARCH(ARM) && !defined(_MSC_VER)
asm("usat %0, #8, %1" : "=r"(i) : "r"(i));
#else
if (i > 255)
return 255;
if (i < 0)
return 0;
#endif
return i;
}
static inline s16 clamp_s16(int i) {
#if PPSSPP_ARCH(ARM) && !defined(_MSC_VER)
asm("ssat %0, #16, %1" : "=r"(i) : "r"(i));
#else
if (i > 32767)
return 32767;
if (i < -32768)
return -32768;
#endif
return i;
}
#ifndef DISALLOW_COPY_AND_ASSIGN
#define DISALLOW_COPY_AND_ASSIGN(t) \
private: \
t(const t &other); \
void operator =(const t &other);
#endif

View File

@ -16,7 +16,6 @@
#include "Windows/Debugger/DebuggerShared.h"
#include "Windows/Debugger/BreakpointWindow.h"
#include "Core/Debugger/SymbolMap.h"
#include "Globals.h"
#include "Windows/main.h"
#include "Common/CommonWindows.h"

View File

@ -3,8 +3,6 @@
#include <tchar.h>
#include <math.h>
#include "../../globals.h"
#include "Core/Config.h"
#include "../resource.h"
#include "../../Core/MemMap.h"

View File

@ -13,7 +13,6 @@
#include "Debugger_MemoryDlg.h"
#include "Core/Config.h"
#include "../../globals.h"
#include "Debugger_Disasm.h"
#include "DebuggerShared.h"

View File

@ -7,7 +7,6 @@
#include "Windows/Debugger/CtrlDisasmView.h"
#include "Windows/Debugger/Debugger_Lists.h"
#include "Windows/Debugger/CPURegsInterface.h"
#include "Globals.h"
#include "Core/MIPS/MIPSDebugInterface.h"
#include "Core/Debugger/Breakpoints.h"
#include <vector>

View File

@ -8,7 +8,6 @@
#include "Common/Log.h"
#include "Common/StringUtils.h"
#include "Globals.h"
#include "Windows/EmuThread.h"
#include "Windows/W32Util/Misc.h"
#include "Windows/MainWindow.h"

View File

@ -1,7 +1,6 @@
#pragma once
#include "Common/CommonWindows.h"
#include "Globals.h"
#include "GPU/Common/GPUDebugInterface.h"
#include <algorithm>

View File

@ -19,7 +19,6 @@
#include "Common/CommonWindows.h"
#include "GPU/Common/GPUDebugInterface.h"
#include "Globals.h"
#include "Windows/resource.h"
#include "Windows/W32Util/DialogManager.h"
#include "Windows/W32Util/TabControl.h"

View File

@ -22,7 +22,6 @@
#include "gfx_es2/glsl_program.h"
#include "Common/CommonWindows.h"
#include "Globals.h"
struct SimpleGLWindow {
static const wchar_t *windowClass;

View File

@ -1,7 +1,6 @@
#pragma once
#include "Common/CommonWindows.h"
#include "Globals.h"
#include "Windows/resource.h"
#include "Windows/W32Util/DialogManager.h"
#include "Windows/W32Util/Misc.h"

View File

@ -1,29 +0,0 @@
// Copyright (c) 2012- PPSSPP 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 or later versions.
// 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 git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "Globals.h"
#include "MsgHandler.h"
#ifdef _WIN32
#include "Common/CommonWindows.h"
// Globals
HMENU g_hPopupMenus;
int g_activeWindow = 0;
#endif

View File

@ -1,3 +1,4 @@
#include "Common/CommonTypes.h"
#include "Common/CommonWindows.h"
#include "Windows/InputBox.h"
#include "Windows/resource.h"

View File

@ -1,7 +1,5 @@
#pragma once
#include "Globals.h"
#include "Common/CommonWindows.h"

View File

@ -33,8 +33,6 @@
#include "base/display.h"
#include "base/NativeApp.h"
#include "Globals.h"
#include "base/timeutil.h"
#include "i18n/i18n.h"
#include "input/input_state.h"

View File

@ -425,7 +425,6 @@
<ClCompile Include="DSoundStream.cpp" />
<ClCompile Include="GPU\WindowsGLContext.cpp" />
<ClCompile Include="WindowsHost.cpp" />
<ClCompile Include="Globals.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
@ -500,7 +499,6 @@
<ClInclude Include="DSoundStream.h" />
<ClInclude Include="GPU\WindowsGLContext.h" />
<ClInclude Include="WindowsHost.h" />
<ClInclude Include="..\Globals.h" />
<ClInclude Include="main.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="stdafx.h" />

View File

@ -88,7 +88,6 @@
<ClCompile Include="InputDevice.cpp">
<Filter>Windows\Input</Filter>
</ClCompile>
<ClCompile Include="Globals.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="stdafx.cpp" />
<ClCompile Include="..\android\jni\ArmEmitterTest.cpp">
@ -239,7 +238,6 @@
<ClInclude Include="WindowsHost.h">
<Filter>Windows\System</Filter>
</ClInclude>
<ClInclude Include="..\Globals.h" />
<ClInclude Include="main.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="Debugger\Debugger_Disasm.h">

View File

@ -80,6 +80,9 @@ static std::string langRegion;
static std::string osName;
static std::string gpuDriverVersion;
HMENU g_hPopupMenus;
int g_activeWindow = 0;
void LaunchBrowser(const char *url) {
ShellExecute(NULL, L"open", ConvertUTF8ToWString(url).c_str(), NULL, NULL, SW_SHOWNORMAL);
}

View File

@ -1,17 +1,18 @@
#pragma once
#include <stdint.h>
#include <stdlib.h> // for byte swapping
#include <cstdint>
#include <cstdlib> // for byte swapping
#ifdef _WIN32
#pragma warning(disable:4244)
#pragma warning(disable:4996)
#endif
#ifndef DISALLOW_COPY_AND_ASSIGN
#define DISALLOW_COPY_AND_ASSIGN(t) \
private: \
t(const t &other); \
void operator =(const t &other);
t(const t &other) = delete; \
void operator =(const t &other) = delete;
#endif
#ifdef _WIN32
@ -19,20 +20,6 @@ typedef intptr_t ssize_t;
#include <tchar.h>
#define ALIGNED16(x) __declspec(align(16)) x
#define ALIGNED32(x) __declspec(align(32)) x
#define ALIGNED64(x) __declspec(align(64)) x
#define ALIGNED16_DECL(x) __declspec(align(16)) x
#define ALIGNED64_DECL(x) __declspec(align(64)) x
#else
#define ALIGNED16(x) __attribute__((aligned(16))) x
#define ALIGNED32(x) __attribute__((aligned(32))) x
#define ALIGNED64(x) __attribute__((aligned(64))) x
#define ALIGNED16_DECL(x) __attribute__((aligned(16))) x
#define ALIGNED64_DECL(x) __attribute__((aligned(64))) x
#endif // _WIN32
// Byteswapping

View File

@ -18,7 +18,7 @@
#include <string>
#include <vector>
#include "Globals.h"
#include "Common/CommonTypes.h"
struct GPUDebugBuffer;