diff options
| author | Dragorn421 <Dragorn421@users.noreply.github.com> | 2021-12-01 14:41:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-01 08:41:38 -0500 |
| commit | 1cf11907fa8d636babba2df854850035f04bd4fc (patch) | |
| tree | f41044c0b587bf563bdd59ca610df7aa367d93ac /progress.py | |
| parent | f1d183d6feac23275306bfa2dee939d123702765 (diff) | |
Make progress.py count libultra files towards boot or code by using _*SegmentStart/End in the map (#1043)
Diffstat (limited to 'progress.py')
| -rwxr-xr-x | progress.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/progress.py b/progress.py index d7fc14e7f..9273a7d1e 100755 --- a/progress.py +++ b/progress.py @@ -60,12 +60,21 @@ def GetNonMatchingSize(path): mapFile = ReadAllLines("build/z64.map") +curSegment = None src = 0 code = 0 boot = 0 ovl = 0 for line in mapFile: + + if "_codeSegmentStart" in line: + curSegment = "code" + elif "_bootSegmentStart" in line: + curSegment = "boot" + elif "_codeSegmentEnd" in line or "_bootSegmentEnd" in line: + curSegment = None + lineSplit = list(filter(None, line.split(" "))) if (len(lineSplit) == 4 and lineSplit[0].startswith(".")): @@ -77,9 +86,9 @@ for line in mapFile: if (objFile.startswith("build/src")): src += size - if (objFile.startswith("build/src/code") or objFile.startswith("build/src/libultra_code")): + if (objFile.startswith("build/src/code") or (objFile.startswith("build/src/libultra/") and curSegment == "code")): code += size - elif (objFile.startswith("build/src/boot") or objFile.startswith("build/src/libultra_boot")): + elif (objFile.startswith("build/src/boot") or (objFile.startswith("build/src/libultra/") and curSegment == "boot")): boot += size elif (objFile.startswith("build/src/overlays")): ovl += size |
