Skip to content

Commit

Permalink
Partially match itcoin (doldecomp#1380)
Browse files Browse the repository at this point in the history
* dump all functions and clean matches + table.

* create `CoinVars` and add to `xDD4_itemVar` in `struct Item`

* match `it_802F14E4`

* match `it_802F1518`. also declaration changes for externed functions

* match `it_802F15B8`

* match `it_802F1888`

* match `it_802F2020`

* match the logic for `it_802F202C`. maybe missing global/exeterned float

* match `it_802F1F48` and modify `padding_x7C` in `struct Item`

* match `it_802F1C70` and add `itCoinAttributes`

* replace M2C fields with `attr` access in `it_802F1910`

* float replacement in `it_802F1910`

* 99% of `it_802F1910`

* match `it_802F13B4`

* use `GET_JOBJ` in `it_802F1888`

* match 77% of `it_802F1CE0` using inlines

* match 77% of `it_802F1630`. same issues as `it_802F1CE0`

* clean `it_802F2094` with inlines

* remove externed floats

* 98% of `it_802F2094`. register allocation moment

* function declarations

* remove `M2C_FIELD` in `it_802F13B4`

* change declaration for `it_802F2094` in `it_27CF.h`

* fix usages for `it_802F2094`

* scopes in `symbols.txt`

* 92% of `it_802F202C`

* fix floats in `it_802F1F48`

* match `it_802F2094`

* match `it_802F202C`

* remove `M2C_FIELD` in `it_802F13B4`

* if statement clarity in `it_802F1910`

* fix comment for `un_8031C5E4`

* update `grfigureget.h`

* update `gm_1601.h`

* update `grfigureget.h` again

* update `it_2725.h`

* update `tydisplay.h`

* fix typo functions and update declaration for `un_8031C5E4`

* float scopes

* revert scope for `it_804DD9B0 `

* declaration fix in `grfigureget.h`

* run `gen_header` for `tydisplay.h`

* proper type usage

* Update src/melee/ty/tydisplay.h
  • Loading branch information
wyatt-avilla authored Mar 15, 2024
1 parent f44d526 commit 2cc16ed
Show file tree
Hide file tree
Showing 12 changed files with 516 additions and 30 deletions.
50 changes: 25 additions & 25 deletions config/GALE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17376,30 +17376,30 @@ it_802F13B0 = .text:0x802F13B0; // type:function size:0x4 scope:global
it_802F13B4 = .text:0x802F13B4; // type:function size:0x130 scope:global
it_802F14E4 = .text:0x802F14E4; // type:function size:0x34 scope:global
it_802F1518 = .text:0x802F1518; // type:function size:0x70 scope:global
it_802F1588 = .text:0x802F1588; // type:function size:0x28 scope:global
it_802F15B0 = .text:0x802F15B0; // type:function size:0x8 scope:global
it_802F15B8 = .text:0x802F15B8; // type:function size:0x4C scope:global
it_802F1604 = .text:0x802F1604; // type:function size:0x2C scope:global
it_802F1630 = .text:0x802F1630; // type:function size:0x220 scope:global
it_802F1850 = .text:0x802F1850; // type:function size:0x8 scope:global
it_802F1858 = .text:0x802F1858; // type:function size:0x4 scope:global
it_802F185C = .text:0x802F185C; // type:function size:0x2C scope:global
it_802F1588 = .text:0x802F1588; // type:function size:0x28 scope:local
it_802F15B0 = .text:0x802F15B0; // type:function size:0x8 scope:local
it_802F15B8 = .text:0x802F15B8; // type:function size:0x4C scope:local
it_802F1604 = .text:0x802F1604; // type:function size:0x2C scope:local
it_802F1630 = .text:0x802F1630; // type:function size:0x220 scope:local
it_802F1850 = .text:0x802F1850; // type:function size:0x8 scope:local
it_802F1858 = .text:0x802F1858; // type:function size:0x4 scope:local
it_802F185C = .text:0x802F185C; // type:function size:0x2C scope:local
it_802F1888 = .text:0x802F1888; // type:function size:0x5C scope:global
it_802F18E4 = .text:0x802F18E4; // type:function size:0x8 scope:global
it_802F18EC = .text:0x802F18EC; // type:function size:0x4 scope:global
it_802F18E4 = .text:0x802F18E4; // type:function size:0x8 scope:local
it_802F18EC = .text:0x802F18EC; // type:function size:0x4 scope:local
it_802F18F0 = .text:0x802F18F0; // type:function size:0x20 scope:global
it_802F1910 = .text:0x802F1910; // type:function size:0x358 scope:global
it_802F1C68 = .text:0x802F1C68; // type:function size:0x8 scope:global
it_802F1C70 = .text:0x802F1C70; // type:function size:0x44 scope:global
it_802F1CB4 = .text:0x802F1CB4; // type:function size:0x2C scope:global
it_802F1C68 = .text:0x802F1C68; // type:function size:0x8 scope:local
it_802F1C70 = .text:0x802F1C70; // type:function size:0x44 scope:local
it_802F1CB4 = .text:0x802F1CB4; // type:function size:0x2C scope:local
it_802F1CE0 = .text:0x802F1CE0; // type:function size:0x204 scope:global
it_802F1EE4 = .text:0x802F1EE4; // type:function size:0x8 scope:global
it_802F1EEC = .text:0x802F1EEC; // type:function size:0x30 scope:global
it_802F1F1C = .text:0x802F1F1C; // type:function size:0x2C scope:global
it_802F1EE4 = .text:0x802F1EE4; // type:function size:0x8 scope:local
it_802F1EEC = .text:0x802F1EEC; // type:function size:0x30 scope:local
it_802F1F1C = .text:0x802F1F1C; // type:function size:0x2C scope:local
it_802F1F48 = .text:0x802F1F48; // type:function size:0x8C scope:global
it_802F1FD4 = .text:0x802F1FD4; // type:function size:0x8 scope:global
it_802F1FDC = .text:0x802F1FDC; // type:function size:0x4 scope:global
it_802F1FE0 = .text:0x802F1FE0; // type:function size:0x34 scope:global
it_802F1FD4 = .text:0x802F1FD4; // type:function size:0x8 scope:local
it_802F1FDC = .text:0x802F1FDC; // type:function size:0x4 scope:local
it_802F1FE0 = .text:0x802F1FE0; // type:function size:0x34 scope:local
it_802F2014 = .text:0x802F2014; // type:function size:0xC scope:global
it_802F2020 = .text:0x802F2020; // type:function size:0xC scope:global
it_802F202C = .text:0x802F202C; // type:function size:0x68 scope:global
Expand Down Expand Up @@ -33044,12 +33044,12 @@ it_804DD9A0 = .sdata2:0x804DD9A0; // type:object size:0x4 scope:global data:floa
it_804DD9A8 = .sdata2:0x804DD9A8; // type:object size:0x4 scope:global data:float
it_804DD9AC = .sdata2:0x804DD9AC; // type:object size:0x4 scope:global data:float
it_804DD9B0 = .sdata2:0x804DD9B0; // type:object size:0x4 scope:global data:float
it_804DD9B8 = .sdata2:0x804DD9B8; // type:object size:0x4 scope:global data:float
it_804DD9BC = .sdata2:0x804DD9BC; // type:object size:0x4 scope:global data:float
it_804DD9C0 = .sdata2:0x804DD9C0; // type:object size:0x4 scope:global data:float
it_804DD9C4 = .sdata2:0x804DD9C4; // type:object size:0x4 scope:global data:float
it_804DD9C8 = .sdata2:0x804DD9C8; // type:object size:0x8 scope:global data:double
it_804DD9D0 = .sdata2:0x804DD9D0; // type:object size:0x4 scope:global data:float
it_804DD9B8 = .sdata2:0x804DD9B8; // type:object size:0x4 scope:local data:float
it_804DD9BC = .sdata2:0x804DD9BC; // type:object size:0x4 scope:local data:float
it_804DD9C0 = .sdata2:0x804DD9C0; // type:object size:0x4 scope:local data:float
it_804DD9C4 = .sdata2:0x804DD9C4; // type:object size:0x4 scope:local data:float
it_804DD9C8 = .sdata2:0x804DD9C8; // type:object size:0x8 scope:local data:double
it_804DD9D0 = .sdata2:0x804DD9D0; // type:object size:0x4 scope:local data:float
it_804DD9D8 = .sdata2:0x804DD9D8; // type:object size:0x4 scope:global data:float
it_804DD9DC = .sdata2:0x804DD9DC; // type:object size:0x4 scope:global data:float
it_804DD9E0 = .sdata2:0x804DD9E0; // type:object size:0x8 scope:global data:double
Expand Down
1 change: 1 addition & 0 deletions src/melee/gm/gm_1601.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
/* 16C6C0 */ /* static */ UNK_RET gm_8016C6C0(UNK_PARAMS);
/* 16C75C */ /* static */ UNK_RET gm_8016C75C(UNK_PARAMS);
/* 17E068 */ bool gm_8017E068(void);
/* 17E280 */ UNK_T gm_8017E280(u16, M2C_UNK);
/* 18841C */ bool gm_8018841C(void);
/* 473A18 */ extern UNK_T gm_80473A18;

Expand Down
7 changes: 7 additions & 0 deletions src/melee/gr/grfigureget.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#ifndef GALE01_219530
#define GALE01_219530

#include <platform.h>

#include <placeholder.h>

int grFigureGet_80219C50(s32);
UNK_T grFigureGet_80219C34(s32);

#endif
4 changes: 2 additions & 2 deletions src/melee/gr/ground.c
Original file line number Diff line number Diff line change
Expand Up @@ -2755,10 +2755,10 @@ void Ground_801C5878(void)
}
}

