mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-17 02:40:50 +12:00
romvisualizer updates for main.asm, common.asm, pokered.asm
hg-commit-id: cc4f5c666710
This commit is contained in:
parent
930417ae3b
commit
cdcf80630f
|
@ -27,8 +27,22 @@ def offset_to_pointer(offset):
|
|||
return int(offset) % 0x4000 + 0x4000
|
||||
|
||||
def load_asm(filename="../main.asm"):
|
||||
"loads the asm source code into memory"
|
||||
"""loads the asm source code into memory
|
||||
this also detects if the revision of the repository
|
||||
is using main.asm, common.asm or pokered.asm, which is
|
||||
useful when generating images in romvisualizer.py"""
|
||||
global asm
|
||||
defaults = ["../main.asm", "../common.asm", "../pokered.asm"]
|
||||
if filename in defaults:
|
||||
if os.path.exists("../main.asm"):
|
||||
asm = open("../main.asm", "r").read().split("\n")
|
||||
elif os.path.exists("../common.asm"):
|
||||
asm = open("../common.asm", "r").read().split("\n")
|
||||
elif os.path.exists("../pokered.asm"):
|
||||
asm = open("../pokered.asm", "r").read().split("\n")
|
||||
else:
|
||||
raise "this shouldn't happen"
|
||||
else:
|
||||
asm = open(filename, "r").read().split("\n")
|
||||
return asm
|
||||
|
||||
|
|
|
@ -2,15 +2,17 @@
|
|||
#date: 2012-01-13
|
||||
import os
|
||||
|
||||
changeset_numbers = range(266, 635)
|
||||
changeset_numbers = range(1145, 1149)
|
||||
|
||||
def take_snapshot_image(changeset_number):
|
||||
"turn main.asm into an image at a certain version"
|
||||
|
||||
print "reverting main.asm to r" + str(changeset_number)
|
||||
|
||||
#revert the file
|
||||
#revert the file (it used to be common.asm)
|
||||
os.system("hg revert ../main.asm -r" + str(changeset_number))
|
||||
os.system("hg revert ../common.asm -r" + str(changeset_number))
|
||||
os.system("hg revert ../pokered.asm -r" + str(changeset_number))
|
||||
|
||||
print "generating the image.."
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ for incbin_key in analyze_incbins.processed_incbins:
|
|||
end = incbin["end"]
|
||||
|
||||
for pos in range(start, end+1):
|
||||
widthx = pos % width
|
||||
heighty = floor(pos / height)
|
||||
widthx = int(pos % width)
|
||||
heighty = int(floor(pos / height))
|
||||
im.putpixel((widthx, heighty), 1)
|
||||
|
||||
im.save("test.png")
|
||||
|
|
Loading…
Reference in a new issue