summaryrefslogtreecommitdiff
path: root/extras
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2012-01-27 22:58:20 -0600
committerBryan Bishop <kanzure@gmail.com>2012-01-27 22:58:20 -0600
commitd1281e8d5e14bd5ae42b34186ac4f91647389e84 (patch)
tree10fc2d8e3c2c585afa746a27b5f4e788d90900df /extras
parentdadfdd5d2e397ae832dbaf7b14a6e8cc94db7690 (diff)
move learnsets into the asm
hg-commit-id: a77dfd566b43
Diffstat (limited to 'extras')
-rw-r--r--extras/analyze_incbins.py17
-rw-r--r--extras/insert_texts.py19
2 files changed, 23 insertions, 13 deletions
diff --git a/extras/analyze_incbins.py b/extras/analyze_incbins.py
index 3f0f9093..22b51c6f 100644
--- a/extras/analyze_incbins.py
+++ b/extras/analyze_incbins.py
@@ -221,7 +221,7 @@ def reset_incbins():
isolate_incbins()
process_incbins()
-def apply_diff(diff, try_fixing=True):
+def apply_diff(diff, try_fixing=True, do_compile=True):
print "... Applying diff."
#write the diff to a file
@@ -237,13 +237,14 @@ def apply_diff(diff, try_fixing=True):
os.system("rm temp.patch")
#confirm it's working
- try:
- subprocess.check_call("cd ../; make clean; LC_CTYPE=C make", shell=True)
- return True
- except Exception, exc:
- if try_fixing:
- os.system("mv ../main1.asm ../main.asm")
- return False
+ if do_compile:
+ try:
+ subprocess.check_call("cd ../; make clean; LC_CTYPE=C make", shell=True)
+ return True
+ except Exception, exc:
+ if try_fixing:
+ os.system("mv ../main1.asm ../main.asm")
+ return False
def index(seq, f):
"""return the index of the first item in seq
diff --git a/extras/insert_texts.py b/extras/insert_texts.py
index 33a51b07..f99f229a 100644
--- a/extras/insert_texts.py
+++ b/extras/insert_texts.py
@@ -747,7 +747,7 @@ def base_data_pretty_printer(id):
incbin_end_address = base_address + 27
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_attack) + " ; base attack\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 " + attack4 + "\n\n"
output += spacing + "db " + str(growth_rate) + " ; growth rate\n"
- output += spacing + "\n" + spacing + "; include learnset directly\n"
- output += spacing + ("INCBIN \"baserom.gbc\",$%.x,$%.x - $%.x\n" % (incbin_start_address, incbin_end_address, incbin_start_address))
+ output += spacing + "\n" + spacing + "; learnset\n"
+
+ #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"
return output
@@ -804,10 +813,10 @@ def insert_base_stats(id):
diff = generate_diff_insert(line_number, newlines)
print diff
- apply_diff(diff, try_fixing=False)
+ apply_diff(diff, try_fixing=False, do_compile=False)
def insert_all_base_stats():
- for id in range(0, 152):
+ for id in range(0, 151):
#if id < 62: continue #skip
insert_base_stats(id)