mirror of
https://github.com/pret/pokemon-reverse-engineering-tools.git
synced 2026-03-21 17:24:42 -05:00
parent
1be104b8e8
commit
460171a2c5
|
|
@ -20,11 +20,19 @@ def bracket_value(string, i=0):
|
|||
def read_bss_sections(bss):
|
||||
sections = []
|
||||
section = {
|
||||
'name': None,
|
||||
'type': None,
|
||||
'bank': None,
|
||||
'start': None,
|
||||
'labels': [],
|
||||
}
|
||||
address = None
|
||||
if type(bss) is not list: bss = bss.split('\n')
|
||||
for line in bss:
|
||||
line = line.lstrip()
|
||||
|
||||
comment_index = line.find(';')
|
||||
line, comment = line[:comment_index].lstrip(), line[comment_index:]
|
||||
|
||||
if 'SECTION' == line[:7]:
|
||||
if section: # previous
|
||||
sections += [section]
|
||||
|
|
@ -71,7 +79,7 @@ def read_bss_sections(bss):
|
|||
}]
|
||||
|
||||
elif line[:3] == 'ds ':
|
||||
length = eval(line[3:line.find(';')].replace('$','0x'))
|
||||
length = eval(line[3:].replace('$','0x'))
|
||||
address += length
|
||||
# adjacent labels use the same space
|
||||
for label in section['labels'][::-1]:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user