Diagnostic buttons, the 8x8 switch matrix, and PinMAME's flipper column
pinmame.input.switch
- -7 … -44 slots
- 1 … 6464 slots
- 81 … 888 slots
- libpinmamechannel=switch
- controller_plugingroup_id=1 · contract_revision=a6f6d7266d30
Technical details for Diagnostic buttons, the 8x8 switch matrix, and PinMAME's flipper columnSource-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.
Flipper column
PinMAME keeps the cabinet flipper buttons in its own flipper switch column, CORE_FLIPPERSWCOL (internal column 11, src/wpc/core.h). The same core_swSeq2m(n)=n+7 conversion publishes that column at 81-88:
| Address | Bit | Position |
|---|---|---|
81 |
CORE_SWLRFLIPEOSBIT (0x01) |
Lower right end-of-stroke |
82 |
CORE_SWLRFLIPBUTBIT (0x02) |
Lower right button |
83 |
CORE_SWLLFLIPEOSBIT (0x04) |
Lower left end-of-stroke |
84 |
CORE_SWLLFLIPBUTBIT (0x08) |
Lower left button |
85 |
CORE_SWURFLIPEOSBIT (0x10) |
Upper right end-of-stroke |
86 |
CORE_SWURFLIPBUTBIT (0x20) |
Upper right button |
87 |
CORE_SWULFLIPEOSBIT (0x40) |
Upper left end-of-stroke |
88 |
CORE_SWULFLIPBUTBIT (0x80) |
Upper left button |
No pinned System 9/11 driver sets FLIP_SOL: each declares FLIP_SWNO(l,r), FLIP_SW(FLIP_L) or no flipper bits at all, so the flippers are cabinet-wired and the CPU drives no flipper coil. core_updateSw (src/wpc/core.c) then does three things on every update:
- With keyboard handling off (the LibPinMAME default), it reads the two lower button bits from this column as the host wrote them; no driver on this platform sets an
invSwbit in column 11. - It copies
82into matrix switchrand84into matrix switchlthroughcore_setSw, so a host write tolorritself is overwritten on the next update. A driver that declares no switch number for a side (FLIP_SW(FLIP_L), a zero inFLIP_SWNO, or no flipper bits) gets no copy for that side. - While the switched-solenoid enable is on (public
23, whichs11.cpasses tocore_updateSwaslocals.ssEn), it fabricates the synthetic flipper outputs45/46from82and47/48from84(CORE_LRFLIPSOLBITS,CORE_LLFLIPSOLBITS).
A consumer that wants a flipper button to reach the ROM drives 82/84, never the matrix address the game's manual prints for it. The known-working System 11 tables curated here drive exactly these two through VPinMAME's S11.VBS (swLRFlip = 82, swLLFlip = 84); its swURFlip = 81 and swULFlip = 83 are script constants that do not follow this mapping, and neither address is read on this platform. Each such definition cites the retained library as its vpm-script-library.s11-vbs source.
locals.flipMask gains an end-of-stroke bit only from FLIP_EOS (implied by FLIP_SOL) and an upper button bit only from FLIP_SW(FLIP_UR)/FLIP_SW(FLIP_UL). No pinned driver on this platform sets either, so core_updateSw never copies 81, 83 or 85-88 anywhere and PinMAME models no end-of-stroke switch here. A host write to them survives in the column, but the ROM cannot read it there: s11.c's pia4a_r reads the matrix only through core_getSwCol with an eight-bit column strobe, which reaches columns 1-8. A definition enumerates 81-88 and states which of them its own driver uses.
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's matrix rule covers only the base1-64range (every pinned System 9/11 driver declareshw.swCol=0); the81-88rule above is PinMAME's own flipper column, not a custom column. 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.