Skip to content

Commit

Permalink
Add more display information to system info.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Aug 30, 2023
1 parent 318ef7c commit b501abf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
7 changes: 1 addition & 6 deletions UI/ControlMappingScreen.cpp
Expand Up @@ -669,11 +669,6 @@ void TouchTestScreen::CreateViews() {
root_->Add(new Button(di->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
}

#if PPSSPP_PLATFORM(ANDROID)
extern int display_xres;
extern int display_yres;
#endif

void TouchTestScreen::UpdateLogView() {
while (keyEventLog_.size() > 8) {
keyEventLog_.erase(keyEventLog_.begin());
Expand Down Expand Up @@ -756,7 +751,7 @@ void TouchTestScreen::render() {
"g_dpi: %0.3f g_dpi_scale: %0.3fx%0.3f\n"
"g_dpi_scale_real: %0.3fx%0.3f\n%s",
#if PPSSPP_PLATFORM(ANDROID)
display_xres, display_yres,
System_GetPropertyInt(SYSPROP_DISPLAY_XRES), System_GetPropertyInt(SYSPROP_DISPLAY_YRES),
#endif
g_display.dp_xres, g_display.dp_yres,
g_display.pixel_xres, g_display.pixel_yres,
Expand Down
15 changes: 14 additions & 1 deletion UI/DevScreens.cpp
Expand Up @@ -616,12 +616,25 @@ void SystemInfoScreen::CreateTabs() {
displayInfo->Add(new InfoItem(si->T("Native Resolution"), StringFromFormat("%dx%d",
System_GetPropertyInt(SYSPROP_DISPLAY_XRES),
System_GetPropertyInt(SYSPROP_DISPLAY_YRES))));
#endif
displayInfo->Add(new InfoItem(si->T("UI Resolution"), StringFromFormat("%dx%d (%s: %0.2f)",
g_display.dp_xres,
g_display.dp_yres,
si->T("DPI"),
g_display.dpi)));
#endif
displayInfo->Add(new InfoItem(si->T("Pixel Resolution"), StringFromFormat("%dx%d",
g_display.pixel_xres,
g_display.pixel_yres)));

const float insets[4] = {
System_GetPropertyFloat(SYSPROP_DISPLAY_SAFE_INSET_LEFT),
System_GetPropertyFloat(SYSPROP_DISPLAY_SAFE_INSET_TOP),
System_GetPropertyFloat(SYSPROP_DISPLAY_SAFE_INSET_RIGHT),
System_GetPropertyFloat(SYSPROP_DISPLAY_SAFE_INSET_BOTTOM),
};
if (insets[0] != 0.0f || insets[1] != 0.0f || insets[2] != 0.0f || insets[3] != 0.0f) {
displayInfo->Add(new InfoItem(si->T("Screen notch insets"), StringFromFormat("%0.1f %0.1f %0.1f %0.1f", insets[0], insets[1], insets[2], insets[3])));
}

// Don't show on Windows, since it's always treated as 60 there.
displayInfo->Add(new InfoItem(si->T("Refresh rate"), StringFromFormat(si->T("%0.2f Hz"), (float)System_GetPropertyFloat(SYSPROP_DISPLAY_REFRESH_RATE))));
Expand Down
4 changes: 2 additions & 2 deletions android/jni/app-android.cpp
Expand Up @@ -148,8 +148,8 @@ static int deviceType;
// Should only be used for display detection during startup (for config defaults etc)
// This is the ACTUAL display size, not the hardware scaled display size.
// Exposed so it can be displayed on the touchscreen test.
int display_xres;
int display_yres;
static int display_xres;
static int display_yres;
static int display_dpi_x;
static int display_dpi_y;
static int backbuffer_format; // Android PixelFormat enum
Expand Down

0 comments on commit b501abf

Please sign in to comment.