upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authoritsRevela <rexmarek@gmail.com>2026-11-22 10:26:34 -0600
committeritsRevela <rexmarek@gmail.com>2026-11-22 10:26:34 -0600
commitb9a3cbcfc006c8fb957f7dc7cbe8cb450adabb51 (patch)
tree8bc0c8107d4045f32031f9834449bf3ab6856bbf /runtime
parent4eb6155d3ac4f9d3fadb0d095c4ce13e76783615 (diff)
gameinput: GetTemporalReading stays E_NOTIMPL, as in GameInput v0 (RT-147)
Microsoft's reference page says IGameInput::GetTemporalReading "was never implemented in v0" and returns E_NOTIMPL, and v1 removed it, so the shim's E_NOTIMPL already matches the API the title was built against. A history lookup would answer what no GameInput runtime does. The v0 header (NuGet Microsoft.GameInput 0.2303.22621.3038) declares (timestamp, device, reading), the shim's layout; the page's five-parameter form doesn't match it. Pin the behaviour in gameinput_test (E_NOTIMPL with the reading cleared, for past, present and current timestamps, with and without a device filter; E_POINTER for a null output) and say so in docs/gameinput.md instead of listing the method as a gap.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/shims/gameinput.cpp2
-rw-r--r--runtime/test/gameinput_test.cpp11
2 files changed, 13 insertions, 0 deletions
diff --git a/runtime/shims/gameinput.cpp b/runtime/shims/gameinput.cpp
index 3b66e2ab9..84807f084 100644
--- a/runtime/shims/gameinput.cpp
+++ b/runtime/shims/gameinput.cpp
@@ -1256,6 +1256,8 @@ public:
1256 IGameInputReading** out) override { 1256 IGameInputReading** out) override {
1257 return find_reading(ref, kind, device, out, false); 1257 return find_reading(ref, kind, device, out, false);
1258 } 1258 }
1259 // E_NOTIMPL is GameInput v0's own answer: Microsoft's reference page says the method "was never implemented in
1260 // v0" and returns E_NOTIMPL, and v1 removed it. A history lookup here would give a title what no GameInput does.
1259 HRESULT STDMETHODCALLTYPE GetTemporalReading(uint64_t, IGameInputDevice*, IGameInputReading** out) override { 1261 HRESULT STDMETHODCALLTYPE GetTemporalReading(uint64_t, IGameInputDevice*, IGameInputReading** out) override {
1260 if (!out) return E_POINTER; 1262 if (!out) return E_POINTER;
1261 *out = nullptr; 1263 *out = nullptr;
diff --git a/runtime/test/gameinput_test.cpp b/runtime/test/gameinput_test.cpp
index d1923ceaf..ba2a21f0e 100644
--- a/runtime/test/gameinput_test.cpp
+++ b/runtime/test/gameinput_test.cpp
@@ -992,6 +992,17 @@ int main() {
992 check(input->GetPreviousReading(idle, GameInputKindGamepad, dev, nullptr) == E_POINTER && 992 check(input->GetPreviousReading(idle, GameInputKindGamepad, dev, nullptr) == E_POINTER &&
993 input->GetPreviousReading(nullptr, GameInputKindGamepad, dev, &hit) == E_INVALIDARG && !hit, 993 input->GetPreviousReading(nullptr, GameInputKindGamepad, dev, &hit) == E_INVALIDARG && !hit,
994 "history: a null output is E_POINTER, a null reference E_INVALIDARG"); 994 "history: a null output is E_POINTER, a null reference E_INVALIDARG");
995 // GetTemporalReading: E_NOTIMPL with a null reading, as GameInput v0 itself, for a timestamp in the history, one
996 // before it and the current time, with and without a device filter.
997 const uint64_t idle_us = idle->GetTimestamp();
998 bool temporal_notimpl = true;
999 for (const uint64_t at : {idle_us, idle_us - 1'000'000, input->GetCurrentTimestamp()})
1000 for (IGameInputDevice* filter : {dev, static_cast<IGameInputDevice*>(nullptr)}) {
1001 IGameInputReading* temporal = idle; // a stale value the call must clear
1002 temporal_notimpl &= input->GetTemporalReading(at, filter, &temporal) == E_NOTIMPL && !temporal;
1003 }
1004 check(temporal_notimpl && input->GetTemporalReading(idle_us, dev, nullptr) == E_POINTER,
1005 "history: GetTemporalReading is E_NOTIMPL with a null reading, as in GameInput v0");
995 1006
996 // Two pads in one stream, one poll each: A on the Xbox pad, B on the DualSense, Y on the Xbox pad. 1007 // Two pads in one stream, one poll each: A on the Xbox pad, B on the DualSense, Y on the Xbox pad.
997 IGameInputReading* start = current(input, dev); 1008 IGameInputReading* start = current(input, dev);