Skip to content

Commit

Permalink
Decompile RIC func_801719A4 (#827)
Browse files Browse the repository at this point in the history
This is a pretty big function, and I'll admit that my code for it is
pretty low quality. But it matches. Scratch is here if you'd like to
make improvements:

https://decomp.me/scratch/xok2Z

A lot of the things that I tried to remove the gotos and temp variables
didn't work.

The entity extension for this uses f32 variables. Those are defined in
`game.h`, but `game.h` is not accessible to `entity.h`, so I moved the
definition of f32 to `types.h` which is accessible in all places and
overall seems like a better place for it anyway.
  • Loading branch information
bismurphy authored Dec 11, 2023
1 parent 968a14a commit 85d0ad5
Show file tree
Hide file tree
Showing 6 changed files with 459 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config/splat.us.ric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ segments:
- [0x1AB68, .rodata, 32324]
- [0x1AB88, rodata]
- [0x1ABC8, .rodata, 345EC]
- [0x1AC30, rodata]
- [0x1AC50, rodata]
- [0x1AC60, c, 1AC60]
- [0x1F348, c, 1F348]
- [0x1FCD0, c, 1FCD0]
Expand Down
18 changes: 18 additions & 0 deletions include/entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,23 @@ typedef struct {
s16 unk7E;
} ET_8017161C;

typedef struct {
s16 unk7C;
s16 unk7E;
s16 unk80;
s16 unk82;
f32 unk84;
s32 unk88;
s32 unk8C;
s16 unk90;
s16 unk92;
s16 unk94;
s16 unk96;
struct Entity* unk98;
s32 pad[5];
s16 unkB0;
} ET_801719A4;

typedef union {
/* 0x7C */ struct Primitive* prim;
/* 0x7C */ ET_EntFactory factory;
Expand Down Expand Up @@ -603,6 +620,7 @@ typedef union {
/* 0x7C */ ET_8017091C et_8017091C;
/* 0x7C */ ET_80170F64 et_80170F64;
/* 0x7C */ ET_8017161C et_8017161C;
/* 0x7C */ ET_801719A4 et_801719A4;
/* 0x7C */ ET_801CF254 et_801CF254;
/* 0x7C */ ET_GurkhaSword gurkhaSword;
/* 0x7C */ ET_Dracula dracula;
Expand Down
8 changes: 0 additions & 8 deletions include/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -455,14 +455,6 @@ struct Entity;

typedef void (*PfnEntityUpdate)(struct Entity*);

typedef union {
s32 val;
struct {
s16 lo;
s16 hi;
} i;
} f32;

#include "unkstruct.h"

typedef struct {
Expand Down
8 changes: 8 additions & 0 deletions include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,12 @@ typedef enum { false, true } bool;
#define NULL (0)
#endif

typedef union {
s32 val;
struct {
s16 lo;
s16 hi;
} i;
} f32;

#endif
Loading

0 comments on commit 85d0ad5

Please sign in to comment.