Skip to content

1.4.1

Latest

Choose a tag to compare

@github-actions github-actions released this 01 Jun 08:23

New

  • Structured error API — Expected failures use a small hierarchy instead of bare ValueError:
    • NeoConvError (base, with code and optional hint)
    • InvalidNeoError — bad or truncated .neo files
    • InvalidRomLayoutError — MAME layout, naming, ZIP/dir issues, C/V sequence gaps
    • InvalidConfigurationError — extract sizes, P-ROM swap rules
    • UserCancelledError — GUI operation cancelled
  • resolve_genre() in neoconv.core — One shared function for genre name/id validation (CLI and GUI use the same rules).
  • SwapMode enumAUTO, YES, and NO for P-ROM bank swap in core, CLI, and GUI (replaces mixed bool/string handling).
  • py.typed in published wheels — PEP 561 marker so type checkers can use neoconv as a typed dependency.

Improvements

  • GUI — Pack with auto swap — Parses the ROM source once and runs swap detection once (faster on large sets; less redundant work than before).
  • GUI — Genre handling — Pack and Edit validate genre like the CLI; Pack preflight shows invalid genre in the status line (no silent “genre id 0”).
  • GUI — Clearer feedback — Info tab shows proper .neo errors with hints; Edit tab warns when header metadata cannot be loaded; cancel is reported as info, not a generic error.
  • GUI — Startup — If tkinter is missing, neoconv-gui exits with OS-specific install hints instead of a raw import error.
  • CLI & GUI — Actionable errors — Hints are printed/logged where available (e.g. C chip size, P-ROM swap on non–2 MB ROMs).
  • Pack--swap-p yes on a non–2 MB P-ROM fails with an explicit message and hint (detect-swap / use auto or no).
  • Library ergonomicsSwapMode, exception types, and resolve_genre are exported from neoconv.core.
  • Tests — End-to-end roundtrip integration tests (pack ↔ extract) strengthen regression coverage.

Bug fixes

  • Interleave: odd C chip count raises a clear layout error instead of IndexError.
  • Pack: _word_swap loop step corrected (off-by-one).
  • CLI: internal assert in extract replaced with RuntimeError for impossible states.
  • Removed stray duplicate neoconv/core/cli.py.

Documentation

  • README overhaul: Getting started table (pack / extract / edit / info), CLI + GUI called out up front, clearer structure and technical overview.
  • Pack metadata limits (latin-1 field lengths, uint types) and extract size reference (byte values for --c-chip-size / --v-bank-size).
  • Explained 2 MB fallback when sizes are unset vs per-game sizes from MAME / neogeo.xml.
  • FBNeo compatibility and split-C-chip notes; why C/V sizes must be chosen on extract.
  • New section: Errors (library API) for embedders.

For Python embedders

from neoconv.core import (
    NeoConvError,
    InvalidNeoError,
    InvalidRomLayoutError,
    InvalidConfigurationError,
    UserCancelledError,
    resolve_genre,
    SwapMode,
)

Catch NeoConvError subclasses for expected failures; read .code and .hint for stable handling and user-facing text.

Upgrade notes

  • Library code that caught ValueError from neoconv.core should catch NeoConvError (or the specific subclasses) instead.
  • CLI behaviour for successful conversions is unchanged; error text may include an extra hint line after —.
  • No new CLI subcommands since 1.3.0; extract sizing (--c-chip-size, --v-bank-size) and other 1.3.x behaviour is unchanged.