Skip to content

D-10: restore post-load reset HDD child handoff#401

Open
NathanNeurotic wants to merge 1 commit intoBETA-11-playfrom
codex/task-title
Open

D-10: restore post-load reset HDD child handoff#401
NathanNeurotic wants to merge 1 commit intoBETA-11-playfrom
codex/task-title

Conversation

@NathanNeurotic
Copy link
Copy Markdown
Owner

Motivation

  • Previous no-reset/fileXio-first child-loader line for partition-aware HDD launches did not produce a stable improvement for D-10 on recorded hardware, so the partition-aware handoff must be narrowed to a deterministic contract the embedded loader historically used.
  • Keep non-HDD direct fileXio flows intact while removing ambiguity in the partition-aware pfs0: branch to reduce experiment noise for the next CI hardware artifact.

Description

  • Reworked the partition-aware HDD child-loader path in src/elf_loader/src/loader/src/loader.c to always call SifLoadElf for mounted pfs0: loads and restore a post-load IOP reset and module reload sequence before ExecPS2.
  • Added load_post_reset_mc_modules() and the sequence SifIopReset("") / SifIopSync() / SifInitRpc(0) / SifLoadFileInit() + module reloads (rom0:SIO2MAN, rom0:MCMAN, rom0:MCSERV) / SifLoadFileExit() in the child before jumping.
  • Removed the earlier mounted-path fileXio-first branch for the partition-aware child path while preserving the fallback fileXio and SifLoadElf behavior for non-partition-aware/direct iomanX paths.
  • Synchronized documentation to describe the new experiment line and status by updating README.md, STATE.md, ROADMAP.md, DECISIONS.md, and QA_REGRESSION_MATRIX.md.

Testing

  • Attempted a local rebuild with make elfloader, which failed in this environment due to missing PS2SDK build include (/samples/Makefile.eeglobal), so no local ELF artifact was produced.
  • Repo-level sanity: committed the targeted source change and updated docs; CI artifact validation and hardware verification remain Unknown (verify on hardware) until the next GitHub Actions build and hardware run produce results.

Codex Task

Copy link
Copy Markdown

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

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 updates the HDD-partition-aware loading logic to use a post-load reset handoff, reverting the previous no-reset strategy to resolve hardware black-screen issues. The implementation now utilizes SifLoadElf for all partition-aware loads and performs an IOP reset and module reload before execution. Feedback indicates that SifLoadModule should be corrected to SifLoadStartModule to comply with PS2SDK standards and that SifExitCmd should be added to the HDD path for consistent SIF cleanup.

Comment on lines +176 to +178
SifLoadModule("rom0:SIO2MAN", 0, NULL);
SifLoadModule("rom0:MCMAN", 0, NULL);
SifLoadModule("rom0:MCSERV", 0, NULL);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The function SifLoadModule is not a standard PS2SDK function and is likely the cause of the compilation failure mentioned in the PR description. It should be replaced with SifLoadStartModule, which is the standard function for loading IOP modules. Note that SifLoadStartModule takes four arguments; the fourth argument (a pointer to an integer to receive the module's return value) can be set to NULL if not needed.

	SifLoadStartModule("rom0:SIO2MAN", 0, NULL, NULL);
	SifLoadStartModule("rom0:MCMAN", 0, NULL, NULL);
	SifLoadStartModule("rom0:MCSERV", 0, NULL, NULL);

SifLoadFileInit();
load_post_reset_mc_modules();
SifLoadFileExit();
SifExitRpc();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The HDD-specific path is missing a call to SifExitCmd() before jumping to the target ELF. This is inconsistent with the else block (line 405) and the standard cleanup sequence used in elf.c. Ensuring a clean SIF command state is important for a stable handoff to the child ELF, especially when trying to resolve black-screen issues.

			SifExitRpc();
			SifExitCmd();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant