mirror of
https://github.com/pret/pokemon-reverse-engineering-tools.git
synced 2026-03-21 17:24:42 -05:00
preprocessor: dont write to globals.asm for each process
This commit is contained in:
parent
05b622e7c0
commit
f5ddc33705
|
|
@ -483,22 +483,18 @@ class Preprocessor(object):
|
|||
for l in lines:
|
||||
self.read_line(l)
|
||||
|
||||
self.update_globals()
|
||||
|
||||
def update_globals(self):
|
||||
"""
|
||||
Add any labels not already in globals.asm.
|
||||
"""
|
||||
# TODO: pokered needs to be fixed
|
||||
try:
|
||||
globes = open(os.path.join(self.config.path, 'globals.asm'), 'r+')
|
||||
path = os.path.join(self.config.path, 'globals.asm')
|
||||
if os.path.exists(path):
|
||||
globes = open(path, 'r+')
|
||||
lines = globes.readlines()
|
||||
for globe in self.globes:
|
||||
line = 'GLOBAL ' + globe + '\n'
|
||||
if line not in lines:
|
||||
globes.write(line)
|
||||
except Exception as exception:
|
||||
pass # don't care if it's not there...
|
||||
|
||||
def read_line(self, l):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user