Repository navigation
Hard-block external emulator binding for in-app consoles (GB/GBC/GBA launch only in PKForge) - #4
Merged
Merged
Conversation
…ved for those consoles Root cause of 'lancer un jeu GBA ouvre RetroArch': the embedded path was a fallback tried *after* the bound/installed external emulator, and the Emulators tab still offered RetroArch/Linkboy/PizzaBoy for GB/GBC/GBA. - EmulatorKind.Embedded = 10 (new, appended — persisted values never renumbered): PKForge itself, 'installed' when libpkforge_mgba.so is packed (EmulatorCatalog.EmbeddedCoreAvailable, probed once at startup in MauiProgram). - ConsoleRules.EmulatorsFor + RomLinkRules.EmulatorsForRom: GB/GBC/GBA (Gen 1-3) now return [Embedded] only. DS/3DS/GC/Switch unchanged. - RomLibraryPage.LaunchAsync: GB/GBC/GBA go embedded first and only; the external path is unreachable for them (clear message if the .so is missing). - SaveIdentitySheet: Play on a linked Gen 1-3 ROM opens EmbeddedGamePage; linking a Gen 1-3 ROM stores EmulatorKind.Embedded; texts updated. - EmulatorsPage: GB/GBC/GBA console rows removed (no external binding offered). - RetroArch's advertised systems now 'DS' only; Embedded advertises GB/GBC/GBA. - Tests updated (RomLinkTests, ConsoleRulesTests): Gen 1-3 prefer Embedded, GB counts as installed with no packages. Verified: dotnet build PKForge.sln 0 warnings 0 errors; DiagnosticBuild APK still packs libpkforge_mgba.so; targeted tests pass (68/69 before the melonDS package-id fix, then full suite = only the 2 pre-existing ICU-less failures). Co-authored-by: Varonal <[email protected]>
…/GBA) The previous commit removed GB/GBC/GBA rows and made EmulatorsFor return [Embedded], but the guard lived only at call sites and a stale persisted binding could still be read. Now the rule is centralized and enforced: - ConsoleRules.RunsInApp(console): single source of truth for consoles PKForge runs itself. RomLibraryPage.LaunchAsync, EmulatorsPage (row list + picker), and SaveIdentitySheet.LinkRomAsync all branch on it before ever touching IConsoleEmulatorStore or an installed external emulator. - EmulatorsPage.ChooseConsoleEmulatorAsync filters out EmulatorKind.Embedded from candidates, so even a hand-edited binding cannot offer it. - New tests: InAppConsolesNeverOfferAnExternalEmulator (GB/GBC/GBA candidates are exactly [Embedded]), ExternalConsolesAreNotMarkedInApp, and GenOneToThreeRomsHaveEmbeddedAsTheirOnlyRoute. Verified: build PKForge.sln 0 warnings 0 errors; DiagnosticBuild APK packs libpkforge_mgba.so; 79/79 targeted tests pass; full suites show only the 2 pre-existing ICU-less sandbox failures (green on CI). Co-authored-by: Varonal <[email protected]>
Owner
Author
Review noteMerged. Final state verified on
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes "lancer un jeu GBA depuis la liste ouvre encore RetroArch" and "RetroArch still selectable in the Emulators tab".
Root cause: the previous fix removed GB/GBC/GBA rows and made
EmulatorsForreturn[Embedded], but the guard lived only at call sites — a stale persisted binding (JsonConsoleEmulatorStore) could still be read and sent the ROM to RetroArch, and the picker could still list external emulators.Now centralized and enforced:
ConsoleRules.RunsInApp(console)— single source of truth for consoles PKForge runs itself.RomLibraryPage.LaunchAsync,EmulatorsPage(row list +ChooseConsoleEmulatorAsync), andSaveIdentitySheet.LinkRomAsyncall branch onRunsInAppbefore touchingIConsoleEmulatorStoreor any installed external emulator.ChooseConsoleEmulatorAsyncfiltersEmulatorKind.Embeddedout of candidates — even a hand-edited binding can't offer it.libpkforge_mgba.sopacked in the APK (native GB/GBC/GBA play), live PokéDaisy companion, trophies column fix.Verification
dotnet build PKForge.sln→ 0 warnings / 0 errorsdotnet build src/PKForge.App/PKForge.App.csproj -f net10.0-android -p:DiagnosticBuild=true→ succeeded; APK containslib/arm64-v8a/libpkforge_mgba.soInAppConsolesNeverOfferAnExternalEmulator(GB/GBC/GBA → exactly[Embedded]),ExternalConsolesAreNotMarkedInApp,GenOneToThreeRomsHaveEmbeddedAsTheirOnlyRoute— 79/79 targeted tests passmainin an ICU-less sandbox (green on CI)