From 378d830a93ed756c2816b9b55cdf3dc1a973ebfa Mon Sep 17 00:00:00 2001 From: OpenSauce Date: Thu, 8 May 2025 19:26:30 +0100 Subject: [PATCH] android: Improve performance stats overlay settings and functionality (#808) * android: Improve performance stats overlay settings and functionality * Add battery temp functions * Readd frametime * Corrected `perf_overlay_position` being placed in the wrong `default_ini.h` file * Fixed the word "overlay" being repeatedly misspelled in function names * `updateshowStatsOverlay` --> `updateShowStatsOverlay` * Increased frequency of performance overlay updates Changed from every 3 seconds to every 1 second * Adjusted overlay margins to avoid text being lost behind rounded corner cutouts * Fix performance overlay updates being stacked when changing orientation * Changed out host RAM usage statistic for available host RAM * Removed seemingly unused code * "FT" --> "Frametime" in overlay * Use non-breaking spaces to control how the overlay text breaks Also used a vertical box drawing character instead of a pipe for the divider because it looks slightly nicer * Renamed/adjusted remnants of the "Show System Memory Usage" setting * Replaced Performance Stats Overlay icon with a stock clip art image from Android Studio * Made performance overlay setting value names and strings less generic * Rebranded Performance Stats Overlay as simply "Performance Overlay" * Rewrote performance overlay settings description * Improved naming consistency * Rebranded "Show Overlay" toggle to "Show Controller Overlay" This is to avoid confusion with the new performance overlay * nitpick: Fixed order of imports in EmulationFragment.kt * More string name consistency improvements * Fixed compile failure due to a binding name not being updated * Changed Performance Overlay setting headers * EmulationFragment.kt: Formatting corrections * Removed seemingly misplaced call to `updateShowPerformanceOverlay` * `OVERLAY_POSITION` --> `PERFORMANCE_OVERLAY_POSITION` --------- Co-authored-by: Kleidis <167202775+kleidis@users.noreply.github.com> Co-authored-by: Zephyron --- .../features/settings/model/BooleanSetting.kt | 7 + .../features/settings/model/IntSetting.kt | 3 +- .../features/settings/model/Settings.kt | 1 + .../settings/ui/SettingsFragmentPresenter.kt | 120 ++++++++++++ .../citra_emu/fragments/EmulationFragment.kt | 181 ++++++++++++++---- .../citra_emu/utils/EmulationMenuSettings.kt | 6 +- src/android/app/src/main/jni/default_ini.h | 9 + .../app/src/main/res/drawable/ic_stats.xml | 9 + .../main/res/layout/fragment_emulation.xml | 2 +- .../main/res/menu/menu_overlay_options.xml | 6 +- .../main/res/values-night/citra_colors.xml | 1 + .../app/src/main/res/values/arrays.xml | 17 ++ .../app/src/main/res/values/citra_colors.xml | 1 + .../app/src/main/res/values/strings.xml | 32 +++- 14 files changed, 348 insertions(+), 47 deletions(-) create mode 100644 src/android/app/src/main/res/drawable/ic_stats.xml diff --git a/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/BooleanSetting.kt b/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/BooleanSetting.kt index 26b97453e..10fd07a72 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/BooleanSetting.kt +++ b/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/BooleanSetting.kt @@ -17,6 +17,13 @@ enum class BooleanSetting( SWAP_SCREEN("swap_screen", Settings.SECTION_LAYOUT, false), INSTANT_DEBUG_LOG("instant_debug_log", Settings.SECTION_DEBUG, false), CUSTOM_LAYOUT("custom_layout",Settings.SECTION_LAYOUT,false), + OVERLAY_SHOW_FPS("overlay_show_fps", Settings.SECTION_LAYOUT, true), + OVERLAY_SHOW_FRAMETIME("overlay_show_frame_time", Settings.SECTION_LAYOUT, false), + OVERLAY_SHOW_SPEED("overlay_show_speed", Settings.SECTION_LAYOUT, false), + OVERLAY_SHOW_APP_RAM_USAGE("overlay_show_app_ram_usage", Settings.SECTION_LAYOUT, false), + OVERLAY_SHOW_AVAILABLE_RAM("overlay_show_available_ram", Settings.SECTION_LAYOUT, false), + OVERLAY_SHOW_BATTERY_TEMP("overlay_show_battery_temp", Settings.SECTION_LAYOUT, false), + OVERLAY_BACKGROUND("overlay_background", Settings.SECTION_LAYOUT, false), DELAY_START_LLE_MODULES("delay_start_for_lle_modules", Settings.SECTION_DEBUG, true), DETERMINISTIC_ASYNC_OPERATIONS("deterministic_async_operations", Settings.SECTION_DEBUG, false), REQUIRED_ONLINE_LLE_MODULES("enable_required_online_lle_modules", Settings.SECTION_SYSTEM, false); diff --git a/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/IntSetting.kt b/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/IntSetting.kt index 8f5f73f9f..ee087b9dd 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/IntSetting.kt +++ b/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/IntSetting.kt @@ -67,7 +67,8 @@ enum class IntSetting( USE_ARTIC_BASE_CONTROLLER("use_artic_base_controller", Settings.SECTION_CONTROLS, 0), ORIENTATION_OPTION("screen_orientation", Settings.SECTION_LAYOUT, 2), DISABLE_RIGHT_EYE_RENDER("disable_right_eye_render", Settings.SECTION_RENDERER, 0), - TURBO_LIMIT("turbo_limit", Settings.SECTION_CORE, 200); + TURBO_LIMIT("turbo_limit", Settings.SECTION_CORE, 200), + PERFORMANCE_OVERLAY_POSITION("performance_overlay_position", Settings.SECTION_LAYOUT, 0); override var int: Int = defaultValue diff --git a/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/Settings.kt b/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/Settings.kt index e3792e37c..b229ffe17 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/Settings.kt +++ b/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/Settings.kt @@ -111,6 +111,7 @@ class Settings { const val SECTION_THEME = "Theme" const val SECTION_CUSTOM_LANDSCAPE = "Custom Landscape Layout" const val SECTION_CUSTOM_PORTRAIT = "Custom Portrait Layout" + const val SECTION_PERFORMANCE_OVERLAY = "Performance Overlay" const val KEY_BUTTON_A = "button_a" const val KEY_BUTTON_B = "button_b" diff --git a/src/android/app/src/main/java/org/citra/citra_emu/features/settings/ui/SettingsFragmentPresenter.kt b/src/android/app/src/main/java/org/citra/citra_emu/features/settings/ui/SettingsFragmentPresenter.kt index b560a7af7..29bab03d1 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/features/settings/ui/SettingsFragmentPresenter.kt +++ b/src/android/app/src/main/java/org/citra/citra_emu/features/settings/ui/SettingsFragmentPresenter.kt @@ -47,6 +47,7 @@ import org.citra.citra_emu.utils.BirthdayMonth import org.citra.citra_emu.utils.Log import org.citra.citra_emu.utils.SystemSaveGame import org.citra.citra_emu.utils.ThemeUtil +import org.citra.citra_emu.utils.EmulationMenuSettings class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView) { private var menuTag: String? = null @@ -102,6 +103,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView) Settings.SECTION_THEME -> addThemeSettings(sl) Settings.SECTION_CUSTOM_LANDSCAPE -> addCustomLandscapeSettings(sl) Settings.SECTION_CUSTOM_PORTRAIT -> addCustomPortraitSettings(sl) + Settings.SECTION_PERFORMANCE_OVERLAY -> addPerformanceOverlaySettings(sl) else -> { fragmentView.showToastMessage("Unimplemented menu", false) return @@ -1116,6 +1118,14 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView) FloatSetting.LARGE_SCREEN_PROPORTION.defaultValue ) ) + add( + SubmenuSetting( + R.string.performance_overlay_options, + R.string.performance_overlay_options_description, + R.drawable.ic_stats, + Settings.SECTION_PERFORMANCE_OVERLAY + ) + ) add( SubmenuSetting( R.string.emulation_landscape_custom_layout, @@ -1135,6 +1145,116 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView) } } + private fun addPerformanceOverlaySettings(sl: ArrayList) { + settingsActivity.setToolbarTitle(settingsActivity.getString(R.string.performance_overlay_options)) + sl.apply { + + add(HeaderSetting(R.string.visibility)) + + add( + SwitchSetting( + object : AbstractBooleanSetting { + override val key = "EmulationMenuSettings_showPerfPerformanceOverlay" + override val section = Settings.SECTION_LAYOUT + override val defaultValue = false + override var boolean: Boolean + get() = EmulationMenuSettings.showPerformanceOverlay + set(value) { EmulationMenuSettings.showPerformanceOverlay = value } + override val isRuntimeEditable = true + override val valueAsString: String get() = boolean.toString() + }, + R.string.performance_overlay_enable, + 0, + "EmulationMenuSettings_showPerfPerformanceOverlay", + false + ) + ) + + add( + SwitchSetting( + BooleanSetting.OVERLAY_BACKGROUND, + R.string.overlay_background, + R.string.overlay_background_description, + "overlay_background", + false + ) + ) + + add( + SingleChoiceSetting( + IntSetting.PERFORMANCE_OVERLAY_POSITION, + R.string.overlay_position, + R.string.overlay_position_description, + R.array.statsPosition, + R.array.statsPositionValues, + ) + ) + + + add(HeaderSetting(R.string.information)) + + add( + SwitchSetting( + BooleanSetting.OVERLAY_SHOW_FPS, + R.string.overlay_show_fps, + R.string.overlay_show_fps_description, + "overlay_show_fps", + true + ) + ) + + add( + SwitchSetting( + BooleanSetting.OVERLAY_SHOW_FRAMETIME, + R.string.overlay_show_frametime, + R.string.overlay_show_frametime_description, + "overlay_show_frame_time", + true + ) + ) + + add( + SwitchSetting( + BooleanSetting.OVERLAY_SHOW_SPEED, + R.string.overlay_show_speed, + R.string.overlay_show_speed_description, + "overlay_show_speed", + false + ) + ) + + add( + SwitchSetting( + BooleanSetting.OVERLAY_SHOW_APP_RAM_USAGE, + R.string.overlay_show_app_ram_usage, + R.string.overlay_show_app_ram_usage_description, + "overlay_show_app_ram_usage", + false + ) + ) + + add( + SwitchSetting( + BooleanSetting.OVERLAY_SHOW_AVAILABLE_RAM, + R.string.overlay_show_available_ram, + R.string.overlay_show_available_ram_description, + "overlay_show_available_ram", + false + ) + ) + + add( + SwitchSetting( + BooleanSetting.OVERLAY_SHOW_BATTERY_TEMP, + R.string.overlay_show_battery_temp, + R.string.overlay_show_battery_temp_description, + "overlay_show_battery_temp", + false + ) + ) + } + } + private fun addCustomLandscapeSettings(sl: ArrayList) { settingsActivity.setToolbarTitle(settingsActivity.getString(R.string.emulation_landscape_custom_layout)) sl.apply { diff --git a/src/android/app/src/main/java/org/citra/citra_emu/fragments/EmulationFragment.kt b/src/android/app/src/main/java/org/citra/citra_emu/fragments/EmulationFragment.kt index 58e7b95c5..7aeecf453 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/fragments/EmulationFragment.kt +++ b/src/android/app/src/main/java/org/citra/citra_emu/fragments/EmulationFragment.kt @@ -5,10 +5,14 @@ package org.citra.citra_emu.fragments import android.annotation.SuppressLint +import android.app.ActivityManager import android.content.Context import android.content.DialogInterface +import android.content.Intent +import android.content.IntentFilter import android.content.SharedPreferences import android.net.Uri +import android.os.BatteryManager import android.os.Bundle import android.os.Handler import android.os.Looper @@ -16,6 +20,7 @@ import android.os.SystemClock import android.text.Editable import android.text.TextWatcher import android.view.Choreographer +import android.view.Gravity import android.view.LayoutInflater import android.view.MotionEvent import android.view.Surface @@ -27,6 +32,7 @@ import android.widget.PopupMenu import android.widget.TextView import android.widget.Toast import androidx.activity.OnBackPressedCallback +import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.core.content.res.ResourcesCompat import androidx.core.graphics.Insets import androidx.core.view.ViewCompat @@ -44,6 +50,7 @@ import androidx.navigation.fragment.navArgs import androidx.preference.PreferenceManager import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.slider.Slider +import java.io.File import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch import org.citra.citra_emu.CitraApplication @@ -57,6 +64,7 @@ import org.citra.citra_emu.databinding.FragmentEmulationBinding import org.citra.citra_emu.display.PortraitScreenLayout import org.citra.citra_emu.display.ScreenAdjustmentUtil import org.citra.citra_emu.display.ScreenLayout +import org.citra.citra_emu.features.settings.model.BooleanSetting import org.citra.citra_emu.features.settings.model.IntSetting import org.citra.citra_emu.features.settings.model.SettingsViewModel import org.citra.citra_emu.features.settings.ui.SettingsActivity @@ -175,8 +183,11 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram binding.surfaceInputOverlay.setIsInEditMode(false) } - // Show/hide the "Show FPS" overlay - updateShowFpsOverlay() + // Show/hide the "Stats" overlay + updateShowPerformanceOverlay() + + val position = IntSetting.PERFORMANCE_OVERLAY_POSITION.int + updateStatsPosition(position) binding.drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED) binding.drawerLayout.addDrawerListener(object : DrawerListener { @@ -455,6 +466,11 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram Choreographer.getInstance().postFrameCallback(this) if (NativeLibrary.isRunning()) { NativeLibrary.unPauseEmulation() + + // If the overlay is enabled, we need to update the position if changed + val position = IntSetting.PERFORMANCE_OVERLAY_POSITION.int + updateStatsPosition(position) + binding.inGameMenu.menu.findItem(R.id.menu_emulation_pause)?.let { menuItem -> menuItem.title = resources.getString(R.string.pause_emulation) menuItem.icon = ResourcesCompat.getDrawable( @@ -640,7 +656,8 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram popupMenu.menu.apply { findItem(R.id.menu_show_overlay).isChecked = EmulationMenuSettings.showOverlay - findItem(R.id.menu_show_fps).isChecked = EmulationMenuSettings.showFps + findItem(R.id.menu_performance_overlay_show).isChecked = + EmulationMenuSettings.showPerformanceOverlay findItem(R.id.menu_haptic_feedback).isChecked = EmulationMenuSettings.hapticFeedback findItem(R.id.menu_emulation_joystick_rel_center).isChecked = EmulationMenuSettings.joystickRelCenter @@ -656,15 +673,14 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram true } - R.id.menu_show_fps -> { - EmulationMenuSettings.showFps = !EmulationMenuSettings.showFps - updateShowFpsOverlay() + R.id.menu_performance_overlay_show -> { + EmulationMenuSettings.showPerformanceOverlay = !EmulationMenuSettings.showPerformanceOverlay + updateShowPerformanceOverlay() true } R.id.menu_haptic_feedback -> { EmulationMenuSettings.hapticFeedback = !EmulationMenuSettings.hapticFeedback - updateShowFpsOverlay() true } @@ -1149,34 +1165,140 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram binding.surfaceInputOverlay.resetButtonPlacement() } - fun updateShowFpsOverlay() { - if (EmulationMenuSettings.showFps) { + fun updateShowPerformanceOverlay() { + if (perfStatsUpdater != null) { + perfStatsUpdateHandler.removeCallbacks(perfStatsUpdater!!) + } + + if (EmulationMenuSettings.showPerformanceOverlay) { val SYSTEM_FPS = 0 val FPS = 1 val FRAMETIME = 2 val SPEED = 3 perfStatsUpdater = Runnable { + val sb = StringBuilder() val perfStats = NativeLibrary.getPerfStats() + val dividerString = "\u00A0\u2502 " if (perfStats[FPS] > 0) { - binding.showFpsText.text = String.format( - "FPS: %d Speed: %d%% FT: %.2fms", - (perfStats[FPS] + 0.5).toInt(), - (perfStats[SPEED] * 100.0 + 0.5).toInt(), - (perfStats[FRAMETIME] * 1000.0f).toFloat() - ) + if (BooleanSetting.OVERLAY_SHOW_FPS.boolean) { + sb.append(String.format("FPS:\u00A0%d", (perfStats[FPS] + 0.5).toInt())) + } + + if (BooleanSetting.OVERLAY_SHOW_FRAMETIME.boolean) { + if (sb.isNotEmpty()) sb.append(dividerString) + sb.append( + String.format( + "Frametime:\u00A0%.1fms", + (perfStats[FRAMETIME] * 1000.0f).toFloat() + ) + ) + } + + if (BooleanSetting.OVERLAY_SHOW_SPEED.boolean) { + if (sb.isNotEmpty()) sb.append(dividerString) + sb.append( + String.format( + "Speed:\u00A0%d%%", + (perfStats[SPEED] * 100.0 + 0.5).toInt() + ) + ) + } + + if (BooleanSetting.OVERLAY_SHOW_APP_RAM_USAGE.boolean) { + if (sb.isNotEmpty()) sb.append(dividerString) + val appRamUsage = + File("/proc/self/statm").readLines()[0].split(' ')[1].toLong() * 4096 / 1000000 + sb.append("Process\u00A0RAM:\u00A0$appRamUsage\u00A0MB") + } + + if (BooleanSetting.OVERLAY_SHOW_AVAILABLE_RAM.boolean) { + if (sb.isNotEmpty()) sb.append(dividerString) + context?.let { ctx -> + val activityManager = + ctx.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager + val memInfo = ActivityManager.MemoryInfo() + activityManager.getMemoryInfo(memInfo) + val megabyteBytes = 1048576L + val availableRam = memInfo.availMem / megabyteBytes + sb.append("Available\u00A0RAM:\u00A0$availableRam\u00A0MB") + } + } + + if (BooleanSetting.OVERLAY_SHOW_BATTERY_TEMP.boolean) { + if (sb.isNotEmpty()) sb.append(dividerString) + val batteryTemp = getBatteryTemperature() + val tempF = celsiusToFahrenheit(batteryTemp) + sb.append(String.format("%.1f°C/%.1f°F", batteryTemp, tempF)) + } + + if (BooleanSetting.OVERLAY_BACKGROUND.boolean) { + binding.performanceOverlayShowText.setBackgroundResource(R.color.citra_transparent_black) + } else { + binding.performanceOverlayShowText.setBackgroundResource(0) + } + + binding.performanceOverlayShowText.text = sb.toString() } - perfStatsUpdateHandler.postDelayed(perfStatsUpdater!!, 3000) + perfStatsUpdateHandler.postDelayed(perfStatsUpdater!!, 1000) } perfStatsUpdateHandler.post(perfStatsUpdater!!) - binding.showFpsText.visibility = View.VISIBLE + binding.performanceOverlayShowText.visibility = View.VISIBLE } else { - if (perfStatsUpdater != null) { - perfStatsUpdateHandler.removeCallbacks(perfStatsUpdater!!) - } - binding.showFpsText.visibility = View.GONE + binding.performanceOverlayShowText.visibility = View.GONE } } + private fun updateStatsPosition(position: Int) { + val params = binding.performanceOverlayShowText.layoutParams as CoordinatorLayout.LayoutParams + val padding = (20 * resources.displayMetrics.density).toInt() // 20dp + params.setMargins(padding, 0, padding, 0) + + when (position) { + 0 -> { + params.gravity = (Gravity.TOP or Gravity.START) + } + + 1 -> { + params.gravity = (Gravity.TOP or Gravity.CENTER_HORIZONTAL) + } + + 2 -> { + params.gravity = (Gravity.TOP or Gravity.END) + } + + 3 -> { + params.gravity = (Gravity.BOTTOM or Gravity.START) + } + + 4 -> { + params.gravity = (Gravity.BOTTOM or Gravity.CENTER_HORIZONTAL) + } + + 5 -> { + params.gravity = (Gravity.BOTTOM or Gravity.END) + } + } + + binding.performanceOverlayShowText.layoutParams = params + } + + private fun getBatteryTemperature(): Float { + try { + val batteryIntent = requireContext().registerReceiver(null, IntentFilter(Intent.ACTION_BATTERY_CHANGED)) + // Temperature in tenths of a degree Celsius + val temperature = batteryIntent?.getIntExtra(BatteryManager.EXTRA_TEMPERATURE, 0) ?: 0 + // Convert to degrees Celsius + return temperature / 10.0f + } catch (e: Exception) { + return 0.0f + } + } + + private fun celsiusToFahrenheit(celsius: Float): Float { + return (celsius * 9 / 5) + 32 + } + + override fun surfaceCreated(holder: SurfaceHolder) { // We purposely don't do anything here. // All work is done in surfaceChanged, which we are guaranteed to get even for surface creation. @@ -1211,23 +1333,6 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram v.setPadding(left, cutInsets.top, right, 0) - // Ensure FPS text doesn't get cut off by rounded display corners - val sidePadding = resources.getDimensionPixelSize(R.dimen.spacing_large) - if (cutInsets.left == 0) { - binding.showFpsText.setPadding( - sidePadding, - cutInsets.top, - cutInsets.right, - cutInsets.bottom - ) - } else { - binding.showFpsText.setPadding( - cutInsets.left, - cutInsets.top, - cutInsets.right, - cutInsets.bottom - ) - } windowInsets } } diff --git a/src/android/app/src/main/java/org/citra/citra_emu/utils/EmulationMenuSettings.kt b/src/android/app/src/main/java/org/citra/citra_emu/utils/EmulationMenuSettings.kt index 660842aa8..6d633360b 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/utils/EmulationMenuSettings.kt +++ b/src/android/app/src/main/java/org/citra/citra_emu/utils/EmulationMenuSettings.kt @@ -27,11 +27,11 @@ object EmulationMenuSettings { .apply() } - var showFps: Boolean - get() = preferences.getBoolean("EmulationMenuSettings_ShowFps", false) + var showPerformanceOverlay: Boolean + get() = preferences.getBoolean("EmulationMenuSettings_showPerformanceOverlay", false) set(value) { preferences.edit() - .putBoolean("EmulationMenuSettings_ShowFps", value) + .putBoolean("EmulationMenuSettings_showPerformanceOverlay", value) .apply() } var hapticFeedback: Boolean diff --git a/src/android/app/src/main/jni/default_ini.h b/src/android/app/src/main/jni/default_ini.h index 5bed81173..d85ec9273 100644 --- a/src/android/app/src/main/jni/default_ini.h +++ b/src/android/app/src/main/jni/default_ini.h @@ -206,6 +206,15 @@ disable_right_eye_render = # 5: Custom Layout layout_option = +# Position of the performance overlay +# 0: Top Left +# 1: Center Top +# 2: Top Right +# 3: Bottom Left +# 4: Center Bottom +# 5: Bottom Right +performance_overlay_position = + # Screen Gap - adds a gap between screens in all two-screen modes # Measured in pixels relative to the 240px default height of the screens # Scales with the larger screen (so 24 is 10% of the larger screen height) diff --git a/src/android/app/src/main/res/drawable/ic_stats.xml b/src/android/app/src/main/res/drawable/ic_stats.xml new file mode 100644 index 000000000..956e0fe25 --- /dev/null +++ b/src/android/app/src/main/res/drawable/ic_stats.xml @@ -0,0 +1,9 @@ + + + diff --git a/src/android/app/src/main/res/layout/fragment_emulation.xml b/src/android/app/src/main/res/layout/fragment_emulation.xml index 91bf7562c..214270df1 100644 --- a/src/android/app/src/main/res/layout/fragment_emulation.xml +++ b/src/android/app/src/main/res/layout/fragment_emulation.xml @@ -117,7 +117,7 @@ #B7B7B7 + #80000000 #C6C5D0 #FFB4AB #93000A diff --git a/src/android/app/src/main/res/values/arrays.xml b/src/android/app/src/main/res/values/arrays.xml index 51b68bd60..f1204291f 100644 --- a/src/android/app/src/main/res/values/arrays.xml +++ b/src/android/app/src/main/res/values/arrays.xml @@ -115,6 +115,23 @@ 11 + + @string/overlay_position_top_left + @string/overlay_position_center_top + @string/overlay_position_top_right + @string/overlay_position_bottom_left + @string/overlay_position_center_bottom + @string/overlay_position_bottom_right + + + 0 + 1 + 2 + 3 + 4 + 5 + + @string/button_a @string/button_b diff --git a/src/android/app/src/main/res/values/citra_colors.xml b/src/android/app/src/main/res/values/citra_colors.xml index e87a2a75b..746604d56 100644 --- a/src/android/app/src/main/res/values/citra_colors.xml +++ b/src/android/app/src/main/res/values/citra_colors.xml @@ -222,6 +222,7 @@ #9E9E9E + #80000000 #C6C5D0 #BA1A1A #FFDAD6 diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 16d84d1bc..ecaaa3ced 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -362,6 +362,8 @@ Cancelling… Important Don\'t show again + Visibility + Information Select Game Folder @@ -445,7 +447,7 @@ Cycle Layouts Swap Screens Reset Overlay - Show Overlay + Show Controller Overlay Close Game Toggle Pause Miscellaneous @@ -534,6 +536,34 @@ Uninstall DLC Uninstall Updates + + Show Performance Overlay + Performance Overlay + Enable Performance Overlay + Configure whether the performance overlay is shown and what information is displayed. + Show FPS + Display current frames per second + Show Frametime + Display current frametime + Show Speed + Display current emulation speed percentage + Show App Memory Usage + Display the amount of RAM getting used by the emulator + Show Available Memory + Display the amount of RAM which is available + Show Battery Temperature + Display current Battery temperature in Celsius and Fahrenheit + Overlay Position + Choose where the performance overlay is displayed on the screen + Top Left + Top Right + Bottom Left + Bottom Right + Center Top + Center Bottom + Overlay Background + Adds a background behind the overlay for easier reading + Cheats Add Cheat