Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Commit

Permalink
Improve parse_roms.py performance
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeckmann committed Jan 2, 2021
1 parent 5ecb6a4 commit e47f665
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions parse_roms.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,7 @@ def generate_char_array(self, name: str, ROM: ROM) -> str:
rom_data = ROM.data()
template = "const uint8_t {name}[] __attribute__((section (\".extflash_game_rom\"))) = {{\n"
char_array = template.format(name=name)
while True:
current_data = rom_data[:8]
char_array += "\t"
for b in current_data:
char_array += hex(b) + ", "
rom_data = rom_data[8:]
char_array += "\n"
if(len(rom_data) == 0):
break
char_array += ", ".join([hex(x) for x in rom_data])
char_array += "};\n"

return char_array
Expand Down

0 comments on commit e47f665

Please sign in to comment.