Skip to content

Commit

Permalink
Decompile lib func_us_801D064C (#2173)
Browse files Browse the repository at this point in the history
PSX: https://decomp.me/scratch/H7XJB
PSP: https://decomp.me/scratch/pxRRV

This function is very different from the others I'm used to decompile:

- line 66 - 73 : each `prim.uv` entry is on a separate line instead of
same line
- line 79 - 80 : `prim->drawMode` is assigned on two separate lines
- it uses 2 separate `tempEntity` variables that could have been 1

It 'feels' like this function was written early in development
  • Loading branch information
gamezter authored Feb 4, 2025
1 parent 6dac238 commit 49fb5a3
Show file tree
Hide file tree
Showing 3 changed files with 398 additions and 2 deletions.
17 changes: 17 additions & 0 deletions include/entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -2757,6 +2757,22 @@ typedef struct {
/* 0x88 */ u8 unk88[1]; // This is not the true size.
} ET_801B15C0;

typedef struct {
/* 0x7C */ struct Primitive* unk7C;
/* 0x80 */ u8 unk80;
/* 0x81 */ u8 unk81;
/* 0x82 */ u8 : 8;
/* 0x83 */ u8 : 8;
/* 0x84 */ u16 unk84;
/* 0x86 */ u16 : 16;
/* 0x88 */ u32 : 32;
/* 0x8C */ u32 : 32;
/* 0x90 */ u32 : 32;
/* 0x94 */ u32 : 32;
/* 0x98 */ u32 : 32;
/* 0x9C */ struct Entity* unk9C;
} ET_801D064C;

typedef union { // offset=0x7C
struct Primitive* prim;
ET_Placeholder ILLEGAL;
Expand Down Expand Up @@ -2998,6 +3014,7 @@ typedef union { // offset=0x7C
ET_Marionette marionette;
ET_801B6F30 et_801B6F30;
ET_801B15C0 et_801B15C0;
ET_801D064C et_801D064C;
} Ext;

#define SYNC_FIELD(struct1, struct2, field) \
Expand Down
2 changes: 2 additions & 0 deletions src/st/lib/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ typedef enum EntityIDs {
/* 0x44 */ E_SKELETON_THROWN_BONE,
/* 0x45 */ E_SKELETON_PIECES,
/* 0x48 */ E_ID_48 = 0x48,
/* 0x4D */ E_ID_4D = 0x4D,
/* 0x4E */ E_ID_4E,
} EntityIDs;

extern void EntityExplosionVariants(Entity* entity);
Expand Down
Loading

0 comments on commit 49fb5a3

Please sign in to comment.