Regression test suite plus two small fixes surfaced while re-validating 0.1. No format or CLI changes — existing JSON extracts and patched binaries remain compatible.
- New
tests/directory with a pytest regression suite covering the non-obvious invariants from 0.1 (Shift-JIS lead-byte range, strict encode,{placeholder}tokens,parse_subscriptbounds, leftover-copy filter, XBE section-layout validation, raw_hex mismatch detection). Runs in under 0.1s with no external assets. (#24)
encode_translationre-raisesUnicodeEncodeErrorwith the correct position in the caller's text. Previously, because the function encoded one character at a time, the exception'sstartalways pointed at index 0 of the one-char substring Python was encoding, so the per-entry diagnostic ininsert_translationsalways mis-identified the offending character. (#24)
- Extracted the JSON
raw_hexcomparison incmd_insertinto a standalone_check_raw_hex_matchhelper. Behaviour-preserving — the mismatch warning fires on the same inputs as in 0.1. (#24)
- Added
.gitignorefor Python cache directories (__pycache__/,*.pyc,.pytest_cache/). (#25)
Bug fixes and hardening across all three tools. No format or CLI changes — existing JSON extracts and patched binaries remain compatible.
- Fix Shift-JIS decoder lead-byte range (#12)
- Make
encode_translationstrict: raiseUnicodeEncodeErroron non-ASCII input instead of silently corrupting output, and surface per-string errors duringinsert(#14) - Raise
ValueErroron unrecognised{placeholder}tokens so typos fail loudly (#20) - Wire
end_limitintoparse_subscriptbounds checks (#18) roundtripnow actually exercises the insert path end-to-end (#16)insertonly copies.mgs/.mgpfiles from the source tree, skipping unrelated leftovers (#19)
insertwarns when JSON entries reference XBE offsets or byte lengths that no longer match the target file (#15)- Validate XBE section layout against hardcoded SMT Nine offsets on load, so the tool refuses to run on an unexpected executable (#22)
- Load DejaVu Sans Mono Bold lazily instead of at import time, so
decode-pageworks without the font installed (#13) previewactually 4× upscales the preview row (#17)- Patch only DXT1 blocks that intersect Latin tiles, leaving neighbouring kanji blocks untouched (#21)
- Discovery of SMT Nine's built-in halfwidth Latin rendering system and the 2-byte XBE patch that enables it globally
mgs_tool.py: MGS/MGP script extraction, translation insertion, and byte-for-byte roundtripxbe_tool.py: in-place XBE string extraction and insertion with null-paddingfont_patch.py: halfwidth Latin glyph rendering and DXT1 encoding forsys_f24.xpr/sys_f18.xpr- Technical documentation: HALFWIDTH_SYSTEM.md, SCRIPT_FORMAT.md, FONT_SYSTEM.md