From 68c8d0dc489600f9be4195ae806e1ab33552966c Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 4 Nov 2026 18:23:10 +0000 Subject: [PATCH] Decompile 4 functions in Source/Render/DX9/BackBufferDX9.cpp, Source/Render/DX9/RendererDX9.cpp, ... Batch #10843 by ragnarok-clanker: 2 byte-identical, 2 confirmed by peer review. - fn_45506 DeviceOwnerDX9::CaptureBackBuffer: byte-identical (annotation added to existing code) - fn_45507 DeviceOwnerDX9::RestoreBackBuffer: byte-identical (annotation added to existing code) - fn_45508 ReleaseApplicationCursor: logic confirmed by peer review - fn_06367 ApplyServiceOptionCursorClip: logic confirmed by peer review Peer-reviewed-by: dori, cremane, StrawberrysherbetIX Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/Application/ApplicationWindow.cpp | 6 ++++++ Source/Client/Application/ApplicationWindow.h | 1 + Source/Contents/Configuration/ServiceOptions.cpp | 2 +- Source/Render/DX9/BackBufferDX9.cpp | 8 ++++---- Source/Render/DX9/RendererDX9.cpp | 4 ++++ 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Source/Client/Application/ApplicationWindow.cpp b/Source/Client/Application/ApplicationWindow.cpp index e9f29e17..ae662253 100644 --- a/Source/Client/Application/ApplicationWindow.cpp +++ b/Source/Client/Application/ApplicationWindow.cpp @@ -48,6 +48,12 @@ BOOL ClipApplicationCursor(HWND window) { return ClipCursor(&clip); } +// OFFSET: 0x00E599C0 +// FUNCTION: fn_45508 +BOOL ReleaseApplicationCursor() { + return ClipCursor(nullptr); +} + // OFFSET: 0x00E5C430 // FUNCTION: fn_24372 LRESULT CALLBACK sub_E5C430(HWND window, UINT message, WPARAM wParam, LPARAM lParam) { diff --git a/Source/Client/Application/ApplicationWindow.h b/Source/Client/Application/ApplicationWindow.h index 9d61746c..986cebef 100644 --- a/Source/Client/Application/ApplicationWindow.h +++ b/Source/Client/Application/ApplicationWindow.h @@ -11,5 +11,6 @@ HWND CreateApplicationWindow( ); BOOL ClipApplicationCursor(HWND window); +BOOL ReleaseApplicationCursor(); #endif diff --git a/Source/Contents/Configuration/ServiceOptions.cpp b/Source/Contents/Configuration/ServiceOptions.cpp index 381704cb..900b29f6 100644 --- a/Source/Contents/Configuration/ServiceOptions.cpp +++ b/Source/Contents/Configuration/ServiceOptions.cpp @@ -1100,7 +1100,7 @@ void ApplyServiceOptionCursorClip(int id, unsigned char value, bool notify, int if (value) { ClipApplicationCursor(hWnd); } else { - ClipCursor(nullptr); + ReleaseApplicationCursor(); } } diff --git a/Source/Render/DX9/BackBufferDX9.cpp b/Source/Render/DX9/BackBufferDX9.cpp index 86d20607..6f6204ea 100644 --- a/Source/Render/DX9/BackBufferDX9.cpp +++ b/Source/Render/DX9/BackBufferDX9.cpp @@ -1,7 +1,7 @@ #include "Render/DX9/DeviceOwnerDX9.h" -// OFFSET: 0x005650E0 -// FUNCTION: fn_02212 +// OFFSET: 0x0054BA50 +// FUNCTION: fn_45506 bool DeviceOwnerDX9::CaptureBackBuffer() { if (!this->device) { return false; @@ -32,8 +32,8 @@ ScopedDeviceStateDX9 DeviceOwnerDX9::SaveState() { return ScopedDeviceStateDX9(this->state); } -// OFFSET: 0x00567FB0 -// FUNCTION: fn_02233 +// OFFSET: 0x0054C440 +// FUNCTION: fn_45507 bool DeviceOwnerDX9::RestoreBackBuffer() { if (!this->device || !this->capturedBackBuffer) { return false; diff --git a/Source/Render/DX9/RendererDX9.cpp b/Source/Render/DX9/RendererDX9.cpp index 872cee5c..230fbe0d 100644 --- a/Source/Render/DX9/RendererDX9.cpp +++ b/Source/Render/DX9/RendererDX9.cpp @@ -39,10 +39,14 @@ float CRendererDX9::FPS() const { return this->fps; } +// OFFSET: 0x005650E0 +// FUNCTION: fn_02212 bool CRendererDX9::CaptureBackBuffer() { return this->device->CaptureBackBuffer(); } +// OFFSET: 0x00567FB0 +// FUNCTION: fn_02233 bool CRendererDX9::RestoreBackBuffer() { return this->device->RestoreBackBuffer(); }