This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
Refactor the LZ tools and fix BSSReader's eval shenanigans. #86
Merged
Merged
Changes from 8 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
aff7602
Fix the output of PointerLabelParam.to_asm.
yenatch 074f8df
audio: Expose header reads via separate functions.
yenatch 85e0e2a
Refactor the de/compressor.
yenatch 0dd6b20
BSSReader: Fix eval inserting __builtins__ into self.constants.
yenatch ca42efa
More lenient palette handling.
yenatch 145269c
Left a scalpel in the patient.
yenatch 41df23f
Refactor the Decompressed class and dump/convert pic animations.
yenatch 0182bca
Read gfx.yaml for graphics conversion options.
yenatch aec2e7f
Refactor get_pic_animation.
yenatch 78aa4f0
Pointless whitespace tweaks.
yenatch 36f7ee5
Refactor the compressor again.
yenatch fb23f27
Split the lz compression tools out of gfx.py.
yenatch 68eae56
Merge remote-tracking branch 'origin/master'
yenatch 8d86abe
hotfix: gfx.py doesn't need baserom.gbc to work
yenatch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -370,7 +370,8 @@ def __init__(self, address, name='', sfx=False): | |
self.asms = [] | ||
self.parse() | ||
|
||
def parse(self): | ||
|
||
def parse_header(self): | ||
self.num_channels = (rom[self.address] >> 6) + 1 | ||
self.channels = [] | ||
for ch in xrange(self.num_channels): | ||
|
@@ -383,9 +384,9 @@ def parse(self): | |
self.channels += [(current_channel, channel)] | ||
self.labels += channel.labels | ||
|
||
asms = [] | ||
|
||
asms += [generate_label_asm(self.base_label, self.start_address)] | ||
def make_header(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
asms = [] | ||
|
||
for i, (num, channel) in enumerate(self.channels): | ||
channel_id = num - 1 | ||
|
@@ -397,16 +398,27 @@ def parse(self): | |
|
||
comment_text = '; %x\n' % self.address | ||
asms += [(self.address, comment_text, self.address)] | ||
return asms | ||
|
||
|
||
def parse(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
self.parse_header() | ||
|
||
asms = [] | ||
|
||
asms += [generate_label_asm(self.base_label, self.start_address)] | ||
asms += self.make_header() | ||
|
||
for num, channel in self.channels: | ||
asms += channel.output | ||
|
||
asms = sort_asms(asms) | ||
self.last_address = asms[-1][2] | ||
_, _, self.last_address = asms[-1] | ||
asms += [(self.last_address,'; %x\n' % self.last_address, self.last_address)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using |
||
|
||
self.asms += asms | ||
|
||
|
||
def to_asm(self, labels=[]): | ||
"""insert outside labels here""" | ||
asms = self.asms | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstring on
parse_header
and why is it different frommake_header
..