mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
MDX: Updated Ring Buffer Backfill Implementation (P4IO Timing Fix) (#456)
## Link to GitHub Issue, if one exists #452 ## Description of change - Extension of #450 - Moved the call to `arkGetTickTime64()` outside the update function to bring the timestamps closer to real-time - Changed the update function to only call `getState()` if called from `rawinput`, otherwise just fill the ring buffer entries with the last known state - Changed the update function to only write one ring buffer entry if called from `rawinput` - Moved the call to `mdxf_poll()` within `rawinput.cpp` outside the loop that iterates over all devices ## Testing - Logging was done to verify the span of poll history covered by each request for 7 ring buffer entries was ~28ms, as the game expects - Observed some improvement in timing precision since the prior implementation
This commit is contained in:
@@ -1826,10 +1826,10 @@ LRESULT CALLBACK rawinput::RawInputManager::input_wnd_proc(
|
||||
|
||||
// free device
|
||||
device.mutex->unlock();
|
||||
|
||||
// update controller state ring buffers (DDR/MDXF)
|
||||
mdxf_poll();
|
||||
}
|
||||
|
||||
// update controller state ring buffers (DDR/MDXF)
|
||||
mdxf_poll();
|
||||
|
||||
// call the default window handler for cleanup
|
||||
DefWindowProc(hWnd, msg, wparam, lParam);
|
||||
|
||||
Reference in New Issue
Block a user