port Inv_Ring_RotateRight

This commit is contained in:
Marcin Kurczewski 2024-09-05 16:48:02 +02:00
parent 06feb50ef4
commit f86ecca242
No known key found for this signature in database
GPG Key ID: CC65E6FD28CAE42A
6 changed files with 23 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.52% (725)</tspan> · <tspan class="known">38.01% (463)</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.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>
<g transform="translate(0 20)">
<rect width="444.64" height="6" x="0" y="0" class="decompiled"/>
<rect width="283.96" height="6" x="444.64" y="0" class="known"/>
<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="18.40" height="6" x="728.60" y="0" class="unused"/>
</g>
<g transform="translate(0 31)">
@ -428,7 +428,7 @@
<rect width="12" height="12" x="735" y="90" class="decompiled"><title>void __cdecl Inv_Ring_CalcAdders(RING_INFO *ring, int16_t rotation_duration);</title></rect>
<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="known"><title>void __cdecl Inv_Ring_RotateRight(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="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>
@ -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.01%</tspan> · <tspan class="known">35.67%</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.02%</tspan> · <tspan class="known">35.65%</tspan> · <tspan class="todo">0%</tspan> · <tspan class="unused">0.33%</tspan></tspan></text>
<g transform="translate(0 20)">
<rect width="478.12" height="6" x="0" y="0" class="decompiled"/>
<rect width="266.44" height="6" x="478.12" y="0" class="known"/>
<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="2.44" height="6" x="744.56" y="0" class="unused"/>
</g>
<g transform="translate(0 31)">
@ -2294,7 +2294,7 @@
<rect width="3.24" height="3.25" x="675.50" y="309.52" class="decompiled"><title>void __cdecl Creature_Initialise(int16_t item_num);</title></rect>
<rect width="3.24" height="3.25" x="675.50" y="315.77" class="decompiled"><title>int32_t __cdecl Room_FindGridShift(int32_t src, int32_t dst);</title></rect>
<rect width="3.24" height="3.25" x="675.50" y="322.02" class="decompiled"><title>void __cdecl Inv_Ring_RotateLeft(RING_INFO *ring);</title></rect>
<rect width="3.24" height="3.25" x="675.50" y="328.27" class="known"><title>void __cdecl Inv_Ring_RotateRight(RING_INFO *ring);</title></rect>
<rect width="3.24" height="3.25" x="675.50" y="328.27" class="decompiled"><title>void __cdecl Inv_Ring_RotateRight(RING_INFO *ring);</title></rect>
<rect width="3.24" height="3.25" x="675.50" y="334.52" class="decompiled"><title>void __cdecl Lara_State_SwanDive(ITEM_INFO *item, COLL_INFO *coll);</title></rect>
<rect width="3.24" height="3.25" x="675.50" y="340.77" class="known"><title>void __cdecl BridgeTilt2Floor(ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int32_t *height);</title></rect>
<rect width="3.24" height="3.25" x="675.50" y="347.02" class="unused"><title>sub_4471C0</title></rect>

Before

Width:  |  Height:  |  Size: 364 KiB

After

Width:  |  Height:  |  Size: 364 KiB

View File

@ -3226,7 +3226,7 @@ typedef enum {
0x004251B0 0x002C + void __cdecl Inv_Ring_CalcAdders(RING_INFO *ring, int16_t rotation_duration);
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);
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);
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);

View File

@ -176,3 +176,15 @@ void __cdecl Inv_Ring_RotateLeft(RING_INFO *const ring)
ring->rot_count = RING_ROTATE_DURATION;
ring->rot_adder = ring->rot_adder_l;
}
void __cdecl Inv_Ring_RotateRight(RING_INFO *const ring)
{
ring->rotating = 1;
if (ring->current_object + 1 >= ring->number_of_objects) {
ring->target_object = 0;
} else {
ring->target_object = ring->current_object + 1;
}
ring->rot_count = RING_ROTATE_DURATION;
ring->rot_adder = ring->rot_adder_r;
}

View File

@ -10,3 +10,4 @@ void __cdecl Inv_Ring_Light(const RING_INFO *ring);
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);

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_RotateRight ((void __cdecl (*)(RING_INFO *ring))0x00425350)
#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)

View File

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