Diagnostic buttons and the 8x8 switch matrix
pinmame.input.switch
- -7 … -44 slots
- 1 … 6464 slots
- libpinmamechannel=switch
- controller_plugingroup_id=1 · contract_revision=a6f6d7266d30
Technical details for Diagnostic buttons and the 8x8 switch matrixSource-derived address behavior and exceptions
Matrix conversion
Public switches are sequential matrix positions addressed column-major across the whole 1-64 range, not column-times-ten notation. The base PinMAME driver registers core_swSeq2m/core_m2swSeq for every generation that does not override MDRV_SWITCH_CONV (src/wpc/core.c MACHINE_DRIVER_START(PinMAME) MDRV_SWITCH_CONV(core_swSeq2m,core_m2swSeq)); src/wpc/s11.c MACHINE_DRIVER_START(s11) imports PinMAME and never overrides it, unlike src/wpc/wpc.c which does.
core_swSeq2m(n) = n+7, so the internal matrix index is m = n+7, column = m/8, and row = m%8 (src/wpc/core.c core_swSeq2m/core_m2swSeq/core_getSw/core_setSw/core_updInvSw). Equivalently, for public address n:
| Value | Calculation |
|---|---|
| Column | ((n-1)/8)+1 |
| Row | ((n-1)%8)+1 (1-indexed) |
Column 1 is public 1-8; column 8 is public 57-64. src/wpc/s11.c documents this at the top of its switch-handling code: 'S11 is 1-64, convert to 0-64 (+8), i.e. 1=8, 2=9...'.
Column 1 and diagnostics
Column 1 (public 1-8) is not a separate dedicated switch namespace the way WPC has one. SWITCH_UPDATE(s11) (src/wpc/s11.c) loads coreGlobals.swMatrix[0] and [1] directly from the shared S11_COMINPORT/S11_COMPORTS keyboard ports (src/wpc/s11.h): tilt=1, ball-tilt/mux-feedback=2 (see below), start=3, coin1-3=4-6, slam tilt=7, and high-score-reset=8. These still occupy ordinary matrix column 1 and read through the same core_getSw/core_setSw path as every other address; there is no separate binding group for them.
The four negative diagnostic addresses are the upper nibble of the same S11_COMINPORT port (src/wpc/s11.h), landing in matrix column 0 (m=0..3) through the identical n+7 formula:
| Address | Constant |
|---|---|
-7 |
S11_SWADVANCE |
-6 |
S11_SWUPDN |
-5 |
S11_SWCPUDIAG |
-4 |
S11_SWSOUNDDIAG |
They are cabinet/service diagnostic buttons, not matrix positions a player-facing definition should place on the playfield.
Per-game exceptions
- Mux relay: When
hw.gameSpecific1hasS11_MUXSW2set,SWITCH_UPDATE(s11)unconditionally overwrites public switch2with the live state of the mux relay solenoid (core_setSw(2, core_getSol(core_gameData->sxx.muxSol))) rather than leaving it as whateverS11_COMPORTSnominally labels that bit. Confirm the real identity of switch 2 from the game's own manual rather than assuming a genericball tiltlabel when this flag is set. - Custom columns: A driver that declares a non-zero
hw.swColadds custom switch columns beyond public64(CORE_CUSTSWCOLnumbering, the same convention WPC-generation games use). This profile asserts only the base1-64range actually exercised by Whirlwind (hw.swCol=0); a game with custom columns must extend its own address space with cited evidence rather than this profile silently widening to cover an unobserved case.