Adds duplicate instance ID checking to debug mode.
Implements joystick_lastbutton.