summaryrefslogtreecommitdiff
path: root/romstr.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2012-06-19 23:59:49 -0500
committerBryan Bishop <kanzure@gmail.com>2012-06-19 23:59:49 -0500
commitb0ff2abc307118fb55eeab5252213a2331e2ac22 (patch)
tree69c95b36fe672aad9f98ff5393ead3f3f98127db /romstr.py
parentc8c4a56caeea4a23aa5cb63348186e848a8a1a75 (diff)
use romstr.py as the new disassembler
original-commit-id: e2babd69fb94781df54f2e4ded5efcc2aa7d0f8d
Diffstat (limited to 'romstr.py')
-rw-r--r--romstr.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/romstr.py b/romstr.py
index 0827efd..7e4c903 100644
--- a/romstr.py
+++ b/romstr.py
@@ -1,3 +1,4 @@
+import sys
from gbz80disasm import opt_table
from ctypes import c_int8
from copy import copy, deepcopy
@@ -73,7 +74,11 @@ class RomStr(str):
that will be parsed, so that large patches of data aren't parsed as
code.
"""
+ if "0x" in address:
+ address = int(address, 16)
+
start_address = address
+
if start_address == None:
raise Exception, "address must be given"
@@ -421,3 +426,7 @@ class AsmList(list):
"""
return "AsmList(too long)"
+if __name__ == "__main__":
+ cryrom = RomStr(open("../pokecrystal.gbc", "r").read());
+ asm = cryrom.to_asm(sys.argv[1])
+ print asm