Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with 0.21.2 & bump version (properly this time) #327

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# splat Release Notes

### 0.21.3
* Updated version graphically

### 0.21.2
* Fix bugs involving segments not having proper end rom positions if followed by segments with "auto" rom addresses; splat will now skip over these properly

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "splat64"
# Should be synced with src/splat/__init__.py
version = "0.21.2"
version = "0.21.3"
description = "A binary splitting tool to assist with decompilation and modding projects"
readme = "README.md"
license = {file = "LICENSE"}
Expand Down
2 changes: 1 addition & 1 deletion src/splat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__package_name__ = __name__

# Should be synced with pyproject.toml
__version_info__: Tuple[int, int, int] = (0, 21, 1)
__version_info__: Tuple[int, int, int] = (0, 21, 3)
__version__ = ".".join(map(str, __version_info__))
__author__ = "ethteck"

Expand Down
10 changes: 8 additions & 2 deletions src/splat/segtypes/common/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ def parse_subsegments(self, segment_yaml) -> List[Segment]:

segment_class = Segment.get_class_for_type(typ)

end = self.get_next_seg_start(i, segment_yaml["subsegments"])

if start is None:
# Attempt to infer the start address
if i == 0:
Expand All @@ -266,10 +264,18 @@ def parse_subsegments(self, segment_yaml) -> List[Segment]:
# The start address is the end address of the previous segment
start = last_rom_end

# First, try to get the end address from the next segment's start address
# Second, try to get the end address from the estimated size of this segment
# Third, try to get the end address from the next segment with a start address
end: Optional[int] = None
if i < len(segment_yaml["subsegments"]) - 1:
end = Segment.parse_segment_start(segment_yaml["subsegments"][i + 1])
if start is not None and end is None:
est_size = segment_class.estimate_size(subsegment_yaml)
if est_size is not None:
end = start + est_size
if end is None:
end = self.get_next_seg_start(i, segment_yaml["subsegments"])

if start is not None and prev_start is not None and start < prev_start:
log.error(
Expand Down
10 changes: 8 additions & 2 deletions src/splat/segtypes/common/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ def parse_subsegments(self, yaml) -> List[Segment]:

segment_class = Segment.get_class_for_type(typ)

end = self.get_next_seg_start(i, yaml["subsegments"])

if start is None:
# Attempt to infer the start address
if i == 0:
Expand All @@ -70,10 +68,18 @@ def parse_subsegments(self, yaml) -> List[Segment]:
# The start address is the end address of the previous segment
start = last_rom_end

# First, try to get the end address from the next segment's start address
# Second, try to get the end address from the estimated size of this segment
# Third, try to get the end address from the next segment with a start address
end: Optional[int] = None
if i < len(yaml["subsegments"]) - 1:
end = Segment.parse_segment_start(yaml["subsegments"][i + 1])
if start is not None and end is None:
est_size = segment_class.estimate_size(subsegment_yaml)
if est_size is not None:
end = start + est_size
if end is None:
end = self.get_next_seg_start(i, yaml["subsegments"])

if start is not None and prev_start is not None and start < prev_start:
log.error(
Expand Down