Skip to content

refactor: clean code pass after the embedded-core merge + branch cleanup - #5

Merged
Varonal merged 2 commits into
mainfrom
vibe/cleanup-020819
Nov 9, 2026
Merged

Varonal merged 2 commits into
mainfrom
vibe/cleanup-020819

Conversation

@Varonal

@Varonal Varonal commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Summary

Review-driven clean code pass, no behavior change for external consoles:

  • FindSaveFor was copy-pasted in RomLibraryPage and SaveIdentitySheet → single owner EmbeddedGameSession.SavePathForRom (the mGBA .sav convention lives next to the core that reads it).
  • EmulatorsPage: EmulatorChip.Icon duplicated EmulatorChipIcon's switch → delegates now.
  • ConsoleRules.AnyInstalled: removed redundant kind == Embedded || — EmulatorCatalog.IsInstalled already handles the embedded core.
  • AndroidEmulatorLauncher: hard guard so an Embedded link can never build an Android intent (returns false + AppLog); CorePathHint 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 throws for Gen 1-3 (in-app), new CoreForGenerationSafe returns null; RetroArch's core list is DS-only.
  • Fixed a duplicated XML doc comment in EmbeddedGameSession.
  • Tests updated (RetroArchCoresFollowTheGeneration asserts Gen 1-3 have no RetroArch core).

Also: all merged vibe/* branches are deleted after merge, so only main remains.

Verification

  • Static review: every TryStart call site uses SavePathForRom; RunsInApp guards every console-binding read; no code path can route Embedded to an intent.
  • CI (this PR): build + 1024 Domain tests + 992 Engine tests + APK pack check.

mistral-vibe and others added 2 commits November 9, 2026 12:10
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]>
@Varonal
Varonal merged commit 3bc8863 into main Nov 9, 2026
1 check passed
@Varonal
Varonal deleted the vibe/cleanup-020819 branch November 9, 2026 12:22
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