Permalink
Browse files

Remove more obsolete ifdefs

  • Loading branch information...
hrydgard committed Dec 19, 2017
1 parent a1f029f commit 5c1dad9909f5b5731a8e0fb74272cd6781eda912
Showing with 14 additions and 50 deletions.
  1. +2 −5 Core/Config.cpp
  2. +11 −33 Core/Core.cpp
  3. +1 −6 GPU/Common/TextureCacheCommon.cpp
  4. +0 −5 GPU/GLES/GPU_GLES.cpp
  5. +0 −1 GPU/GPUState.h
View
@@ -525,12 +525,9 @@ static ConfigSetting graphicsSettings[] = {
#endif
ReportedConfigSetting("ForceMaxEmulatedFPS", &g_Config.iForceMaxEmulatedFPS, 60, true, true),
// TODO: Hm, on fast mobile GPUs we should definitely default to at least 4 (setting = 2)...
#ifdef MOBILE_DEVICE
ConfigSetting("AnisotropyLevel", &g_Config.iAnisotropyLevel, 0, true, true),
#else
// Most low-performance (and many high performance) mobile GPUs do not support aniso anyway so defaulting to 4 is fine.
ConfigSetting("AnisotropyLevel", &g_Config.iAnisotropyLevel, 4, true, true),
#endif
ReportedConfigSetting("VertexDecCache", &g_Config.bVertexCache, &DefaultVertexCache, true, true),
ReportedConfigSetting("TextureBackoffCache", &g_Config.bTextureBackoffCache, false, true, true),
ReportedConfigSetting("TextureSecondaryCache", &g_Config.bTextureSecondaryCache, false, true, true),
View
@@ -195,11 +195,16 @@ void UpdateRunLoop() {
}
}
void KeepScreenAwake() {
#ifdef _WIN32
SetThreadExecutionState(ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED);
#endif
}
void Core_RunLoop(GraphicsContext *ctx) {
graphicsContext = ctx;
while ((GetUIState() != UISTATE_INGAME || !PSP_IsInited()) && GetUIState() != UISTATE_EXIT) {
time_update();
#if defined(USING_WIN_UI)
double startTime = time_now_d();
UpdateRunLoop();
@@ -212,15 +217,11 @@ void Core_RunLoop(GraphicsContext *ctx) {
if (!windowHidden) {
ctx->SwapBuffers();
}
#else
UpdateRunLoop();
#endif
}
while (!coreState && GetUIState() == UISTATE_INGAME) {
time_update();
UpdateRunLoop();
#if defined(USING_WIN_UI)
if (!windowHidden && !Core_IsStepping()) {
ctx->SwapBuffers();
@@ -230,12 +231,11 @@ void Core_RunLoop(GraphicsContext *ctx) {
// Only resetting it ever prime number seconds in case the call is expensive.
// Using a prime number to ensure there's no interaction with other periodic events.
if (now - lastKeepAwake > 89.0 || now < lastKeepAwake) {
SetThreadExecutionState(ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED);
KeepScreenAwake();
lastKeepAwake = now;
}
}
}
#endif
}
}
@@ -260,31 +260,21 @@ static inline void CoreStateProcessed() {
}
// Many platforms, like Android, do not call this function but handle things on their own.
// Instead they simply call PSP_RunLoopFor() directly, and forgo the debugging machinery.
// Instead they simply call NativeRender and NativeUpdate directly.
void Core_Run(GraphicsContext *ctx) {
#if defined(_DEBUG)
host->UpdateDisassembly();
#endif
#if !defined(USING_QT_UI)
while (true)
#endif
{
while (true) {
reswitch:
if (GetUIState() != UISTATE_INGAME) {
CoreStateProcessed();
if (GetUIState() == UISTATE_EXIT) {
return;
}
Core_RunLoop(ctx);
#if defined(USING_QT_UI)
return;
#else
continue;
#endif
}
switch (coreState)
{
switch (coreState) {
case CORE_RUNNING:
// enter a fast runloop
Core_RunLoop(ctx);
@@ -302,7 +292,7 @@ void Core_Run(GraphicsContext *ctx) {
}
// wait for step command..
#if defined(USING_QT_UI) || defined(_DEBUG)
#if defined(_DEBUG)
host->UpdateDisassembly();
host->UpdateMemView();
host->SendCoreWait(true);
@@ -313,13 +303,7 @@ void Core_Run(GraphicsContext *ctx) {
m_StepCond.wait(guard);
}
#if defined(USING_QT_UI) || defined(_DEBUG)
host->SendCoreWait(false);
#endif
#if defined(USING_QT_UI)
if (coreState != CORE_STEPPING)
return;
#endif
// No step pending? Let's go back to the wait.
if (!singleStepPending || coreState != CORE_STEPPING) {
if (coreState == CORE_POWERDOWN) {
@@ -330,10 +314,8 @@ void Core_Run(GraphicsContext *ctx) {
Core_SingleStep();
// update disasm dialog
#if defined(USING_QT_UI) || defined(_DEBUG)
host->UpdateDisassembly();
host->UpdateMemView();
#endif
break;
case CORE_POWERUP:
@@ -353,14 +335,10 @@ void Core_Run(GraphicsContext *ctx) {
void Core_EnableStepping(bool step) {
if (step) {
sleep_ms(1);
#if defined(_DEBUG)
host->SetDebugMode(true);
#endif
Core_UpdateState(CORE_STEPPING);
} else {
#if defined(_DEBUG)
host->SetDebugMode(false);
#endif
coreState = CORE_RUNNING;
coreStatePending = false;
m_StepCond.notify_one();
@@ -910,12 +910,7 @@ void TextureCacheCommon::NotifyConfigChanged() {
}
}
// Mobile devices don't get the higher scale factors, too expensive. Very rough way to decide though...
if (!gstate_c.Supports(GPU_IS_MOBILE)) {
scaleFactor = std::min(5, scaleFactor);
} else {
scaleFactor = std::min(3, scaleFactor);
}
scaleFactor = std::min(5, scaleFactor);
} else {
scaleFactor = g_Config.iTexScalingLevel;
}
View
@@ -342,11 +342,6 @@ void GPU_GLES::CheckGPUFeatures() {
features |= GPU_USE_CLEAR_RAM_HACK;
}
#ifdef MOBILE_DEVICE
// Arguably, we should turn off GPU_IS_MOBILE on like modern Tegras, etc.
features |= GPU_IS_MOBILE;
#endif
gstate_c.featureFlags = features;
}
View
@@ -490,7 +490,6 @@ enum {
GPU_SUPPORTS_ARB_FRAMEBUFFER_BLIT = FLAG_BIT(26),
GPU_SUPPORTS_NV_FRAMEBUFFER_BLIT = FLAG_BIT(27),
GPU_SUPPORTS_OES_TEXTURE_NPOT = FLAG_BIT(28),
GPU_IS_MOBILE = FLAG_BIT(29),
GPU_PREFER_CPU_DOWNLOAD = FLAG_BIT(30),
GPU_PREFER_REVERSE_COLOR_ORDER = FLAG_BIT(31),
};

0 comments on commit 5c1dad9

Please sign in to comment.