mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-17 02:40:50 +12:00
Merge
hg-commit-id: 3b25511ba1aa
This commit is contained in:
commit
c3f71abe64
1276
common.asm
1276
common.asm
File diff suppressed because it is too large
Load diff
|
@ -6,16 +6,16 @@ from gbz80disasm import load_labels, find_label
|
||||||
from extract_maps import calculate_pointer
|
from extract_maps import calculate_pointer
|
||||||
import sys
|
import sys
|
||||||
spacing = "\t"
|
spacing = "\t"
|
||||||
|
rom = None
|
||||||
|
|
||||||
def pretty_print_trainer_header(address, label=None):
|
def pretty_print_trainer_header(address, label=None):
|
||||||
"""make pretty text for a trainer header"""
|
"""make pretty text for a trainer header"""
|
||||||
|
global rom
|
||||||
output = ""
|
output = ""
|
||||||
bank_id = 0
|
bank_id = 0
|
||||||
if address > 0x4000:
|
if address > 0x4000:
|
||||||
bank_id = address / 0x4000
|
bank_id = address / 0x4000
|
||||||
|
|
||||||
rom = open("../baserom.gbc", "r").read()
|
|
||||||
|
|
||||||
#convert address to an integer if necessary
|
#convert address to an integer if necessary
|
||||||
if type(address) == str:
|
if type(address) == str:
|
||||||
if "$" in address: address = address.replace("$", "0x")
|
if "$" in address: address = address.replace("$", "0x")
|
||||||
|
@ -97,6 +97,12 @@ def pretty_print_trainer_header(address, label=None):
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
def all_trainer_headers_at(address):
|
||||||
|
i = 0
|
||||||
|
while ord(rom[address + (i*12)]) != 0xff:
|
||||||
|
print pretty_print_trainer_header(address + (i*12))
|
||||||
|
i += 1
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
load_labels()
|
load_labels()
|
||||||
|
|
||||||
|
@ -111,7 +117,11 @@ def main():
|
||||||
address = int(args[0], 16)
|
address = int(args[0], 16)
|
||||||
label = args[1]
|
label = args[1]
|
||||||
|
|
||||||
print pretty_print_trainer_header(address, label)
|
global rom
|
||||||
|
rom = open("../baserom.gbc", "r").read()
|
||||||
|
|
||||||
|
#print pretty_print_trainer_header(address, label)
|
||||||
|
print all_trainer_headers_at(address)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Reference in a new issue