mirror of
https://github.com/pret/pokefirered.git
synced 2026-05-09 04:23:14 -05:00
Add rodata to calcrom
This commit is contained in:
parent
201418cd4d
commit
d58bf398b2
|
|
@ -9,6 +9,8 @@ open(my $file, $ARGV[0])
|
|||
|
||||
my $src = 0;
|
||||
my $asm = 0;
|
||||
my $srcdata = 0;
|
||||
my $data = 0;
|
||||
while (my $line = <$file>)
|
||||
{
|
||||
if ($line =~ /^ \.(\w+)\s+0x[0-9a-f]+\s+(0x[0-9a-f]+) (\w+)\/.+\.o/)
|
||||
|
|
@ -28,6 +30,17 @@ while (my $line = <$file>)
|
|||
$asm += $size;
|
||||
}
|
||||
}
|
||||
elsif ($section =~ /rodata/)
|
||||
{
|
||||
if ($dir eq 'src')
|
||||
{
|
||||
$srcdata += $size;
|
||||
}
|
||||
elsif ($dir eq 'data')
|
||||
{
|
||||
$data += $size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -118,3 +131,26 @@ print "$total_syms total symbols\n";
|
|||
print "$documented symbols documented ($docPct%)\n";
|
||||
print "$partial_documented symbols partially documented ($partialPct%)\n";
|
||||
print "$undocumented symbols undocumented ($undocPct%)\n";
|
||||
|
||||
my $foundLines = `git grep '\.incbin "baserom\.gba"' data/`;
|
||||
my @allLines = split('\n', $foundLines);
|
||||
my $incbinTotal = 0;
|
||||
my $incbinNum = 0;
|
||||
foreach my $line (@allLines)
|
||||
{
|
||||
if ($line =~ /\.incbin\s+"baserom\.gba",\s*0x\w+,\s*(.+?)\s*(\@.*)?$/)
|
||||
{
|
||||
my $size = hex($1);
|
||||
$incbinTotal += $size;
|
||||
$incbinNum++;
|
||||
}
|
||||
}
|
||||
print "\n";
|
||||
my $dataTotal = $srcdata + $data;
|
||||
my $srcDataPct = sprintf("%.4f", 100 * $srcdata / $dataTotal);
|
||||
my $dataPct = sprintf("%.4f", 100 * $data / $dataTotal);
|
||||
my $incbinTotalPct = sprintf("%.4f", 100 * $incbinTotal / $dataTotal);
|
||||
print "$dataTotal total bytes of data\n";
|
||||
print "$srcdata bytes of data in src ($srcDataPct%)\n";
|
||||
print "$data bytes of data in data ($dataPct%)\n";
|
||||
print "$incbinNum baserom incbins with a combined $incbinTotal bytes ($incbinTotalPct%)\n";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user