port WinVidGetDisplayModes

This commit is contained in:
Marcin Kurczewski 2024-06-09 14:18:18 +02:00
parent 714cebe37b
commit 027a0f83dc
No known key found for this signature in database
GPG Key ID: CC65E6FD28CAE42A
6 changed files with 26 additions and 10 deletions

View File

@ -69,10 +69,10 @@
</g>
<g transform="translate(0 116)">
<text x="0" y="7.50">Tomb2.exe progress according to the physical function order:</text>
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">41.13% (501)</tspan> · <tspan class="known">56.40% (687)</tspan> · <tspan class="todo">0% (0)</tspan> · <tspan class="unused">2.46% (30)</tspan></tspan></text>
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">41.22% (502)</tspan> · <tspan class="known">56.32% (686)</tspan> · <tspan class="todo">0% (0)</tspan> · <tspan class="unused">2.46% (30)</tspan></tspan></text>
<g transform="translate(0 20)">
<rect width="307.26" height="6" x="0" y="0" class="decompiled"/>
<rect width="421.34" height="6" x="307.26" y="0" class="known"/>
<rect width="307.88" height="6" x="0" y="0" class="decompiled"/>
<rect width="420.72" height="6" x="307.88" y="0" class="known"/>
<rect width="18.40" height="6" x="728.60" y="0" class="unused"/>
</g>
<g transform="translate(0 31)">
@ -929,7 +929,7 @@
<rect width="12" height="12" x="0" y="255" class="decompiled"><title>bool __cdecl WinVidGoWindowed(int32_t width, int32_t height, DISPLAY_MODE *dispMode);</title></rect>
<rect width="12" height="12" x="15" y="255" class="decompiled"><title>void __cdecl WinVidSetDisplayAdapter(DISPLAY_ADAPTER *disp_adapter);</title></rect>
<rect width="12" height="12" x="30" y="255" class="decompiled"><title>bool __thiscall CompareVideoModes(const DISPLAY_MODE *mode1, const DISPLAY_MODE *mode2);</title></rect>
<rect width="12" height="12" x="45" y="255" class="known"><title>bool __cdecl WinVidGetDisplayModes(void);</title></rect>
<rect width="12" height="12" x="45" y="255" class="decompiled"><title>bool __cdecl WinVidGetDisplayModes(void);</title></rect>
<rect width="12" height="12" x="60" y="255" class="known"><title>HRESULT __stdcall EnumDisplayModesCallback(LPDDSDESC lpDDSurfaceDesc, LPVOID lpContext);</title></rect>
<rect width="12" height="12" x="75" y="255" class="known"><title>bool __cdecl WinVidInit(void);</title></rect>
<rect width="12" height="12" x="90" y="255" class="known"><title>bool __cdecl WinVidGetDisplayAdapters(void);</title></rect>
@ -1298,10 +1298,10 @@
</g>
<g transform="translate(0 546)">
<text x="0" y="7.50">Tomb2.exe progress according to the function sizes:</text>
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">38.07%</tspan> · <tspan class="known">61.60%</tspan> · <tspan class="todo">0%</tspan> · <tspan class="unused">0.33%</tspan></tspan></text>
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">38.10%</tspan> · <tspan class="known">61.58%</tspan> · <tspan class="todo">0%</tspan> · <tspan class="unused">0.33%</tspan></tspan></text>
<g transform="translate(0 20)">
<rect width="284.40" height="6" x="0" y="0" class="decompiled"/>
<rect width="460.16" height="6" x="284.40" y="0" class="known"/>
<rect width="284.58" height="6" x="0" y="0" class="decompiled"/>
<rect width="459.98" height="6" x="284.58" y="0" class="known"/>
<rect width="2.44" height="6" x="744.56" y="0" class="unused"/>
</g>
<g transform="translate(0 31)">
@ -2084,7 +2084,7 @@
<rect width="5.39" height="5.31" x="616.62" y="328.90" class="decompiled"><title>bool __cdecl DDrawCreate(LPGUID lpGUID);</title></rect>
<rect width="5.39" height="5.22" x="616.62" y="337.22" class="decompiled"><title>void __cdecl Lara_State_UWDeath(ITEM_INFO *item, COLL_INFO *coll);</title></rect>
<rect width="5.39" height="5.22" x="616.62" y="345.43" class="known"><title>void __cdecl InitialiseLOTarray(void);</title></rect>
<rect width="5.39" height="5.22" x="616.62" y="353.65" class="known"><title>bool __cdecl WinVidGetDisplayModes(void);</title></rect>
<rect width="5.39" height="5.22" x="616.62" y="353.65" class="decompiled"><title>bool __cdecl WinVidGetDisplayModes(void);</title></rect>
<rect width="5.39" height="5.12" x="616.62" y="361.87" class="decompiled"><title>void __cdecl Item_InitialiseArray(int32_t num_items);</title></rect>
<rect width="5.39" height="5.02" x="616.62" y="369.98" class="decompiled"><title>void __cdecl Lara_State_Extra_DinoKill(ITEM_INFO *item, COLL_INFO *coll);</title></rect>
<rect width="4.97" height="5.43" x="625.01" y="253.38" class="decompiled"><title>int32_t __cdecl Lara_Fallen(ITEM_INFO *item, COLL_INFO *coll);</title></rect>

