Skip to content

More C# alignment#63

Merged
jsm174 merged 9 commits into
vpinball:masterfrom
jsm174:followups
Jul 11, 2026
Merged

More C# alignment#63
jsm174 merged 9 commits into
vpinball:masterfrom
jsm174:followups

Conversation

@jsm174

@jsm174 jsm174 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Follow-ups from reviewing the recent AI-submitted PRs, aligning the port with the C# source and fixing the issues those reviews surfaced:

  • pacled64: resolve the unit via map::at(), matching the C# dictionary indexer (throws for a missing key, caught in Pinball::MainThreadDoIt exactly like C#'s KeyNotFoundException).
  • misc (AlarmHandler): the no-parameter RegisterAlarm now unregisters same-handler alarms before adding, per AlarmHandler.cs (the parameterized overload already did). Renames the parameter to doNotUnregister (C# DoNotUnregister) and drops the stored flag C# doesn't keep. Closes the stale MaxRunTimeMotorStop accumulation possible after Fix Motor toy never scheduling its kickstart/max-runtime alarms #55.
  • misc (CabinetOutputList): GetByName's controller+number fast path now falls through to the by-name loop when the numbered output doesn't exist, matching the C# indexer; TryParseInt now requires full consumption like int.TryParse ("1x" no longer parses as 1).
  • misc (LedWizEquivalent): remove the comment and now-unused includes left by Resolve LedWizEquivalent outputs via CabinetOutputList (fixes PinOne + FTDI "0 of N resolved") #60.
  • pinone: connect failure messages and log level now match PinOne.cs exactly.
  • pico: m_oldOutputValues initialized to 255 per C# (Enumerable.Repeat((byte)255, ...)), so the initial all-off sweep actually transmits.
  • misc (auto-configurators): restore the C# hierarchical {ctrl}\{ctrl}.NN output name form in LedWiz, PacLed64, PacUIO, Pinscape, PinscapePico, and DudesCab configurators (safe now that resolution goes through GetByName after Resolve LedWizEquivalent outputs via CabinetOutputList (fixes PinOne + FTDI "0 of N resolved") #60); align FT245R's format string with the C# original. PacDrive stays flat, matching C#.
  • pacuio: replace the unit vector with a map keyed like the C# static dictionary (0-2), fixing out-of-bounds UB at Init/Update/OnOutputValueChanged for a <PacUIO> with a missing Id; outputs are now added via OutputList::Add so they subscribe to value-changed events.
  • pinone (NamedPipeServer): supersedes Fix PinOne DOF output silently dropped on Linux (sp_open return ignored) #53. sp_open's result was ignored, so a bad or unopenable port left the server running with a dead handle, silently dropping every write (10.8.1 Linux standalone: DOF not working with PinOne Control Board vpinball#2962). The constructor now throws, making CreateServer return false and ConnectToController fail the same way C# does when SerialPort.Open() throws. The server thread previously blocked forever in accept(), hanging StopServer()'s join() on every teardown ("Updater thread did not quit" in 10.8.1 Linux standalone: DOF not working with PinOne Control Board #31); select() with a 200ms timeout bounds both accept() and the client read so the thread re-checks m_isRunning — unlike Fix PinOne DOF output silently dropped on Linux (sp_open return ignored) #53's SO_RCVTIMEO, this also works on macOS, where that option does not affect accept() (verified empirically). Port close/free is now owned solely by StopServer, removing the pre-existing double sp_close.

Testing: full build clean; teardown behavior of the select-based server loop verified on macOS with a standalone harness (no-client teardown joins in ~110ms where accept() previously blocked forever; silent-client teardown ~105ms; data path unaffected).

@dynajoe

dynajoe commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for bringing this all together. I tried to keep each fix isolated and small to make incremental progress.

I've been jamming on replacing my Windows cabinet with a linux version this past week and it's looking very promising.

@jsm174

jsm174 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for bringing this all together. I tried to keep each fix isolated and small to make incremental progress.

I've been jamming on replacing my Windows cabinet with a linux version this past week and it's looking very promising.

What hardware do you have? We have a discord channel that would be helpful for feedback.

@jsm174 jsm174 changed the title 1:1 C# alignment follow-ups from PR 53/55/56/58/59/60 reviews More C# alignment Jul 11, 2026
@jsm174
jsm174 merged commit eef645d into vpinball:master Jul 11, 2026
13 checks passed
@dynajoe

dynajoe commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Thanks for bringing this all together. I tried to keep each fix isolated and small to make incremental progress.
I've been jamming on replacing my Windows cabinet with a linux version this past week and it's looking very promising.

What hardware do you have? We have a discord channel that would be helpful for feedback.

I'm running:

  • OS: Batocera 43
  • Frontend: vpinfe
  • Graphics: RTX 3080
  • Audio: SSF
  • Playfield: LG 43" 4K OLED 120hz
  • separate 1080p displays for backglass and dmd
  • Solenoids / buttons powered by Cleveland Software PinOne
  • Headtracking: Kinect V2

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.

2 participants