Skip to content

Latest commit

 

History

History
53 lines (33 loc) · 3.92 KB

File metadata and controls

53 lines (33 loc) · 3.92 KB

Changelog

0.2 — 2026-04-19

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.

Tests

  • 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_subscript bounds, leftover-copy filter, XBE section-layout validation, raw_hex mismatch detection). Runs in under 0.1s with no external assets. (#24)

mgs_tool.py

  • encode_translation re-raises UnicodeEncodeError with the correct position in the caller's text. Previously, because the function encoded one character at a time, the exception's start always pointed at index 0 of the one-char substring Python was encoding, so the per-entry diagnostic in insert_translations always mis-identified the offending character. (#24)

xbe_tool.py

  • Extracted the JSON raw_hex comparison in cmd_insert into a standalone _check_raw_hex_match helper. Behaviour-preserving — the mismatch warning fires on the same inputs as in 0.1. (#24)

Housekeeping

  • Added .gitignore for Python cache directories (__pycache__/, *.pyc, .pytest_cache/). (#25)

0.1 — 2026-04-19

Bug fixes and hardening across all three tools. No format or CLI changes — existing JSON extracts and patched binaries remain compatible.

mgs_tool.py

  • Fix Shift-JIS decoder lead-byte range (#12)
  • Make encode_translation strict: raise UnicodeEncodeError on non-ASCII input instead of silently corrupting output, and surface per-string errors during insert (#14)
  • Raise ValueError on unrecognised {placeholder} tokens so typos fail loudly (#20)
  • Wire end_limit into parse_subscript bounds checks (#18)
  • roundtrip now actually exercises the insert path end-to-end (#16)
  • insert only copies .mgs / .mgp files from the source tree, skipping unrelated leftovers (#19)

xbe_tool.py

  • insert warns 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)

font_patch.py

  • Load DejaVu Sans Mono Bold lazily instead of at import time, so decode-page works without the font installed (#13)
  • preview actually 4× upscales the preview row (#17)
  • Patch only DXT1 blocks that intersect Latin tiles, leaving neighbouring kanji blocks untouched (#21)

Initial release

  • 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 roundtrip
  • xbe_tool.py: in-place XBE string extraction and insertion with null-padding
  • font_patch.py: halfwidth Latin glyph rendering and DXT1 encoding for sys_f24.xpr / sys_f18.xpr
  • Technical documentation: HALFWIDTH_SYSTEM.md, SCRIPT_FORMAT.md, FONT_SYSTEM.md