Skip to content

Commit

Permalink
Improve 'next' segment rom pos finding behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
ethteck committed Jan 8, 2024
1 parent 04e2942 commit 8fa6580
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/splat/scripts/split.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,15 @@ def initialize_segments(config_segments: Union[dict, list]) -> List[Segment]:

this_start = Segment.parse_segment_start(seg_yaml)

if i == len(config_segments) - 1 and Segment.parse_segment_file_path(seg_yaml):
next_start: Optional[int] = 0
else:
next_start = Segment.parse_segment_start(config_segments[i + 1])
j = i + 1
while j < len(config_segments):
next_start = Segment.parse_segment_start(config_segments[j])
if next_start is not None:
break
j += 1
assert (
next_start is not None
), "Next segment address could not be found. Segments list must end with a rom end pos marker ([0x10000000])"

if segment_class.is_noload():
# Pretend bss's rom address is after the last actual rom segment
Expand Down

0 comments on commit 8fa6580

Please sign in to comment.