mirror of https://github.com/pret/pokecrystal.git
Handle unused banks (notably OAM and HRAM)
This commit is contained in:
parent
927d392a02
commit
c07ffc7633
|
@ -23,6 +23,7 @@ def total_bank_size(type):
|
||||||
return sizes[type]
|
return sizes[type]
|
||||||
|
|
||||||
def sorted_mapfile(input):
|
def sorted_mapfile(input):
|
||||||
|
unused_rx = re.compile(r'^([A-Z]+):$')
|
||||||
bank_rx = re.compile(r'^([A-Z]+) Bank #([0-9]+)')
|
bank_rx = re.compile(r'^([A-Z]+) Bank #([0-9]+)')
|
||||||
section_rx = re.compile(r' +SECTION: \$([0-9A-F]+)(?:-\$([0-9A-F]+))? \(\$([0-9A-F]+) bytes\) \["(.+)"\]')
|
section_rx = re.compile(r' +SECTION: \$([0-9A-F]+)(?:-\$([0-9A-F]+))? \(\$([0-9A-F]+) bytes\) \["(.+)"\]')
|
||||||
label_rx = re.compile(r' +\$([0-9A-F]+) = (.+)')
|
label_rx = re.compile(r' +\$([0-9A-F]+) = (.+)')
|
||||||
|
@ -40,6 +41,16 @@ def sorted_mapfile(input):
|
||||||
# empty banks have their entire capacity as slack
|
# empty banks have their entire capacity as slack
|
||||||
line = ' SLACK: $%04X bytes\n' % total_bank_size(bank_type)
|
line = ' SLACK: $%04X bytes\n' % total_bank_size(bank_type)
|
||||||
|
|
||||||
|
x = re.match(unused_rx, line)
|
||||||
|
if x:
|
||||||
|
# start an unused bank
|
||||||
|
bank_type = x.group(1)
|
||||||
|
bank_number = '00'
|
||||||
|
bank_size = 0
|
||||||
|
bank_queue.clear()
|
||||||
|
section_queue.clear()
|
||||||
|
continue
|
||||||
|
|
||||||
x = re.match(bank_rx, line)
|
x = re.match(bank_rx, line)
|
||||||
if x:
|
if x:
|
||||||
# start a new bank
|
# start a new bank
|
||||||
|
|
Loading…
Reference in New Issue