mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-17 02:40:50 +12:00
rename common.asm -> main.asm
hg-commit-id: adec8319c54b
This commit is contained in:
parent
8cf4620deb
commit
4f7a07efa9
6
Makefile
6
Makefile
|
@ -8,10 +8,10 @@ TEXTFILES = text/oakspeech.tx text/pokedex.tx text/mapRedsHouse1F.tx \
|
||||||
|
|
||||||
all: pokered.gbc
|
all: pokered.gbc
|
||||||
|
|
||||||
pokered.o: pokered.asm common.tx constants.asm ${TEXTFILES}
|
pokered.o: pokered.asm main.tx constants.asm ${TEXTFILES}
|
||||||
rgbasm -o pokered.o pokered.asm
|
rgbasm -o pokered.o pokered.asm
|
||||||
|
|
||||||
pokeblue.o: pokeblue.asm common.tx constants.asm ${TEXTFILES}
|
pokeblue.o: pokeblue.asm main.tx constants.asm ${TEXTFILES}
|
||||||
rgbasm -o pokeblue.o pokeblue.asm
|
rgbasm -o pokeblue.o pokeblue.asm
|
||||||
|
|
||||||
redrle: extras/redrle.c
|
redrle: extras/redrle.c
|
||||||
|
@ -30,6 +30,6 @@ pokeblue.gbc: pokeblue.o
|
||||||
rgbfix -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "POKEMON BLUE" $@
|
rgbfix -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "POKEMON BLUE" $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f common.tx pokered.o pokered.gbc pokeblue.o pokeblue.gbc redrle ${TEXTFILES}
|
rm -f main.tx pokered.o pokered.gbc pokeblue.o pokeblue.gbc redrle ${TEXTFILES}
|
||||||
|
|
||||||
more: pokered.gbc pokeblue.gbc
|
more: pokered.gbc pokeblue.gbc
|
||||||
|
|
|
@ -27,7 +27,7 @@ def offset_to_pointer(offset):
|
||||||
if type(offset) == str: offset = int(offset, base)
|
if type(offset) == str: offset = int(offset, base)
|
||||||
return int(offset) % 0x4000 + 0x4000
|
return int(offset) % 0x4000 + 0x4000
|
||||||
|
|
||||||
def load_asm(filename="../common.asm"):
|
def load_asm(filename="../main.asm"):
|
||||||
"loads the asm source code into memory"
|
"loads the asm source code into memory"
|
||||||
global asm
|
global asm
|
||||||
asm = open(filename, "r").read().split("\n")
|
asm = open(filename, "r").read().split("\n")
|
||||||
|
@ -86,7 +86,7 @@ def process_incbins():
|
||||||
|
|
||||||
def find_incbin_to_replace_for(address):
|
def find_incbin_to_replace_for(address):
|
||||||
"""returns a line number for which incbin to edit
|
"""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)
|
if type(address) == str: address = int(address, 16)
|
||||||
|
|
||||||
for incbin_key in processed_incbins.keys():
|
for incbin_key in processed_incbins.keys():
|
||||||
|
@ -155,7 +155,7 @@ def generate_diff_insert(line_number, newline):
|
||||||
newfile_fh.close()
|
newfile_fh.close()
|
||||||
|
|
||||||
try:
|
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:
|
except AttributeError, exc:
|
||||||
raise exc
|
raise exc
|
||||||
except Exception, exc:
|
except Exception, exc:
|
||||||
|
@ -195,7 +195,7 @@ def insert_map_header_asm(map_id):
|
||||||
fh.close()
|
fh.close()
|
||||||
|
|
||||||
#apply the patch
|
#apply the patch
|
||||||
os.system("patch ../common.asm temp.patch")
|
os.system("patch ../main.asm temp.patch")
|
||||||
|
|
||||||
#remove the patch
|
#remove the patch
|
||||||
os.system("rm temp.patch")
|
os.system("rm temp.patch")
|
||||||
|
@ -230,8 +230,8 @@ def apply_diff(diff, try_fixing=True):
|
||||||
fh.close()
|
fh.close()
|
||||||
|
|
||||||
#apply the patch
|
#apply the patch
|
||||||
os.system("cp ../common.asm ../common1.asm")
|
os.system("cp ../main.asm ../main1.asm")
|
||||||
os.system("patch ../common.asm temp.patch")
|
os.system("patch ../main.asm temp.patch")
|
||||||
|
|
||||||
#remove the patch
|
#remove the patch
|
||||||
os.system("rm temp.patch")
|
os.system("rm temp.patch")
|
||||||
|
@ -242,7 +242,7 @@ def apply_diff(diff, try_fixing=True):
|
||||||
return True
|
return True
|
||||||
except Exception, exc:
|
except Exception, exc:
|
||||||
if try_fixing:
|
if try_fixing:
|
||||||
os.system("mv ../common1.asm ../common.asm")
|
os.system("mv ../main1.asm ../main.asm")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def index(seq, f):
|
def index(seq, f):
|
||||||
|
|
|
@ -610,7 +610,7 @@ def scan_for_map_scripts_pointer():
|
||||||
|
|
||||||
def scan_rom_for_tx_fars_and_insert():
|
def scan_rom_for_tx_fars_and_insert():
|
||||||
"""calls analyze_texts.scan_rom_for_tx_fars()
|
"""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.
|
finds TX_FARs that aren't included yet.
|
||||||
"""
|
"""
|
||||||
x = 0
|
x = 0
|
||||||
|
|
|
@ -23,8 +23,8 @@ def get_map_size_constants(do_sed=False):
|
||||||
output += constant_name + "_WIDTH EQU $%.2x\n" % (width)
|
output += constant_name + "_WIDTH EQU $%.2x\n" % (width)
|
||||||
output += "\n"
|
output += "\n"
|
||||||
|
|
||||||
sed_lines += "sed -i 's/" + base_name + "Height/" + constant_name + "_HEIGHT" + "/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' common.asm" + "\n"
|
sed_lines += "sed -i 's/" + base_name + "Width/" + constant_name + "_WIDTH" + "/g' main.asm" + "\n"
|
||||||
|
|
||||||
if do_sed:
|
if do_sed:
|
||||||
return sed_lines
|
return sed_lines
|
||||||
|
|
|
@ -39,7 +39,7 @@ asm = None
|
||||||
asm_lines = None
|
asm_lines = None
|
||||||
def load_asm():
|
def load_asm():
|
||||||
global asm, asm_lines
|
global asm, asm_lines
|
||||||
asm = open("../common.asm", "r").read()
|
asm = open("../main.asm", "r").read()
|
||||||
asm_lines = asm.split("\n")
|
asm_lines = asm.split("\n")
|
||||||
|
|
||||||
def get_xy_movement_of_connection_strip(map_id, connection_id):
|
def get_xy_movement_of_connection_strip(map_id, connection_id):
|
||||||
|
|
|
@ -6,12 +6,12 @@ import os
|
||||||
changeset_numbers = range(266, 635)
|
changeset_numbers = range(266, 635)
|
||||||
|
|
||||||
def take_snapshot_image(changeset_number):
|
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
|
#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.."
|
print "generating the image.."
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
_RED EQU 0
|
_RED EQU 0
|
||||||
_BLUE EQU 1
|
_BLUE EQU 1
|
||||||
INCLUDE "common.tx"
|
INCLUDE "main.tx"
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
_RED EQU 1
|
_RED EQU 1
|
||||||
_BLUE EQU 0
|
_BLUE EQU 0
|
||||||
INCLUDE "common.tx"
|
INCLUDE "main.tx"
|
||||||
|
|
Loading…
Reference in a new issue