Skip to content

feat: Add user-configurable MiSTer _Other launchables#1063

Merged
wizzomafizzo merged 8 commits into
ZaparooProject:mainfrom
gmcnaught:feat/other-launchables-config
Jul 11, 2026
Merged

feat: Add user-configurable MiSTer _Other launchables#1063
wizzomafizzo merged 8 commits into
ZaparooProject:mainfrom
gmcnaught:feat/other-launchables-config

Conversation

@gmcnaught

@gmcnaught gmcnaught commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Adds a new [[other_launchables]] section to config.toml so users can register additional MiSTer _Other launchable cores (e.g. Sonic Mania, OpenBOR, PICO-8)

Entries are validated at config-load time: required fields, core_path must be a bare filename (no path separators/traversal), category defaults to "Other" or must be a known value.

The MiSTer platform's previously-hardcoded _Other launchable list is now data-driven and merges user entries on top: a matching id overrides an existing built-in's display fields while freezing its original UUID (so any existing frontend hidden/renamed/cover-art state isn't lost); a new id gets a UUID deterministically derived from the id string.

Test plan

go test -race ./pkg/config/... — passing
go test -race ./pkg/launchables/... — passing
go test -race ./pkg/platforms/mister/... — passing (run via Linux, since this package requires GOOS=linux)
golangci-lint run on changed packages — clean

Summary by CodeRabbit

  • New Features
    • Added support for custom launchers and virtual systems via configuration files.
    • Added command-based virtual systems that work even without a platform provider.
    • Added MiSTer “Other” entries with configurable name/category/load path, including user overrides.
    • Added stable, deterministic identifiers for user-defined launchables across restarts/devices.
  • Bug Fixes
    • Strengthened validation for custom launcher definitions and incompatible field combinations.
    • Improved reload behavior to keep the last known-good configuration when loads fail.
    • Ignored whitespace-only file extensions.

gmcnaught added 5 commits July 8, 2026 12:40
Lets users register additional MiSTer _Other launchables via a new
config.toml [[other_launchables]] section instead of requiring a Core
code change per new core.
Two-task plan: pkg/config validation section, then merging user
entries into the mister platform's launchable list.
Lets users declare additional MiSTer _Other launchable cores in
config.toml. Entries are validated at load time (required fields,
core_path must be a bare filename with no path separators, category
must be a known value or omitted). Invalid entries are dropped with a
warning; nothing here is wired into the mister platform yet.
Turns the hardcoded _Other launchable list into a data-driven slice
and overlays config.toml's [[other_launchables]] entries onto it. A
user id matching a built-in overrides its display fields while
keeping the built-in's fixed UUID; a new id gets a UUID deterministically
derived from the id string (uuid.NewSHA1), so users can now register
cores like Arduboy, Chip8, OpenBOR, PICO-8, Solarus, Sonic Mania, and
Tamagotchi themselves without a Core code change.
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7edc5808-f3e8-4275-89c9-67d66d48bf78

📥 Commits

Reviewing files that changed from the base of the PR and between dcdec8c and 822dafa.

📒 Files selected for processing (1)
  • pkg/config/configcustomlaunchers_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/config/configcustomlaunchers_test.go

📝 Walkthrough

Walkthrough

Adds validated custom launcher configuration and external TOML loading, deterministic UUIDs for user-defined launchables, command-backed virtual-system synthesis, and configurable MiSTer “Other” launchables with override and append behavior.

Changes

Custom launcher configuration

Layer / File(s) Summary
Custom launcher schema and validation
pkg/config/configlaunchers.go, pkg/config/configcustomlaunchers.go
Adds optional launcher fields and kind/backend constants, validates launcher combinations and MiSTer paths, and deep-clones launcher data.
External launcher loading and config application
pkg/config/configlaunchers.go, pkg/config/config.go
Strictly decodes sorted external TOML files, validates and merges entries, preserves state after failed loads, and validates inline custom launchers.
Custom launcher validation and loading tests
pkg/config/configcustomlaunchers_test.go
Covers validation, atomic loading, duplicate precedence, snapshot retention, and deep-copy behavior.

Launcher and platform integration

Layer / File(s) Summary
Command launcher parsing and execution
pkg/helpers/launchers.go, pkg/helpers/launchers_test.go
Centralizes custom launcher conversion and command execution, filters native backends, and ignores whitespace-only extensions.
Command virtual-system launchables
pkg/launchables/ids.go, pkg/launchables/launchables.go, pkg/launchables/launchables_test.go
Creates deterministic-ID command virtual systems from configuration and supports them without a platform provider.
MiSTer Other launchable merging
pkg/platforms/mister/launchables.go, pkg/platforms/mister/platform.go, pkg/platforms/mister/launchables_test.go
Builds MiSTer “Other” entries from built-ins plus case-insensitive custom overrides or deterministic-ID additions, while retaining existing Arcade exposure.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Config as config.Instance
  participant Platform as MiSTer Platform
  participant Merge as mergeOtherLaunchableDefinitions
  participant Launchables as launchables.Launchables

  Platform->>Config: CustomLaunchers()
  Platform->>Merge: merge built-in and custom Other definitions
  Merge-->>Platform: merged definitions
  Platform->>Platform: create VirtualSystem launch and test functions
  Launchables->>Platform: Launchables(cfg)
  Platform-->>Launchables: MiSTer launchables
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.16% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: user-configurable MiSTer _Other launchables.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gmcnaught gmcnaught changed the title Add user-configurable MiSTer _Other launchables feat: Add user-configurable MiSTer _Other launchables Jul 8, 2026
@wizzomafizzo

Copy link
Copy Markdown
Member

I have kept this idea but moved it to a multi-platform setup. You can define launchables in custom launchers now

[[launchers.custom]]
id = "Tools"
kind = "virtual_system"
backend = "command"
name = "Tools"
category = "Computer"
execute = "echo tools"

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/config/configcustomlaunchers_test.go`:
- Around line 164-235: Replace hardcoded path literals and string concatenation
in TestLoadCustomLaunchers_StrictAndAtomic,
TestLoadCustomLaunchers_RetainsSnapshotWhenAllFilesFail, and
TestLoadCustomLaunchers_InlineEntryWinsDuplicateID with filepath.Join, including
launchersDir initialization and launcher file paths; add the required filepath
import.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9c030ced-6414-49c7-a081-c3150e8e88e7

📥 Commits

Reviewing files that changed from the base of the PR and between 15b1089 and dcdec8c.

📒 Files selected for processing (11)
  • pkg/config/config.go
  • pkg/config/configcustomlaunchers.go
  • pkg/config/configcustomlaunchers_test.go
  • pkg/config/configlaunchers.go
  • pkg/helpers/launchers.go
  • pkg/helpers/launchers_test.go
  • pkg/launchables/launchables.go
  • pkg/launchables/launchables_test.go
  • pkg/platforms/mister/launchables.go
  • pkg/platforms/mister/launchables_test.go
  • pkg/platforms/mister/platform.go
✅ Files skipped from review due to trivial changes (1)
  • pkg/platforms/mister/platform.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/platforms/mister/launchables_test.go

Comment thread pkg/config/configcustomlaunchers_test.go
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.23404% with 42 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/helpers/launchers.go 82.47% 8 Missing and 9 partials ⚠️
pkg/config/configcustomlaunchers.go 87.61% 8 Missing and 6 partials ⚠️
pkg/launchables/launchables.go 70.96% 5 Missing and 4 partials ⚠️
pkg/config/configlaunchers.go 93.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@wizzomafizzo
wizzomafizzo merged commit 7dc4636 into ZaparooProject:main Jul 11, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants