diff --git a/payload/wwfcNatneg.cpp b/payload/wwfcNatneg.cpp index b3c0a78..c0cc809 100644 --- a/payload/wwfcNatneg.cpp +++ b/payload/wwfcNatneg.cpp @@ -65,4 +65,28 @@ s32 GT2CreateSocket( ); } +#if RMC +// Attempt to fix the "suspend bug," where DWC stalls suspending the match due +// to ongoing NATNEG between clients. This patch will ignore NATNEG and suspend +// anyway if not the host. +// Credit: MrBean35000vr +WWFC_DEFINE_PATCH = {Patch::CallWithCTR( + WWFC_PATCH_LEVEL_BUGFIX | WWFC_PATCH_LEVEL_PARITY, // + RMCXD_PORT(0x800E77F4, 0x800E7754, 0x800E7714, 0x800E7854), // + ASM_LAMBDA( + // clang-format off + lbz r0, 0x16(r31); // stpMatchCnt->hostState + cmpwi r0, 0; // Not in a match + beqlr; // r0 = 0 will already fall through to 0x800E7814 + + cmpwi r0, 1; // Client in room + beqlr; // r0 = 1 will already fall through to 0x800E781C + + lwz r0, 0x71C(r31); // stpMatchCnt->state + blr; + // clang-format on + ) +)}; +#endif // RMC + } // namespace wwfc::Natneg \ No newline at end of file