port Inv_Ring_MotionInit

This commit is contained in:
Marcin Kurczewski 2024-09-05 16:50:29 +02:00
parent f86ecca242
commit 2cd78a73f4
No known key found for this signature in database
GPG Key ID: CC65E6FD28CAE42A
6 changed files with 42 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">59.61% (726)</tspan> · <tspan class="known">37.93% (462)</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">59.69% (727)</tspan> · <tspan class="known">37.85% (461)</tspan> · <tspan class="todo">0% (0)</tspan> · <tspan class="unused">2.46% (30)</tspan></tspan></text>
<g transform="translate(0 20)">
<rect width="445.26" height="6" x="0" y="0" class="decompiled"/>
<rect width="283.34" height="6" x="445.26" y="0" class="known"/>
<rect width="445.87" height="6" x="0" y="0" class="decompiled"/>
<rect width="282.73" height="6" x="445.87" y="0" class="known"/>
<rect width="18.40" height="6" x="728.60" y="0" class="unused"/>
</g>
<g transform="translate(0 31)">
@ -429,7 +429,7 @@
<rect width="12" height="12" x="0" y="105" class="decompiled"><title>void __cdecl Inv_Ring_DoMotions(RING_INFO *ring);</title></rect>
<rect width="12" height="12" x="15" y="105" class="decompiled"><title>void __cdecl Inv_Ring_RotateLeft(RING_INFO *ring);</title></rect>
<rect width="12" height="12" x="30" y="105" class="decompiled"><title>void __cdecl Inv_Ring_RotateRight(RING_INFO *ring);</title></rect>
<rect width="12" height="12" x="45" y="105" class="known"><title>void __cdecl Inv_Ring_MotionInit(RING_INFO *ring, int16_t frames, int16_t status, int16_t status_target);</title></rect>
<rect width="12" height="12" x="45" y="105" class="decompiled"><title>void __cdecl Inv_Ring_MotionInit(RING_INFO *ring, int16_t frames, int16_t status, int16_t status_target);</title></rect>
<rect width="12" height="12" x="60" y="105" class="known"><title>void __cdecl Inv_Ring_MotionSetup(RING_INFO *ring, int16_t status, int16_t status_target, int16_t frames);</title></rect>
<rect width="12" height="12" x="75" y="105" class="known"><title>void __cdecl Inv_Ring_MotionRadius(RING_INFO *ring, int16_t target);</title></rect>
<rect width="12" height="12" x="90" y="105" class="known"><title>void __cdecl Inv_Ring_MotionRotation(RING_INFO *ring, int16_t rotation, int16_t target);</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">64.02%</tspan> · <tspan class="known">35.65%</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">64.05%</tspan> · <tspan class="known">35.62%</tspan> · <tspan class="todo">0%</tspan> · <tspan class="unused">0.33%</tspan></tspan></text>
<g transform="translate(0 20)">
<rect width="478.23" height="6" x="0" y="0" class="decompiled"/>
<rect width="266.33" height="6" x="478.23" y="0" class="known"/>
<rect width="478.44" height="6" x="0" y="0" class="decompiled"/>
<rect width="266.12" height="6" x="478.44" y="0" class="known"/>
<rect width="2.44" height="6" x="744.56" y="0" class="unused"/>
</g>
<g transform="translate(0 31)">
@ -2020,7 +2020,7 @@
<rect width="6.36" height="5.87" x="598.66" y="307.93" class="known"><title>void __thiscall SE_DrawBitmap(BITMAP_RESOURCE *bmpRsrc, HDC hdc, int32_t x, int32_t y);</title></rect>
<rect width="6.36" height="5.78" x="598.66" y="316.80" class="known"><title>void __cdecl swap_meshes_with_meshswap1(ITEM_INFO *item);</title></rect>
<rect width="6.36" height="5.78" x="598.66" y="325.58" class="known"><title>void __cdecl swap_meshes_with_meshswap2(ITEM_INFO *item);</title></rect>
<rect width="6.36" height="5.78" x="598.66" y="334.36" class="known"><title>void __cdecl Inv_Ring_MotionInit(RING_INFO *ring, int16_t frames, int16_t status, int16_t status_target);</title></rect>
<rect width="6.36" height="5.78" x="598.66" y="334.36" class="decompiled"><title>void __cdecl Inv_Ring_MotionInit(RING_INFO *ring, int16_t frames, int16_t status, int16_t status_target);</title></rect>
<rect width="6.36" height="5.78" x="598.66" y="343.14" class="known"><title>void __cdecl Inv_Ring_MotionItemDeselect(RING_INFO *ring, INVENTORY_ITEM *inv_item);</title></rect>
<rect width="6.36" height="5.69" x="598.66" y="351.92" class="known"><title>void __cdecl InitialiseStartInfo(void);</title></rect>
<rect width="6.36" height="5.69" x="598.66" y="360.62" class="known"><title>void __cdecl IncreaseScreenSize(void);</title></rect>

