Repository navigation
refactor: clean code pass after the embedded-core merge + branch cleanup - #5
Merged
Merged
Conversation
Review-driven cleanup, no behavior change for external consoles: - Deduplicate FindSaveFor (was copy-pasted in RomLibraryPage and SaveIdentitySheet) into EmbeddedGameSession.SavePathForRom, the single owner of the mGBA .sav naming convention. - EmulatorsPage: EmulatorChip.Icon now delegates to the existing EmulatorChipIcon switch instead of duplicating it. - ConsoleRules.AnyInstalled: drop the redundant 'kind == Embedded ||' — EmulatorCatalog.IsInstalled already handles the embedded core via EmbeddedCoreAvailable. - AndroidEmulatorLauncher: hard guard — an Embedded link can never build an intent (returns false + log); CorePathHint now reuses EmulatorCatalog.CoreForGenerationSafe/CoreFileName instead of a local switch that still named GB/GBA cores. - EmulatorCatalog: App(Embedded) returns an explicit package-less entry; CoreForGeneration now throws for Gen 1-3 (they play in-app) and a new CoreForGenerationSafe returns null instead of throwing; RetroArch's core list drops Gambatte/MGba (DS only now). - EmbeddedGameSession: fixed the duplicated doc comment above IsAvailable. - Tests updated: RetroArchCoresFollowTheGeneration asserts Gen 1-3 have no RetroArch core (safe API null, throwing API throws). Verified statically (no .NET SDK in this sandbox — CI validates): all TryStart call sites use SavePathForRom; RunsInApp guards every console binding read; no path can route Embedded to an Android intent. Co-authored-by: Varonal <[email protected]>
…able AnyInstalled(GB) delegates to EmulatorCatalog.IsInstalled(Embedded), which reads the EmbeddedCoreAvailable flag (probed at startup). The test now sets the flag explicitly and asserts True when packed, False when not — restoring it after. Co-authored-by: Varonal <[email protected]>
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
Review-driven clean code pass, no behavior change for external consoles:
FindSaveForwas copy-pasted inRomLibraryPageandSaveIdentitySheet→ single ownerEmbeddedGameSession.SavePathForRom(the mGBA.savconvention lives next to the core that reads it).EmulatorsPage:EmulatorChip.IconduplicatedEmulatorChipIcon's switch → delegates now.ConsoleRules.AnyInstalled: removed redundantkind == Embedded ||—EmulatorCatalog.IsInstalledalready handles the embedded core.AndroidEmulatorLauncher: hard guard so anEmbeddedlink can never build an Android intent (returns false + AppLog);CorePathHintreusesEmulatorCatalog.CoreForGenerationSafe/CoreFileNameinstead of a local switch that still named GB/GBA cores.EmulatorCatalog:App(Embedded)returns an explicit package-less entry;CoreForGenerationthrows for Gen 1-3 (in-app), newCoreForGenerationSafereturns null; RetroArch's core list is DS-only.EmbeddedGameSession.RetroArchCoresFollowTheGenerationasserts Gen 1-3 have no RetroArch core).Also: all merged
vibe/*branches are deleted after merge, so onlymainremains.Verification
TryStartcall site usesSavePathForRom;RunsInAppguards every console-binding read; no code path can routeEmbeddedto an intent.