-
Notifications
You must be signed in to change notification settings - Fork 55
Add support for PWM frames #542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for PWM (Pulse Width Modulation) frames through a new Render_Lum_And_Raw API that produces 8-bit grayscale frames (gray8) from PWM emulation, providing behavior closer to real DMD hardware. This primarily affects GTS3 games but has subtle impacts on other game types as well.
- Introduces
gray8frame format (8-bit, 256 shades) from PWM dithering - Adds dual-frame rendering with separate luminance and identification frames
- Updates virtual DMD renderer to support native
gray8format with colored-gray6 conversion for physical devices
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| PinMameDevice/DmdDevice.cs | Adds new RenderLumRaw export function and internal rendering method for dual-frame PWM support |
| LibDmd/RenderGraph.cs | Extends rendering pipeline with gray8 support, adds palette generation, and updates frame source method signatures |
| LibDmd/Output/Virtual/Dmd/VirtualDmdControl.xaml.cs | Implements IGray8Destination interface and adds gray8 palette support to virtual DMD |
| LibDmd/Output/Virtual/Dmd/Convert.frag | Adds GLSL shader function for gray8 frame decoding |
| LibDmd/Output/IGray8Destination.cs | Defines new interface for 8-bit grayscale frame rendering |
| LibDmd/Input/IGray8Source.cs | Defines new interface for 8-bit grayscale frame sources |
| LibDmd/Input/Passthrough/PassthroughGray8Source.cs | Implements passthrough source for gray8 frames with deduplication |
| LibDmd/Frame/DmdFrame.cs | Adds identification frame support and gray8 conversion methods |
| LibDmd/DmdDevice/DmdDevice.cs | Integrates gray8 source into device pipeline and adds dual-frame rendering |
| LibDmd/Common/FrameUtil.cs | Adds utility function for converting gray8 to lower bit depths |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This PR adds support for DmdDevice's new
Render_Lum_And_Raw()API, which computes frame data based on PWM emulation and is much closer to real DMD behavior. This impacts mostly GTS3 games, but has also subtle effects on other type of games.This new mode receives frames at one byte per pixel and is thus called
gray8. The renderer of the virtual DMD has been updated to support this format natively. All physical devices need a firmware update, the closest right now is the colored-gray6 conversion, which results in 64 gray scale values (instead of the original 256).Since these PWM frames aren't stable (they receive averaged values based on the ROM's internal clock), they cannot used for colorization matching. Thus, we continue sending the original frames ("identification frames") to the colorization plugins. These frames are tagged so they don't reach the renderers.
This PR is dependent on vpinball/pinmame#486, so make sure to use the latest VPM build when testing this. Closes #540.