Skip to content

Commit

Permalink
Decompile lib func_us_801B7C94 and func_us_801B7D10
Browse files Browse the repository at this point in the history
  • Loading branch information
gamezter committed Feb 26, 2025
1 parent 56b2469 commit 29bc856
Showing 1 changed file with 54 additions and 2 deletions.
56 changes: 54 additions & 2 deletions src/st/lib/unk_36F30.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,9 +705,61 @@ void func_us_801B6F30(Entity* self) {
}
}

INCLUDE_ASM("st/lib/nonmatchings/unk_36F30", func_us_801B7C94);
#ifdef VERSION_PSP
extern const char** D_us_8018181C;
extern const char** D_us_8018187C;
#else
extern const char* D_us_8018181C[];
extern const char* D_us_8018187C[];
#endif
extern u16 D_us_801818A8[];

const char* func_us_801B7C94(u16 itemId) {
const char* name;
if (itemId >= 0x80) {
itemId -= 0x80;
if (itemId < 0xA9) {
name = g_api.equipDefs[itemId].name;
} else {
itemId -= 0xA9;
name = g_api.accessoryDefs[itemId].name;
}
} else {
name = D_us_8018181C[itemId];
}
return name;
}

INCLUDE_ASM("st/lib/nonmatchings/unk_36F30", func_us_801B7D10);
#ifdef VERSION_PSP
Primitive* func_us_801B7D10(Primitive* prim, u16 arg1, s16 posX, s16 posY) {
s32 x = posX;
#else
Primitive* func_us_801B7D10(Primitive* prim, u16 arg1, s16 posY) {
s16 x = 0x84;
#endif
s16 y = 8;
s32 i;
if ((arg1 & 0xFFE0) == 0) {
#ifdef VERSION_PSP
prim = func_us_801B1064(prim, posX, posY, D_us_8018181C[0], 0x196);
#else
prim = func_us_801B1064(prim, 0x84, posY, D_us_8018181C[0], 0x159);
#endif
} else {
for (i = 0; i < 11; i++) {
if (arg1 & D_us_801818A8[i]) {
#ifdef VERSION_PSP
prim = func_us_801B1064(prim, x, posY, D_us_8018187C[i], 0x196);
x += 0x20;
#else
prim = func_us_801B1064(prim, x, posY, D_us_8018187C[i], 0x15C);
x += 0x1C;
#endif
}
}
}
return prim;
}

void func_us_801B7DF8(Primitive* arg0, Entity* arg1, s16 arg2);
INCLUDE_ASM("st/lib/nonmatchings/unk_36F30", func_us_801B7DF8);
Expand Down

0 comments on commit 29bc856

Please sign in to comment.