aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorduck912 <350528965+Duck912@users.noreply.github.com>2026-10-31 00:42:26 -0400
committerDuck912 <350528965+Duck912@users.noreply.github.com>2026-11-01 14:59:07 -0500
commit9cf6a499c84af39be013c0a358044cc66e31117a (patch)
treef70e73bd6b126d595e8e840ad568a33b2efbb365 /src/core
parentcce19772ce434e462223663b88294bfd8a0f203e (diff)
nx2:vi2: reply to 104 with the display's output format
GetHdrStatus returns a u64 output format after the result. The bare success reply left it to stale reply words, and Fire Emblem: Fortune's Weave set up HDR output from them: its tone map constants came out NaN and every frame was black. Report format 1 (SDR) for the "default" display. Assisted-by: Claude Opus 5.5 (debugging and drafting) Signed-off-by: duck912 <350528965+Duck912@users.noreply.github.com>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/nx2_gsv.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/core/hle/service/nx2_gsv.h b/src/core/hle/service/nx2_gsv.h
index cb92bc107b..7ef4c2e0e3 100644
--- a/src/core/hle/service/nx2_gsv.h
+++ b/src/core/hle/service/nx2_gsv.h
@@ -1442,10 +1442,10 @@ public:
{11, &INx2Vi2Session::ReturnEvent, "Unknown11"},
{31, &INx2Vi2Session::GetVsyncEvent, "GetVsyncEvent (guessed)"},
{32, &INx2Vi2Session::GetVsyncEvent, "GetDisplayVsyncEvent (guessed)"},
- // Title 1 calls these ~75 times a second with the display name "default"; the
+ {104, &INx2Vi2Session::GetHdrStatus, "GetHdrStatus"},
+ // Title 1 calls this ~75 times a second with the display name "default"; the
// auto stub's empty success reply works, but logged two lines per call (a 50 MB log
// in an 18 minute session).
- {104, &INx2Vi2Session::SucceedQuietly, "Unknown104 (display \"default\")"},
{105, &INx2Vi2Session::SucceedQuietly, "Unknown105 (display \"default\")"},
{228, &INx2Vi2Session::CancelClientBuffer, "CancelClientBuffer"},
{229, &INx2Vi2Session::PresentClientBuffer, "PresentClientBuffer"},
@@ -1798,6 +1798,27 @@ private:
TipcReplyWords(ctx, {1});
}
+ // 104(u64 display name): result, u64 output format, u32 0. Format 1 is SDR. A bare success
+ // left the format to stale reply words and a game could set up HDR output from them.
+ void GetHdrStatus(HLERequestContext& ctx) {
+ const auto* packet = ctx.CommandBuffer();
+ const u64 name = u64{packet[2]} | (u64{packet[3]} << 32);
+ constexpr u64 DefaultDisplay = 0x00746c7561666564ULL; // "default"
+ Result result = Kernel::ResultInvalidCombination;
+ u64 format{};
+ if (packet[0] == 0x78 && packet[1] == 2) {
+ result = Result{ErrorModule::VI, 7};
+ if (name == DefaultDisplay) {
+ format = 1;
+ result = ResultSuccess;
+ }
+ }
+ IPC::ResponseBuilder rb{ctx, 5};
+ rb.Push(result.raw);
+ rb.Push(format);
+ rb.Push<u32>(0);
+ }
+
// The same reply as the auto stub (success, no data), without its log lines.
void SucceedQuietly(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2};