diff --git a/Core/Config.cpp b/Core/Config.cpp index 1a3c1ef40a..1145037ab5 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -669,34 +669,6 @@ static int DefaultFastForwardMode() { #endif } -static int DefaultAndroidHwScale() { -#ifdef __ANDROID__ - if (System_GetPropertyInt(SYSPROP_SYSTEMVERSION) >= 19 || System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_TV) { - // Arbitrary cutoff at Kitkat - modern devices are usually powerful enough that hw scaling - // doesn't really help very much and mostly causes problems. See #11151 - return 0; - } - - // Get the real resolution as passed in during startup, not dp_xres and stuff - int xres = System_GetPropertyInt(SYSPROP_DISPLAY_XRES); - int yres = System_GetPropertyInt(SYSPROP_DISPLAY_YRES); - - if (xres <= 960) { - // Smaller than the PSP*2, let's go native. - return 0; - } else if (xres <= 480 * 3) { // 720p xres - // Small-ish screen, we should default to 2x - return 2 + 1; - } else { - // Large or very large screen. Default to 3x psp resolution. - return 3 + 1; - } - return 0; -#else - return 1; -#endif -} - // See issue 14439. Should possibly even block these devices from selecting VK. const char * const vulkanDefaultBlacklist[] = { "Sony:BRAVIA VH1", @@ -889,7 +861,6 @@ static ConfigSetting graphicsSettings[] = { ReportedConfigSetting("TextureFiltering", &g_Config.iTexFiltering, 1, true, true), ReportedConfigSetting("BufferFiltering", &g_Config.iBufFilter, SCALE_LINEAR, true, true), ReportedConfigSetting("InternalResolution", &g_Config.iInternalResolution, &DefaultInternalResolution, true, true), - ReportedConfigSetting("AndroidHwScale", &g_Config.iAndroidHwScale, &DefaultAndroidHwScale), ReportedConfigSetting("HighQualityDepth", &g_Config.bHighQualityDepth, true, true, true), ReportedConfigSetting("FrameSkip", &g_Config.iFrameSkip, 0, true, true), ReportedConfigSetting("FrameSkipType", &g_Config.iFrameSkipType, 0, true, true), diff --git a/Core/Config.h b/Core/Config.h index 8f10a50893..c8df6334a9 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -419,9 +419,6 @@ public: bool bSystemControls; - // Use the hardware scaler to scale up the image to save fillrate. Similar to Windows' window size, really. - int iAndroidHwScale; // 0 = device resolution. 1 = 480x272 (extended to correct aspect), 2 = 960x544 etc. - // Risky JIT optimizations bool bDiscardRegsOnJRRA; diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index 725353631c..3b2d4d16f1 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -853,9 +853,6 @@ void RecreateActivity(); UI::EventReturn TouchTestScreen::OnImmersiveModeChange(UI::EventParams &e) { System_SendMessage("immersive", ""); - if (g_Config.iAndroidHwScale != 0) { - RecreateActivity(); - } return UI::EVENT_DONE; } diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 8f45fc358a..63dc334a7c 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -325,18 +325,6 @@ void GameSettingsScreen::CreateViews() { } } -#if PPSSPP_PLATFORM(ANDROID) - if ((deviceType != DEVICE_TYPE_TV) && (deviceType != DEVICE_TYPE_VR)) { - static const char *deviceResolutions[] = { "Native device resolution", "Auto (same as Rendering)", "1x PSP", "2x PSP", "3x PSP", "4x PSP", "5x PSP" }; - int max_res_temp = std::max(System_GetPropertyInt(SYSPROP_DISPLAY_XRES), System_GetPropertyInt(SYSPROP_DISPLAY_YRES)) / 480 + 2; - if (max_res_temp == 3) - max_res_temp = 4; // At least allow 2x - int max_res = std::min(max_res_temp, (int)ARRAY_SIZE(deviceResolutions)); - UI::PopupMultiChoice *hwscale = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iAndroidHwScale, gr->T("Display Resolution (HW scaler)"), deviceResolutions, 0, max_res, gr->GetName(), screenManager())); - hwscale->OnChoice.Handle(this, &GameSettingsScreen::OnHwScaleChange); // To refresh the display mode - } -#endif - if (deviceType != DEVICE_TYPE_VR) { #if !defined(MOBILE_DEVICE) graphicsSettings->Add(new CheckBox(&g_Config.bFullScreen, gr->T("FullScreen", "Full Screen")))->OnClick.Handle(this, &GameSettingsScreen::OnFullscreenChange); @@ -1156,9 +1144,6 @@ UI::EventReturn GameSettingsScreen::OnAdhocGuides(UI::EventParams &e) { UI::EventReturn GameSettingsScreen::OnImmersiveModeChange(UI::EventParams &e) { System_SendMessage("immersive", ""); - if (g_Config.iAndroidHwScale != 0) { - RecreateActivity(); - } return UI::EVENT_DONE; } @@ -1274,19 +1259,11 @@ UI::EventReturn GameSettingsScreen::OnFullscreenMultiChange(UI::EventParams &e) } UI::EventReturn GameSettingsScreen::OnResolutionChange(UI::EventParams &e) { - if (g_Config.iAndroidHwScale == 1) { - RecreateActivity(); - } Reporting::UpdateConfig(); NativeMessageReceived("gpu_renderResized", ""); return UI::EVENT_DONE; } -UI::EventReturn GameSettingsScreen::OnHwScaleChange(UI::EventParams &e) { - RecreateActivity(); - return UI::EVENT_DONE; -} - void GameSettingsScreen::onFinish(DialogResult result) { if (g_Config.bEnableSound) { if (PSP_IsInited() && !IsAudioInitialised()) diff --git a/UI/GameSettingsScreen.h b/UI/GameSettingsScreen.h index 86d5881f56..91d146bcd1 100644 --- a/UI/GameSettingsScreen.h +++ b/UI/GameSettingsScreen.h @@ -98,7 +98,6 @@ private: UI::EventReturn OnFullscreenChange(UI::EventParams &e); UI::EventReturn OnFullscreenMultiChange(UI::EventParams &e); UI::EventReturn OnResolutionChange(UI::EventParams &e); - UI::EventReturn OnHwScaleChange(UI::EventParams &e); UI::EventReturn OnRestoreDefaultSettings(UI::EventParams &e); UI::EventReturn OnRenderingMode(UI::EventParams &e); UI::EventReturn OnRenderingBackend(UI::EventParams &e); diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 306cc91746..ef5b11227d 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -236,22 +236,6 @@ std::string NativeQueryConfig(std::string query) { return std::string(temp); } else if (query == "immersiveMode") { return std::string(g_Config.bImmersiveMode ? "1" : "0"); - } else if (query == "hwScale") { - int scale = g_Config.iAndroidHwScale; - // Override hw scale for TV type devices. - if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_TV) - scale = 0; - - if (scale == 1) { - // If g_Config.iInternalResolution is also set to Auto (1), we fall back to "Device resolution" (0). It works out. - scale = g_Config.iInternalResolution; - } else if (scale >= 2) { - scale -= 1; - } - - int max_res = std::max(System_GetPropertyInt(SYSPROP_DISPLAY_XRES), System_GetPropertyInt(SYSPROP_DISPLAY_YRES)) / 480 + 1; - snprintf(temp, sizeof(temp), "%d", std::min(scale, max_res)); - return std::string(temp); } else if (query == "sustainedPerformanceMode") { return std::string(g_Config.bSustainedPerformanceMode ? "1" : "0"); } else if (query == "androidJavaGL") { diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index ae99cd1054..65d92cb4b5 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -1236,50 +1236,6 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeActivity_requestExitVulkanR } } -void correctRatio(int &sz_x, int &sz_y, float scale) { - float x = (float)sz_x; - float y = (float)sz_y; - float ratio = x / y; - INFO_LOG(G3D, "CorrectRatio: Considering size: %0.2f/%0.2f=%0.2f for scale %f", x, y, ratio, scale); - float targetRatio; - - // Try to get the longest dimension to match scale*PSP resolution. - if (x >= y) { - targetRatio = 480.0f / 272.0f; - x = 480.f * scale; - y = 272.f * scale; - } else { - targetRatio = 272.0f / 480.0f; - x = 272.0f * scale; - y = 480.0f * scale; - } - - float correction = targetRatio / ratio; - INFO_LOG(G3D, "Target ratio: %0.2f ratio: %0.2f correction: %0.2f", targetRatio, ratio, correction); - if (ratio < targetRatio) { - y *= correction; - } else { - x /= correction; - } - - sz_x = x; - sz_y = y; - INFO_LOG(G3D, "Corrected ratio: %dx%d", sz_x, sz_y); -} - -void getDesiredBackbufferSize(int &sz_x, int &sz_y) { - sz_x = display_xres; - sz_y = display_yres; - std::string config = NativeQueryConfig("hwScale"); - int scale; - if (1 == sscanf(config.c_str(), "%d", &scale) && scale > 0) { - correctRatio(sz_x, sz_y, scale); - } else { - sz_x = 0; - sz_y = 0; - } -} - extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_setDisplayParameters(JNIEnv *, jclass, jint xres, jint yres, jint dpi, jfloat refreshRate) { INFO_LOG(G3D, "NativeApp.setDisplayParameters(%d x %d, dpi=%d, refresh=%0.2f)", xres, yres, dpi, refreshRate); @@ -1308,18 +1264,6 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_setDisplayParameters(JN } } -extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_computeDesiredBackbufferDimensions() { - getDesiredBackbufferSize(desiredBackbufferSizeX, desiredBackbufferSizeY); -} - -extern "C" jint JNICALL Java_org_ppsspp_ppsspp_NativeApp_getDesiredBackbufferWidth(JNIEnv *, jclass) { - return desiredBackbufferSizeX; -} - -extern "C" jint JNICALL Java_org_ppsspp_ppsspp_NativeApp_getDesiredBackbufferHeight(JNIEnv *, jclass) { - return desiredBackbufferSizeY; -} - std::vector __cameraGetDeviceList() { jclass cameraClass = findClass("org/ppsspp/ppsspp/CameraHelper"); jmethodID deviceListMethod = getEnv()->GetStaticMethodID(cameraClass, "getDeviceList", "()Ljava/util/ArrayList;"); diff --git a/android/src/org/ppsspp/ppsspp/SizeManager.java b/android/src/org/ppsspp/ppsspp/SizeManager.java index d5977e974a..befdfc54cd 100644 --- a/android/src/org/ppsspp/ppsspp/SizeManager.java +++ b/android/src/org/ppsspp/ppsspp/SizeManager.java @@ -85,11 +85,6 @@ public class SizeManager implements SurfaceHolder.Callback { Log.d(TAG, "Surface created. pixelWidth=" + pixelWidth + ", pixelHeight=" + pixelHeight + " holder: " + holder.toString() + " or: " + requestedOr); NativeApp.setDisplayParameters(pixelWidth, pixelHeight, (int)densityDpi, refreshRate); - getDesiredBackbufferSize(desiredSize); - - // Note that desiredSize might be 0,0 here - but that's fine when calling setFixedSize! It means auto. - Log.d(TAG, "Setting fixed size " + desiredSize.x + " x " + desiredSize.y); - holder.setFixedSize(desiredSize.x, desiredSize.y); } @Override