diff --git a/config/GALE01/symbols.txt b/config/GALE01/symbols.txt index 0eb930cb28..8a7b689a51 100644 --- a/config/GALE01/symbols.txt +++ b/config/GALE01/symbols.txt @@ -28774,83 +28774,83 @@ ftCo_804D87C4 = .sdata2:0x804D87C4; // type:object size:0x4 scope:global data:fl ftCo_804D87C8 = .sdata2:0x804D87C8; // type:object size:0x4 scope:global data:float ftCo_804D87CC = .sdata2:0x804D87CC; // type:object size:0x4 scope:global data:float ftCo_804D87D0 = .sdata2:0x804D87D0; // type:object size:0x4 scope:global data:float -ftCo_804D87D8 = .sdata2:0x804D87D8; // type:object size:0x4 scope:global data:float -ftCo_804D87E0 = .sdata2:0x804D87E0; // type:object size:0x8 scope:global data:double -ftCo_804D87E8 = .sdata2:0x804D87E8; // type:object size:0x4 scope:global data:float -ftCo_804D87EC = .sdata2:0x804D87EC; // type:object size:0x4 scope:global data:float -ftCo_804D87F0 = .sdata2:0x804D87F0; // type:object size:0x4 scope:global data:float -ftCo_804D87F8 = .sdata2:0x804D87F8; // type:object size:0x8 scope:global data:double -ftCo_804D8800 = .sdata2:0x804D8800; // type:object size:0x8 scope:global data:double -ftCo_804D8808 = .sdata2:0x804D8808; // type:object size:0x4 scope:global data:float -ftCo_804D8810 = .sdata2:0x804D8810; // type:object size:0x8 scope:global data:double -ftCo_804D8818 = .sdata2:0x804D8818; // type:object size:0x8 scope:global data:double -ftCo_804D8820 = .sdata2:0x804D8820; // type:object size:0x8 scope:global data:double -ftCo_804D8828 = .sdata2:0x804D8828; // type:object size:0x8 scope:global data:double -ftCo_804D8830 = .sdata2:0x804D8830; // type:object size:0x8 scope:global data:double -ftCo_804D8838 = .sdata2:0x804D8838; // type:object size:0x4 scope:global data:float -ftCo_804D8840 = .sdata2:0x804D8840; // type:object size:0x8 scope:global data:double -ftCo_804D8848 = .sdata2:0x804D8848; // type:object size:0x4 scope:global data:float -ftCo_804D884C = .sdata2:0x804D884C; // type:object size:0x4 scope:global data:float -ftCo_804D8850 = .sdata2:0x804D8850; // type:object size:0x4 scope:global data:float -ftCo_804D8854 = .sdata2:0x804D8854; // type:object size:0x4 scope:global data:float -ftCo_804D8858 = .sdata2:0x804D8858; // type:object size:0x4 scope:global data:float -ftCo_804D8860 = .sdata2:0x804D8860; // type:object size:0x8 scope:global data:double -ftCo_804D8868 = .sdata2:0x804D8868; // type:object size:0x4 scope:global data:float -ftCo_804D886C = .sdata2:0x804D886C; // type:object size:0x4 scope:global data:float -ftCo_804D8870 = .sdata2:0x804D8870; // type:object size:0x4 scope:global data:float -ftCo_804D8874 = .sdata2:0x804D8874; // type:object size:0x4 scope:global data:float -ftCo_804D8878 = .sdata2:0x804D8878; // type:object size:0x8 scope:global data:double -ftCo_804D8880 = .sdata2:0x804D8880; // type:object size:0x4 scope:global data:float -ftCo_804D8884 = .sdata2:0x804D8884; // type:object size:0x4 scope:global data:float -ftCo_804D8888 = .sdata2:0x804D8888; // type:object size:0x4 scope:global data:float -ftCo_804D888C = .sdata2:0x804D888C; // type:object size:0x4 scope:global data:float -ftCo_804D8890 = .sdata2:0x804D8890; // type:object size:0x4 scope:global data:float -ftCo_804D8898 = .sdata2:0x804D8898; // type:object size:0x8 scope:global data:double -ftCo_804D88A0 = .sdata2:0x804D88A0; // type:object size:0x8 scope:global data:double -ftCo_804D88A8 = .sdata2:0x804D88A8; // type:object size:0x4 scope:global data:float -ftCo_804D88B0 = .sdata2:0x804D88B0; // type:object size:0x8 scope:global data:double -ftCo_804D88B8 = .sdata2:0x804D88B8; // type:object size:0x8 scope:global data:double -ftCo_804D88C0 = .sdata2:0x804D88C0; // type:object size:0x8 scope:global data:double -ftCo_804D88C8 = .sdata2:0x804D88C8; // type:object size:0x4 scope:global data:float -ftCo_804D88D0 = .sdata2:0x804D88D0; // type:object size:0x8 scope:global data:double -ftCo_804D88D8 = .sdata2:0x804D88D8; // type:object size:0x4 scope:global data:float -ftCo_804D88E0 = .sdata2:0x804D88E0; // type:object size:0x8 scope:global data:double -ftCo_804D88E8 = .sdata2:0x804D88E8; // type:object size:0x4 scope:global data:float -ftCo_804D88EC = .sdata2:0x804D88EC; // type:object size:0x4 scope:global data:float -ftCo_804D88F0 = .sdata2:0x804D88F0; // type:object size:0x8 scope:global data:double -ftCo_804D88F8 = .sdata2:0x804D88F8; // type:object size:0x8 scope:global data:double -ftCo_804D8900 = .sdata2:0x804D8900; // type:object size:0x8 scope:global data:double -ftCo_804D8908 = .sdata2:0x804D8908; // type:object size:0x4 scope:global data:float -ftCo_804D890C = .sdata2:0x804D890C; // type:object size:0x4 scope:global data:float -ftCo_804D8910 = .sdata2:0x804D8910; // type:object size:0x4 scope:global data:float -ftCo_804D8914 = .sdata2:0x804D8914; // type:object size:0x4 scope:global data:float -ftCo_804D8918 = .sdata2:0x804D8918; // type:object size:0x4 scope:global data:float -ftCo_804D891C = .sdata2:0x804D891C; // type:object size:0x4 scope:global data:float -ftCo_804D8920 = .sdata2:0x804D8920; // type:object size:0x8 scope:global data:double -ftCo_804D8928 = .sdata2:0x804D8928; // type:object size:0x4 scope:global data:float -ftCo_804D892C = .sdata2:0x804D892C; // type:object size:0x4 scope:global data:float -ftCo_804D8930 = .sdata2:0x804D8930; // type:object size:0x4 scope:global data:float -ftCo_804D8934 = .sdata2:0x804D8934; // type:object size:0x4 scope:global data:float -ftCo_804D8938 = .sdata2:0x804D8938; // type:object size:0x4 scope:global data:float -ftCo_804D8940 = .sdata2:0x804D8940; // type:object size:0x8 scope:global data:double -ftCo_804D8948 = .sdata2:0x804D8948; // type:object size:0x4 scope:global data:float -ftCo_804D894C = .sdata2:0x804D894C; // type:object size:0x4 scope:global data:float -ftCo_804D8950 = .sdata2:0x804D8950; // type:object size:0x4 scope:global data:float -ftCo_804D8958 = .sdata2:0x804D8958; // type:object size:0x8 scope:global data:double -ftCo_804D8960 = .sdata2:0x804D8960; // type:object size:0x8 scope:global data:double -ftCo_804D8968 = .sdata2:0x804D8968; // type:object size:0x4 scope:global data:float -ftCo_804D8970 = .sdata2:0x804D8970; // type:object size:0x8 scope:global data:double -ftCo_804D8978 = .sdata2:0x804D8978; // type:object size:0x8 scope:global data:double -ftCo_804D8980 = .sdata2:0x804D8980; // type:object size:0x8 scope:global data:double -ftCo_804D8988 = .sdata2:0x804D8988; // type:object size:0x8 scope:global data:double -ftCo_804D8990 = .sdata2:0x804D8990; // type:object size:0x8 scope:global data:double -ftCo_804D8998 = .sdata2:0x804D8998; // type:object size:0x8 scope:global data:double -ftCo_804D89A0 = .sdata2:0x804D89A0; // type:object size:0x8 scope:global data:double -ftCo_804D89A8 = .sdata2:0x804D89A8; // type:object size:0x4 scope:global data:float -ftCo_804D89B0 = .sdata2:0x804D89B0; // type:object size:0x8 scope:global data:double -ftCo_804D89B8 = .sdata2:0x804D89B8; // type:object size:0x8 scope:global data:double -ftCo_804D89C0 = .sdata2:0x804D89C0; // type:object size:0x4 scope:global data:float -ftCo_804D89C4 = .sdata2:0x804D89C4; // type:object size:0x4 scope:global data:float +ftCo_804D87D8 = .sdata2:0x804D87D8; // type:object size:0x4 scope:local data:float +ftCo_804D87E0 = .sdata2:0x804D87E0; // type:object size:0x8 scope:local data:double +ftCo_804D87E8 = .sdata2:0x804D87E8; // type:object size:0x4 scope:local data:float +ftCo_804D87EC = .sdata2:0x804D87EC; // type:object size:0x4 scope:local data:float +ftCo_804D87F0 = .sdata2:0x804D87F0; // type:object size:0x4 scope:local data:float +ftCo_804D87F8 = .sdata2:0x804D87F8; // type:object size:0x8 scope:local data:double +ftCo_804D8800 = .sdata2:0x804D8800; // type:object size:0x8 scope:local data:double +ftCo_804D8808 = .sdata2:0x804D8808; // type:object size:0x4 scope:local data:float +ftCo_804D8810 = .sdata2:0x804D8810; // type:object size:0x8 scope:local data:double +ftCo_804D8818 = .sdata2:0x804D8818; // type:object size:0x8 scope:local data:double +ftCo_804D8820 = .sdata2:0x804D8820; // type:object size:0x8 scope:local data:double +ftCo_804D8828 = .sdata2:0x804D8828; // type:object size:0x8 scope:local data:double +ftCo_804D8830 = .sdata2:0x804D8830; // type:object size:0x8 scope:local data:double +ftCo_804D8838 = .sdata2:0x804D8838; // type:object size:0x4 scope:local data:float +ftCo_804D8840 = .sdata2:0x804D8840; // type:object size:0x8 scope:local data:double +ftCo_804D8848 = .sdata2:0x804D8848; // type:object size:0x4 scope:local data:float +ftCo_804D884C = .sdata2:0x804D884C; // type:object size:0x4 scope:local data:float +ftCo_804D8850 = .sdata2:0x804D8850; // type:object size:0x4 scope:local data:float +ftCo_804D8854 = .sdata2:0x804D8854; // type:object size:0x4 scope:local data:float +ftCo_804D8858 = .sdata2:0x804D8858; // type:object size:0x4 scope:local data:float +ftCo_804D8860 = .sdata2:0x804D8860; // type:object size:0x8 scope:local data:double +ftCo_804D8868 = .sdata2:0x804D8868; // type:object size:0x4 scope:local data:float +ftCo_804D886C = .sdata2:0x804D886C; // type:object size:0x4 scope:local data:float +ftCo_804D8870 = .sdata2:0x804D8870; // type:object size:0x4 scope:local data:float +ftCo_804D8874 = .sdata2:0x804D8874; // type:object size:0x4 scope:local data:float +ftCo_804D8878 = .sdata2:0x804D8878; // type:object size:0x8 scope:local data:double +ftCo_804D8880 = .sdata2:0x804D8880; // type:object size:0x4 scope:local data:float +ftCo_804D8884 = .sdata2:0x804D8884; // type:object size:0x4 scope:local data:float +ftCo_804D8888 = .sdata2:0x804D8888; // type:object size:0x4 scope:local data:float +ftCo_804D888C = .sdata2:0x804D888C; // type:object size:0x4 scope:local data:float +ftCo_804D8890 = .sdata2:0x804D8890; // type:object size:0x4 scope:local data:float +ftCo_804D8898 = .sdata2:0x804D8898; // type:object size:0x8 scope:local data:double +ftCo_804D88A0 = .sdata2:0x804D88A0; // type:object size:0x8 scope:local data:double +ftCo_804D88A8 = .sdata2:0x804D88A8; // type:object size:0x4 scope:local data:float +ftCo_804D88B0 = .sdata2:0x804D88B0; // type:object size:0x8 scope:local data:double +ftCo_804D88B8 = .sdata2:0x804D88B8; // type:object size:0x8 scope:local data:double +ftCo_804D88C0 = .sdata2:0x804D88C0; // type:object size:0x8 scope:local data:double +ftCo_804D88C8 = .sdata2:0x804D88C8; // type:object size:0x4 scope:local data:float +ftCo_804D88D0 = .sdata2:0x804D88D0; // type:object size:0x8 scope:local data:double +ftCo_804D88D8 = .sdata2:0x804D88D8; // type:object size:0x4 scope:local data:float +ftCo_804D88E0 = .sdata2:0x804D88E0; // type:object size:0x8 scope:local data:double +ftCo_804D88E8 = .sdata2:0x804D88E8; // type:object size:0x4 scope:local data:float +ftCo_804D88EC = .sdata2:0x804D88EC; // type:object size:0x4 scope:local data:float +ftCo_804D88F0 = .sdata2:0x804D88F0; // type:object size:0x8 scope:local data:double +ftCo_804D88F8 = .sdata2:0x804D88F8; // type:object size:0x8 scope:local data:double +ftCo_804D8900 = .sdata2:0x804D8900; // type:object size:0x8 scope:local data:double +ftCo_804D8908 = .sdata2:0x804D8908; // type:object size:0x4 scope:local data:float +ftCo_804D890C = .sdata2:0x804D890C; // type:object size:0x4 scope:local data:float +ftCo_804D8910 = .sdata2:0x804D8910; // type:object size:0x4 scope:local data:float +ftCo_804D8914 = .sdata2:0x804D8914; // type:object size:0x4 scope:local data:float +ftCo_804D8918 = .sdata2:0x804D8918; // type:object size:0x4 scope:local data:float +ftCo_804D891C = .sdata2:0x804D891C; // type:object size:0x4 scope:local data:float +ftCo_804D8920 = .sdata2:0x804D8920; // type:object size:0x8 scope:local data:double +ftCo_804D8928 = .sdata2:0x804D8928; // type:object size:0x4 scope:local data:float +ftCo_804D892C = .sdata2:0x804D892C; // type:object size:0x4 scope:local data:float +ftCo_804D8930 = .sdata2:0x804D8930; // type:object size:0x4 scope:local data:float +ftCo_804D8934 = .sdata2:0x804D8934; // type:object size:0x4 scope:local data:float +ftCo_804D8938 = .sdata2:0x804D8938; // type:object size:0x4 scope:local data:float +ftCo_804D8940 = .sdata2:0x804D8940; // type:object size:0x8 scope:local data:double +ftCo_804D8948 = .sdata2:0x804D8948; // type:object size:0x4 scope:local data:float +ftCo_804D894C = .sdata2:0x804D894C; // type:object size:0x4 scope:local data:float +ftCo_804D8950 = .sdata2:0x804D8950; // type:object size:0x4 scope:local data:float +ftCo_804D8958 = .sdata2:0x804D8958; // type:object size:0x8 scope:local data:double +ftCo_804D8960 = .sdata2:0x804D8960; // type:object size:0x8 scope:local data:double +ftCo_804D8968 = .sdata2:0x804D8968; // type:object size:0x4 scope:local data:float +ftCo_804D8970 = .sdata2:0x804D8970; // type:object size:0x8 scope:local data:double +ftCo_804D8978 = .sdata2:0x804D8978; // type:object size:0x8 scope:local data:double +ftCo_804D8980 = .sdata2:0x804D8980; // type:object size:0x8 scope:local data:double +ftCo_804D8988 = .sdata2:0x804D8988; // type:object size:0x8 scope:local data:double +ftCo_804D8990 = .sdata2:0x804D8990; // type:object size:0x8 scope:local data:double +ftCo_804D8998 = .sdata2:0x804D8998; // type:object size:0x8 scope:local data:double +ftCo_804D89A0 = .sdata2:0x804D89A0; // type:object size:0x8 scope:local data:double +ftCo_804D89A8 = .sdata2:0x804D89A8; // type:object size:0x4 scope:local data:float +ftCo_804D89B0 = .sdata2:0x804D89B0; // type:object size:0x8 scope:local data:double +ftCo_804D89B8 = .sdata2:0x804D89B8; // type:object size:0x8 scope:local data:double +ftCo_804D89C0 = .sdata2:0x804D89C0; // type:object size:0x4 scope:local data:float +@1003 = .sdata2:0x804D89C4; // type:object size:0x4 scope:local data:float ftCo_804D89C8 = .sdata2:0x804D89C8; // type:object size:0x8 scope:global data:double ftCo_804D89D0 = .sdata2:0x804D89D0; // type:object size:0x8 scope:global data:double ftCo_804D89D8 = .sdata2:0x804D89D8; // type:object size:0x4 scope:global data:float diff --git a/src/melee/ft/chara/ftCommon/ftCo_0A01.c b/src/melee/ft/chara/ftCommon/ftCo_0A01.c index f29446f64f..cc745182b8 100644 --- a/src/melee/ft/chara/ftCommon/ftCo_0A01.c +++ b/src/melee/ft/chara/ftCommon/ftCo_0A01.c @@ -35,90 +35,6 @@ #include #include -float const ftCo_804D87D8 = 0; -double const ftCo_804D87E0 = 30; -float const ftCo_804D87E8 = 0.6; -float const ftCo_804D87EC = 0.8; -float const ftCo_804D87F0 = 0.9; -double const ftCo_804D87F8 = 0.05; -double const ftCo_804D8800 = S32_TO_F32; -float const ftCo_804D8808 = 1; -double const ftCo_804D8810 = 9; -double const ftCo_804D8818 = 18; -double const ftCo_804D8820 = 4; -double const ftCo_804D8828 = 0; -double const ftCo_804D8830 = 0.5; -float const ftCo_804D8838 = 1000; -double const ftCo_804D8840 = 5; -float const ftCo_804D8848 = 5; -float const ftCo_804D884C = 15; -float const ftCo_804D8850 = 40; -float const ftCo_804D8854 = 50; -float const ftCo_804D8858 = 10; -double const ftCo_804D8860 = 10; -float const ftCo_804D8868 = 0.5; -float const ftCo_804D886C = 2.0; -float const ftCo_804D8870 = +1e-5; -float const ftCo_804D8874 = -1e-5; -double const ftCo_804D8878 = 2.0; -float const ftCo_804D8880 = 8.5; -float const ftCo_804D8884 = 17.0; -float const ftCo_804D8888 = 3.5; -float const ftCo_804D888C = 127.0; -float const ftCo_804D8890 = 0.0078125; -double const ftCo_804D8898 = +1; -double const ftCo_804D88A0 = -1; -float const ftCo_804D88A8 = -1; -double const ftCo_804D88B0 = 255; -double const ftCo_804D88B8 = U32_TO_F32; -double const ftCo_804D88C0 = 3; -float const ftCo_804D88C8 = 10000; -double const ftCo_804D88D0 = 1000; -float const ftCo_804D88D8 = -10; -double const ftCo_804D88E0 = -5; -float const ftCo_804D88E8 = 0.4; -float const ftCo_804D88EC = 0.2; -double const ftCo_804D88F0 = 0.4; -double const ftCo_804D88F8 = 0.01; -double const ftCo_804D8900 = -1.047197543084621429443359375; -float const ftCo_804D8908 = -35; -float const ftCo_804D890C = 0.1; -float const ftCo_804D8910 = -1.3089969158172607; -float const ftCo_804D8914 = 120; -float const ftCo_804D8918 = 20; -float const ftCo_804D891C = 0.7853981852531433; -double const ftCo_804D8920 = 50; -float const ftCo_804D8928 = 100; -float const ftCo_804D892C = 80; -float const ftCo_804D8930 = M_PI; -float const ftCo_804D8934 = -M_PI_2; -float const ftCo_804D8938 = M_PI_2; -double const ftCo_804D8940 = 60; -float const ftCo_804D8948 = 4.700000286102295; -float const ftCo_804D894C = -150; -float const ftCo_804D8950 = -90; -double const ftCo_804D8958 = 40; -double const ftCo_804D8960 = 37.5; -float const ftCo_804D8968 = 0.05; -double const ftCo_804D8970 = 0.61086523346602916717529296875; -double const ftCo_804D8978 = 1.30899692885577678680419921875; -double const ftCo_804D8980 = -0.78539815731346607208251953125; - -/// Roughly -#M_PI / 12 or -15 degrees. -double const ftCo_804D8988 = -0.26179938577115535736083984375; - -double const ftCo_804D8990 = 15; -double const ftCo_804D8998 = -1.30899692885577678680419921875; - -/// Roughly #M_PI / 12 or 15 degrees. -double const ftCo_804D89A0 = 0.26179938577115535736083984375; - -float const ftCo_804D89A8 = 128; -double const ftCo_804D89B0 = 0.95; -double const ftCo_804D89B8 = 625; -float const ftCo_804D89C0 = 0.3; -float const ftCo_804D89C4 = 0.04; - int ftCo_803C5A68[] = { 1, 0, 0, 1, 0, 0, 0, 1, 7, 6, 5, 4, 4, 3, 1, 1, 2, 1, 5, 2, 2, 2, 3, 3, 3, 4, 0, 0, 8, 4, 1, 4, 4, 5, 5, @@ -155,7 +71,32 @@ void ftCo_800A0508(ftCo_Fighter* fp) /// #ftCo_800A05F4 -/// #ftCo_800A0798 +void ftCo_800A0798(ftCo_Fighter* fp) +{ + if (ftCo_800A1CA8(fp)) { + ftCo_800B46B8(fp, 0x80, 0); + ftCo_800B46B8(fp, 0x81, 0); + ftCo_800B46B8(fp, 0x8E, 0xA); + ftCo_800B463C(fp, 8); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 7); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 8); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 0x7F); + } else { + ftCo_800B46B8(fp, 0x80, 0); + ftCo_800B46B8(fp, 0x81, 0); + ftCo_800B463C(fp, 8); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B46B8(fp, 0x95, 0x7F); + ftCo_800B463C(fp, 7); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 8); + ftCo_800B46B8(fp, 0x8E, 5); + ftCo_800B463C(fp, 0x7F); + } +} /// #ftCo_800A08F0 @@ -596,7 +537,31 @@ bool ftCo_800A2998(Fighter* fp, float arg1) return false; } -/// #ftCo_800A2A70 +float ftCo_800A2A70(Fighter* fp, bool arg1) +{ + if (fp->ground_or_air == GA_Air) { + return -1.0f; + } + { + mp_UnkStruct0* data = mpIsland_8005AB54(fp->coll_data.floor.index); + if (data == NULL) { + return -1.0f; + } + { + float r; + if (arg1) { + float x = data->x8 - fp->cur_pos.x, + y = data->xC - fp->cur_pos.y; + r = sqrtf(SQ(x) + SQ(y)); + } else { + float x = data->x14 - fp->cur_pos.x, + y = data->x18 - fp->cur_pos.y; + r = sqrtf(SQ(x) + SQ(y)); + } + return r; + } + } +} bool ftCo_800A2BD4(ftCo_Fighter* fp) { @@ -1175,7 +1140,41 @@ void ftCo_800AABC8(ftCo_Fighter* fp) /// #ftCo_800AB224 -/// #ftCo_800ABA34 +void ftCo_800ABA34(ftCo_Fighter* fp) +{ + struct Fighter_x1A88_t* data = &fp->x1A88; + if (fp->x1A88.xC == 11) { + if (fp->item_gobj == NULL) { + ftCo_800B4880(fp, 38); + return; + } + } else if (data->xC == 12) { + if (data->x7C % 30 == 0) { + ftCo_800B4880(fp, 38); + return; + } + } else if (data->xC == 16 && fp->ground_or_air == GA_Ground && + data->x7C % 300 == 0) + { + ftCo_800A05F4(fp); + return; + } + if ((fp->kind == FTKIND_ZELDA || fp->kind == FTKIND_SEAK) && data->xF8_b5) + { + ftCo_800B4880(fp, 38); + data->xF8_b5 = false; + return; + } + if (ftCo_800A5CE0(fp) == NULL && fp->motion_id == ftCo_MS_RebirthWait) { + ftCo_800A08F0(fp); + return; + } + if (fp->ground_or_air == GA_Air) { + ftCo_800A9CB4(fp); + return; + } + ftCo_800AB224(fp); +} /// #ftCo_800ABBA8 @@ -1214,7 +1213,58 @@ void ftCo_800AC30C(Fighter* fp) } } -/// #ftCo_800AC434 +static inline enum_t inlineH0(ftCo_Fighter* fp) +{ + if (fp->motion_id == ftCo_MS_BarrelWait) { + return 1; + } + if (fp->motion_id == ftCo_MS_Barrel) { + return 2; + } + return 0; +} + +static inline void inlineH1(ftCo_Fighter* fp, struct Fighter_x1A88_t* data) +{ + if (data->x7C % ((10 - data->x10) * 5) == 0 && HSD_Randf() < 0.5f) { + ftCo_800B463C(fp, 1); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 2); + ftCo_800B463C(fp, 0x7F); + } else { + ftCo_800B463C(fp, 0x7F); + } +} + +void ftCo_800AC434(ftCo_Fighter* fp) +{ + struct Fighter_x1A88_t* data = &fp->x1A88; + Vec3 vec; + float f; + enum_t barrel_state = inlineH0(fp); + PAD_STACK(5 * 4); + + if (barrel_state == 0) { + data->x18 = data->x1C; + ftCo_800B463C(fp, 0x7F); + return; + } + if (barrel_state == 1) { + PAD_STACK(1 * 4); + Ground_801C4DA0(&vec, &f); + } else { + inlineH1(fp, data); + return; + } + if (f >= -0.26179938577115536 && f <= 0.0) { + ftCo_800B463C(fp, 1); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 2); + ftCo_800B463C(fp, 0x7F); + } else { + ftCo_800B463C(fp, 0x7F); + } +} /// #ftCo_800AC5A0 @@ -1285,7 +1335,68 @@ void ftCo_800AD42C(ftCo_Fighter* fp) /// #ftCo_800B0CA8 -/// #ftCo_800B0E98 +static inline bool inlineG0(struct Fighter_x1A88_t* data) +{ + if (data->x18 != data->x20 && data->x18 != data->x1C) { + data->x60 = 0; + } + if (data->x18 == 4) { + return false; + } else { + data->xFA_b2 = false; + return true; + } +} + +static inline bool inlineG1(ftCo_Fighter* fp0) +{ + if (fp0->motion_id >= 361 && fp0->motion_id <= 366) { + return 1; + } else { + return 0; + } +} + +bool ftCo_800B0E98(Fighter* fp0, Fighter* fp1) +{ + s32 temp_r0; + s32 var_r0; + s32 var_r0_2; + + if (ftCo_800B0CA8(fp0) != 0) { + struct Fighter_x1A88_t* data = &fp0->x1A88; + if (fp1->ground_or_air == GA_Air) { + return false; + } + if (fp0->ground_or_air == GA_Air) { + return false; + } + if (!data->xFB_b0) { + struct Fighter_x1A88_t* data = &fp0->x1A88; + if (inlineG1(fp0)) { + if (!inlineG0(data) && fp0->motion_id != ftCo_MS_Wait) { + return false; + } + { + float x = fp0->pos_delta.x - fp1->pos_delta.x, + y = fp0->pos_delta.y - fp1->pos_delta.y, + r = fp0->co_attrs.mid_walk_point; + if (SQ(x) + SQ(y) > SQ(r)) { + return false; + } + } + { + float x = fp0->cur_pos.x - fp1->cur_pos.x, + y = fp1->cur_pos.y - fp0->cur_pos.y; + if (SQ(x) + SQ(y) < SQ(25.0)) { + return true; + } + } + } + } + } + return false; +} /// #ftCo_800B101C @@ -1297,7 +1408,24 @@ void ftCo_800AD42C(ftCo_Fighter* fp) /// #ftCo_800B1AB8 -/// #ftCo_800B1DA0 +void ftCo_800B1DA0(Fighter* fp) +{ + struct Fighter_x1A88_t* data = &fp->x1A88; + PAD_STACK(6 * 4); + data->xF8_b0 = false; + data->xF9_b2 = true; + data->xF9_b4 = true; + data->xF9_b3 = false; + data->xF9_b5 = false; + data->xF9_b6 = false; + data->xF9_b7 = false; + data->xF9_b1 = false; + fp->x1A88.x44 = ftCo_800A4BEC(fp); + if (inlineG0(data) && data->x7C % 60 * 5 == 0 && HSD_Randf() < 0.5) { + ftCo_800A8940(fp); + } + ftCo_800ADE48(fp); +} /// #ftCo_800B1EF0 diff --git a/src/melee/ft/chara/ftCommon/ftCo_0A01.h b/src/melee/ft/chara/ftCommon/ftCo_0A01.h index 97f287f72f..2f33ea6bcd 100644 --- a/src/melee/ft/chara/ftCommon/ftCo_0A01.h +++ b/src/melee/ft/chara/ftCommon/ftCo_0A01.h @@ -9,15 +9,8 @@ #include #include -struct _m2c_stack_ftCo_800A80E4 { - /* 0x00 */ char pad_0[0xC]; - /* 0x0C */ float f; - /* 0x0C */ Vec3 vec; - /* 0x18 */ char pad_18[0x14 - 0x8]; -}; /* size = 0x28 */ - -/* 09D4F0 */ UNK_RET ftCo_800A05F4(UNK_PARAMS); -/* 09D694 */ UNK_RET ftCo_800A0798(UNK_PARAMS); +/* 09D4F0 */ void ftCo_800A05F4(ftCo_Fighter* fp); +/* 09D694 */ void ftCo_800A0798(ftCo_Fighter* fp); /* 09DB88 */ void ftCo_800A0C8C(ftCo_Fighter* fp); /* 09DCA0 */ void ftCo_800A0DA4(Fighter* fp); /* 09DEAC */ bool ftCo_800A0FB0(Vec3* arg0, int* arg1, int arg2, int arg3, @@ -35,7 +28,7 @@ struct _m2c_stack_ftCo_800A80E4 { /* 09F06C */ bool ftCo_800A2170(ftCo_Fighter* fp0, ftCo_Fighter* fp1); /* 09F7CC */ bool ftCo_800A28D0(ftCo_Fighter* fp, float arg1); /* 09F894 */ bool ftCo_800A2998(ftCo_Fighter* fp, float arg1); -/* 09F96C */ UNK_RET ftCo_800A2A70(UNK_PARAMS); +/* 09F96C */ float ftCo_800A2A70(ftCo_Fighter* fp, bool); /* 09FAD0 */ bool ftCo_800A2BD4(ftCo_Fighter* fp); /* 09FB04 */ bool ftCo_800A2C08(ftCo_Fighter* fp); /* 0A0030 */ bool ftCo_800A3134(ftCo_Fighter* fp); @@ -67,7 +60,7 @@ struct _m2c_stack_ftCo_800A80E4 { /* 09D3DC */ static UNK_RET ftCo_800ACB44(UNK_PARAMS); /* 09D404 */ static void ftCo_800A0508(ftCo_Fighter* fp); /* 09D5F4 */ static UNK_RET ftCo_800ACD5C(UNK_PARAMS); -/* 09D7EC */ static UNK_RET ftCo_800A08F0(UNK_PARAMS); +/* 09D7EC */ static void ftCo_800A08F0(ftCo_Fighter* fp); /* 09D9F0 */ static UNK_RET ftCo_800A0AF4(UNK_PARAMS); /* 09DBAC */ static void ftCo_800A0CB0(ftCo_Fighter* fp); /* 09DCC4 */ static void ftCo_800AD42C(ftCo_Fighter* fp); @@ -75,7 +68,7 @@ struct _m2c_stack_ftCo_800A80E4 { /* 09DDFC */ static bool ftCo_800A0F00(ftCo_GObj* gobj); /* 09E094 */ static UNK_RET ftCo_800AD7FC(UNK_PARAMS); /* 09E4C0 */ static UNK_RET ftCo_800ADC28(UNK_PARAMS); -/* 09E6E0 */ static UNK_RET ftCo_800ADE48(UNK_PARAMS); +/* 09E6E0 */ static void ftCo_800ADE48(ftCo_Fighter* fp); /* 09EBC0 */ static void ftCo_800A1CC4(UNK_T, UNK_T, UNK_T); /* 09EE38 */ static void ftCo_800A1F3C(ftCo_Fighter* fp, float arg1, float arg2, float arg3); @@ -104,12 +97,12 @@ struct _m2c_stack_ftCo_800A80E4 { /* 0A0FF8 */ static UNK_RET ftCo_800B0760(UNK_PARAMS); /* 0A11B0 */ static UNK_RET ftCo_800B0918(UNK_PARAMS); /* 0A138C */ static void ftCo_800B0AF4(ftCo_Fighter* fp); -/* 0A1540 */ static UNK_RET ftCo_800B0CA8(UNK_PARAMS); +/* 0A1540 */ static bool ftCo_800B0CA8(ftCo_Fighter* fp); /* 0A1664 */ static UNK_RET ftCo_800A4768(UNK_PARAMS); -/* 0A1730 */ static UNK_RET ftCo_800B0E98(UNK_PARAMS); +/* 0A1730 */ static bool ftCo_800B0E98(ftCo_Fighter* fp0, ftCo_Fighter* fp1); /* 0A18B0 */ static void ftCo_800A49B4(ftCo_Fighter* fp); /* 0A18B4 */ static UNK_RET ftCo_800B101C(UNK_PARAMS); -/* 0A1AE8 */ static UNK_RET ftCo_800A4BEC(UNK_PARAMS); +/* 0A1AE8 */ static ftCo_Fighter* ftCo_800A4BEC(ftCo_Fighter* fp); /* 0A1B04 */ static UNK_RET ftCo_800B126C(UNK_PARAMS); /* 0A1B38 */ static bool ftCo_800A1B38(enum_t); /* 0A1D10 */ static UNK_RET ftCo_800B1478(UNK_PARAMS); @@ -119,7 +112,7 @@ struct _m2c_stack_ftCo_800A80E4 { int player_id); /* 0A22D8 */ static UNK_RET ftCo_800A53DC(UNK_PARAMS); /* 0A2350 */ static UNK_RET ftCo_800B1AB8(UNK_PARAMS); -/* 0A2638 */ static UNK_RET ftCo_800B1DA0(UNK_PARAMS); +// /* 0A2638 */ static void ftCo_800B1DA0(ftCo_Fighter* fp); /* 0A2788 */ static UNK_RET ftCo_800B1EF0(UNK_PARAMS); /* 0A2798 */ static ftCo_Fighter* ftCo_800A589C(ftCo_Fighter* fp); /* 0A2840 */ static bool ftCo_800A5944(ftCo_Fighter* fp); @@ -128,7 +121,7 @@ struct _m2c_stack_ftCo_800A80E4 { /* 0A3028 */ static void ftCo_800B2790(ftCo_Fighter* fp); /* 0A3C48 */ static void ftCo_800B33B0(ftCo_Fighter* fp); /* 0A5ACC */ static UNK_RET ftCo_800A5ACC(UNK_PARAMS); -/* 0A5CE0 */ static UNK_RET ftCo_800A5CE0(UNK_PARAMS); +/* 0A5CE0 */ static UNK_T ftCo_800A5CE0(ftCo_Fighter* fp); /* 0A5F4C */ static UNK_RET ftCo_800A5F4C(UNK_PARAMS); /* 0A61D8 */ static UNK_RET ftCo_800A61D8(UNK_PARAMS); /* 0A648C */ static UNK_RET ftCo_800A648C(UNK_PARAMS); @@ -141,7 +134,7 @@ struct _m2c_stack_ftCo_800A80E4 { /* 0A80E4 */ static void ftCo_800A80E4(ftCo_Fighter* fp); /* 0A8210 */ static UNK_RET ftCo_800A8210(UNK_PARAMS); /* 0A866C */ static UNK_RET ftCo_800A866C(UNK_PARAMS); -/* 0A8940 */ static UNK_RET ftCo_800A8940(UNK_PARAMS); +/* 0A8940 */ static void ftCo_800A8940(ftCo_Fighter* fp); /* 0A8DE4 */ static void ftCo_800A8DE4(ftCo_Fighter* fp); /* 0A8EB0 */ static UNK_RET ftCo_800A8EB0(UNK_PARAMS); /* 0A92CC */ static UNK_RET ftCo_800A92CC(UNK_PARAMS); @@ -149,18 +142,18 @@ struct _m2c_stack_ftCo_800A80E4 { /* 0A963C */ static void ftCo_800A963C(ftCo_Fighter* fp); /* 0A96B8 */ static UNK_RET ftCo_800A96B8(UNK_PARAMS); /* 0A9904 */ static UNK_RET ftCo_800A9904(UNK_PARAMS); -/* 0A9CB4 */ static UNK_RET ftCo_800A9CB4(UNK_PARAMS); +/* 0A9CB4 */ static void ftCo_800A9CB4(ftCo_Fighter* fp); /* 0AA320 */ static void ftCo_800AA320(ftCo_Fighter* fp, int*, int*); /* 0AA42C */ static UNK_RET ftCo_800AA42C(UNK_PARAMS); /* 0AA844 */ static UNK_RET ftCo_800AA844(UNK_PARAMS); /* 0AABC8 */ static void ftCo_800AABC8(ftCo_Fighter* fp); /* 0AACD0 */ static UNK_RET ftCo_800AACD0(UNK_PARAMS); /* 0AAF48 */ static UNK_RET ftCo_800AAF48(UNK_PARAMS); -/* 0AB224 */ static UNK_RET ftCo_800AB224(UNK_PARAMS); -/* 0ABA34 */ static UNK_RET ftCo_800ABA34(UNK_PARAMS); +/* 0AB224 */ static void ftCo_800AB224(ftCo_Fighter* fp); +/* 0ABA34 */ static void ftCo_800ABA34(ftCo_Fighter* fp); /* 0ABBA8 */ static UNK_RET ftCo_800ABBA8(UNK_PARAMS); /* 0AC30C */ static void ftCo_800AC30C(ftCo_Fighter* fp); -/* 0AC434 */ static UNK_RET ftCo_800AC434(UNK_PARAMS); +/* 0AC434 */ static void ftCo_800AC434(ftCo_Fighter* fp); /* 0AC5A0 */ static UNK_RET ftCo_800AC5A0(UNK_PARAMS); /* 0B2AFC */ static void ftCo_800B2AFC(ftCo_Fighter* fp); diff --git a/src/melee/ft/chara/ftCommon/ftCo_0B3E.h b/src/melee/ft/chara/ftCommon/ftCo_0B3E.h index b0281bc657..b3a2b12bcd 100644 --- a/src/melee/ft/chara/ftCommon/ftCo_0B3E.h +++ b/src/melee/ft/chara/ftCommon/ftCo_0B3E.h @@ -13,7 +13,7 @@ /// @todo Static declarations belong in #ftCo_0B3E.c /* 0B462C */ static UNK_RET ftCo_800B462C(ftCo_Fighter* fp); /* 0B4778 */ static void ftCo_800B4778(ftCo_Fighter* fp, int, s8, s8); -/* 0B4880 */ static UNK_RET ftCo_800B4880(UNK_PARAMS); +/* 0B4880 */ static void ftCo_800B4880(ftCo_Fighter* fp, int); /* 0B49F4 */ static UNK_RET ftCo_800B49F4(UNK_PARAMS); /* 0B4A78 */ static void ftCo_800B4A78(ftCo_Fighter* fp); /* 0B4AB0 */ static UNK_RET ftCo_800B4AB0(UNK_PARAMS); diff --git a/src/melee/ft/types.h b/src/melee/ft/types.h index 8ab51d9b14..c0a04f4266 100644 --- a/src/melee/ft/types.h +++ b/src/melee/ft/types.h @@ -967,12 +967,13 @@ struct Fighter_x1A88_t { /* +9 */ u8 x9; /* +A */ u8 xA; /* +B */ u8 xB; - /* +C */ int xC; + /* +C */ enum_t xC; /* +10 */ int x10; /* +14 */ int x14; /* +18 */ int x18; /* +1C */ int x1C; - /* +20 */ u8 x20[0x34 - 0x20]; + /* +20 */ int x20; + /* +24 */ u8 x24[0x34 - 0x24]; /* +34 */ float x34; /* +38 */ float x38; /* +3C */ UNK_T x3C; @@ -983,7 +984,8 @@ struct Fighter_x1A88_t { /* +50 */ UNK_T x50; /* +54 */ Vec2 x54; /* +5C */ float x5C; - /* +60 */ u8 x60[0x7C - 0x60]; + /* +60 */ int x60; + /* +64 */ u8 x64[0x7C - 0x64]; /* +7C */ int x7C; /* +80 */ u8 x80[0xF8 - 0x80]; /* +F8:0 */ u8 xF8_b0 : 1; @@ -1010,7 +1012,15 @@ struct Fighter_x1A88_t { /* +FA:5 */ u8 xFA_b5 : 1; /* +FA:6 */ u8 xFA_b6 : 1; /* +FA:7 */ u8 xFA_b7 : 1; - /* +80 */ u8 xFB[0x44C - 0xFB]; + /* +FB:0 */ u8 xFB_b0 : 1; + /* +FB:1 */ u8 xFB_b1 : 1; + /* +FB:2 */ u8 xFB_b2 : 1; + /* +FB:3 */ u8 xFB_b3 : 1; + /* +FB:4 */ u8 xFB_b4 : 1; + /* +FB:5 */ u8 xFB_b5 : 1; + /* +FB:6 */ u8 xFB_b6 : 1; + /* +FB:7 */ u8 xFB_b7 : 1; + /* +80 */ u8 xFC[0x44C - 0xFC]; /* +454 */ UNK_T x44C; /* +454 */ UNK_T x450; /* +454 */ uint x454; diff --git a/src/melee/mp/mpisland.c b/src/melee/mp/mpisland.c index c48868e10e..b2868b3440 100644 --- a/src/melee/mp/mpisland.c +++ b/src/melee/mp/mpisland.c @@ -48,9 +48,9 @@ void mpIsland_8005A728(void) int v20; // r26 int v21; // r27 float v22; // fp31 - int* v22_2; + float* v22_2; int* v23; // r19 - int* v24_2; + float* v24_2; mpisland* v24; // r3 mpisland* v25; // r25 int v26; // r4 diff --git a/src/melee/mp/types.h b/src/melee/mp/types.h index 16a9d1e8bf..301a471137 100644 --- a/src/melee/mp/types.h +++ b/src/melee/mp/types.h @@ -8,11 +8,11 @@ struct mp_UnkStruct0 { /* +0 */ mp_UnkStruct0* next; /* +4 */ int x4; - /* +8 */ int x8; - /* +C */ int xC; + /* +8 */ float x8; + /* +C */ float xC; /* +10 */ int x10; - /* +14 */ int x14; - /* +18 */ int x18; + /* +14 */ float x14; + /* +18 */ float x18; /* +1C */ int x1C; /* +20 */ int x20; /* +24 */ short x24;