Skip to content

Commit

Permalink
Squashed 'tools/' changes from ae6f6a6..530d5ab
Browse files Browse the repository at this point in the history
530d5ab Merge commit 'ad81dd553da94bcab18274fdb3d845596843de2b'
ad81dd5 Squashed 'freesia/' changes from f4fd6d5..f72b2e7

git-subtree-dir: tools
git-subtree-split: 530d5ab5ef6018f7493f59438d2ba157ce2ab834
  • Loading branch information
Zeturic committed Mar 14, 2020
1 parent af77fcb commit 501543f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions freesia/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import argparse, sys
from pathlib import Path
#!/usr/bin/env python

from __future__ import print_function

import argparse, sys, os.path

argparser = argparse.ArgumentParser(description="Locates free space inside a GBA ROM.")
argparser.add_argument("--rom", dest="ROM", required=True)
Expand Down Expand Up @@ -40,7 +43,7 @@ def find_needed_bytes(rom, needed_bytes, start_at):
else:
record += 1
elif len(val) < 4:
print(f"{Path(sys.argv[0]).name}: error: end of file reached before a suitable location was found", file=sys.stderr)
print("{}: error: end of file reached before a suitable location was found".format(os.path.basename(sys.argv[0])), file=sys.stderr)
sys.exit(1)
else:
record, start = 0, None
Expand All @@ -54,4 +57,4 @@ def find_needed_bytes(rom, needed_bytes, start_at):

addr = find_needed_bytes(rom=args.ROM, needed_bytes=args.NEEDED_BYTES, start_at=args.START_AT) | 0x08000000

print(f"0x{addr :08X}")
print("0x{0:08X}".format(addr))

0 comments on commit 501543f

Please sign in to comment.