Skip to content

Commit

Permalink
Merge pull request #43 from WhenGryphonsFly/working
Browse files Browse the repository at this point in the history
Fix up NONMATCHING
  • Loading branch information
WhenGryphonsFly authored Feb 22, 2024
2 parents 211f782 + a570f5a commit ce5a95b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 34 deletions.
8 changes: 4 additions & 4 deletions .github/calcrom/calcrom.pl
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,14 @@
(($functions_remaining_count != 0) and ($functions_remaining_as_string ne "0"))
or die "ERROR: Cannot convert string to num: '$functions_remaining_as_string'";

my $nonmatching_cmd = "git grep -E '#if[n]?def NONMATCHING' ':/' ':(exclude)*.pl'";
my $nonmatching_cmd = "git grep -E 'asm_unified' ':/' ':(exclude)*.pl'";
my $nonmatching_as_string;
(run (
command => "$nonmatching_cmd | $count_cmd",
buffer => \$nonmatching_as_string,
timeout => 60
))
or die "ERROR: Error while calculating NONMATCHING totals: $?";
or die "ERROR: Error while calculating asm_unified totals: $?";
my $nonmatching_count = $nonmatching_as_string + 0;
(($nonmatching_count != 0) and ($nonmatching_as_string ne "0"))
or die "ERROR: Cannot convert string to num: '$nonmatching_as_string'";
Expand All @@ -216,7 +216,7 @@
my $srcPct = 100 * $src / $total;
my $asmPct = 100 * $asm / $total;

if ($asm == 0)
if ($asm == 0 and $nonmatching_count == 0)
{
print "Code decompilation is 100% complete\n"
}
Expand All @@ -226,7 +226,7 @@
printf "%8d bytes of code in src (%.4f%%)\n", $src, $srcPct;
printf "%8d bytes of code in asm (%.4f%%)\n", $asm, $asmPct;
printf "%8d functions remain\n", $functions_remaining_count;
printf "%8d functions are NONMATCHING\n", $nonmatching_count;
printf "%8d functions use asm_unified\n", $nonmatching_count;
}
print "\n";

Expand Down
2 changes: 1 addition & 1 deletion src/high_scores.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ void sub_D20C(void)
case 1:
gUnknown_0201A4B8 -= 1;

// NOTE: FAKEMATCH - Seth
// TODO: FAKEMATCH - Seth
temp = gUnknown_02002858.unk18;
if((gUnknown_02002858.unk18 & 3) == 0)
{
Expand Down
23 changes: 1 addition & 22 deletions src/intro.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,27 +573,7 @@ void sub_9D70(void)
puVar4->available = 0;
}

#ifdef NONMATCHING
void sub_9E90(void)
{
gMain.blendControl = 0xF10;
gMain.blendAlpha = gUnknown_0201C1B8 | (gUnknown_0202ADD4 << 8);
REG_BLDCNT = gMain.blendControl;
REG_BLDALPHA = gMain.blendAlpha;

gMain.spriteGroups[gUnknown_0201A450.unk18].available = gUnknown_0201A450.unk1C;
gMain.spriteGroups[3].available = gUnknown_0201A450.unk2C;
gMain.spriteGroups[2].available = gUnknown_0201A450.unk3C;
gMain.spriteGroups[0x30].available = gUnknown_0201A450.unk4C; // 80
LoadSpriteSets(gUnknown_086A769C, 0x31, gMain.spriteGroups);

if (gUnknown_0201A450.unk1C == 1)
{
// ...
}
// ...
}
#else
// TODO see https://decomp.me/scratch/9Nuw9
NAKED
void sub_9E90(void)
{
Expand Down Expand Up @@ -951,7 +931,6 @@ _0800A148: .4byte gOamBuffer\n\
_0800A14C: .4byte 0xFFFFFE00\n\
_0800A150: .4byte 0x000001FF");
}
#endif

void sub_A154(void)
{
Expand Down
7 changes: 0 additions & 7 deletions src/rom_3219C.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@ void sub_3219C(void)
gUnknown_020314E0->unk59C = gUnknown_020314E0->unk598;
}

#ifdef NONMATCHING
____ sub_32484(____)
{

}
#else
NAKED
void sub_32484(void)
{
Expand Down Expand Up @@ -300,7 +294,6 @@ _080325D4: .4byte gUnknown_086A4A38\n\
_080325D8: .4byte gUnknown_020314E0\n\
_080325DC: .4byte 0x0000059E");
}
#endif

void sub_325E0(void)
{
Expand Down

0 comments on commit ce5a95b

Please sign in to comment.