Just sharing the OpenMSX settings I am using in order to properly use an Xbox 360 controller. The mappings are optimized for Konami games (in particular, Metal Gear 2: Solid Snake).
- Directions: D-pad (note how OpenMSX sees the D-pad as a hat switch.)
- A and B: A and B — intuitive, uh?
- F1: The “Xbox” button, or whatever it is called.
- F2: X
- F3: Y
- F4: Back (◀)
- F5: Start (▶)
- Reverse 5 seconds: LB
- Take screenshot: RB
Here’s how I configured it in my ~/.openMSX/share/settings.xml
file (I am showing just the controller-related stuff; merge this with your own configuration as desired):
<!DOCTYPE settings SYSTEM 'settings.dtd'>
<settings>
<settings>
<setting id="joystick1_config">LEFT L_hat0 RIGHT R_hat0 UP U_hat0 DOWN D_hat0 A {button0} B {button1}</setting>
</settings>
<bindings>
<bind key="joy1 button2 up">keymatrixup 6 0x40</bind>
<bind key="joy1 button3 up">keymatrixup 6 0x80</bind>
<bind key="joy1 button6 up">keymatrixup 7 0x01</bind>
<bind key="joy1 button7 up">keymatrixup 7 0x02</bind>
<bind key="joy1 button8 up">keymatrixup 6 0x20</bind>
<bind key="joy1 button2 down">keymatrixdown 6 0x40</bind> <!-- X -->
<bind key="joy1 button3 down">keymatrixdown 6 0x80</bind> <!-- Y -->
<bind key="joy1 button4 down">reverse goback 5</bind> <!-- LB -->
<bind key="joy1 button5 down">screenshot -raw</bind> <!-- RB -->
<bind key="joy1 button6 down">keymatrixdown 7 0x01</bind> <!-- Back -->
<bind key="joy1 button7 down">keymatrixdown 7 0x02</bind> <!-- Start -->
<bind key="joy1 button8 down">keymatrixdown 6 0x20</bind> <!-- Xbox -->
</bindings>
</settings>
And by the way, if you want to understand these “keymatrix” codes, see this page on the MSX Assembly Page.