Before

Width:  |  Height:  |  Size: 364 KiB

After

Width:  |  Height:  |  Size: 364 KiB

View File

@ -3227,7 +3227,7 @@ typedef enum {
0x004251E0 0x013E + void __cdecl Inv_Ring_DoMotions(RING_INFO *ring);
0x00425320 0x002F + void __cdecl Inv_Ring_RotateLeft(RING_INFO *ring);
0x00425350 0x002F + void __cdecl Inv_Ring_RotateRight(RING_INFO *ring);
0x00425380 0x0063 - void __cdecl Inv_Ring_MotionInit(RING_INFO *ring, int16_t frames, int16_t status, int16_t status_target);
0x00425380 0x0063 + void __cdecl Inv_Ring_MotionInit(RING_INFO *ring, int16_t frames, int16_t status, int16_t status_target);
0x004253F0 0x002C - void __cdecl Inv_Ring_MotionSetup(RING_INFO *ring, int16_t status, int16_t status_target, int16_t frames);
0x00425420 0x0026 - void __cdecl Inv_Ring_MotionRadius(RING_INFO *ring, int16_t target);
0x00425450 0x0022 - void __cdecl Inv_Ring_MotionRotation(RING_INFO *ring, int16_t rotation, int16_t target);

View File

@ -188,3 +188,32 @@ void __cdecl Inv_Ring_RotateRight(RING_INFO *const ring)
ring->rot_count = RING_ROTATE_DURATION;
ring->rot_adder = ring->rot_adder_r;
}
void __cdecl Inv_Ring_MotionInit(
RING_INFO *const ring, const int16_t frames, const RING_STATUS status,
const RING_STATUS status_target)
{
IMOTION_INFO *const imo = ring->imo;
imo->count = frames;
imo->status = status;
imo->status_target = status_target;
imo->radius_target = 0;
imo->radius_rate = 0;
imo->camera_y_target = 0;
imo->camera_y_rate = 0;
imo->camera_pitch_target = 0;
imo->camera_pitch_rate = 0;
imo->rotate_target = 0;
imo->rotate_rate = 0;
imo->item_pt_x_rot_target = 0;
imo->item_pt_x_rot_rate = 0;
imo->item_x_rot_target = 0;
imo->item_x_rot_rate = 0;
imo->item_y_trans_target = 0;
imo->item_y_trans_rate = 0;
imo->item_z_trans_target = 0;
imo->item_z_trans_rate = 0;
imo->misc = 0;
}

View File

@ -11,3 +11,6 @@ void __cdecl Inv_Ring_CalcAdders(RING_INFO *ring, int16_t rotation_duration);
void __cdecl Inv_Ring_DoMotions(RING_INFO *ring);
void __cdecl Inv_Ring_RotateLeft(RING_INFO *ring);
void __cdecl Inv_Ring_RotateRight(RING_INFO *ring);
void __cdecl Inv_Ring_MotionInit(
RING_INFO *ring, int16_t frames, RING_STATUS status,
RING_STATUS status_target);

View File

@ -105,7 +105,6 @@
#define Inv_RemoveAllItems ((void __cdecl (*)(void))0x00424CB0)
#define Inv_RemoveItem ((int32_t __cdecl (*)(GAME_OBJECT_ID object_num))0x00424CD0)
#define RemoveInventoryText ((void __cdecl (*)(void))0x00424FD0)
#define Inv_Ring_MotionInit ((void __cdecl (*)(RING_INFO *ring, int16_t frames, int16_t status, int16_t status_target))0x00425380)
#define Inv_Ring_MotionSetup ((void __cdecl (*)(RING_INFO *ring, int16_t status, int16_t status_target, int16_t frames))0x004253F0)
#define Inv_Ring_MotionRadius ((void __cdecl (*)(RING_INFO *ring, int16_t target))0x00425420)
#define Inv_Ring_MotionRotation ((void __cdecl (*)(RING_INFO *ring, int16_t rotation, int16_t target))0x00425450)

View File

@ -629,6 +629,7 @@ static void Inject_Inventory(const bool enable)
INJECT(enable, 0x004251E0, Inv_Ring_DoMotions);
INJECT(enable, 0x00425320, Inv_Ring_RotateLeft);
INJECT(enable, 0x00425350, Inv_Ring_RotateRight);
INJECT(enable, 0x00425380, Inv_Ring_MotionInit);
}
static void Inject_Lara_Control(const bool enable)