summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/vi/application_display_service.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/core/hle/service/vi/application_display_service.cpp b/src/core/hle/service/vi/application_display_service.cpp
index a3673df14..4fe85d081 100644
--- a/src/core/hle/service/vi/application_display_service.cpp
+++ b/src/core/hle/service/vi/application_display_service.cpp
@@ -99,11 +99,25 @@ Result IApplicationDisplayService::GetIndirectDisplayTransactionService(
}
Result IApplicationDisplayService::OpenDisplay(Out<u64> out_display_id, DisplayName display_name) {
- LOG_WARNING(Service_VI, "(STUBBED) called");
+ LOG_DEBUG(Service_VI, "called with display_name={}", display_name.data());
+ // Ensure the display name is null-terminated
display_name[display_name.size() - 1] = '\0';
- ASSERT_MSG(strcmp(display_name.data(), "Default") == 0,
- "Non-default displays aren't supported yet");
+
+ // According to switchbrew, only "Default", "External", "Edid", "Internal" and "Null" are valid
+ const std::array<std::string_view, 5> valid_names = {
+ "Default", "External", "Edid", "Internal", "Null"
+ };
+
+ bool valid_name = false;
+ for (const auto& name : valid_names) {
+ if (name == display_name.data()) {
+ valid_name = true;
+ break;
+ }
+ }
+
+ R_UNLESS(valid_name, ResultOperationFailed);
R_RETURN(m_container->OpenDisplay(out_display_id, display_name));
}