diff --git a/Core/Dialog/PSPNetconfDialog.cpp b/Core/Dialog/PSPNetconfDialog.cpp index 31775cefa0..b33c459d34 100644 --- a/Core/Dialog/PSPNetconfDialog.cpp +++ b/Core/Dialog/PSPNetconfDialog.cpp @@ -17,8 +17,8 @@ #include "PSPNetconfDialog.h" #include "ChunkFile.h" -#include "../Core/MemMap.h" -#include "../Core/HLE/sceNetAdhoc.h" +#include "Core/MemMap.h" +#include "Core/HLE/sceNetAdhoc.h" #define NETCONF_CONNECT_ADHOC 2 #define NETCONF_CREATE_ADHOC 4 diff --git a/Core/Dialog/PSPNetconfDialog.h b/Core/Dialog/PSPNetconfDialog.h index 9774e74891..5765c7bf4f 100644 --- a/Core/Dialog/PSPNetconfDialog.h +++ b/Core/Dialog/PSPNetconfDialog.h @@ -18,6 +18,7 @@ #pragma once #include "Core/Dialog/PSPDialog.h" +#include "Core/MemMap.h" #include "Core/System.h" struct SceUtilityNetconfData { @@ -31,7 +32,7 @@ struct SceUtilityNetconfParam { PSPPointer NetconfData; int netHotspot; int netHotspotConnected; - int netWifiSpot; + int netWifiSpot; }; class PSPNetconfDialog: public PSPDialog { diff --git a/Core/Dialog/SavedataParam.cpp b/Core/Dialog/SavedataParam.cpp index 597bc0da3b..fc055c16d2 100644 --- a/Core/Dialog/SavedataParam.cpp +++ b/Core/Dialog/SavedataParam.cpp @@ -147,6 +147,47 @@ namespace }; } +void SaveFileInfo::DoState(PointerWrap &p) +{ + auto s = p.Section("SaveFileInfo", 1, 2); + if (!s) + return; + + p.Do(size); + p.Do(saveName); + p.Do(idx); + + p.DoArray(title, sizeof(title)); + p.DoArray(saveTitle, sizeof(saveTitle)); + p.DoArray(saveDetail, sizeof(saveDetail)); + + p.Do(modif_time); + + if (s <= 1) { + u32 textureData; + int textureWidth; + int textureHeight; + p.Do(textureData); + p.Do(textureWidth); + p.Do(textureHeight); + + if (textureData != 0) { + // Must be MODE_READ. + texture = new PPGeImage(""); + texture->CompatLoad(textureData, textureWidth, textureHeight); + } + } else { + bool hasTexture = texture != NULL; + p.Do(hasTexture); + if (hasTexture) { + if (p.mode == p.MODE_READ) { + texture = new PPGeImage(""); + } + texture->DoState(p); + } + } +} + SavedataParam::SavedataParam() : pspParam(0) , selectedSave(0) diff --git a/Core/Dialog/SavedataParam.h b/Core/Dialog/SavedataParam.h index abd87bc9e8..c917aecb69 100644 --- a/Core/Dialog/SavedataParam.h +++ b/Core/Dialog/SavedataParam.h @@ -17,12 +17,13 @@ #pragma once +#include "Common/CommonTypes.h" +#include "Core/MemMap.h" #include "Core/HLE/sceKernel.h" #include "Core/HLE/sceRtc.h" #include "Core/System.h" #include "Core/Dialog/PSPDialog.h" #include "Core/Util/PPGeDraw.h" -#include "Common/CommonTypes.h" #undef st_ctime #undef st_atime @@ -263,48 +264,9 @@ struct SaveFileInfo memset(&modif_time, 0, sizeof(modif_time)); } - void DoState(PointerWrap &p) - { - auto s = p.Section("SaveFileInfo", 1, 2); - if (!s) - return; - - p.Do(size); - p.Do(saveName); - p.Do(idx); - - p.DoArray(title, sizeof(title)); - p.DoArray(saveTitle, sizeof(saveTitle)); - p.DoArray(saveDetail, sizeof(saveDetail)); - - p.Do(modif_time); - - if (s <= 1) { - u32 textureData; - int textureWidth; - int textureHeight; - p.Do(textureData); - p.Do(textureWidth); - p.Do(textureHeight); - - if (textureData != 0) { - // Must be MODE_READ. - texture = new PPGeImage(""); - texture->CompatLoad(textureData, textureWidth, textureHeight); - } - } else { - bool hasTexture = texture != NULL; - p.Do(hasTexture); - if (hasTexture) { - if (p.mode == p.MODE_READ) { - texture = new PPGeImage(""); - } - texture->DoState(p); - } - } - } + void DoState(PointerWrap &p); }; - + class SavedataParam { public: diff --git a/Core/System.cpp b/Core/System.cpp index 7cec4c165f..03d7a35585 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -33,6 +33,7 @@ #include "Core/MIPS/MIPSAnalyst.h" #include "Core/MIPS/JitCommon/JitCommon.h" +#include "Core/Host.h" #include "Core/System.h" #include "Core/PSPMixer.h" #include "Core/HLE/HLE.h" @@ -81,6 +82,14 @@ volatile CoreState coreState = CORE_STEPPING; volatile bool coreStatePending = false; static volatile CPUThreadState cpuThreadState = CPU_THREAD_NOT_RUNNING; +void UpdateUIState(GlobalUIState newState) { + // Never leave the EXIT state. + if (globalUIState != newState && globalUIState != UISTATE_EXIT) { + globalUIState = newState; + host->UpdateDisassembly(); + } +} + bool IsAudioInitialised() { return mixer != NULL; } diff --git a/Core/System.h b/Core/System.h index d7c3507c2c..da9a2b17d5 100644 --- a/Core/System.h +++ b/Core/System.h @@ -17,9 +17,6 @@ #pragma once -#include "Globals.h" -#include "Core/MemMap.h" -#include "Core/Host.h" #include "Core/CoreParameter.h" #include "Core/ELF/ParamSFO.h" @@ -28,7 +25,6 @@ class MetaFileSystem; extern MetaFileSystem pspFileSystem; extern ParamSFOData g_paramSFO; - // To synchronize the two UIs, we need to know which state we're in. enum GlobalUIState { UISTATE_MENU, @@ -49,13 +45,7 @@ enum PSPDirectories { extern GlobalUIState globalUIState; -inline static void UpdateUIState(GlobalUIState newState) { - // Never leave the EXIT state. - if (globalUIState != newState && globalUIState != UISTATE_EXIT) { - globalUIState = newState; - host->UpdateDisassembly(); - } -} +void UpdateUIState(GlobalUIState newState); bool PSP_Init(const CoreParameter &coreParam, std::string *error_string); bool PSP_IsInited(); diff --git a/Core/Util/GameManager.cpp b/Core/Util/GameManager.cpp index 0976e25a1d..213db5a8d7 100644 --- a/Core/Util/GameManager.cpp +++ b/Core/Util/GameManager.cpp @@ -15,6 +15,9 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. +#include +#include + #include "file/file_util.h" #include "ext/libzip/zip.h" #include "thread/thread.h" diff --git a/Core/Util/PPGeDraw.cpp b/Core/Util/PPGeDraw.cpp index 2f61df35ac..25ff13a0f8 100644 --- a/Core/Util/PPGeDraw.cpp +++ b/Core/Util/PPGeDraw.cpp @@ -22,6 +22,7 @@ #include "util/text/utf8.h" #include "Common/ChunkFile.h" +#include "Core/Host.h" #include "GPU/ge_constants.h" #include "GPU/GPUState.h" #include "GPU/GPUInterface.h" diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 6c0e86a559..ef287ea39f 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -15,6 +15,9 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. +#include +#include + #include "gfx_es2/glsl_program.h" #include "gfx_es2/gl_state.h" #include "gfx_es2/fbo.h" @@ -38,8 +41,6 @@ #include "UI/OnScreenDisplay.h" -#include - #if defined(USING_GLES2) #ifndef GL_READ_FRAMEBUFFER #define GL_READ_FRAMEBUFFER GL_FRAMEBUFFER diff --git a/GPU/GLES/Framebuffer.h b/GPU/GLES/Framebuffer.h index f36a17bc61..0cbc2a093a 100644 --- a/GPU/GLES/Framebuffer.h +++ b/GPU/GLES/Framebuffer.h @@ -18,6 +18,8 @@ #pragma once #include +#include +#include #include "gfx/gl_common.h" #include "gfx_es2/fbo.h" diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index 3e2d4a4fa5..d3439b8e5f 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -18,6 +18,7 @@ #include #include +#include "Core/Host.h" #include "Core/MemMap.h" #include "Core/Reporting.h" #include "GPU/ge_constants.h" diff --git a/GPU/Software/SoftGpu.cpp b/GPU/Software/SoftGpu.cpp index 4945fa9172..45eeec75af 100644 --- a/GPU/Software/SoftGpu.cpp +++ b/GPU/Software/SoftGpu.cpp @@ -21,6 +21,7 @@ #include "GPU/Common/TextureDecoder.h" #include "Core/Config.h" #include "Core/Debugger/Breakpoints.h" +#include "Core/Host.h" #include "Core/MemMap.h" #include "Core/HLE/sceKernelInterrupt.h" #include "Core/HLE/sceGe.h" @@ -170,6 +171,13 @@ SoftGPU::~SoftGPU() glDeleteTextures(1, &temp_texture); } +void SoftGPU::SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) { + displayFramebuf_ = framebuf; + displayStride_ = stride; + displayFormat_ = format; + host->GPUNotifyDisplay(framebuf, stride, format); +} + // Copies RGBA8 data from RAM to the currently bound render target. void SoftGPU::CopyToCurrentFboFromDisplayRam(int srcwidth, int srcheight) { diff --git a/GPU/Software/SoftGpu.h b/GPU/Software/SoftGpu.h index 575e18fea8..940fd1669c 100644 --- a/GPU/Software/SoftGpu.h +++ b/GPU/Software/SoftGpu.h @@ -55,12 +55,7 @@ public: virtual void ExecuteOp(u32 op, u32 diff); virtual void BeginFrame() {} - virtual void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) { - displayFramebuf_ = framebuf; - displayStride_ = stride; - displayFormat_ = format; - host->GPUNotifyDisplay(framebuf, stride, format); - } + virtual void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format); virtual void CopyDisplayToOutput(); virtual void UpdateStats(); virtual void InvalidateCache(u32 addr, int size, GPUInvalidationType type); diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 3a1ba9fbd0..06ff21594e 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -31,6 +31,7 @@ #include "UI/EmuScreen.h" #include "UI/MainScreen.h" #include "Core/Config.h" +#include "Core/Host.h" #include "Core/System.h" #include "Core/MIPS/JitCommon/JitCommon.h" #include "Core/HLE/sceUtility.h"