Skip to content

Add 7z archive support to MinArch #69

@nchapman

Description

@nchapman

Feature Request

Add support for 7z-compressed ROM files in MinArch (the libretro frontend).

Current Behavior

MinArch currently only supports ZIP archives via custom parsing in minarch_zip.c:

  • Parses ZIP file headers manually
  • Extracts using zlib (deflate compression only)
  • Supports compression methods: 0 (store) and 8 (deflate)

Files with .7z extension are passed directly to cores, which typically cannot load them, resulting in black screens.

Desired Behavior

Support .7z archives the same way .zip archives are handled:

  • Detect .7z extension
  • Extract first matching ROM file from archive
  • Pass extracted file to core

Implementation Options

Option 1: Shell out to 7z binary

  • Bundle 7z binary for all platforms (Info-ZIP unzip already bundled for some)
  • Call via system() to extract to /tmp/
  • Simpler, handles both zip and 7z
  • Downside: Process overhead for extraction

Option 2: Link against p7zip library

  • Add LZMA decompression support to minarch_zip.c
  • Native extraction like current ZIP handling
  • More efficient, no process spawn
  • Downside: Binary size increase, library dependency

Related Files

  • workspace/all/minarch/minarch.c (line 215) - ZIP detection
  • workspace/all/minarch/minarch_zip.c - ZIP extraction
  • Existing unzip binaries: workspace/*/other/unzip60/unzip

Benefits

  • Better compatibility with ROM sets that use 7z compression
  • 7z typically achieves better compression than ZIP for ROMs
  • Reduces user confusion about supported formats

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions