mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-06 15:45:24 +13:00
rename common.asm -> main.asm
hg-commit-id: adec8319c54b
This commit is contained in:
parent
8cf4620deb
commit
4f7a07efa9
9 changed files with 19 additions and 19 deletions
|
|
@ -27,7 +27,7 @@ def offset_to_pointer(offset):
|
|||
if type(offset) == str: offset = int(offset, base)
|
||||
return int(offset) % 0x4000 + 0x4000
|
||||
|
||||
def load_asm(filename="../common.asm"):
|
||||
def load_asm(filename="../main.asm"):
|
||||
"loads the asm source code into memory"
|
||||
global asm
|
||||
asm = open(filename, "r").read().split("\n")
|
||||
|
|
@ -86,7 +86,7 @@ def process_incbins():
|
|||
|
||||
def find_incbin_to_replace_for(address):
|
||||
"""returns a line number for which incbin to edit
|
||||
if you were to insert bytes into common.asm"""
|
||||
if you were to insert bytes into main.asm"""
|
||||
if type(address) == str: address = int(address, 16)
|
||||
|
||||
for incbin_key in processed_incbins.keys():
|
||||
|
|
@ -155,7 +155,7 @@ def generate_diff_insert(line_number, newline):
|
|||
newfile_fh.close()
|
||||
|
||||
try:
|
||||
diffcontent = subprocess.check_output("diff -u ../common.asm " + newfile_filename, shell=True)
|
||||
diffcontent = subprocess.check_output("diff -u ../main.asm " + newfile_filename, shell=True)
|
||||
except AttributeError, exc:
|
||||
raise exc
|
||||
except Exception, exc:
|
||||
|
|
@ -195,7 +195,7 @@ def insert_map_header_asm(map_id):
|
|||
fh.close()
|
||||
|
||||
#apply the patch
|
||||
os.system("patch ../common.asm temp.patch")
|
||||
os.system("patch ../main.asm temp.patch")
|
||||
|
||||
#remove the patch
|
||||
os.system("rm temp.patch")
|
||||
|
|
@ -230,8 +230,8 @@ def apply_diff(diff, try_fixing=True):
|
|||
fh.close()
|
||||
|
||||
#apply the patch
|
||||
os.system("cp ../common.asm ../common1.asm")
|
||||
os.system("patch ../common.asm temp.patch")
|
||||
os.system("cp ../main.asm ../main1.asm")
|
||||
os.system("patch ../main.asm temp.patch")
|
||||
|
||||
#remove the patch
|
||||
os.system("rm temp.patch")
|
||||
|
|
@ -242,7 +242,7 @@ def apply_diff(diff, try_fixing=True):
|
|||
return True
|
||||
except Exception, exc:
|
||||
if try_fixing:
|
||||
os.system("mv ../common1.asm ../common.asm")
|
||||
os.system("mv ../main1.asm ../main.asm")
|
||||
return False
|
||||
|
||||
def index(seq, f):
|
||||
|
|
|
|||
|
|
@ -610,7 +610,7 @@ def scan_for_map_scripts_pointer():
|
|||
|
||||
def scan_rom_for_tx_fars_and_insert():
|
||||
"""calls analyze_texts.scan_rom_for_tx_fars()
|
||||
looks through INCBIN'd addresses from common.asm,
|
||||
looks through INCBIN'd addresses from main.asm,
|
||||
finds TX_FARs that aren't included yet.
|
||||
"""
|
||||
x = 0
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ def get_map_size_constants(do_sed=False):
|
|||
output += constant_name + "_WIDTH EQU $%.2x\n" % (width)
|
||||
output += "\n"
|
||||
|
||||
sed_lines += "sed -i 's/" + base_name + "Height/" + constant_name + "_HEIGHT" + "/g' common.asm" + "\n"
|
||||
sed_lines += "sed -i 's/" + base_name + "Width/" + constant_name + "_WIDTH" + "/g' common.asm" + "\n"
|
||||
sed_lines += "sed -i 's/" + base_name + "Height/" + constant_name + "_HEIGHT" + "/g' main.asm" + "\n"
|
||||
sed_lines += "sed -i 's/" + base_name + "Width/" + constant_name + "_WIDTH" + "/g' main.asm" + "\n"
|
||||
|
||||
if do_sed:
|
||||
return sed_lines
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ asm = None
|
|||
asm_lines = None
|
||||
def load_asm():
|
||||
global asm, asm_lines
|
||||
asm = open("../common.asm", "r").read()
|
||||
asm = open("../main.asm", "r").read()
|
||||
asm_lines = asm.split("\n")
|
||||
|
||||
def get_xy_movement_of_connection_strip(map_id, connection_id):
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ import os
|
|||
changeset_numbers = range(266, 635)
|
||||
|
||||
def take_snapshot_image(changeset_number):
|
||||
"turn common.asm into an image at a certain version"
|
||||
"turn main.asm into an image at a certain version"
|
||||
|
||||
print "reverting common.asm to r" + str(changeset_number)
|
||||
print "reverting main.asm to r" + str(changeset_number)
|
||||
|
||||
#revert the file
|
||||
os.system("hg revert ../common.asm -r" + str(changeset_number))
|
||||
os.system("hg revert ../main.asm -r" + str(changeset_number))
|
||||
|
||||
print "generating the image.."
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue