Skip to content

Fix Ratchet & Clank 3 launch over SMB - #1761

Open
L10N37 wants to merge 1 commit into
ps2homebrew:masterfrom
L10N37:fix/rnc3-smb-retail-shift
Open

Fix Ratchet & Clank 3 launch over SMB#1761
L10N37 wants to merge 1 commit into
ps2homebrew:masterfrom
L10N37:fix/rnc3-smb-retail-shift

Conversation

@L10N37

@L10N37 L10N37 commented Aug 5, 2026

Copy link
Copy Markdown

What changed

Use an SMB-specific pointer recovery shift in the existing Ratchet & Clank 3: Up Your Arsenal patch for retail builds.

For ETH_MODE outside _DTL_T10000, the patch now uses sll $v1, $v0, 1. The existing behavior remains unchanged for DTL-T10000 and every non-SMB backend.

Why

The game derives an IOP memory pointer from the loaded module layout. Its iop_stash_daemon shifts that pointer while scanning module names.

The SMB module layout on the tested retail configuration causes one fewer right shift than the layouts handled by the existing default path. Recovering the pointer with the default two-bit retail shift therefore produces the wrong address and prevents the game from launching over SMB.

Testing

  • Confirmed launching and gameplay over SMB on a real retail PS2.
  • Confirmed launching over SMB through OPL in PCSX2.
  • No OPL compatibility modes were enabled.
  • Verified the remote diff contains one file with six additions and no deletions.
  • git diff --check and the repository format check pass locally.

A full local build was unavailable because the test workspace does not include PS2SDK; repository CI can provide the complete build matrix.

@10522

10522 commented Aug 10, 2026

Copy link
Copy Markdown

@AKuHAK @rickgaiser @sp193 @israpps @uyjulian @fjtrujy @Wolf3s @KrahJohlito @NathanNeurotic @F0bes

I confirm that this PR fixes this issue and this one (more details here).

Comment thread ee_core/src/patches.c

word1 = JAL((unsigned int)&RnC3_AlwaysAllocMem);
switch (config->GameMode) {
#ifndef _DTL_T10000

@sp193 sp193 Aug 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we now only need to left-shift by 1, it implies that there is an additional right-shift by 1 when using ETH mode today. So if built for the DTL-T10000, we should right-shift by 3 to keep things working.

@sp193

sp193 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

If you needed to change the math, it probably means that the modules loaded changed ever since I originally contributed this. patch - which was built off crazyc's work.
It looks like you need the repository maintainer to approve and merge this, for which I am not one of them.

If you know why the math is now wrong and can explain why, that would be best. So that future readers can understand which change in OPL caused this patch to evolve in such a way.

@L10N37

L10N37 commented Aug 15, 2026

Copy link
Copy Markdown
Author

You are correct that applying the same one-bit difference to a DTL-T10000 build would change the SMB case from sra $v1, $v0, 4 to sra $v1, $v0, 3.

I originally included that case, but removed it from this PR because I do not own or have access to a DTL-T10000 development console and therefore cannot test it. This PR is intentionally limited to the configuration I could verify: ETH_MODE on a retail PS2. The DTL-T10000 adjustment can be added later when somebody with suitable hardware can validate it.

I also traced the regression more precisely. Reports show that DB 792 works over SMB and DB 793 is the first broken build. The corresponding r793 change is commit 94babef7, which moved SMB authentication from the EE into a temporary smbinit.irx module loaded during the ETH-mode IOP reset. Therefore, the regression occurred during the DB 793/r793 cycle in 2015, rather than the earlier February NETMAN rewrite.

The likely explanation is that loading this temporary IOP module changed the module list/layout inspected by the game's iop_stash_daemon. That daemon modifies the saved pointer according to the module names it encounters: unnamed or Deci modules shift it left, while cdvd modules shift it right. The observed difference is exactly one bit, leaving one fewer net right shift under the current SMB layout. Retail SMB therefore needs sll $v1, $v0, 1 instead of the existing sll $v1, $v0, 2.

I have not instrumented the live IOP module list, so the smbinit.irx effect is the likely explanation rather than a directly verified one. The actual retail SMB correction has been confirmed on a real PS2 and through OPL over SMB in PCSX2, with no compatibility modes enabled. Every non-SMB backend remains unchanged.

@sp193

sp193 commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Sounds plausible enough to me. Thank you for looking into this. This change is what we need.

I would prefer including a change for the T10000 for completeness, but it is possible that I was always the only guy who got one. Yeah, it doesn't concern most people and I have no objections, even if you do not include a fix for this.

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.

3 participants