Switch matrix, special GPIO inputs and synthetic flipper buttons
pinmame.input.switch
- -8 … -18 slots
- 0 … 78 slots
- 10 … 178 slots
- 20 … 278 slots
- 30 … 378 slots
- 40 … 478 slots
- 50 … 578 slots
- 60 … 678 slots
- 70 … 778 slots
- 81 … 888 slots
- libpinmamechannel=switch
Technical details for Switch matrix, special GPIO inputs and synthetic flipper buttonsSource-derived address behavior and exceptions
GTS1_sw2m maps n=0..77 to ((n+1)%10)*8+(n+1)/10. The tens digit is the return and units digit the strobe, matching factory SW.nn labels. port_w device 2 selects internal switch columns 1..6 only and reads each column's eight bits: public x0..x5 (x=0..7). Matrix positions x6/x7 are not read there. Device 3 special GPIO instead reads the high nibble of swMatrix[7], public 46/56/66/76; 76 is XORed with 0x08, so its CPU input sense differs from the others. Public values below zero map to internal column 0; bit 7 (public -1) is used only for a sound-board diagnostic when a sound board is fitted. No generic CPU read consumes column 0. At PinMAME revision 97aa922bf8e4b6970126192ec1ac1fb0305a4f62, SetupMsgApi in libpinmame.cpp passes zero-based rows 0..7 to GTS1_m2sw for Controller Plugin device enumeration. That converter returns -9..-2 for column 0 and fails its sw2m round-trip assertion there; canonical getter/setter addresses remain -8..-1 under GTS1_sw2m/core_getSw. This is an enumeration quirk, not a different set of physical inputs. With keyboard handling enabled, SWITCH_UPDATE rewrites 00/01/02/03/04, special 56/76 and diagnostic -1 from the configured ports. With keyboard handling off the host supplies them. The CPU does not read internal flipper column 11, which GTS1_m2sw publishes at 81..88. core_updateSw derives synthetic flipper outputs from right button 82 and left 84, while per-game FLIP_SW/FLIP_SOL/FLIP_BUT fields control any additional core synthesis. Matrix reads complement the state into the PPS/4 input; public state is consumed exactly as delivered and must never be inverted again globally. This does not establish physical contact construction, especially for the special slam line. Exact game fitment is game documentation.