Skip to content

Player plugin resources and native outputs - #42

Merged
freezy merged 7 commits into
masterfrom
feat/player-plugins
Oct 14, 2026
Merged

freezy merged 7 commits into
masterfrom
feat/player-plugins

Conversation

@freezy

@freezy freezy commented Oct 14, 2026

Copy link
Copy Markdown
Member

Lets plugins in the Player use PinMAME games. Requires the VPE plugin system (VisualPinball.Engine, feat/player-plugins).

  • Game identity, and the original display and audio streams, are exposed as plugin resources.
  • A PinMAME settings plugin controls ROM playback volume and shows up on the Player's global volume mixer.
  • Native outputs (IGamelogicNativeOutputs): every lamp, GI string, solenoid and mech is reported by its PinMAME number, mapped or not, once per poll. Backglass-only lamps reach plugins such as B2S this way.
  • Value semantics are fixed per hardware generation, following libpinmame:
    • Lamps are physical on Pinball 2000 and for SAM LEDs above 80.
    • Solenoids are physical where PinMAME forces PWM integration: SAM, Capcom, PinHeck and Pinball 2000.
    • GI uses levels 0..8 on WPC, and 0 or 9 elsewhere.
  • Segment display layouts are reported per display (seg7, seg9, seg14, seg16), with an upright hint for Gottlieb System 80.

Implements IGamelogicNativeOutputs: every lamp, GI string, solenoid and mech by PinMAME number, mapped or not, once per poll. Value semantics are fixed per hardware generation, following libpinmame: physical lamps on Pinball 2000 and SAM LEDs above 80, physical solenoids where PWM integration is forced (SAM, Capcom, PinHeck, Pinball 2000), GI levels 0..8 on WPC and 0/9 elsewhere.

Implements ISegmentDisplayMetadata with the segment layout per display and an upright hint for Gottlieb System 80.
@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with no outstanding findings.

Summary

This PR exposes PinMAME game identity, display and audio resources, and numbered hardware outputs to Player plugins.

  • Plugins receive PinMAME outputs with hardware-specific values and display layouts.
  • PinMAME shares game identity and original media with Player plugins.
  • Player settings let people change PinMAME ROM playback volume.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  ROM[PinMAME ROM] --> Engine[PinMAME engine]
  Engine --> Resources[Identity, displays and raw audio]
  Resources --> Plugins[Player plugins]
  Engine --> Outputs[Numbered hardware outputs]
  Outputs --> Plugins
  Settings[Player volume setting] --> Gain[Playback gain]
  Engine --> Gain
  Gain --> Unity[Unity audio]
Loading

Reviews (3) · Last reviewed commit: "engine: stop replaying every GI change o..." · Reviewed by Greptile

Comment thread VisualPinball.Engine.PinMAME.Unity/Runtime/PinMameGamelogicEngine.cs Outdated
The hardware-generation rules for native output values (physical SAM LEDs above lamp 80 and all Pinball 2000 lamps, physical solenoids where PWM integration is forced, the GI maximum, upright Gottlieb System 80 segments) move into PinMameOutputModel, a Unity-free struct. The test project links it and covers the boundaries and generations.
pinmame-dotnet's GetChangedGIs(List) appends without clearing, unlike GetChangedLamps, so each poll dispatched all GI changes since the game started to lights, shared state and native output listeners.
@freezy
freezy merged commit a580a63 into master Oct 14, 2026
17 checks passed
@freezy
freezy deleted the feat/player-plugins branch October 14, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant