You are trying to do this in software? My inclination is to say that it would be easier to build/hack a controller that would remap any of the buttons for you. A schematic for a controller is over here (if you want to do it from scratch):
http://www.gamesx.com/controldata/nessnes.htmIf not, I'm not sure exactly how it would work, but you'd probably have to do something like (in a debugging emulator like the debugging version of SNES 9x):
wait for a read of $4218/$4219
http://wiki.superfamicom.org/snes/show/RegistersThen there will probably be something like a mask to check a specific joypad button, you'll probably just have to switch which bit is getting masked when.
The issue may be that you'd have to check for all the instances. I am not sure how it would work in an "official game" but the B/A buttons work differently in different situations (ie when you ride different animal characters, or are in a menu for selecting your file...haven't played the DKC games in very long). The input may also be stored in different variables in RAM for different purposes (ie a momentary press, versus a hold). See bazz's sample code:
http://wiki.superfamicom.org/snes/show/ ... ller+Input