200cc (CTGP Replica)
#24
(10-30-2020, 04:41 PM)stebler Wrote: Brake drifting v0.2

NTSC-U:
c251bea0 00000006
55040739 41820020
a09c0090 548406b5
41820014 a09c0090
548405ad 41820008
61080010 b11d0004
60000000 00000000
c251b1ec 00000005
54c40739 41820018
54640673 41820010
546405ad 41820008
60c60010 5464073b
60000000 00000000
c258e1cc 00000003
540307fe 5400e7fe
68000001 7c001839
60000000 00000000
045776e8 60000000
c2574620 00000002
2c000001 41820008
548307ff 00000000

PAL:
c2520314 00000006
55040739 41820020
a09c0090 548406b5
41820014 a09c0090
548405ad 41820008
61080010 b11d0004
60000000 00000000
c251f660 00000005
54c40739 41820018
54640673 41820010
546405ad 41820008
60c60010 5464073b
60000000 00000000
c25949f0 00000003
540307fe 5400e7fe
68000001 7c001839
60000000 00000000
0457df4c 60000000
c257ae84 00000002
2c000001 41820008
548307ff 00000000

ASM patch 1: set the brake drifting bit when both B and R are pressed and the player is drifting (GCN controller)
# inject at 8051bea0 (NTSC-U)
# inject at 80520314 (PAL)
rlwinm. r4, r8, 0, 28, 28
beq end
lhz r4, 0x90 (r28)
rlwinm. r4, r4, 0, 26, 26
beq end
lhz r4, 0x90 (r28)
rlwinm. r4, r4, 0, 22, 22
beq end
ori r8, r8, 0x10
end:
sth r8, 0x4 (r29)

ASM patch 2: set the brake drifting bit when both B and R are pressed and the player is drifting (classic controller)
# inject at 8051b1ec (NTSC-U)
# inject at 8051f660 (PAL)
rlwinm. r4, r6, 0, 28, 28
beq end
rlwinm. r4, r3, 0, 25, 25
beq end
rlwinm. r4, r3, 0, 22, 22
beq end
ori r6, r6, 0x10
end:
rlwinm. r4, r3, 0, 28, 29

ASM patch 3: do not accelerate when the brake drifting bit is set
# inject at 8058e1cc (NTSC-U)
# inject at 805949f0 (PAL)
rlwinm r3, r0, 0, 31, 31
rlwinm r0, r0, 28, 31, 31
xori r0, r0, 1
and. r0, r0, r3

ASM patch 4: do not cancel the drifting when the player is no longer accelerating
# replace at 805776e8 (NTSC-U)
# replace at 8057df4c (PAL)
nop

ASM patch 5: allow breaking while drifting
# inject at 80574620 (NTSC-U)
# inject at 8057ae84 (PAL)
cmpwi r0, 1
beq end
rlwinm. r3, r4, 0, 31, 31
end:

Note: just like CTGP, this code uses bit 4 of the button input variable for brake drifting (0 = accelerate, 1 = brake or drift, 2 = use item, 3 = drift, 5 = look backwards).

TODO:
* nunchuk
* wii wheel
* NTSC-J, NTSC-K
* test on real Wii
* check that it works online
* work on perfect CTGP compatibility (using ghost replay)

This is my first time working on a code for MKW, so any feedback is welcome!

If you'd like, I'd be more than happy to help you port this to NTSC-J and NTSC-K once you've done the other two controllers. Also, I've tested the PAL version of this code on Wii, and I'm happy to say it works perfectly so good job!


Messages In This Thread
200cc (CTGP Replica) - by Zeraora - 03-14-2020, 09:58 PM
RE: 200cc (CTGP Replica) - by Vega - 03-15-2020, 01:20 PM
RE: 200cc (CTGP Replica) - by Zeraora - 03-15-2020, 02:14 PM
RE: 200cc (CTGP Replica) - by JoshuaMK - 03-15-2020, 05:49 PM
RE: 200cc (CTGP Replica) - by Zeraora - 03-15-2020, 06:24 PM
RE: 200cc (CTGP Replica) - by JoshuaMK - 03-15-2020, 06:28 PM
RE: 200cc (CTGP Replica) - by Seeky - 03-16-2020, 09:40 PM
RE: 200cc (CTGP Replica) - by JoshuaMK - 03-16-2020, 10:38 PM
RE: 200cc (CTGP Replica) - by Jragsdale22 - 08-04-2020, 03:51 AM
RE: 200cc (CTGP Replica) - by Zeraora - 08-18-2020, 10:19 PM
RE: 200cc (CTGP Replica) - by 1superchip - 08-18-2020, 11:32 PM
RE: 200cc (CTGP Replica) - by stebler - 10-30-2020, 04:41 PM
RE: 200cc (CTGP Replica) - by Luke1911 - 11-02-2020, 11:24 AM
RE: 200cc (CTGP Replica) - by Zeraora - 11-04-2020, 07:53 PM
RE: 200cc (CTGP Replica) - by Zeraora - 11-06-2020, 12:35 AM
RE: 200cc (CTGP Replica) - by Brawlbox - 11-11-2020, 12:15 PM
RE: 200cc (CTGP Replica) - by Vega - 10-31-2020, 10:53 AM
RE: 200cc (CTGP Replica) - by stebler - 11-04-2020, 11:50 AM
RE: 200cc (CTGP Replica) - by stebler - 11-04-2020, 11:52 AM
RE: 200cc (CTGP Replica) - by Luke1911 - 11-07-2020, 10:21 PM
RE: 200cc (CTGP Replica) - by Vega - 11-04-2020, 01:55 PM
RE: 200cc (CTGP Replica) - by stebler - 11-10-2020, 09:48 PM
RE: 200cc (CTGP Replica) - by stebler - 11-10-2020, 09:51 PM
RE: 200cc (CTGP Replica) - by Vega - 11-10-2020, 09:54 PM
RE: 200cc (CTGP Replica) - by stebler - 11-19-2020, 10:31 PM
RE: 200cc (CTGP Replica) - by Vega - 11-19-2020, 10:54 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)