Magus420
Smash Master
Depending on its mood, Brawl takes between 0-2 additional frames (possibly more in rare cases?) from the time it initially reads inputs from controllers until it goes to actually use them to control your character. This code corrects that oddity. See this post and this video for more info.
Controller Input Lag Fix [Magus]
* C202AD8C 00000002
* 7C630214 3863FBFC
* 60000000 00000000
[collapse=ASM]
[/collapse]This makes the game use the initial set of controller inputs which are always the ones polled that frame and the most recent stored in memory for controlling your character. The set of inputs used by default is often running 1 or 2 frames behind (whether it's behind by 0, 1, or 2 frames varies over time during gameplay).
Controller Input Lag Fix (Comparison Test) [Magus]
* C202AD8C 00000004
* 7C630214 2C040001
* 4182000C 2C040005
* 4082000C 3863FFC0
* 3863FBFC 00000000
[collapse=ASM]
[/collapse]This version of the code makes the 2nd Gamecube and Wii controller ports instead use the 1st GC/Wii ports, and applies the fix only to them. With this, if you use a controller in the 1st slot it'll act as if it's also plugged into the 2nd slot, allowing you to control 2 characters with 1 controller. Only the 2nd character will have the input delay corrected though, so with 2 of the same character side by side you can compare them (during the times when the delay is at 2 frames it's particularly noticeable).
Controller Input Lag Fix [Magus]
* C202AD8C 00000002
* 7C630214 3863FBFC
* 60000000 00000000
[collapse=ASM]
Code:
add r3,r3,r0 entry point (8002AD8C). adds offset for controller port to base address (port * 0x40)
subi r3,r3,1028 changes base address to load inputs from most up to date controller inputs
Controller Input Lag Fix (Comparison Test) [Magus]
* C202AD8C 00000004
* 7C630214 2C040001
* 4182000C 2C040005
* 4082000C 3863FFC0
* 3863FBFC 00000000
[collapse=ASM]
Code:
add r3,r3,r0 entry point (8002AD8C). adds offset for controller port to base address (port * 0x40)
cmpwi r4,1 check if 2nd GC port
beq- 0xC
cmpwi r4,5 check if 2nd wii port
bne- 0xC skip if not 2nd GC port or 2nd wii port
subi r3,r3,64 looks at 1st GC controller or 1st wii if 2nd GC or 2nd wii
subi r3,r3,1028 changes base address to load inputs from most up to date controller inputs