From d2108a962e5e590a7a91698040af60615e4741f3 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 8 Feb 2014 10:29:22 -0800 Subject: [PATCH 1/4] Switch from USING_GLES2 to MOBILE_DEVICE. Still using USING_GLES2 for, well, GLES2. But for things that are really about mobile, we need a new define. Devices are coming that don't use GLES2. --- CMakeLists.txt | 7 ++++++- Common/KeyMap.cpp | 4 ++-- Common/LogManager.cpp | 8 ++++---- Core/Config.cpp | 6 +++--- Core/Core.cpp | 6 +++--- Core/HLE/sceDmac.cpp | 2 +- Core/HLE/sceKernelInterrupt.cpp | 2 +- Core/HLE/sceKernelModule.cpp | 4 ++-- Core/MemMap.cpp | 2 +- Core/SaveState.cpp | 2 +- Core/System.cpp | 2 +- GPU/Directx9/FramebufferDX9.cpp | 2 ++ GPU/Directx9/GPU_DX9.cpp | 9 ++------- GPU/GLES/Framebuffer.cpp | 2 +- GPU/GLES/GLES_GPU.cpp | 12 +++++++----- GPU/GLES/SoftwareTransform.cpp | 2 +- GPU/GLES/StateMapping.cpp | 3 --- GPU/GLES/TextureCache.cpp | 4 ++-- GPU/GLES/TransformPipeline.cpp | 2 +- GPU/Software/SoftGpu.cpp | 2 +- Qt/Settings.pri | 1 + UI/EmuScreen.cpp | 2 +- UI/GameSettingsScreen.cpp | 10 +++++----- android/jni/Locals.mk | 2 +- 24 files changed, 50 insertions(+), 48 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 52dd7f4d09..d28875a209 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,7 @@ endif() if(ARM OR SIMULATOR) set(USING_GLES2 ON) + set(MOBILE_DEVICE ON) else() # Assume x86 set(X86 ON) endif() @@ -44,7 +45,7 @@ endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(LINUX ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS") - if (NOT USING_GLES2) + if (NOT MOBILE_DEVICE) set(USE_FFMPEG ON) endif() endif() @@ -74,6 +75,7 @@ option(MAEMO "Set to ON if targeting an Maemo (N900) device" ${MAEMO}) option(IOS "Set to ON if targeting an iOS device" ${IOS}) option(USING_GLES2 "Set to ON if target device uses OpenGL ES 2.0" ${USING_GLES2}) option(USING_QT_UI "Set to ON if you wish to use the Qt frontend wrapper" ${USING_QT_UI}) +option(MOBILE_DEVICE "Set to ON when targetting a mobile device" ${MOBILE_DEVICE}) option(HEADLESS "Set to OFF to not generate the PPSSPPHeadless target" ${HEADLESS}) option(UNITTEST "Set to ON to generate the unittest target" ${UNITTEST}) option(SIMULATOR "Set to ON when targeting an x86 simulator of an ARM platform" ${SIMULATOR}) @@ -146,6 +148,9 @@ endif() if(USING_GLES2) add_definitions(-DUSING_GLES2) endif() +if(MOBILE_DEVICE) + add_definitions(-DMOBILE_DEVICE) +endif() if(MIPS) add_definitions(-DMIPS) diff --git a/Common/KeyMap.cpp b/Common/KeyMap.cpp index f8b13a89c4..d6d9b58e60 100644 --- a/Common/KeyMap.cpp +++ b/Common/KeyMap.cpp @@ -628,13 +628,13 @@ const KeyMap_IntStrPair psp_button_names[] = { {VIRTKEY_UNTHROTTLE, "Unthrottle"}, {VIRTKEY_SPEED_TOGGLE, "SpeedToggle"}, {VIRTKEY_PAUSE, "Pause"}, -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE {VIRTKEY_REWIND, "Rewind"}, #endif {VIRTKEY_SAVE_STATE, "Save State"}, {VIRTKEY_LOAD_STATE, "Load State"}, {VIRTKEY_NEXT_SLOT, "Next Slot"}, -#if !defined(_WIN32) && !defined(USING_GLES2) +#if !defined(_WIN32) && !defined(MOBILE_DEVICE) {VIRTKEY_TOGGLE_FULLSCREEN, "Toggle Fullscreen"}, #endif diff --git a/Common/LogManager.cpp b/Common/LogManager.cpp index 8241edc1ab..e8e93385be 100644 --- a/Common/LogManager.cpp +++ b/Common/LogManager.cpp @@ -94,7 +94,7 @@ LogManager::LogManager() { } // Remove file logging on small devices -#if !defined(USING_GLES2) || defined(_DEBUG) +#if !defined(MOBILE_DEVICE) || defined(_DEBUG) fileLog_ = new FileLogListener(""); consoleLog_ = new ConsoleListener(); debuggerLog_ = new DebuggerLogListener(); @@ -106,7 +106,7 @@ LogManager::LogManager() { for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i) { log_[i]->SetEnable(true); -#if !defined(USING_GLES2) || defined(_DEBUG) +#if !defined(MOBILE_DEVICE) || defined(_DEBUG) log_[i]->AddListener(fileLog_); log_[i]->AddListener(consoleLog_); #ifdef _MSC_VER @@ -119,7 +119,7 @@ LogManager::LogManager() { LogManager::~LogManager() { for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i) { -#if !defined(USING_GLES2) || defined(_DEBUG) +#if !defined(MOBILE_DEVICE) || defined(_DEBUG) if (fileLog_ != NULL) logManager_->RemoveListener((LogTypes::LOG_TYPE)i, fileLog_); logManager_->RemoveListener((LogTypes::LOG_TYPE)i, consoleLog_); @@ -133,7 +133,7 @@ LogManager::~LogManager() { delete log_[i]; if (fileLog_ != NULL) delete fileLog_; -#if !defined(USING_GLES2) || defined(_DEBUG) +#if !defined(MOBILE_DEVICE) || defined(_DEBUG) delete consoleLog_; delete debuggerLog_; #endif diff --git a/Core/Config.cpp b/Core/Config.cpp index e8e60030d8..177fd3a8f2 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -300,7 +300,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { #if defined(_WIN32) && !defined(USING_QT_UI) control->Get("IgnoreWindowsKey", &bIgnoreWindowsKey, false); #endif -#if defined(USING_GLES2) +#if defined(MOBILE_DEVICE) std::string name = System_GetProperty(SYSPROP_NAME); if (KeyMap::HasBuiltinController(name)) { control->Get("ShowTouchControls", &bShowTouchControls, false); @@ -311,7 +311,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { control->Get("ShowTouchControls", &bShowTouchControls, false); #endif // control->Get("KeyMapping",iMappingMap); -#ifdef USING_GLES2 +#ifdef MOBILE_DEVICE control->Get("TiltBaseX", &fTiltBaseX, 0); control->Get("TiltBaseY", &fTiltBaseY, 0); control->Get("InvertTiltX", &bInvertTiltX, false); @@ -603,7 +603,7 @@ void Config::Save() { control->Set("ShowTouchUnthrottle", bShowTouchUnthrottle); control->Set("ShowTouchDpad", bShowTouchDpad); -#ifdef USING_GLES2 +#ifdef MOBILE_DEVICE control->Set("TiltBaseX", fTiltBaseX); control->Set("TiltBaseY", fTiltBaseY); control->Set("InvertTiltX", bInvertTiltX); diff --git a/Core/Core.cpp b/Core/Core.cpp index 8073c71c01..92af5cb021 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -199,7 +199,7 @@ void Core_Run() #if defined(_DEBUG) host->UpdateDisassembly(); #endif -#if !defined(USING_QT_UI) || defined(USING_GLES2) +#if !defined(USING_QT_UI) || defined(MOBILE_DEVICE) while (true) #endif { @@ -210,7 +210,7 @@ reswitch: return; } Core_RunLoop(); -#if defined(USING_QT_UI) && !defined(USING_GLES2) +#if defined(USING_QT_UI) && !defined(MOBILE_DEVICE) return; #else continue; @@ -247,7 +247,7 @@ reswitch: #if defined(USING_QT_UI) || defined(_DEBUG) host->SendCoreWait(false); #endif -#if defined(USING_QT_UI) && !defined(USING_GLES2) +#if defined(USING_QT_UI) && !defined(MOBILE_DEVICE) if (coreState != CORE_STEPPING) return; #endif diff --git a/Core/HLE/sceDmac.cpp b/Core/HLE/sceDmac.cpp index 5621b722e5..d3ad3c81c2 100644 --- a/Core/HLE/sceDmac.cpp +++ b/Core/HLE/sceDmac.cpp @@ -42,7 +42,7 @@ void __DmacDoState(PointerWrap &p) { int __DmacMemcpy(u32 dst, u32 src, u32 size) { Memory::Memcpy(dst, Memory::GetPointer(src), size); -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(src, false, size, currentMIPS->pc); CBreakPoints::ExecMemCheck(dst, true, size, currentMIPS->pc); #endif diff --git a/Core/HLE/sceKernelInterrupt.cpp b/Core/HLE/sceKernelInterrupt.cpp index d875ddf919..92d3ff1184 100644 --- a/Core/HLE/sceKernelInterrupt.cpp +++ b/Core/HLE/sceKernelInterrupt.cpp @@ -584,7 +584,7 @@ u32 sceKernelMemcpy(u32 dst, u32 src, u32 size) *dstp++ = *srcp++; } } -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(src, false, size, currentMIPS->pc); CBreakPoints::ExecMemCheck(dst, true, size, currentMIPS->pc); #endif diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index 8c2dab66d3..21f505727e 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -857,7 +857,7 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro // TODO: It seems like the data size excludes the text size, which kinda makes sense? module->nm.data_size -= textSize; -#if !defined(USING_GLES2) +#if !defined(MOBILE_DEVICE) bool gotSymbols = reader.LoadSymbols(); MIPSAnalyst::ScanForFunctions(textStart, textStart + textSize, !gotSymbols); #else @@ -1018,7 +1018,7 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro if (textSection == -1) { u32 textStart = reader.GetVaddr(); u32 textEnd = firstImportStubAddr - 4; -#if !defined(USING_GLES2) +#if !defined(MOBILE_DEVICE) bool gotSymbols = reader.LoadSymbols(); MIPSAnalyst::ScanForFunctions(textStart, textEnd, !gotSymbols); #else diff --git a/Core/MemMap.cpp b/Core/MemMap.cpp index 1d84aef94e..039203b497 100644 --- a/Core/MemMap.cpp +++ b/Core/MemMap.cpp @@ -252,7 +252,7 @@ void Memset(const u32 _Address, const u8 _iValue, const u32 _iLength) for (size_t i = 0; i < _iLength; i++) Write_U8(_iValue, (u32)(_Address + i)); } -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(_Address, true, _iLength, currentMIPS->pc); #endif } diff --git a/Core/SaveState.cpp b/Core/SaveState.cpp index 85015539f3..1e440e530d 100644 --- a/Core/SaveState.cpp +++ b/Core/SaveState.cpp @@ -432,7 +432,7 @@ namespace SaveState void Process() { -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE if (g_Config.iRewindFlipFrequency != 0 && gpuStats.numFlips != 0) CheckRewindState(); #endif diff --git a/Core/System.cpp b/Core/System.cpp index 1f9a33e428..9c5d4701d5 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -375,7 +375,7 @@ bool PSP_IsInited() { } void PSP_Shutdown() { -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE if (g_Config.bFuncHashMap) { MIPSAnalyst::StoreHashMap(); } diff --git a/GPU/Directx9/FramebufferDX9.cpp b/GPU/Directx9/FramebufferDX9.cpp index 259fd8eee0..04d5db5712 100644 --- a/GPU/Directx9/FramebufferDX9.cpp +++ b/GPU/Directx9/FramebufferDX9.cpp @@ -500,6 +500,7 @@ void FramebufferManagerDX9::SetRenderFrameBuffer() { // We already have it! } else if (vfb != currentRenderVfb_) { + // TODO: This doesn't make sense for DirectX? #ifndef USING_GLES2 bool useMem = g_Config.iRenderingMode == FB_READFBOMEMORY_GPU || g_Config.iRenderingMode == FB_READFBOMEMORY_CPU; #else @@ -928,6 +929,7 @@ std::vector FramebufferManagerDX9::GetFramebufferList() { void FramebufferManagerDX9::DecimateFBOs() { fbo_unbind(); currentRenderVfb_ = 0; + // TODO: This doesn't make sense for DirectX? #ifndef USING_GLES2 bool useMem = g_Config.iRenderingMode == FB_READFBOMEMORY_GPU || g_Config.iRenderingMode == FB_READFBOMEMORY_CPU; #else diff --git a/GPU/Directx9/GPU_DX9.cpp b/GPU/Directx9/GPU_DX9.cpp index 7dc8efe477..59ee9b712c 100644 --- a/GPU/Directx9/GPU_DX9.cpp +++ b/GPU/Directx9/GPU_DX9.cpp @@ -165,13 +165,8 @@ static const CommandTableEntry commandTable[] = { {GE_CMD_ZTEST, FLAG_FLUSHBEFOREONCHANGE}, {GE_CMD_ZTESTENABLE, FLAG_FLUSHBEFOREONCHANGE}, {GE_CMD_ZWRITEDISABLE, FLAG_FLUSHBEFOREONCHANGE}, -#ifndef USING_GLES2 {GE_CMD_LOGICOP, FLAG_FLUSHBEFOREONCHANGE}, {GE_CMD_LOGICOPENABLE, FLAG_FLUSHBEFOREONCHANGE}, -#else - {GE_CMD_LOGICOP, 0}, - {GE_CMD_LOGICOPENABLE, 0}, -#endif // Can probably ignore this one as we don't support AA lines. {GE_CMD_ANTIALIASENABLE, FLAG_FLUSHBEFOREONCHANGE}, @@ -1100,7 +1095,7 @@ void DIRECTX9_GPU::ExecuteOp(u32 op, u32 diff) { break; case GE_CMD_ALPHATEST: -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE if (((data >> 16) & 0xFF) != 0xFF && (data & 7) > 1) WARN_LOG_REPORT_ONCE(alphatestmask, G3D, "Unsupported alphatest mask: %02x", (data >> 16) & 0xFF); // Intentional fallthrough. @@ -1239,7 +1234,7 @@ void DIRECTX9_GPU::ExecuteOp(u32 op, u32 diff) { } break; -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE case GE_CMD_LOGICOPENABLE: if (data != 0) ERROR_LOG_REPORT_ONCE(logicOpEnable, G3D, "Unsupported logic op enabled: %x", data); diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index cf2bb6c770..5494ee5bf3 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -1677,7 +1677,7 @@ void FramebufferManager::UpdateFromMemory(u32 addr, int size, bool safe) { } void FramebufferManager::NotifyBlockTransfer(u32 dst, u32 src) { -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE if (!reportedBlits_.insert(std::make_pair(dst, src)).second) { // Already reported/checked. return; diff --git a/GPU/GLES/GLES_GPU.cpp b/GPU/GLES/GLES_GPU.cpp index a25bc42267..3baa89f8bc 100644 --- a/GPU/GLES/GLES_GPU.cpp +++ b/GPU/GLES/GLES_GPU.cpp @@ -733,7 +733,7 @@ void GLES_GPU::ExecuteOpInternal(u32 op, u32 diff) { inds = Memory::GetPointerUnchecked(gstate_c.indexAddr); } -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE if (prim > GE_PRIM_RECTANGLES) { ERROR_LOG_REPORT_ONCE(reportPrim, G3D, "Unexpected prim type: %d", prim); } @@ -1267,7 +1267,7 @@ void GLES_GPU::ExecuteOpInternal(u32 op, u32 diff) { break; case GE_CMD_ALPHATEST: -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE if (((data >> 16) & 0xFF) != 0xFF && (data & 7) > 1) WARN_LOG_REPORT_ONCE(alphatestmask, G3D, "Unsupported alphatest mask: %02x", (data >> 16) & 0xFF); #endif @@ -1416,7 +1416,7 @@ void GLES_GPU::ExecuteOpInternal(u32 op, u32 diff) { } break; -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE case GE_CMD_ANTIALIASENABLE: if (data != 0) WARN_LOG_REPORT_ONCE(antiAlias, G3D, "Unsupported antialias enabled: %06x", data); @@ -1426,16 +1426,18 @@ void GLES_GPU::ExecuteOpInternal(u32 op, u32 diff) { if (data != 0) WARN_LOG_REPORT_ONCE(texLodSlope, G3D, "Unsupported texture lod slope: %06x", data); break; +#endif case GE_CMD_TEXLEVEL: +#ifndef MOBILE_DEVICE if (data == 1) WARN_LOG_REPORT_ONCE(texLevel1, G3D, "Unsupported texture level bias settings: %06x", data) else if (data != 0) WARN_LOG_REPORT_ONCE(texLevel2, G3D, "Unsupported texture level bias settings: %06x", data); +#endif if (diff) gstate_c.textureChanged = true; break; -#endif ////////////////////////////////////////////////////////////////// // STENCIL TESTING @@ -1603,7 +1605,7 @@ void GLES_GPU::DoBlockTransfer() { framebufferManager_.DrawPixels(Memory::GetPointerUnchecked(dstBasePtr), GE_FORMAT_8888, 512); } -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(srcBasePtr + (srcY * srcStride + srcX) * bpp, false, height * srcStride * bpp, currentMIPS->pc); CBreakPoints::ExecMemCheck(dstBasePtr + (srcY * dstStride + srcX) * bpp, true, height * dstStride * bpp, currentMIPS->pc); #endif diff --git a/GPU/GLES/SoftwareTransform.cpp b/GPU/GLES/SoftwareTransform.cpp index d32c6be5e4..68230319e4 100644 --- a/GPU/GLES/SoftwareTransform.cpp +++ b/GPU/GLES/SoftwareTransform.cpp @@ -286,7 +286,7 @@ void TransformDrawEngine::SoftwareTransformAndDraw( // TODO: Split up into multiple draw calls for GLES 2.0 where you can't guarantee support for more than 0x10000 verts. -#if defined(USING_GLES2) +#if defined(MOBILE_DEVICE) if (vertexCount > 0x10000/3) vertexCount = 0x10000/3; #endif diff --git a/GPU/GLES/StateMapping.cpp b/GPU/GLES/StateMapping.cpp index 75f143db41..6e45cb782f 100644 --- a/GPU/GLES/StateMapping.cpp +++ b/GPU/GLES/StateMapping.cpp @@ -320,12 +320,9 @@ void TransformDrawEngine::ApplyDrawState(int prim) { glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, GL_ZERO, GL_ONE); } - // Don't report on Android device (why?) -#if !defined(USING_GLES2) if (blendFuncEq == GE_BLENDMODE_ABSDIFF) { WARN_LOG_REPORT_ONCE(blendAbsdiff, G3D, "Unsupported absdiff blend mode"); } -#endif if (((blendFuncEq >= GE_BLENDMODE_MIN) && gl_extensions.EXT_blend_minmax) || gl_extensions.GLES3) { glstate.blendEquation.set(eqLookup[blendFuncEq]); diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index 3430de5051..35915fbf22 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -915,7 +915,7 @@ void TextureCache::SetTexture(bool force) { // Validate the texture still matches the cache entry. u16 dim = gstate.getTextureDimension(0); bool match = entry->Matches(dim, format, maxLevel); -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE match &= host->GPUAllowTextureCache(texaddr); #endif @@ -1542,7 +1542,7 @@ void TextureCache::LoadTextureLevel(TexCacheEntry &entry, int level, bool replac int scaleFactor; //Auto-texture scale upto 5x rendering resolution if (g_Config.iTexScalingLevel == 0) { -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE scaleFactor = std::min(gl_extensions.OES_texture_npot ? 5 : 4, g_Config.iInternalResolution); if (!gl_extensions.OES_texture_npot && scaleFactor == 3) { scaleFactor = 2; diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index 5d98a838cb..7c3e04a35f 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -731,7 +731,7 @@ rotateVBO: decodeCounter_ = 0; prevPrim_ = GE_PRIM_INVALID; -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE host->GPUNotifyDraw(); #endif } diff --git a/GPU/Software/SoftGpu.cpp b/GPU/Software/SoftGpu.cpp index 43522a6339..849306968c 100644 --- a/GPU/Software/SoftGpu.cpp +++ b/GPU/Software/SoftGpu.cpp @@ -620,7 +620,7 @@ void SoftGPU::ExecuteOp(u32 op, u32 diff) memcpy(dst, src, width * bpp); } -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(srcBasePtr + (srcY * srcStride + srcX) * bpp, false, height * srcStride * bpp, currentMIPS->pc); CBreakPoints::ExecMemCheck(dstBasePtr + (srcY * dstStride + srcX) * bpp, true, height * dstStride * bpp, currentMIPS->pc); #endif diff --git a/Qt/Settings.pri b/Qt/Settings.pri index a7294c898b..8b4c1d71ac 100644 --- a/Qt/Settings.pri +++ b/Qt/Settings.pri @@ -52,6 +52,7 @@ gleslib = $$lower($$QMAKE_LIBS_OPENGL) gleslib = $$find(gleslib, "gles") maemo|!count(gleslib,0) { DEFINES += USING_GLES2 + DEFINES += MOBILE_DEVICE } # Platform specific diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 36c865664f..427fb482fe 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -508,7 +508,7 @@ void EmuScreen::update(InputState &input) { // Apply tilt to left stick // TODO: Make into an axis -#ifdef USING_GLES2 +#ifdef MOBILE_DEVICE /* if (g_Config.bAccelerometerToAnalogHoriz) { // Get the "base" coordinate system which is setup by the calibration system diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 44c16f41d5..931708fb73 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -138,7 +138,7 @@ void GameSettingsScreen::CreateViews() { graphicsSettings->Add(new ItemHeader(gs->T("Performance"))); -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE static const char *internalResolutions[] = {"Auto (1:1)", "1x PSP", "2x PSP", "3x PSP", "4x PSP", "5x PSP", "6x PSP", "7x PSP", "8x PSP", "9x PSP", "10x PSP" }; #else static const char *internalResolutions[] = {"Auto (1:1)", "1x PSP", "2x PSP", "3x PSP", "4x PSP", "5x PSP" }; @@ -169,7 +169,7 @@ void GameSettingsScreen::CreateViews() { // In case we're going to add few other antialiasing option like MSAA in the future. // graphicsSettings->Add(new CheckBox(&g_Config.bFXAA, gs->T("FXAA"))); graphicsSettings->Add(new ItemHeader(gs->T("Texture Scaling"))); -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE static const char *texScaleLevelsNPOT[] = {"Auto", "Off", "2x", "3x", "4x", "5x"}; static const char *texScaleLevelsPOT[] = {"Auto", "Off", "2x", "4x"}; #else @@ -255,7 +255,7 @@ void GameSettingsScreen::CreateViews() { controlsSettings->Add(new ItemHeader(ms->T("Controls"))); controlsSettings->Add(new Choice(c->T("Control Mapping")))->OnClick.Handle(this, &GameSettingsScreen::OnControlMapping); -#if defined(USING_GLES2) +#if defined(MOBILE_DEVICE) controlsSettings->Add(new CheckBox(&g_Config.bHapticFeedback, c->T("HapticFeedback", "Haptic Feedback (vibration)"))); static const char *tiltTypes[] = { "None (Disabled)", "Analog Stick", "D-PAD", "PSP Action Buttons"}; controlsSettings->Add(new PopupMultiChoice(&g_Config.iTiltInputType, c->T("Tilt Input Type"), tiltTypes, 0, ARRAY_SIZE(tiltTypes), c, screenManager()))->OnClick.Handle(this, &GameSettingsScreen::OnTiltTypeChange); @@ -298,7 +298,7 @@ void GameSettingsScreen::CreateViews() { systemSettings->Add(new CheckBox(&g_Config.bSeparateCPUThread, s->T("Multithreaded (experimental)")))->SetEnabled(!PSP_IsInited()); systemSettings->Add(new CheckBox(&g_Config.bSeparateIOThread, s->T("I/O on thread (experimental)")))->SetEnabled(!PSP_IsInited()); systemSettings->Add(new PopupSliderChoice(&g_Config.iLockedCPUSpeed, 0, 1000, s->T("Change CPU Clock", "Change CPU Clock (0 = default) (unstable)"), screenManager())); -#ifndef USING_GLES2 +#ifndef MOBILE_DEVICE systemSettings->Add(new PopupSliderChoice(&g_Config.iRewindFlipFrequency, 0, 1800, s->T("Rewind Snapshot Frequency", "Rewind Snapshot Frequency (0 = off, mem hog)"), screenManager())); #endif @@ -343,7 +343,7 @@ void GameSettingsScreen::CreateViews() { #if defined(_WIN32) || defined(USING_QT_UI) systemSettings->Add(new Choice(s->T("Change Nickname")))->OnClick.Handle(this, &GameSettingsScreen::OnChangeNickname); #endif -#if defined(_WIN32) || (defined(USING_QT_UI) && !defined(USING_GLES2)) +#if defined(_WIN32) || (defined(USING_QT_UI) && !defined(MOBILE_DEVICE)) // Screenshot functionality is not yet available on non-Windows/non-Qt systemSettings->Add(new CheckBox(&g_Config.bScreenshotsAsPNG, s->T("Screenshots as PNG"))); #endif diff --git a/android/jni/Locals.mk b/android/jni/Locals.mk index e4ad2d1cde..ebae82ba63 100644 --- a/android/jni/Locals.mk +++ b/android/jni/Locals.mk @@ -1,7 +1,7 @@ # These are definitions for LOCAL_ variables for PPSSPP. # They are shared between ppsspp_jni (lib for Android app) and ppsspp_headless. -LOCAL_CFLAGS := -DUSE_FFMPEG -DUSING_GLES2 -O3 -fsigned-char -Wall -Wno-multichar -Wno-psabi -Wno-unused-variable -fno-strict-aliasing -D__STDC_CONSTANT_MACROS +LOCAL_CFLAGS := -DUSE_FFMPEG -DUSING_GLES2 -DMOBILE_DEVICE -O3 -fsigned-char -Wall -Wno-multichar -Wno-psabi -Wno-unused-variable -fno-strict-aliasing -D__STDC_CONSTANT_MACROS # yes, it's really CPPFLAGS for C++ LOCAL_CPPFLAGS := -fno-exceptions -std=gnu++11 -fno-rtti -Wno-reorder LOCAL_C_INCLUDES := \ From cd4cd77938e9b4d780f9d5704493844b5f874819 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 8 Feb 2014 10:51:35 -0800 Subject: [PATCH 2/4] Clean up defines in MSVC project files. This way they're all basically the same. A lot of cases where debug/release/etc. where inconsistent... Also, define USING_WIN_UI. --- Common/Common.vcxproj | 8 ++++---- Core/Core.vcxproj | 10 +++++----- GPU/GPU.vcxproj | 8 ++++---- UI/UI.vcxproj | 8 ++++---- Windows/PPSSPP.vcxproj | 8 ++++---- headless/Headless.vcxproj | 8 ++++---- unittest/UnitTests.vcxproj | 8 ++++---- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj index 0434bf4b9e..b80863a7d2 100644 --- a/Common/Common.vcxproj +++ b/Common/Common.vcxproj @@ -70,7 +70,7 @@ Use Level3 Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) stdafx.h MultiThreadedDebugDLL ../native @@ -95,7 +95,7 @@ Disabled stdafx.h MultiThreadedDebugDLL - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) ../native NotSet Fast @@ -119,7 +119,7 @@ MaxSpeed true true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) stdafx.h false StreamingSIMDExtensions2 @@ -146,7 +146,7 @@ MaxSpeed true true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) stdafx.h ../native false diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 127c4fed4e..327f106974 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -71,7 +71,7 @@ Level3 Disabled ..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86\include;../common;..;../native;../native/ext/glew;../ext/zlib - USE_FFMPEG;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;USE_FFMPEG;WIN32;_DEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) StreamingSIMDExtensions2 Fast true @@ -91,7 +91,7 @@ Level3 Disabled ..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\include;../common;..;../native;../native/ext/glew;../ext/zlib - USE_FFMPEG;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;USE_FFMPEG;WIN32;_DEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) NotSet Fast false @@ -117,7 +117,7 @@ false StreamingSIMDExtensions2 Fast - USE_FFMPEG;_MBCS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;USE_FFMPEG;WIN32;_LIB;NDEBUG;_UNICODE;UNICODE;%(PreprocessorDefinitions) Speed MultiThreadedDLL true @@ -151,7 +151,7 @@ Speed false true - USE_FFMPEG;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;USE_FFMPEG;WIN32;_LIB;NDEBUG;_UNICODE;UNICODE;%(PreprocessorDefinitions) false @@ -514,7 +514,7 @@ - + diff --git a/GPU/GPU.vcxproj b/GPU/GPU.vcxproj index 8b6b9a172f..a80b82a73b 100644 --- a/GPU/GPU.vcxproj +++ b/GPU/GPU.vcxproj @@ -88,7 +88,7 @@ Level3 Disabled ../common;..;../native;../native/ext/glew; - _CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) StreamingSIMDExtensions2 Fast true @@ -110,7 +110,7 @@ true false false - _CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) true @@ -126,7 +126,7 @@ false StreamingSIMDExtensions2 Fast - _CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_LIB;NDEBUG;_UNICODE;UNICODE;%(PreprocessorDefinitions) Speed true false @@ -151,7 +151,7 @@ false true false - _CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_LIB;NDEBUG;_UNICODE;UNICODE;%(PreprocessorDefinitions) true diff --git a/UI/UI.vcxproj b/UI/UI.vcxproj index 38bdda9277..e83f00b294 100644 --- a/UI/UI.vcxproj +++ b/UI/UI.vcxproj @@ -116,7 +116,7 @@ Level3 Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) ../common;..;../native;../native/ext/glew;../ext/zlib;../native/ext true false @@ -133,7 +133,7 @@ Level3 Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) ../common;..;../native;../native/ext/glew;../ext/zlib;../native/ext true false @@ -152,7 +152,7 @@ MaxSpeed true true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) ../common;..;../native;../native/ext/glew;../ext/zlib;../native/ext false Speed @@ -174,7 +174,7 @@ MaxSpeed true true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) ../common;..;../native;../native/ext/glew;../ext/zlib;../native/ext false true diff --git a/Windows/PPSSPP.vcxproj b/Windows/PPSSPP.vcxproj index c687e50ac4..a69552c61a 100644 --- a/Windows/PPSSPP.vcxproj +++ b/Windows/PPSSPP.vcxproj @@ -116,7 +116,7 @@ Disabled - WIN32;_DEBUG;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_UNICODE;UNICODE;%(PreprocessorDefinitions) false Sync Use @@ -150,7 +150,7 @@ Disabled false - WIN32;_DEBUG;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_UNICODE;UNICODE;%(PreprocessorDefinitions) Sync Use Level3 @@ -183,7 +183,7 @@ AnySuitable true Speed - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_UNICODE;UNICODE;%(PreprocessorDefinitions) true Sync MultiThreadedDLL @@ -225,7 +225,7 @@ true Speed false - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_UNICODE;UNICODE;%(PreprocessorDefinitions) true Sync MultiThreadedDLL diff --git a/headless/Headless.vcxproj b/headless/Headless.vcxproj index 9da58f479f..2cc096d961 100644 --- a/headless/Headless.vcxproj +++ b/headless/Headless.vcxproj @@ -92,7 +92,7 @@ NotUsing Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_UNICODE;UNICODE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS ../Common;..;../Core;../native/ext/glew;../native Default StreamingSIMDExtensions2 @@ -116,7 +116,7 @@ NotUsing Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_UNICODE;UNICODE;%(PreprocessorDefinitions) ../Common;..;../Core;../native/ext/glew;../native NotSet Fast @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_UNICODE;UNICODE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS ../Common;..;../Core;../native/ext/glew;../native false StreamingSIMDExtensions2 @@ -170,7 +170,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_UNICODE;UNICODE;%(PreprocessorDefinitions) ../Common;..;../Core;../native/ext/glew;../native false NotSet diff --git a/unittest/UnitTests.vcxproj b/unittest/UnitTests.vcxproj index f591570116..51f74813a1 100644 --- a/unittest/UnitTests.vcxproj +++ b/unittest/UnitTests.vcxproj @@ -85,7 +85,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_UNICODE;UNICODE;%(PreprocessorDefinitions) ../common;..;../native;../native/ext/glew;../ext/zlib true false @@ -103,7 +103,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_UNICODE;UNICODE;%(PreprocessorDefinitions) ../common;..;../native;../native/ext/glew;../ext/zlib true false @@ -123,7 +123,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_UNICODE;UNICODE;%(PreprocessorDefinitions) ../common;..;../native;../native/ext/glew;../ext/zlib false Speed @@ -146,7 +146,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_UNICODE;UNICODE;%(PreprocessorDefinitions) ../common;..;../native;../native/ext/glew;../ext/zlib false true From 7add81fbd26e833665f04199915992d5abdba5e4 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 8 Feb 2014 11:11:50 -0800 Subject: [PATCH 3/4] Use USING_WIN_UI instead of _WIN32 for differences. Just makes the code clearer and probably helps other UIs work on Windows more easily. --- Core/Config.cpp | 14 +++++++------- Core/Config.h | 4 ++-- Core/Core.cpp | 4 ++-- Core/Dialog/PSPOskDialog.cpp | 6 +++--- Core/Dialog/PSPOskDialog.h | 2 +- Core/HLE/sceIo.cpp | 4 ++-- UI/EmuScreen.cpp | 4 ++-- UI/GameSettingsScreen.cpp | 8 +------- UI/MainScreen.cpp | 2 +- UI/MiscScreens.cpp | 2 +- 10 files changed, 22 insertions(+), 28 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 177fd3a8f2..4ddaec5780 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -149,7 +149,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { general->Get("ScreenRotation", &iScreenRotation, 1); #endif -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) general->Get("TopMost", &bTopMost); general->Get("WindowX", &iWindowX, -1); // -1 tells us to center the window. general->Get("WindowY", &iWindowY, -1); @@ -213,7 +213,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { graphics->Get("SoftwareSkinning", &bSoftwareSkinning, true); graphics->Get("TextureFiltering", &iTexFiltering, 1); // Auto on Windows, 2x on large screens, 1x elsewhere. -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) graphics->Get("InternalResolution", &iInternalResolution, 0); #else graphics->Get("InternalResolution", &iInternalResolution, pixel_xres >= 1024 ? 2 : 1); @@ -297,7 +297,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { control->Get("ShowAnalogStick", &bShowTouchAnalogStick, true); control->Get("ShowTouchDpad", &bShowTouchDpad, true); control->Get("ShowTouchUnthrottle", &bShowTouchUnthrottle, true); -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) control->Get("IgnoreWindowsKey", &bIgnoreWindowsKey, false); #endif #if defined(MOBILE_DEVICE) @@ -406,7 +406,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { pspConfig->Get("ButtonPreference", &iButtonPreference, PSP_SYSTEMPARAM_BUTTON_CROSS); pspConfig->Get("LockParentalLevel", &iLockParentalLevel, 0); pspConfig->Get("WlanAdhocChannel", &iWlanAdhocChannel, PSP_SYSTEMPARAM_ADHOC_CHANNEL_AUTOMATIC); -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) pspConfig->Get("BypassOSKWithKeyboard", &bBypassOSKWithKeyboard, false); #endif pspConfig->Get("WlanPowerSave", &bWlanPowerSave, PSP_SYSTEMPARAM_WLAN_POWERSAVE_OFF); @@ -498,7 +498,7 @@ void Config::Save() { general->Set("ScreenRotation", iScreenRotation); #endif -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) general->Set("TopMost", bTopMost); general->Set("WindowX", iWindowX); general->Set("WindowY", iWindowY); @@ -643,7 +643,7 @@ void Config::Save() { control->Set("AnalogStickY", fAnalogStickY); control->Set("AnalogStickScale", fAnalogStickScale); control->Delete("DPadRadius"); -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) control->Set("IgnoreWindowsKey", bIgnoreWindowsKey); #endif @@ -666,7 +666,7 @@ void Config::Save() { pspConfig->Set("WlanAdhocChannel", iWlanAdhocChannel); pspConfig->Set("WlanPowerSave", bWlanPowerSave); pspConfig->Set("EncryptSave", bEncryptSave); -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) pspConfig->Set("BypassOSKWithKeyboard", bBypassOSKWithKeyboard); #endif diff --git a/Core/Config.h b/Core/Config.h index ceea88b2ea..7b0085ec42 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -64,7 +64,7 @@ public: int iNumWorkerThreads; bool bScreenshotsAsPNG; bool bEnableLogging; -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) bool bPauseOnLostFocus; bool bTopMost; std::string sFont; @@ -262,7 +262,7 @@ public: int iPSPModel; int iFirmwareVersion; // TODO: Make this work with your platform, too! -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) bool bBypassOSKWithKeyboard; #endif diff --git a/Core/Core.cpp b/Core/Core.cpp index 92af5cb021..cf4ceb0fc4 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -146,7 +146,7 @@ void Core_RunLoop() { while ((globalUIState != UISTATE_INGAME || !PSP_IsInited()) && globalUIState != UISTATE_EXIT) { time_update(); -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) double startTime = time_now_d(); UpdateRunLoop(); @@ -165,7 +165,7 @@ void Core_RunLoop() { while (!coreState && globalUIState == UISTATE_INGAME) { time_update(); UpdateRunLoop(); -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) if (!Core_IsStepping()) { GL_SwapBuffers(); } diff --git a/Core/Dialog/PSPOskDialog.cpp b/Core/Dialog/PSPOskDialog.cpp index 89e4d5387d..bd55e21b2e 100755 --- a/Core/Dialog/PSPOskDialog.cpp +++ b/Core/Dialog/PSPOskDialog.cpp @@ -28,7 +28,7 @@ #include "Common/ChunkFile.h" #include "GPU/GPUState.h" -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) #include "base/NativeApp.h" #endif @@ -786,7 +786,7 @@ void PSPOskDialog::RenderKeyboard() } } -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) // TODO: Why does this have a 2 button press lag/delay when // re-opening the dialog box? I don't get it. int PSPOskDialog::NativeKeyboard() @@ -866,7 +866,7 @@ int PSPOskDialog::Update(int animSpeed) // TODO: Add your platforms here when you have a NativeKeyboard func. -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) // Windows: Fall back to the OSK/continue normally if we're in fullscreen. // The dialog box doesn't work right if in fullscreen. if(g_Config.bBypassOSKWithKeyboard && !g_Config.bFullScreen) diff --git a/Core/Dialog/PSPOskDialog.h b/Core/Dialog/PSPOskDialog.h index a22cbfbc7f..43deb2260f 100644 --- a/Core/Dialog/PSPOskDialog.h +++ b/Core/Dialog/PSPOskDialog.h @@ -215,7 +215,7 @@ private: void ConvertUCS2ToUTF8(std::string& _string, const PSPPointer em_address); void ConvertUCS2ToUTF8(std::string& _string, const wchar_t *input); void RenderKeyboard(); -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) int NativeKeyboard(); #endif diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index 60cfbd382c..e141ae7216 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -429,7 +429,7 @@ void __IoAsyncEndCallback(SceUID threadID, SceUID prevCallbackId) { } static DirectoryFileSystem *memstickSystem = NULL; -#if (defined(_WIN32) && !defined(USING_QT_UI)) || defined(APPLE) +#if defined(USING_WIN_UI) || defined(APPLE) static DirectoryFileSystem *flash0System = NULL; #else static VFSFileSystem *flash0System = NULL; @@ -455,7 +455,7 @@ void __IoInit() { syncNotifyEvent = CoreTiming::RegisterEvent("IoSyncNotify", __IoSyncNotify); memstickSystem = new DirectoryFileSystem(&pspFileSystem, g_Config.memCardDirectory); -#if (defined(_WIN32) && !defined(USING_QT_UI)) || defined(APPLE) +#if defined(USING_WIN_UI) || defined(APPLE) flash0System = new DirectoryFileSystem(&pspFileSystem, g_Config.flash0Directory); #else flash0System = new VFSFileSystem(&pspFileSystem, "flash0"); diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 427fb482fe..41eab12b69 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -129,7 +129,7 @@ void EmuScreen::bootComplete() { I18NCategory *s = GetI18NCategory("Screen"); -#ifdef _WIN32 +#ifndef MOBILE_DEVICE if (g_Config.bFirstRun) { osm.Show(s->T("PressESC", "Press ESC to open the pause menu"), 3.0f); } @@ -181,7 +181,7 @@ void EmuScreen::sendMessage(const char *message, const char *value) { } host->BootDone(); host->UpdateDisassembly(); -#ifdef _WIN32 +#ifndef MOBILE_DEVICE if (g_Config.bAutoRun) { Core_EnableStepping(false); } else { diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 931708fb73..fd882d3fde 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -47,12 +47,6 @@ #include "GPU/GPUInterface.h" #include "GPU/GLES/Framebuffer.h" -#ifdef _WIN32 -namespace MainWindow { - extern HWND hwndMain; -} -#endif - #ifdef IOS extern bool iosCanUseJit; #endif @@ -277,7 +271,7 @@ void GameSettingsScreen::CreateViews() { View *style = controlsSettings->Add(new PopupMultiChoice(&g_Config.iTouchButtonStyle, c->T("Button style"), touchControlStyles, 0, ARRAY_SIZE(touchControlStyles), c, screenManager())); style->SetEnabledPtr(&g_Config.bShowTouchControls); -#if defined(_WIN32) && !defined(USING_QT_UI) +#if defined(USING_WIN_UI) controlsSettings->Add(new ItemHeader(c->T("Keyboard", "Keyboard Control Settings"))); controlsSettings->Add(new CheckBox(&g_Config.bIgnoreWindowsKey, c->T("Ignore Windows Key"))); #endif diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 2fd4a5e470..66dca8e56a 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -868,7 +868,7 @@ UI::EventReturn MainScreen::OnLoadFile(UI::EventParams &e) { g_Config.Save(); screenManager()->switchScreen(new EmuScreen(fileName.toStdString())); } -#elif defined(_WIN32) +#elif defined(USING_WIN_UI) MainWindow::BrowseAndBoot(""); #endif return UI::EVENT_DONE; diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 4a95ba4f46..4d10e0c103 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -531,7 +531,7 @@ void CreditsScreen::render() { #endif #if defined(USING_QT_UI) "Qt", -#elif !defined(_WIN32) +#elif !defined(USING_WIN_UI) "SDL", #endif "CMake", From f53926907913b55ff539b0093bdcb8804d1fddc5 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 8 Feb 2014 11:14:07 -0800 Subject: [PATCH 4/4] Allow PSPModel to be set/saved on mobile devices. Fixes #5289, still defaulting off on mobile. --- Core/Config.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 4ddaec5780..285832a05c 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -391,9 +391,11 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { IniFile::Section *pspConfig = iniFile.GetOrCreateSection("SystemParam"); pspConfig->Get("PSPModel", &iPSPModel, PSP_MODEL_SLIM); pspConfig->Get("PSPFirmwareVersion", &iFirmwareVersion, PSP_DEFAULT_FIRMWARE); + // TODO: Can probably default this on, but not sure about its memory differences. #if !defined(_M_X64) && !defined(_WIN32) && !defined(__SYMBIAN32__) - // 32-bit mmap cannot map more than 32MB contiguous - iPSPModel = PSP_MODEL_FAT; + pspConfig->Get("PSPModel", &iPSPModel, PSP_MODEL_FAT); +#else + pspConfig->Get("PSPModel", &iPSPModel, PSP_MODEL_SLIM); #endif pspConfig->Get("NickName", &sNickName, "PPSSPP"); pspConfig->Get("proAdhocServer", &proAdhocServer, "localhost");