ROM Hack Donkey Kong Country Returns 3D Co-op Enemy Bounce Fix

Peter0x44

Member
Newcomer
Joined
Jan 11, 2021
Messages
10
Reaction score
11
Trophies
0
Age
23
XP
187
Country
Bulgaria
Donkey Kong Country Returns 3D Co-op Enemy Bounce Fix
Both players can bounce off the same enemy again!

​

The problem
In DKC Returns 3D co-op, if player 1 jumps on an enemy, player 2 falls straight through it instead of bouncing. On the Wii, the defeated enemy stays solid for about half a second, so both players can chain bounces. That's important in later levels where you have to bounce across hazards.

The Switch remaster (built from the 3DS code) had the same bug, and people noticed. It was covered by Kong Kompendium, xXglitchygamesXx, Game & Gig, Nintendo Life and GoNintendo, and many others.

Nintendo fixed it on the Switch in update 1.1.0, but the 3DS version was never patched.
The 3DS version always deserved the same fix. It never sat right with me that 3DS players got left out, so I decided to fix it myself.

Download
github.com/Peter0x44/dkcr3ds-coop-bounce-fix

Patches are available for all four retail versions. Pick the one matching your title ID:
RegionTitle IDIPS patchCheat
USA00040000000CCE00code.ipscheat_gateway.txt
Europe00040000000CCF00code.ipscheat_gateway.txt
Japan00040000000CC000code.ipscheat_gateway.txt
Korea00040000000FFC00code.ipscheat_gateway.txt

Install
Replace <TID> with your version's title ID.
  • Luma3DS: put code.ips in sd:/luma/titles/<TID>/, then enable "Enable game patching" in the Luma config menu (hold SELECT while powering on). Both consoles in a co-op session need the patch.
  • Azahar: put code.ips in load/mods/<TID>/exefs/ (right-click the game → Open Mods Location).
  • Cheat instead: use cheat_gateway.txt in Rosalina (sd:/cheats/<TID>.txt) or Azahar's cheat window. Enable it before entering a level.

Status
  • USA: tested in co-op on Azahar (two instances in a local multiplayer room). Both players bounce.
  • Europe / Japan / Korea: same patch at each version's addresses, found and checked automatically, but not play-tested.
  • Real hardware: not tested yet.
If you try it on real hardware or another region, please report back!

What was wrong (short version)
A defeated enemy keeps its collision for 0.5 s on both Wii and 3DS, and the game's own rules still say "landing on a dead enemy from above = bounce". On the 3DS, two checks throw away every collision with a dead enemy before those rules run, so player 2's landing never counts.

Tracing the Wii version showed it has an extra code path that sends a dead enemy's collisions straight to the bounce rules. The 3DS port lost that path. The patch (24 instructions) restores it, using the game's own 0.5 s window.

Simplified C version of the relevant code:
C:
// Wii: a dead enemy still forwards player collisions to the bounce rules
void Enemy_CollidedWith(Enemy *e, Actor *other) {
    if (e->alive)
        DispatchToBehaviors(e, other);
    else
        ContactHandler(e, other);       // rules: "dead + landed on from above" -> bounce
}

// 3DS (buggy): player contact goes through Touch, and dead enemies are ignored
void Enemy_Touch(Enemy *e, Actor *other) {
    if (!e->alive)
        return;                         // gate 1: player 2 falls through
    DispatchToBehaviors(e, other);      // gate 2: needs an active behavior; corpses have none
}

// 3DS (patched): during the corpse's 0.5 s window, behave like the Wii
void Enemy_Touch(Enemy *e, Actor *other) {
    if (!e->alive && e->corpseTimer <= 0)
        return;
    if (!e->alive)
        ContactHandler(e, other);       // same handler and rules the Wii uses
    else
        DispatchToBehaviors(e, other);
}

In the actual game code:
  • Gate 1: Creature::vf9 (the touch callback) returns immediately if the enemy is dead. The patch lets it through while the corpse timer is running.
  • Gate 2: the behaviour dispatcher only forwards collisions to the enemy's active behaviour, and a corpse has none. The patch sends corpse contacts straight to the contact handler, as the Wii does.
  • Both routines live in unused padding at the end of the code segment.

I made this patch using Claude Opus 5.5. I provided my own copies of the Wii and 3DS versions, did the play-testing, and directed the work; the AI did most of the reverse engineering and wrote the patch and tools.

Roughly what that involved:
  • Decompiling both versions in Ghidra and comparing the Wii and 3DS code for the same enemy logic.
  • A first patch that didn't work, which led to debugging the running game instead of just reading code.
  • A two-player test setup on one PC: two Azahar instances in a local multiplayer room, and one keyboard split into two virtual controllers so two separate Azahar instances could recieve input at once.
  • Live tracing of both games using GDB stubs (Azahar for the 3DS, Dolphin for the Wii) to find exactly where player 2's landing was being dropped, and what the Wii does instead.
Everything is documented step by step, including the wrong turns, in PROCESS.md. All the scripts used are in the repo too.

Released into the public domain (Unlicense).
 

Site & Scene News

New Hot Discussed User Submitted