mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-17 02:40:50 +12:00
move learnsets into the asm
hg-commit-id: a77dfd566b43
This commit is contained in:
parent
dadfdd5d2e
commit
d1281e8d5e
|
@ -221,7 +221,7 @@ def reset_incbins():
|
||||||
isolate_incbins()
|
isolate_incbins()
|
||||||
process_incbins()
|
process_incbins()
|
||||||
|
|
||||||
def apply_diff(diff, try_fixing=True):
|
def apply_diff(diff, try_fixing=True, do_compile=True):
|
||||||
print "... Applying diff."
|
print "... Applying diff."
|
||||||
|
|
||||||
#write the diff to a file
|
#write the diff to a file
|
||||||
|
@ -237,13 +237,14 @@ def apply_diff(diff, try_fixing=True):
|
||||||
os.system("rm temp.patch")
|
os.system("rm temp.patch")
|
||||||
|
|
||||||
#confirm it's working
|
#confirm it's working
|
||||||
try:
|
if do_compile:
|
||||||
subprocess.check_call("cd ../; make clean; LC_CTYPE=C make", shell=True)
|
try:
|
||||||
return True
|
subprocess.check_call("cd ../; make clean; LC_CTYPE=C make", shell=True)
|
||||||
except Exception, exc:
|
return True
|
||||||
if try_fixing:
|
except Exception, exc:
|
||||||
os.system("mv ../main1.asm ../main.asm")
|
if try_fixing:
|
||||||
return False
|
os.system("mv ../main1.asm ../main.asm")
|
||||||
|
return False
|
||||||
|
|
||||||
def index(seq, f):
|
def index(seq, f):
|
||||||
"""return the index of the first item in seq
|
"""return the index of the first item in seq
|
||||||
|
|
|
@ -747,7 +747,7 @@ def base_data_pretty_printer(id):
|
||||||
incbin_end_address = base_address + 27
|
incbin_end_address = base_address + 27
|
||||||
|
|
||||||
output = mon_name.title() + ("BaseStats: ; 0x%.x" % (base_address)) + "\n"
|
output = mon_name.title() + ("BaseStats: ; 0x%.x" % (base_address)) + "\n"
|
||||||
output += spacing + "db " + str(id+1) + " ; pokedex id\n"
|
output += spacing + "db DEX_" + mon_name.upper() + " ; pokedex id\n"
|
||||||
output += spacing + ("db " + str(base_hp)) + " ; base hp\n"
|
output += spacing + ("db " + str(base_hp)) + " ; base hp\n"
|
||||||
output += spacing + "db " + str(base_attack) + " ; base attack\n"
|
output += spacing + "db " + str(base_attack) + " ; base attack\n"
|
||||||
output += spacing + "db " + str(base_defense) + " ; base defense\n"
|
output += spacing + "db " + str(base_defense) + " ; base defense\n"
|
||||||
|
@ -766,8 +766,17 @@ def base_data_pretty_printer(id):
|
||||||
output += spacing + "db " + attack3 + "\n"
|
output += spacing + "db " + attack3 + "\n"
|
||||||
output += spacing + "db " + attack4 + "\n\n"
|
output += spacing + "db " + attack4 + "\n\n"
|
||||||
output += spacing + "db " + str(growth_rate) + " ; growth rate\n"
|
output += spacing + "db " + str(growth_rate) + " ; growth rate\n"
|
||||||
output += spacing + "\n" + spacing + "; include learnset directly\n"
|
output += spacing + "\n" + spacing + "; learnset\n"
|
||||||
output += spacing + ("INCBIN \"baserom.gbc\",$%.x,$%.x - $%.x\n" % (incbin_start_address, incbin_end_address, incbin_start_address))
|
|
||||||
|
#learnset crap
|
||||||
|
output += spacing + "db %" + bin(ord(rom[base_address + 20]))[2:] + "\n"
|
||||||
|
output += spacing + "db %" + bin(ord(rom[base_address + 21]))[2:] + "\n"
|
||||||
|
output += spacing + "db %" + bin(ord(rom[base_address + 22]))[2:] + "\n"
|
||||||
|
output += spacing + "db %" + bin(ord(rom[base_address + 23]))[2:] + "\n"
|
||||||
|
output += spacing + "db %" + bin(ord(rom[base_address + 24]))[2:] + "\n"
|
||||||
|
output += spacing + "db %" + bin(ord(rom[base_address + 25]))[2:] + "\n"
|
||||||
|
output += spacing + "db %" + bin(ord(rom[base_address + 26]))[2:] + "\n\n"
|
||||||
|
|
||||||
output += spacing + "db 0 ; padding\n"
|
output += spacing + "db 0 ; padding\n"
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
@ -804,10 +813,10 @@ def insert_base_stats(id):
|
||||||
|
|
||||||
diff = generate_diff_insert(line_number, newlines)
|
diff = generate_diff_insert(line_number, newlines)
|
||||||
print diff
|
print diff
|
||||||
apply_diff(diff, try_fixing=False)
|
apply_diff(diff, try_fixing=False, do_compile=False)
|
||||||
|
|
||||||
def insert_all_base_stats():
|
def insert_all_base_stats():
|
||||||
for id in range(0, 152):
|
for id in range(0, 151):
|
||||||
#if id < 62: continue #skip
|
#if id < 62: continue #skip
|
||||||
insert_base_stats(id)
|
insert_base_stats(id)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue