Conversation
…y_fields Implement the address-mode-aware offset conversion when writing back to a directory entry. The conversion is the inverse of file_offset() in entry.py: mode 0 (x86 physical) preserves upper bits and replaces only the ROM-masked lower bits; mode 1 (flash offset) stores the value directly; modes 2/3 (relative to directory header/slot) subtract the directory's buffer offset. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Type 0xb (SOFT_FUSE_CHAIN_01) stores 0xFFFFFFFF as a sentinel in its size field. from_entry() was zeroing it out via entry.size = 0, but since entry is a NestedBuffer overlaying the ROM bytes directly, this permanently destroyed the sentinel at parse time. The zero-write is unnecessary: file_offset() for type 0xb uses a special-cased path that ignores entry.size, and File.__init__ takes the NO_SIZE_ENTRY_TYPES branch (using entry.ENTRY_SIZE) before ever reaching the bounds check that reads entry.size. Fix: remove the zero-write so the sentinel is preserved throughout the object's lifetime, and guard update_entry_fields so a move_buffer call can never accidentally overwrite it either. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Metrics
|
| Metric | Value |
|---|---|
| Files Processed | 68 |
| Stdout Lines | 14,965 |
| Stderr Lines | 156 |
| Total Lines | 15,121 |
| Error Ratio | 1.03% |
PSPTool python library metrics
| Status | Count | Percentage |
|---|---|---|
| ✓ Successful | 68 | 100.0% |
| ✗ Failed | 0 | 0.0% |
| Total | 68 | 100% |
All files parsed successfully!
cwerling
commented
Apr 14, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
update_entry_fieldsindirectory.pyto properly convert ROM buffer offsets back to the value expected by a directory entry, respecting the entry's address mode. Previously the raw buffer offset was written directly, which produced wrong values for x86-physical (mode 0) and relative (mode 2/3) entries.NO_SIZE_ENTRY_TYPESsentinel sizes (e.g.0xFFFFFFFFforSOFT_FUSE_CHAIN) during updates. The old code infile.pyunconditionally zeroedentry.sizefor these types at parse time, destroying the sentinel; that logic is removed andupdate_entry_fieldsnow skips overwriting the size for these types instead.Address mode handling details
rom.addr_maskoffset - directory.buffer_offset🤖 Generated with Claude Code