mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-11-14 09:06:41 +13:00
Merge in new Route2 work.
hg-commit-id: b67f316a108a
This commit is contained in:
commit
5f7bb0da72
2
Makefile
2
Makefile
|
|
@ -18,7 +18,7 @@ redrle: extras/redrle.c
|
||||||
${CC} -o $@ $>
|
${CC} -o $@ $>
|
||||||
|
|
||||||
.asm.tx:
|
.asm.tx:
|
||||||
awk -b -f textpre.awk < $< > $@
|
awk -f textpre.awk < $< > $@
|
||||||
|
|
||||||
pokered.gbc: pokered.o
|
pokered.gbc: pokered.o
|
||||||
rgblink -o $@ $<
|
rgblink -o $@ $<
|
||||||
|
|
|
||||||
1016
common.asm
1016
common.asm
File diff suppressed because it is too large
Load diff
910
constants.asm
910
constants.asm
File diff suppressed because it is too large
Load diff
|
|
@ -3,27 +3,36 @@
|
||||||
#date: 2012-01-15
|
#date: 2012-01-15
|
||||||
#dump map height/width constants
|
#dump map height/width constants
|
||||||
import extract_maps
|
import extract_maps
|
||||||
from pretty_map_headers import map_name_cleaner
|
from pretty_map_headers import map_name_cleaner, map_constants
|
||||||
|
|
||||||
def get_map_size_constants():
|
def get_map_size_constants(do_sed=False):
|
||||||
output = ""
|
output = ""
|
||||||
|
sed_lines = ""
|
||||||
for map_id in extract_maps.map_headers.keys():
|
for map_id in extract_maps.map_headers.keys():
|
||||||
if map_id in extract_maps.bad_maps: continue #skip
|
if map_id in extract_maps.bad_maps: continue #skip
|
||||||
|
|
||||||
map2 = extract_maps.map_headers[map_id]
|
map2 = extract_maps.map_headers[map_id]
|
||||||
base_name = map_name_cleaner(map2["name"], None)[:-2]
|
base_name = map_name_cleaner(map2["name"], None)[:-2]
|
||||||
|
constant_name = map_constants[map_id]
|
||||||
|
|
||||||
height = int(map2["y"], 16)
|
height = int(map2["y"], 16)
|
||||||
width = int(map2["x"], 16)
|
width = int(map2["x"], 16)
|
||||||
|
|
||||||
output += "; " + base_name + "_h map_id=" + str(map_id) + "\n"
|
output += "; " + base_name + "_h map_id=" + str(map_id) + "\n"
|
||||||
output += base_name + "Height EQU $%.2x\n" % (height)
|
output += constant_name + "_HEIGHT EQU $%.2x\n" % (height)
|
||||||
output += base_name + "Width EQU $%.2x\n" % (width)
|
output += constant_name + "_WIDTH EQU $%.2x\n" % (width)
|
||||||
output += "\n"
|
output += "\n"
|
||||||
return output
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
if do_sed:
|
||||||
|
return sed_lines
|
||||||
|
else:
|
||||||
|
return output
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
extract_maps.load_rom()
|
extract_maps.load_rom()
|
||||||
extract_maps.load_map_pointers()
|
extract_maps.load_map_pointers()
|
||||||
extract_maps.read_all_map_headers()
|
extract_maps.read_all_map_headers()
|
||||||
print get_map_size_constants()
|
print get_map_size_constants(do_sed=True)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue