Key Remapper (GCN) [mdmwii]
#2
Sorry for the random thread bump, but I was going to use this code and I should mention that due to this source using an  add instruction, it can create undefined inputs if for some reason you press both the remapped and the assigned key. 
Let's say you remap Y (0x800) to D-Pad up (0x8), and you press both at the same time: your combined input will be 0x888, the code will retract 0x800 and then add 0x8 for a total of 0x90 (80+8+8), which is definitely not D-Pad up and actually not even a GCN key. 
Using or instead fixes the issue:

Code:
#inject(0x801AFBF8)\n\n (PAL)
#inject(0x801AFB58)\n\n (NTSC-U)
#inject(0x801AFB18)\n\n (NTSC-J)
#inject(0x801AFF54)\n\n (NTSC-K)

li r6, XXXX
and. r7, r0, r6
beq+ end        #Small optimisation
li r7, YYYY
xor r0, r0, r6  #A glorified sub
or r0, r0, r7   #Fix for the issue
end:
sth r0, 0x0(r4)
Reply


Messages In This Thread
Key Remapper (GCN) [mdmwii] - by Vega - 02-15-2018, 12:49 AM
RE: Key Remapper (GCN) [mdmwii] - by Melg - 12-01-2021, 10:50 PM
RE: Key Remapper (GCN) [mdmwii] - by Vega - 12-02-2021, 02:10 PM
RE: Key Remapper (GCN) [mdmwii] - by toothicc - 11-19-2023, 08:17 PM
RE: Key Remapper (GCN) [mdmwii] - by Vega - 11-20-2023, 09:30 PM
RE: Key Remapper (GCN) [mdmwii] - by Yuri Bacon - 11-26-2023, 09:43 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)