You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
hmm duplicate insertions
This commit is contained in:
@@ -4219,7 +4219,7 @@ def to_asm(some_object):
|
|||||||
asmr = asmr.replace("\n"+spacing+"\n", "\n\n"+spacing)
|
asmr = asmr.replace("\n"+spacing+"\n", "\n\n"+spacing)
|
||||||
asm += spacing + asmr
|
asm += spacing + asmr
|
||||||
#show the address of the next byte below this
|
#show the address of the next byte below this
|
||||||
asm += "\n; " + hex(last_address)
|
asm += "\n; " + hex(last_address) + "\n"
|
||||||
return asm
|
return asm
|
||||||
|
|
||||||
def flattener(x):
|
def flattener(x):
|
||||||
@@ -4637,11 +4637,26 @@ class Asm:
|
|||||||
if self.debug:
|
if self.debug:
|
||||||
print "object.__class__="+str(object.__class__) + " object is: " + str(object)
|
print "object.__class__="+str(object.__class__) + " object is: " + str(object)
|
||||||
self.insert(object)
|
self.insert(object)
|
||||||
def insert_all(self):
|
def insert_all(self, limit=100):
|
||||||
|
count = 0
|
||||||
for each in script_parse_table.items():
|
for each in script_parse_table.items():
|
||||||
|
if count == limit: break
|
||||||
object = each[1]
|
object = each[1]
|
||||||
if type(object) == str: continue
|
if type(object) == str: continue
|
||||||
self.insert_single_with_dependencies(object)
|
self.insert_single_with_dependencies(object)
|
||||||
|
count += 1
|
||||||
|
def insert_and_dump(self, limit=100, filename="output.txt"):
|
||||||
|
self.insert_all(limit=limit)
|
||||||
|
fh = open(filename, "w")
|
||||||
|
for each in self.parts:
|
||||||
|
if hasattr(each, "to_asm"):
|
||||||
|
if isinstance(each, AsmSection) or isinstance(each, Incbin) or isinstance(each, AsmLine):
|
||||||
|
fh.write(each.to_asm()+"\n")
|
||||||
|
else:
|
||||||
|
#print "each is: " + str(each)
|
||||||
|
fh.write(to_asm(each))
|
||||||
|
else:
|
||||||
|
fh.write(each + "\n")
|
||||||
|
|
||||||
def index(seq, f):
|
def index(seq, f):
|
||||||
"""return the index of the first item in seq
|
"""return the index of the first item in seq
|
||||||
|
Reference in New Issue
Block a user