diff --git a/Core/Config.cpp b/Core/Config.cpp index ffe1f865b6..4307ab3289 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -473,7 +473,7 @@ void Config::Save() { pinnedPaths->Clear(); for (size_t i = 0; i < vPinnedPaths.size(); ++i) { char keyName[64]; - snprintf(keyName, sizeof(keyName), "Path%d", i); + snprintf(keyName, sizeof(keyName), "Path%d", (int)i); pinnedPaths->Set(keyName, vPinnedPaths[i]); } diff --git a/Core/Debugger/DisassemblyManager.h b/Core/Debugger/DisassemblyManager.h index ae1847dcdc..7225df2016 100644 --- a/Core/Debugger/DisassemblyManager.h +++ b/Core/Debugger/DisassemblyManager.h @@ -17,6 +17,7 @@ #pragma once #include "Globals.h" +#include "Core/Debugger/SymbolMap.h" #include "Core/MIPS/MIPSAnalyst.h" enum DisassemblyLineType { DISTYPE_OPCODE, DISTYPE_MACRO, DISTYPE_DATA, DISTYPE_OTHER }; diff --git a/Core/HLE/sceKernelMemory.cpp b/Core/HLE/sceKernelMemory.cpp index 7ad6eda327..c3c035e491 100644 --- a/Core/HLE/sceKernelMemory.cpp +++ b/Core/HLE/sceKernelMemory.cpp @@ -1550,7 +1550,7 @@ u32 AllocMemoryBlock(const char *pname, u32 type, u32 size, u32 paramsAddr) { if (!block->IsValid()) { delete block; - ERROR_LOG(SCEKERNEL, "AllocMemoryBlock(%s, %i, %08x, %08x): allocation failed"); + ERROR_LOG(SCEKERNEL, "AllocMemoryBlock(%s, %i, %08x, %08x): allocation failed", pname, type, size, paramsAddr); return SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED; } SceUID uid = kernelObjects.Create(block); diff --git a/Core/Host.cpp b/Core/Host.cpp index b2b6eb3184..2dd5c7d33c 100644 --- a/Core/Host.cpp +++ b/Core/Host.cpp @@ -15,11 +15,18 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. +#include + #include "Core/Host.h" #include "Core/Debugger/SymbolMap.h" Host *host; +int PMixer::Mix(short *stereoout, int numSamples) { + memset(stereoout, 0, numSamples * 2 * sizeof(short)); + return numSamples; +} + bool Host::AttemptLoadSymbolMap() { symbolMap.Clear(); return false; diff --git a/Core/Host.h b/Core/Host.h index 0205ec43c3..06c0947263 100644 --- a/Core/Host.h +++ b/Core/Host.h @@ -26,7 +26,7 @@ class PMixer { public: PMixer() {} virtual ~PMixer() {} - virtual int Mix(short *stereoout, int numSamples) {memset(stereoout,0,numSamples*2*sizeof(short)); return numSamples;} + virtual int Mix(short *stereoout, int numSamples); }; class Host { diff --git a/Core/MemMap.cpp b/Core/MemMap.cpp index 9af4b58d8b..fcb3c1c8a6 100644 --- a/Core/MemMap.cpp +++ b/Core/MemMap.cpp @@ -188,7 +188,7 @@ Opcode Read_Instruction(u32 address, bool resolveReplacements) return Opcode(op); } } else { - ERROR_LOG(HLE, "Replacement, but no replacement op? %08x", inst); + ERROR_LOG(HLE, "Replacement, but no replacement op? %08x", inst.encoding); } } return inst; diff --git a/Core/System.cpp b/Core/System.cpp index 71244d9232..f73504f5b2 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -300,6 +300,8 @@ void System_Wake() { } } +static bool pspIsInited = false; + bool PSP_Init(const CoreParameter &coreParam, std::string *error_string) { INFO_LOG(BOOT, "PPSSPP %s", PPSSPP_GIT_VERSION); @@ -325,11 +327,12 @@ bool PSP_Init(const CoreParameter &coreParam, std::string *error_string) { *error_string = "Unable to initialize rendering engine."; } } + pspIsInited = success; return success; } bool PSP_IsInited() { - return currentMIPS != 0; + return pspIsInited; } void PSP_Shutdown() { @@ -353,6 +356,7 @@ void PSP_Shutdown() { GPU_Shutdown(); host->SetWindowTitle(0); currentMIPS = 0; + pspIsInited = false; } void PSP_RunLoopUntil(u64 globalticks) { diff --git a/GPU/Directx9/GPU_DX9.cpp b/GPU/Directx9/GPU_DX9.cpp index 68c9134686..f3bd3a217f 100644 --- a/GPU/Directx9/GPU_DX9.cpp +++ b/GPU/Directx9/GPU_DX9.cpp @@ -15,6 +15,8 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. +#include + #include "Core/MemMap.h" #include "Core/Host.h" #include "Core/Config.h" diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index 3c0b14b795..1a9a69bdae 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -17,6 +17,7 @@ #include #include +#include #include "Core/MemMap.h" #include "Core/Reporting.h" @@ -26,6 +27,7 @@ #include "GPU/Directx9/FramebufferDX9.h" #include "GPU/Common/TextureDecoder.h" #include "Core/Config.h" +#include "Core/Host.h" #include "ext/xxhash.h" #include "math/math_util.h" diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index ac03343f76..4b2dc05782 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -17,6 +17,7 @@ #include #include +#include #include "Core/Host.h" #include "Core/MemMap.h" @@ -27,6 +28,7 @@ #include "GPU/GLES/Framebuffer.h" #include "GPU/Common/TextureDecoder.h" #include "Core/Config.h" +#include "Core/Host.h" #include "ext/xxhash.h" #include "math/math_util.h" @@ -1125,6 +1127,7 @@ void TextureCache::SetTexture(bool force) { // If GLES3 is available, we can preallocate the storage, which makes texture loading more efficient. GLenum dstFmt = GetDestFormat(format, gstate.getClutPaletteFormat()); +#if defined(MAY_HAVE_GLES3) if (gl_extensions.GLES3 && maxLevel > 0) { // glTexStorage2D requires the use of sized formats. GLenum storageFmt = GL_RGBA8; @@ -1137,10 +1140,12 @@ void TextureCache::SetTexture(bool force) { ERROR_LOG(G3D, "Unknown dstfmt %i", (int)dstFmt); break; } + // TODO: This may cause bugs, since it hard-sets the texture w/h, and we might try to reuse it later with a different size. glTexStorage2D(GL_TEXTURE_2D, maxLevel + 1, storageFmt, w, h); // Make sure we don't use glTexImage2D after glTexStorage2D. replaceImages = true; } +#endif // GLES2 doesn't have support for a "Max lod" which is critical as PSP games often // don't specify mips all the way down. As a result, we either need to manually generate @@ -1165,7 +1170,7 @@ void TextureCache::SetTexture(bool force) { #ifndef USING_GLES2 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 0); -#else +#elif defined(MAY_HAVE_GLES3) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); #endif } diff --git a/Windows/Debugger/CPURegsInterface.h b/Windows/Debugger/CPURegsInterface.h index dbec96fedf..4b5013b85d 100644 --- a/Windows/Debugger/CPURegsInterface.h +++ b/Windows/Debugger/CPURegsInterface.h @@ -1,5 +1,4 @@ #pragma once -#include "Core/CPU.h" - +#include "Core/Core.h" diff --git a/Windows/Debugger/CtrlRegisterList.cpp b/Windows/Debugger/CtrlRegisterList.cpp index 02d006788d..f21c564e60 100644 --- a/Windows/Debugger/CtrlRegisterList.cpp +++ b/Windows/Debugger/CtrlRegisterList.cpp @@ -19,6 +19,8 @@ #include "../main.h" +static const int numCPUs = 1; + //#include "DbgHelp.h" extern HMENU g_hPopupMenus; diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index 7e5c30947b..f40cc9b572 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -20,7 +20,6 @@ #include "Windows/WndMainWindow.h" #include "Core/Core.h" -#include "Core/CPU.h" #include "Core/HLE/HLE.h" #include "Core/CoreTiming.h" #include "Core/MIPS/MIPSAnalyst.h" @@ -36,6 +35,8 @@ #include #include +static const int numCPUs = 1; + // How long (max) to wait for Core to pause before clearing temp breakpoints. const int TEMP_BREAKPOINT_WAIT_MS = 100; diff --git a/Windows/Debugger/Debugger_Disasm.h b/Windows/Debugger/Debugger_Disasm.h index 309b894608..a013443953 100644 --- a/Windows/Debugger/Debugger_Disasm.h +++ b/Windows/Debugger/Debugger_Disasm.h @@ -9,7 +9,6 @@ #include "Windows/Debugger/Debugger_Lists.h" #include "Windows/Debugger/CPURegsInterface.h" #include "Globals.h" -#include "Core/CPU.h" #include "Core/MIPS/MIPSDebugInterface.h" #include "Core/Debugger/Breakpoints.h" #include diff --git a/Windows/Debugger/Debugger_Lists.cpp b/Windows/Debugger/Debugger_Lists.cpp index cd7cd5b5e7..b73cd1b302 100644 --- a/Windows/Debugger/Debugger_Lists.cpp +++ b/Windows/Debugger/Debugger_Lists.cpp @@ -10,6 +10,8 @@ #include "../../Core/HLE/sceKernelThread.h" #include "util/text/utf8.h" +static const int numCPUs = 1; + enum { TL_NAME, TL_PROGRAMCOUNTER, TL_ENTRYPOINT, TL_PRIORITY, TL_STATE, TL_WAITTYPE, TL_COLUMNCOUNT }; enum { BPL_TYPE, BPL_OFFSET, BPL_SIZELABEL, BPL_OPCODE, BPL_CONDITION, BPL_HITS, BPL_ENABLED, BPL_COLUMNCOUNT }; enum { SF_ENTRY, SF_ENTRYNAME, SF_CURPC, SF_CUROPCODE, SF_CURSP, SF_FRAMESIZE, SF_COLUMNCOUNT }; diff --git a/Windows/Debugger/Debugger_MemoryDlg.h b/Windows/Debugger/Debugger_MemoryDlg.h index d324b50145..d8e2c5fef4 100644 --- a/Windows/Debugger/Debugger_MemoryDlg.h +++ b/Windows/Debugger/Debugger_MemoryDlg.h @@ -4,7 +4,6 @@ #include "Windows/W32Util/DialogManager.h" #include "Core/MemMap.h" -#include "Core/CPU.h" #include "Core/Debugger/DebugInterface.h" diff --git a/Windows/Debugger/Debugger_VFPUDlg.h b/Windows/Debugger/Debugger_VFPUDlg.h index 2a5239265b..5481e29fb8 100644 --- a/Windows/Debugger/Debugger_VFPUDlg.h +++ b/Windows/Debugger/Debugger_VFPUDlg.h @@ -1,12 +1,12 @@ // NOTE: Apologies for the quality of this code, this is really from pre-opensource Dolphin - that is, 2003. #pragma once -#include "../W32Util/DialogManager.h" +#include "Windows/W32Util/DialogManager.h" -#include "../../Core/MemMap.h" -#include "../../Core/CPU.h" +#include "Core/MemMap.h" +#include "Core/Core.h" -#include "../../Core/Debugger/DebugInterface.h" +#include "Core/Debugger/DebugInterface.h" class CVFPUDlg : public Dialog { diff --git a/Windows/GEDebugger/CtrlDisplayListView.cpp b/Windows/GEDebugger/CtrlDisplayListView.cpp index cd3c9ae7d9..f6ffd2cc2d 100644 --- a/Windows/GEDebugger/CtrlDisplayListView.cpp +++ b/Windows/GEDebugger/CtrlDisplayListView.cpp @@ -6,6 +6,8 @@ #include "GPU/Debugger/Breakpoints.h" #include +static const int numCPUs = 1; + const PTCHAR CtrlDisplayListView::windowClass = _T("CtrlDisplayListView"); const int POPUP_SUBMENU_ID_DISPLAYLISTVIEW = 8; diff --git a/Windows/GEDebugger/VertexPreview.cpp b/Windows/GEDebugger/VertexPreview.cpp index a17ae66fb5..c63bc59299 100644 --- a/Windows/GEDebugger/VertexPreview.cpp +++ b/Windows/GEDebugger/VertexPreview.cpp @@ -19,6 +19,7 @@ #include "gfx_es2/glsl_program.h" #include "Windows/GEDebugger/GEDebugger.h" #include "Windows/GEDebugger/SimpleGLWindow.h" +#include "Core/System.h" #include "GPU/GPUInterface.h" #include "GPU/Common/GPUDebugInterface.h" #include "GPU/GPUState.h" diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index 70171e0e7f..b536ae37f7 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -56,6 +56,8 @@ #include "Common/StringUtils.h" #include "main.h" +static const int numCPUs = 1; + static PMixer *curMixer; float mouseDeltaX = 0; diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index 1c4f693116..f8f043577a 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -77,6 +77,8 @@ #define ENABLE_TOUCH 0 +static const int numCPUs = 1; + int verysleepy__useSendMessage = 1; const UINT WM_VERYSLEEPY_MSG = WM_APP + 0x3117;