This can be a much more difficult task.
First
Nintendo
Button 1 = A
Button 2 = B
Hehe. I know, not that simple. You want to know what the button does in game. Well, that can be very difficult as the buttons may have multiple uses, especially if in combo with another button.
Then you have later systems like psx that some games have different control schemes.