port RemoveInventoryText

This commit is contained in:
rr- 2021-03-01 23:44:50 +01:00
parent 46951faa98
commit c305ff43f3
5 changed files with 25 additions and 11 deletions

View file

@ -300,7 +300,7 @@
<rect width="12.00" height="12.00" x="658.00" y="87.00" fill="forestgreen"/>
<rect width="12.00" height="12.00" x="672.00" y="87.00" fill="forestgreen"/>
<rect width="12.00" height="12.00" x="686.00" y="87.00" fill="forestgreen"/>
<rect width="12.00" height="12.00" x="0.00" y="101.00" fill="lightpink"/>
<rect width="12.00" height="12.00" x="0.00" y="101.00" fill="forestgreen"/>
<rect width="12.00" height="12.00" x="14.00" y="101.00" fill="lightpink"/>
<rect width="12.00" height="12.00" x="28.00" y="101.00" fill="lightpink"/>
<rect width="12.00" height="12.00" x="42.00" y="101.00" fill="lightpink"/>
@ -1337,7 +1337,7 @@
<rect width="3.21" height="3.88" x="682.62" y="484.46" fill="lightpink"/>
<rect width="3.08" height="3.88" x="687.83" y="484.46" fill="forestgreen"/>
<rect width="3.08" height="3.88" x="692.92" y="484.46" fill="forestgreen"/>
<rect width="3.57" height="3.37" x="649.83" y="490.34" fill="lightpink"/>
<rect width="3.57" height="3.37" x="649.83" y="490.34" fill="forestgreen"/>
<rect width="3.57" height="3.37" x="649.83" y="495.71" fill="forestgreen"/>
<rect width="3.57" height="3.37" x="649.83" y="501.08" fill="mistyrose"/>
<rect width="3.57" height="3.37" x="649.83" y="506.45" fill="lightpink"/>
@ -1463,10 +1463,10 @@
<rect width="-0.06" height="-0.07" x="694.51" y="536.07" fill="mistyrose"/>
<rect width="-0.45" height="-0.55" x="696.45" y="536.07" fill="mistyrose"/>
<rect width="-0.45" height="-1.52" x="696.45" y="537.52" fill="lightpink"/>
<rect width="12.00" height="12.00" x="0.00" y="564.50" fill="forestgreen"/><text alignment-baseline="central" x="17.00" y="570.50" style="font-family: sans-serif; font-size: 15px">Functions decompiled (count): 43.37%</text>
<rect width="12.00" height="12.00" x="0.00" y="582.50" fill="forestgreen"/><text alignment-baseline="central" x="17.00" y="588.50" style="font-family: sans-serif; font-size: 15px">Functions decompiled (bytesize): 43.33%</text>
<rect width="12.00" height="12.00" x="0.00" y="600.50" fill="lightpink"/><text alignment-baseline="central" x="17.00" y="606.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, but with known names (count): 42.54%</text>
<rect width="12.00" height="12.00" x="0.00" y="618.50" fill="lightpink"/><text alignment-baseline="central" x="17.00" y="624.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, but with known names (bytesize): 40.84%</text>
<rect width="12.00" height="12.00" x="0.00" y="564.50" fill="forestgreen"/><text alignment-baseline="central" x="17.00" y="570.50" style="font-family: sans-serif; font-size: 15px">Functions decompiled (count): 43.50%</text>
<rect width="12.00" height="12.00" x="0.00" y="582.50" fill="forestgreen"/><text alignment-baseline="central" x="17.00" y="588.50" style="font-family: sans-serif; font-size: 15px">Functions decompiled (bytesize): 43.35%</text>
<rect width="12.00" height="12.00" x="0.00" y="600.50" fill="lightpink"/><text alignment-baseline="central" x="17.00" y="606.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, but with known names (count): 42.41%</text>
<rect width="12.00" height="12.00" x="0.00" y="618.50" fill="lightpink"/><text alignment-baseline="central" x="17.00" y="624.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, but with known names (bytesize): 40.82%</text>
<rect width="12.00" height="12.00" x="0.00" y="636.50" fill="mistyrose"/><text alignment-baseline="central" x="17.00" y="642.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, with unknown names (count): 14.09%</text>
<rect width="12.00" height="12.00" x="0.00" y="654.50" fill="mistyrose"/><text alignment-baseline="central" x="17.00" y="660.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, with unknown names (bytesize): 15.83%</text>
</svg>

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Before After
Before After

View file

@ -414,7 +414,7 @@ Inv_RequestItem 0x00421200 0x00000077 +
Inv_RemoveAllItems 0x00421280 0x0000001E +
Inv_RemoveItem 0x004212A0 0x00000110 +
Inv_GetItemOption 0x004213B0 0x000000A7 +
RemoveInventoryText 0x00421550 0x00000028 *
RemoveInventoryText 0x00421550 0x00000028 +
Inv_RingInit 0x00421580 0x0000017E *
Inv_RingGetView 0x00421700 0x00000060 *
Inv_RingLight 0x00421760 0x00000040 *

View file

@ -5,7 +5,6 @@
#include <stdint.h>
// clang-format off
#define RemoveInventoryText ((void (*)())0x00421550)
#define Inv_RingInit ((void (*)(RING_INFO* ring, int16_t type, INVENTORY_ITEM** list, int16_t qty, int16_t current, IMOTION_INFO* imo))0x00421580)
#define Inv_RingGetView ((void (*)(RING_INFO* ring, PHD_3DPOS* viewer))0x00421700)
#define Inv_RingLight ((void (*)(RING_INFO* ring))0x00421760)
@ -41,6 +40,7 @@ int32_t Inv_RequestItem(int item_num);
void Inv_RemoveAllItems();
int32_t Inv_RemoveItem(int32_t item_num);
int32_t Inv_GetItemOption(int32_t item_num);
void RemoveInventoryText();
void T1MInjectGameInvEntry();
void T1MInjectGameInvFunc();

View file

@ -6,9 +6,6 @@
#include "specific/shed.h"
#include "util.h"
#define IT_NAME 0
#define IT_QTY 1
void InitColours()
{
InvColours[IC_BLACK] = S_Colour(0, 0, 0);
@ -659,6 +656,16 @@ int32_t Inv_GetItemOption(int32_t item_num)
return -1;
}
void RemoveInventoryText()
{
for (int i = 0; i < IT_NUMBER_OF; i++) {
if (InvItemText[i]) {
T_RemovePrint(InvItemText[i]);
InvItemText[i] = NULL;
}
}
}
void T1MInjectGameInvFunc()
{
INJECT(0x0041FEF0, InitColours);
@ -672,4 +679,5 @@ void T1MInjectGameInvFunc()
INJECT(0x00421280, Inv_RemoveAllItems);
INJECT(0x004212A0, Inv_RemoveItem);
INJECT(0x004213B0, Inv_GetItemOption);
INJECT(0x00421550, RemoveInventoryText);
}

View file

@ -745,6 +745,12 @@ typedef enum {
IC_NUMBER_OF = 17,
} INV_COLOUR;
typedef enum {
IT_NAME = 0,
IT_QTY = 1,
IT_NUMBER_OF = 2,
} INV_TEXT;
#pragma pack(push, 1)
typedef struct {