Skip to content

Added configurable pak shortcut in game menu - #818

Open
bmpriest wants to merge 1 commit into
LoveRetro:mainfrom
bmpriest:feat/option-pak
Open

Added configurable pak shortcut in game menu#818
bmpriest wants to merge 1 commit into
LoveRetro:mainfrom
bmpriest:feat/option-pak

Conversation

@bmpriest

Copy link
Copy Markdown

What

  • Adds a setting to set a certain pak as launchable from the in-game menu.
    • Only paks with "in_game_shortcut": true are considered valid for assignment; feature is opt-in for pak makers.
    • Paks can also set a "short_name" value for display comfort. Otherwise it limits it to 12 characters.
  • Pak is launched from the in-game menu with the 'X' button.
  • Closing the pak returns to the menu (and game)
  • Passes along two environmental variables: rom path and emu pak, to allow for context aware paks

Why

  • Ideally, to allow for "guide" paks that can be referenced while still in-game. Quitting to navigate to a Tool pak, looking up whatever you need, quitting and then navigating back to the game is a complicated flow. We can simplify this by including a way to launch the .pak from the game menu
  • Could also allow for Pokedex paks, or Netplay paks, or (later) even perhaps a way to listen to your own music while playing a game, or any reason you might want to look at something in-game without losing your spot.
  • I tried to focus on something that would be easy to maintain, allowing pak launching under only certain conditions.

How

  • ma_menu.c: duplicates much of the functionality of the L3/R3 function pak shortcut. If unbound, displays the current ( ( POWER ) SLEEP ) button hint; if bound to a pak, truncates the name to 12 characters if too long, or uses the short_name attribute. Bound to "X."
    • Keeps the underlying emulation paused and launches the pak on a fork().
    • Quitting/leaving the pak returns directly to the menu.
  • fnbuttonmenu.cpp/fnbuttonmenu.h: re-uses a good bit of the code to build a list of valid paks
  • settings.cpp: adds the buildPakShortcutItem() under "In-Game"
  • utils.c/utils.h: allows determination of in_game_shortcut flag, as well as getting the name or short_name from pak.json
  • config.c/config.h: allows the saving of the setting to a pakshortcut.txt file. CFG_init() and CFG_sync() can remove entries from minuisettings.txt, so this is admittedly a small workaround.

Proof of Concept:

GameGuide.pak.zip

GameGuide.pak is a very basic text file reader that, if launched from in-game, looks for a .txt file under:

  1. <ROM folder>/.media/<ROM filename stem>.txt
  2. <ROM folder>/<ROM filename stem>.txt
  3. /Guides/<emulator tag>/<ROM filename stem>.txt
  4. /Guides/<ROM filename stem>.txt

and launches it automatically, as well as remembering the user's place in the file. Can also be launched from Tools with a SD Card file browser.

Screenshots:

Screenshot 2026-08-19-23-15-27 Pokemon - FireRed Version 2026-08-19-15-48-37 Pokemon - FireRed Version 2026-08-19-23-17-07

…me. Borrows .pak selection logic from fnbuttonmenu. Opt-in with 'in_game_shortcut' flag in pak.json.
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