s32 Ground_801C58E0(s32 arg0, s32 arg1)
Item_GObj* Ground_801C58E0(s32 arg0, s32 arg1)
{
s32 tmp = arg0;
s32 result;
Item_GObj* result;
Vec3 sp10;
Ground_801C2D24(arg1, &sp10);
result = it_802F2094(0, &sp10, tmp, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/melee/gr/ground.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
/* 1C57F0 */ f32 Ground_801C57F0(void);
/* 1C5800 */ void Ground_801C5800(void);
/* 1C5840 */ s32 Ground_801C5840(void);
/* 1C58E0 */ s32 Ground_801C58E0(s32, s32);
/* 1C58E0 */ Item_GObj* Ground_801C58E0(s32, s32);
/* 1C5940 */ int Ground_801C5940(void);
/* 1C5A28 */ void Ground_801C5A28(void);
/* 1C5A60 */ void Ground_801C5A60(void);
Expand Down
31 changes: 31 additions & 0 deletions src/melee/it/itCommonItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,35 @@ typedef struct MewVars {
f32 xC;
} MewVars;

typedef struct itCoinAttributes {
f32 x0;
f32 x4;
f32 x8;
f32 xC;
f32 x10;
f32 x14;
f32 x18;
f32 x1C;
f32 x20;
f32 x24;
f32 x28;
f32 x2C;
f32 x30;
f32 x34;
f32 x38;
f32 x3C;
f32 x40;
f32 x44;
f32 x48;
} itCoinAttributes;

typedef struct CoinVars {
int x0;
int x4;
f32 x8;
f32 xC;
int x10;
int x14;
} CoinVars;

#endif
2 changes: 2 additions & 0 deletions src/melee/it/it_2725.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
/* 27ADEC */ M2C_UNK it_8027ADEC(M2C_UNK, Item_GObj*, HSD_JObj*, f32);
/* 27B070 */ void it_8027B070(Item_GObj* gobj, Fighter_GObj* owner_gobj);
/* 27B378 */ void it_8027B378(Fighter_GObj*, Item_GObj*, float);
/* 27B798 */ UNK_T it_8027B798(Item_GObj*, Vec3*);
/* 27C56C */ void it_8027C56C(Item_GObj*, f32);
/* 27C8B0 */ void it_8027C8B0(Item_GObj*);
/* 27CBFC */ f32 it_8027CBFC(Item_GObj*);
/* 27CE44 */ void it_8027CE44(Item_GObj*);
/* 3F14C4 */ extern struct ItemLogicTable it_803F14C4[43];
/* 3F23CC */ extern struct ItemLogicTable it_803F23CC[];
Expand Down
2 changes: 1 addition & 1 deletion src/melee/it/items/it_27CF.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
/* 2F046C */ void it_802F046C(s32);
/* 2F0AE0 */ void it_802F0AE0(Item_GObj* fighter_gobj, Vec3*, Vec3*, enum_t,
bool, float facing_dir, float, float);
/* 2F2094 */ s32 it_802F2094(s32, Vec3*, s32, s32);
/* 2F2094 */ Item_GObj* it_802F2094(int, Vec3*, int, int);
/* 2F3330 */ bool it_802F3330(Item_GObj*);
/* 2F3374 */ void it_802F3374(Item_GObj*, Item_GObj*);
/* 3F94A0 */ extern ItemStateTable it_803F94A0[];
Expand Down
Loading

0 comments on commit 2cc16ed

Please sign in to comment.