Before

Width:  |  Height:  |  Size: 360 KiB

After

Width:  |  Height:  |  Size: 360 KiB

View File

@ -3041,7 +3041,7 @@ typedef struct {
0x004457B0 0x010B +R bool __cdecl WinVidGoWindowed(int32_t width, int32_t height, DISPLAY_MODE *dispMode);
0x004458C0 0x00D5 +R void __cdecl WinVidSetDisplayAdapter(DISPLAY_ADAPTER *disp_adapter);
0x004459A0 0x0045 +R bool __thiscall CompareVideoModes(const DISPLAY_MODE *mode1, const DISPLAY_MODE *mode2);
0x004459F0 0x0053 -R bool __cdecl WinVidGetDisplayModes(void);
0x004459F0 0x0053 +R bool __cdecl WinVidGetDisplayModes(void);
0x00445A50 0x03B1 -R HRESULT __stdcall EnumDisplayModesCallback(LPDDSDESC lpDDSurfaceDesc, LPVOID lpContext);
0x00445E10 0x0040 -R bool __cdecl WinVidInit(void);
0x00445E50 0x00AF -R bool __cdecl WinVidGetDisplayAdapters(void);

View File

@ -2199,3 +2199,18 @@ bool __thiscall CompareVideoModes(
}
return false;
}
bool __cdecl WinVidGetDisplayModes(void)
{
for (DISPLAY_ADAPTER_NODE *adapter = g_DisplayAdapterList.head; adapter;
adapter = adapter->next) {
DDrawCreate(adapter->body.adapter_guid_ptr);
ShowDDrawGameWindow(false);
g_DDraw->lpVtbl->EnumDisplayModes(
g_DDraw, DDEDM_STANDARDVGAMODES, NULL, (LPVOID)&adapter->body,
EnumDisplayModesCallback);
HideDDrawGameWindow();
DDrawRelease();
}
return true;
}

View File

@ -106,3 +106,4 @@ void __cdecl GameWindowCalculateSizeFromClient(int *width, int *height);
void __cdecl GameWindowCalculateSizeFromClientByZero(int *width, int *height);
bool __thiscall CompareVideoModes(
const DISPLAY_MODE *mode1, const DISPLAY_MODE *mode2);
bool __cdecl WinVidGetDisplayModes(void);

View File

@ -443,7 +443,6 @@
#define ControlLavaBlob ((void __cdecl (*)(int16_t fx_num))0x00442F40)
#define GiantYetiControl ((void __cdecl (*)(int16_t item_num))0x00443050)
#define YetiControl ((void __cdecl (*)(int16_t item_num))0x00443350)
#define WinVidGetDisplayModes ((bool __cdecl (*)(void))0x004459F0)
#define EnumDisplayModesCallback ((HRESULT __stdcall (*)(LPDDSDESC lpDDSurfaceDesc, LPVOID lpContext))0x00445A50)
#define WinVidInit ((bool __cdecl (*)(void))0x00445E10)
#define WinVidGetDisplayAdapters ((bool __cdecl (*)(void))0x00445E50)

View File

@ -150,6 +150,7 @@ static void Inject_Decomp(const bool enable)
INJECT(enable, 0x00444C70, GameWindowCalculateSizeFromClient);
INJECT(enable, 0x00444CF0, GameWindowCalculateSizeFromClientByZero);
INJECT(enable, 0x004459A0, CompareVideoModes);
INJECT(enable, 0x004459F0, WinVidGetDisplayModes);
}
static void Inject_Background(const bool enable)