Skip to content

Fix MMCE VCD reliability, HDD probing, and device defaults - #236

Closed
NathanNeurotic wants to merge 6 commits into
masterfrom
agent/unified-mmce-vcd-fixes
Closed

Fix MMCE VCD reliability, HDD probing, and device defaults#236
NathanNeurotic wants to merge 6 commits into
masterfrom
agent/unified-mmce-vcd-fixes

Conversation

@NathanNeurotic

@NathanNeurotic NathanNeurotic commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Overview

Four functional commits keep each requested change reviewable:

  1. Silence speculative HDD config probes

    • Preserve legacy APA and BDM-HDD config discovery.
    • Suppress startup error 401 when no HDD is expected.
    • Correct the legacy getcwd buffer handling.
  2. Fix MMCE VCD art-quiesce ordering

    • Drain the MMCE artwork worker before VCD pre-launch file access.
    • Leave the POPSTARTER selector and handoff unchanged.
  3. Make BDMA replacement transactional

    • Validate the live driver pair before trusting its marker.
    • Back up a complete prior pair and restore it after replacement failure.
    • Write the new marker only after both modules install successfully.
    • Allow a corrupted empty marker to be replaced, but do not restore that empty marker during rollback.
  4. Default Device Settings entries to Manual or Off

    • BDM, HDD, Network, Apps, MMCE, and Favourites: Manual.
    • USB, iLink, MX4SIO, and exFAT HDD toggles: Off.
    • Network default: SMB with Manual startup.
    • Existing saved settings continue to override shipped defaults.

A fifth formatting-only commit applies the repository's required clang-format 12 configuration to the single pre-existing line flagged by the repository-wide CI check. The final empty bookkeeping commit records that formatter-generated tree through a normal push so GitHub can execute CI without Actions-token approval gating.

Validation

Do not treat this PR as test-ready until the complete compile matrix and CI format check are green. Hardware tests should cover HDD-less startup, legacy HDD config discovery, repeated MMCE VCD launches during artwork browsing, interrupted BDMA replacement, corrupted marker recovery, and fresh Device Settings defaults.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d4ff7461-c35e-4c1a-ace1-35b8b25e6efa

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

HDD probing now supports silent failure reporting, configuration defaults use unified SMB/manual networking, MMCE launch ordering quiesces art loads before VCD handoff, and BDMA installation validates, backs up, and restores live driver files.

Changes

Launch and device probing robustness

Layer / File(s) Summary
Silent HDD probing and alternate-device safety
include/hddsupport.h, src/hddsupport.c, src/opl.c
Adds silent HDD module loading for legacy configuration probes and safely handles getcwd() failure during alternate-device probing.
MMCE launch quiescing
src/mmcesupport.c
Aborts MMCE art-image loads before VCD handoff and warns when quiescing fails.
Network configuration defaults and reconciliation
include/opl.h, src/opl.c
Updates legacy network derivation, fresh-install SMB/manual defaults, device start modes, and transport flags.
BDMA installation validation and recovery
src/vcdsupport.c
Bounds backup reads, verifies both live modules, restores previous files after failed installation, and requires valid modules alongside the matching marker.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Launch
  participant vcdEnsureBdmaForLaunch
  participant vcdBdmaLivePairPresent
  participant vcdEquipBdma
  participant MemoryCard
  Launch->>vcdEnsureBdmaForLaunch: ensure BDMA for launch
  vcdEnsureBdmaForLaunch->>vcdBdmaLivePairPresent: validate live module pair
  vcdBdmaLivePairPresent->>MemoryCard: read both driver files
  vcdEnsureBdmaForLaunch->>vcdEquipBdma: install when marker or pair is invalid
  vcdEquipBdma->>MemoryCard: back up existing pair and marker
  vcdEquipBdma->>MemoryCard: write new pair and marker
  vcdEquipBdma->>MemoryCard: restore backup or clean up failed installation
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. 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 is concise and accurately reflects the main themes of the change set, including MMCE VCD, HDD probing, and default settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/unified-mmce-vcd-fixes

Comment @coderabbitai help to get the list of available commands.

@github-actions
github-actions Bot force-pushed the agent/unified-mmce-vcd-fixes branch 3 times, most recently from 8f272d1 to ff80416 Compare July 20, 2026 13:14

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions
github-actions Bot force-pushed the agent/unified-mmce-vcd-fixes branch 4 times, most recently from 155f406 to 615d404 Compare July 20, 2026 13:16

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a silent HDD module loading mechanism to prevent false-positive connection errors on HDD-less consoles during speculative legacy config discovery. It also moves the MMCE art-loading abort check before the VCD launch path to avoid card IO contention, improves safety in tryAlternateDevice by checking getcwd and increasing buffer size, and implements a robust backup-and-rollback mechanism for BDMA driver installation on memory cards. Feedback points out that the backup allocation function fails on empty files, which could block driver installation if a previous install was corrupted or left an empty marker file.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/vcdsupport.c Outdated
@github-actions
github-actions Bot force-pushed the agent/unified-mmce-vcd-fixes branch 3 times, most recently from 23d61cf to f3bcd6d Compare July 20, 2026 13:16
@NathanNeurotic
NathanNeurotic force-pushed the agent/unified-mmce-vcd-fixes branch from f3bcd6d to b981b86 Compare July 20, 2026 13:18
@github-actions
github-actions Bot force-pushed the agent/unified-mmce-vcd-fixes branch 4 times, most recently from 5579055 to c5f13a8 Compare July 20, 2026 13:20
@github-actions
github-actions Bot force-pushed the agent/unified-mmce-vcd-fixes branch 5 times, most recently from b30e56e to 83f1917 Compare July 20, 2026 13:23
@NathanNeurotic
NathanNeurotic force-pushed the agent/unified-mmce-vcd-fixes branch from 83f1917 to 311c92a Compare July 20, 2026 13:37
@NathanNeurotic NathanNeurotic changed the title Fix MMCE VCD launch reliability and silent HDD probing Fix MMCE VCD reliability, HDD probing, and device defaults Jul 20, 2026
@NathanNeurotic
NathanNeurotic marked this pull request as ready for review July 20, 2026 13:53
@NathanNeurotic
NathanNeurotic force-pushed the agent/unified-mmce-vcd-fixes branch from 7ba180d to 4b8dac0 Compare July 20, 2026 14:00

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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