Conversation
Implement IDisplayFrameFormatPreference and IRomNameProvider on the PinMAME engine. Clients can now request a DMD frame format (2/4/8 bit), which maps to PinMAME's raw vs. brightness DMD mode via reflection and selects the reported frame format accordingly. Snapshot each DMD and segmented display frame into a fresh array before queueing it for the main thread, so a follow-up native callback can no longer overwrite or tear a frame that is still being read. Drop frames with a null native pointer instead of marshalling from IntPtr.Zero, logging a warning when it happens.
The solenoid callback now carries the raw PinMAME value (0/1 for binary coils, 0-255 for PWM-integrated/modulated coils on WPC/SAM ROMs). Detect the modulated case (any value > 1) and normalize to a [0..1] strength for the coil pipeline's OnCoilChanged, so magnet coils that the ROM PWMs (e.g. Iron Man) drive a proportional pull. The sim-thread dispatch and shared snapshot stay boolean on/off. Requires the pinmame-dotnet feature/modulated-coils build (PinMameDotNet.dll carrying the int solenoid value); ship as a PinMame NuGet bump.
1.0.3 carries the solenoid value through OnSolenoidUpdated (int, not a collapsed bool), which the modulated-coil strength path depends on. Native stays 3.7.0-beta1 (unchanged).
The 1.0.4 binding exposes SetDmdMode publicly, so drop the reflection-based fallback and call it directly. Guard against a null PinMame instance and mark the DMD format and modulation flags volatile since they're read across threads.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.