Skip to content

fix(zaparoo): leave ACTIVEGAME alone when started from Zaparoo's temp MGL - #24

Open
wizzomafizzo wants to merge 1 commit into
masterfrom
fix/zaparoo-active-game-temp-mgl
Open

fix(zaparoo): leave ACTIVEGAME alone when started from Zaparoo's temp MGL#24
wizzomafizzo wants to merge 1 commit into
masterfrom
fix/zaparoo-active-game-temp-mgl

Conversation

@wizzomafizzo

@wizzomafizzo wizzomafizzo commented Sep 5, 2026

Copy link
Copy Markdown
Member

Summary

  • zaparoo_active_game_set_core() runs on every user_io_init(), including the app_restart() re-exec after a load_core, and wrote the MGL path for any .mgl start. Zaparoo Core and mrext send load_core /media/fat/.LASTLAUNCH.mgl after writing the real game path themselves, so about a second after a launch /tmp/ACTIVEGAME flipped from the game to the MGL. Nothing wrote the game back: menu.cpp skips recent_update() while an MGL is processing.
  • Skip the write for that one path. The file is rewritten on every launch, so its path never identifies a game. Bare-core starts still clear, menu-selected MRA/MGL starts still write, set_file is unchanged.
  • Row 20 of ZAPAROO_FORK.md notes the exception.

Reported against Core 2.17.1 by a user polling /tmp/ACTIVEGAME after a Frontend launch. Core's tracker already resolves an MGL value to the game it loads, so playtime and history were unaffected; the Core-side id follow-up is ZaparooProject/zaparoo-core#1432.

Validation

  • ./docker-build.sh clean && ./docker-build.sh
  • On a MiSTer, an API launch of a Genesis game polled at 250 ms: ACTIVEGAME held the game path through the re-exec (the previous binary flipped it to .LASTLAUNCH.mgl), returning to the menu cleared it, and load_core of _Console/Game Gear.mgl still wrote that MGL's path.

Summary by CodeRabbit

  • Bug Fixes

    • Improved active-game tracking during launches that use temporary game-launch files, preventing those temporary entries from replacing the currently tracked game.
    • Preserved existing behavior for standard core startup and regular game launches.
  • Documentation

    • Clarified the active-game tracking behavior and the exception for temporary launch files.

… MGL

zaparoo_active_game_set_core() runs on every user_io_init(), including
the app_restart() re-exec after a load_core, and wrote the MGL path for
any .mgl start. Zaparoo Core and mrext send load_core with
/media/fat/.LASTLAUNCH.mgl after writing the real game path themselves,
so /tmp/ACTIVEGAME flipped from the game to the MGL about a second after
every launch. Nothing wrote the game back: menu.cpp skips recent_update()
while an MGL is processing.

Skip the write for that one path. It is rewritten on every launch, so it
never identifies a game. Bare-core starts still clear, menu-selected MRA
and MGL starts still write, and set_file is unchanged.
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: ddee72b8-e27d-4bf9-a702-1a77d7b2558c

📥 Commits

Reviewing files that changed from the base of the PR and between b99bf53 and 9f2abdf.

📒 Files selected for processing (2)
  • ZAPAROO_FORK.md
  • support/zaparoo/active_game.cpp

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The active game tracker now leaves /tmp/ACTIVEGAME unchanged when startup uses /media/fat/.LASTLAUNCH.mgl. The code identifies this temporary MGL, and the change-map documentation records the exception.

Changes

Active game tracking

Layer / File(s) Summary
Temporary MGL exception
support/zaparoo/active_game.cpp, ZAPAROO_FORK.md
The tracker defines /media/fat/.LASTLAUNCH.mgl and skips active_game_write for matching MGL paths. The change-map documents this behavior.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 9f2ab

The launcher temporary MGL no longer replaces the actual game path in ACTIVEGAME, preserving active-game tracking across re-execution without changing normal core or menu-selected launch behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preventing ACTIVEGAME from being updated for Zaparoo's temporary MGL file.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

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.

1 participant