Direct service latches, 12 by 8 matrix, and synthetic flipper column
pinmame.input.switch
- -7 … -53 slots
- 1 … 9696 slots
- 113 … 1208 slots
- libpinmamechannel=switch
Technical details for Direct service latches, 12 by 8 matrix, and synthetic flipper columnSource-derived address behavior and exceptions
At PinMAME 97aa922bf8e4b6970126192ec1ac1fb0305a4f62, alvg_sw2m(n)=n+7 and alvg_m2sw(col,row)=col*8+row-7 are symmetric. The twelve physical scan strobes reach internal columns 1-12, public 1-96; each eight-address block shares a strobe. xvia_0_a_r returns swMatrix[swCol]^0xff. INITGAME/INITGAME2 declare no per-game inverted-switch mask, so a matrix contact the ROM treats as active at public 1 rests open. Consume public state directly and do not add a controller-wide inversion. With keyboard handling enabled SWITCH_UPDATE(alvg) rewrites cabinet addresses 1-5,9,10,15,16 and the three direct latches; with it disabled host writes persist except for the flipper copies described below. The active CoinDoorSwitches_Read block differs from its disabled manual-order block: -7 (swTest) reaches CPU PB2, -6 (swEnter) PB4, and -5 (swTicket) is ORed with swAvail1 at PB5. swAvail1 is set by any nonzero 17-24 flasher byte, also copied to PB1; solenoid15 sets swAvail2 at PB3. Names such as Test, Enter and Ticket are emulator symbols; label the actual game functions from the retained VBS library and service evidence. core_updateSw uses internal column15 for both ALVG generations, so its eight positions are public113-120. Right and left lower buttons are114 and116; EOS positions are113/115 and upper positions117-120. FLIP_SWNO(l,r) copies the buttons into the declared matrix pair every update, overwriting writes there. A consumer drives114/116, never those matrix copies. No ALVG driver declares FLIP_SOL or upper button bits, and no EOS simulation runs. The retained alvinG.vbs agrees on lower buttons114/116; its upper constants115/117 are not a substitute for the pinned core arithmetic and are not fitted upper buttons on Mystery Castle. Physical polarity and fitment still require each game's own wiring evidence.