diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-09-01 00:14:36 -0700 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-09-01 00:14:36 -0700 |
commit | 6a7af346c0f12fc8126c3c62f4393ec3949d6c5c (patch) | |
tree | fd63e7757cab9d9c4ca5384aba1f3cc3f008d625 /redtools/romviz.py | |
parent | e2fb614cae9b0080382d76c620955b446d59a0a5 (diff) | |
parent | a5b718db57a361cf3c196d73cbc5b3e21d3ddf6e (diff) |
Merge pull request #3 from kanzure/dump-pokered-extras
Dump pokered extras
Diffstat (limited to 'redtools/romviz.py')
-rw-r--r-- | redtools/romviz.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/redtools/romviz.py b/redtools/romviz.py new file mode 100644 index 0000000..3f07d65 --- /dev/null +++ b/redtools/romviz.py @@ -0,0 +1,40 @@ +#author: Bryan Bishop <kanzure@gmail.com> +#date: 2012-01-10 +#show me an image +import Image +from math import floor +import extract_maps +import analyze_incbins + +print "loading rom.." +extract_maps.load_rom() +#extract_maps.load_map_pointers() +#extract_maps.read_all_map_headers() + +print "analyzing incbins.." +analyze_incbins.load_asm() +analyze_incbins.isolate_incbins() +analyze_incbins.process_incbins() + +width = 1024 +height = 1024 + +im = Image.new("P", (width, height), 0) + +im.putpalette([ + 0, 0, 0, + 126, 30, 156, +]) + +print "drawing incbins..." +for incbin_key in analyze_incbins.processed_incbins: + incbin = analyze_incbins.processed_incbins[incbin_key] + start = incbin["start"] + end = incbin["end"] + + for pos in range(start, end+1): + widthx = int(pos % width) + heighty = int(floor(pos / height)) + im.putpixel((widthx, heighty), 1) + +im.save("test.png") |