Jump to content



Photo
- - - - -

B2S Plugin Data Stream -- Decoding LEDs


  • Please log in to reply
10 replies to this topic

#1 RandoHondo

RandoHondo

    Hobbyist

  • Members
  • PipPip
  • 12 posts

  • Flag: United States of America

  • Favorite Pinball: Whitewater

Posted 05 September 2022 - 06:58 AM

I will be greatly appreciative of any help anyone can provide...

 

I am working on a plugin that will give an intelligent DMD for all tables that don't have a real DMD.  I already have about 3,000 lines of VBS working with over 70 tables, but I got the grand idea to move all this to C#--so tired of the VBS environment.  This, too, will allow the whole thing to work without any implentation needed at the table level.  I super hate the DMDs that just have a bunch of digits all over the place... 

 

So, I have a plugin that is receiving the data stream and, in turn, lights up FlexDMD.  I already have most of the logic worked out to determine the state of the game (who's up, how many players, if high scores are showing, if we're matching, etc.).  It's good stuff--makes tables look like they had a DMD built into the ROM.  My time with VBS wasn't completely wasted.

 

The B2S stream surprised me when I saw that the LEDs are coming through with what appears to be a flag on digit 0.  Digit 0 when it is 0 seems to mean, "Flush the LEDs to the display and clear the stored values."  It's close but not quite right.  

 

What is the secret with the position 0, value 0?  I am also timing the LED transitions and waiting for "stability."  The time between the last LED to change and, say 200ms.  That seems to be appropriate to determine the the LEDs have all been painted.  But, what is the approriate way to reset the digits that should be blank for the next wave of updates?

 

I'll keep plugging away until I have this solved, but someone here surely knows how the ROMs' signal blanking the LEDs.  Greatly appreciate any help!

 

-Randy



#2 STAT

STAT

    Pinball and Arcade Freak

  • VIP
  • 4,981 posts
  • Location:Wels - Austria

  • Flag: Austria

  • Favorite Pinball: Twilight Zone

Posted 05 September 2022 - 08:44 AM

What's the different to VPinMAME ?



#3 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,859 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 05 September 2022 - 09:41 AM

I will be greatly appreciative of any help anyone can provide...

 

I am working on a plugin that will give an intelligent DMD for all tables that don't have a real DMD.  I already have about 3,000 lines of VBS working with over 70 tables, but I got the grand idea to move all this to C#--so tired of the VBS environment.  This, too, will allow the whole thing to work without any implentation needed at the table level.  I super hate the DMDs that just have a bunch of digits all over the place... 

 

So, I have a plugin that is receiving the data stream and, in turn, lights up FlexDMD.  I already have most of the logic worked out to determine the state of the game (who's up, how many players, if high scores are showing, if we're matching, etc.).  It's good stuff--makes tables look like they had a DMD built into the ROM.  My time with VBS wasn't completely wasted.

 

The B2S stream surprised me when I saw that the LEDs are coming through with what appears to be a flag on digit 0.  Digit 0 when it is 0 seems to mean, "Flush the LEDs to the display and clear the stored values."  It's close but not quite right.  

 

What is the secret with the position 0, value 0?  I am also timing the LED transitions and waiting for "stability."  The time between the last LED to change and, say 200ms.  That seems to be appropriate to determine the the LEDs have all been painted.  But, what is the approriate way to reset the digits that should be blank for the next wave of updates?

 

I'll keep plugging away until I have this solved, but someone here surely knows how the ROMs' signal blanking the LEDs.  Greatly appreciate any help!

 

-Randy

 

I am confused, as we can already do this

we already know which LEDs are lit
and each digit is made from 7 10 or 14 LEDs

 

So we just look up the value in the dictionary

 

I can put a 30 digit long array, of 14 segment digits displayed on the DMD, with no truncation
unless it is a real DMD, then obviously 30 digits just wont fit.

 

Can also use nifty hand painted letters and numbers if you want

 

What is the plugin going to do exactly?


What's the different to VPinMAME ?

 

well, vpinmame displays things in logical order, which may not agree with artistic order.

It also displays that which was not meant to be on the backglass.

 

Look at haunted hotel, black hole, haunted house and shaq attack


If you feel the need to empty your wallet in my direction, i don't have any way to receive it anyways

Spend it on Hookers and Blow


#4 gtxjoe

gtxjoe

    VPF Veteran

  • VIP
  • 5,152 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 05 September 2022 - 01:30 PM

Is there a data sheet for the LED display that might list the supported operations?

#5 RandoHondo

RandoHondo

    Hobbyist

  • Members
  • PipPip
  • 12 posts

  • Flag: United States of America

  • Favorite Pinball: Whitewater

Posted 05 September 2022 - 03:42 PM

I must not have explained this well enough...

 

In the VBS scripts, there is usually a piece of code that looks like this:

 

 
Sub DisplayTimer_Timer
   Dim ChgLED,ii,num,chg,stat,obj
   ChgLed = Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
   If Not IsEmpty(ChgLED) Then
      If DesktopMode = True Then
         For ii = 0 To UBound(chgLED)
             num = chgLED(ii, 0) : chg = chgLED(ii, 1) : stat = chgLED(ii, 2)
             if (num < 28) then
                For Each obj In Digits(num)
                     If chg And 1 Then obj.State = stat And 1 
                         chg = chg\2 : stat = stat\2
                Next
              end if
          next 
        end if
    end if
End Sub
 
The controller sends each and every LED udpate to the script.  From here, the LEDs can be tracked / duplicated on the desktop,etc.  Thie updates that flow through this from Controller are DIFFERENT than those that flow through the B2S plugins.   The Controller for the VBS script sends blanks when the scores flash or when things change from High Scores to Player Scores.  On the B2S stream, the values come through only.  No blanks.  Instead, there appears to be a sentenal in the 0 position to indicate that the update is complete for the current sweep (or somehting like that).  
 
I am looking for anyone who knows the action to take on this sentenal value.  The stream that come through Controller must be tied to the byte 0 being set to 0 to trigger ChangedLEDs.  In short, I'm trying to determine the correct way to know when to blank the scores from the B2S stream that is coming from PinMame.  I haven't come across a whole lot of documentation, so if there is something somewhere, I am open to be pointed to somewhere to continue the research if such a thing exists.
 
-Randy


#6 gtxjoe

gtxjoe

    VPF Veteran

  • VIP
  • 5,152 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 05 September 2022 - 08:00 PM

I would assume VPinMame is sending the same info to VPX and B2S. Maybe B2S is not forwarding or replacing that event to the B2S plugins. B2S source is available and there was someone that made recent updates to it. Hopefully he can chime in on this

#7 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,859 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 06 September 2022 - 08:30 AM

vpinball/b2s-backglass: B2S Backglass Server and Designer for use with Visual Pinball (github.com)

 

source


If you feel the need to empty your wallet in my direction, i don't have any way to receive it anyways

Spend it on Hookers and Blow


#8 RandoHondo

RandoHondo

    Hobbyist

  • Members
  • PipPip
  • 12 posts

  • Flag: United States of America

  • Favorite Pinball: Whitewater

Posted 07 September 2022 - 04:41 AM

Yep, been there.  Don't know enough about VB6 to make this go and realizing that I'm heading down a rabbit hole.  May just abort the project, unfortunately.  There is a lot of architecture here that I can't seem to wrap my head around and no real documentation on most of it (from a design and interoperability standpoint).  20+ hours invested just in trying to unravel the mysteries beyond the couple hundred I have in the base logic. I am sure making contact with the right person and a 15 minute conversation would unblock me.  I was hoping that "right" person might be on the forum.

 

-Randy



#9 scutters

scutters

    Pinball Fan

  • Members
  • PipPipPipPip
  • 539 posts

  • Flag: England

  • Favorite Pinball: Addams Family

Posted 07 September 2022 - 10:12 AM

Hi Randy,
 
Sounds like you started adding flexDMDs to display segment scores in the table vbs scripts a bit like i've been doing, but have now moved on to try a more generic solution using a B2S plugin?.
 
I don't know crap about B2S plugins, but to me it looks like the data being passed through to the plugin should be exactly the same as if you called ChangedLEDs command from the table script (https://github.com/v.../Server.vb#L660).
 
If that's the case then D0 being set to 0 would only signify that the first digit of the segment display has been cleared. You should see D0-31 all having 0's being passed through to clear all digits (on a 32digit display).
 
If you're not seeing that then maybe it's a timing issue, or somehow a there's a conflict with a similar call to ChangeLEDs in the table script?


#10 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,859 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 07 September 2022 - 10:56 PM

Freezy's is open source

Freezy's reads the LED segment states (you have to enable alphanumerics for a given ROM if you want a segmented display, see below how to)
 

Maybe look at freezy's source?

 

And if the Segmented display flickers or blinks, freezys does the same, so see what freezy's is reading maybe?

 

OjL1gkE.png


If you feel the need to empty your wallet in my direction, i don't have any way to receive it anyways

Spend it on Hookers and Blow


#11 RandoHondo

RandoHondo

    Hobbyist

  • Members
  • PipPip
  • 12 posts

  • Flag: United States of America

  • Favorite Pinball: Whitewater

Posted 10 September 2022 - 03:18 AM

Just to close this out, there was a bug in B2SBackglassServer.dll.  The offending code is in PluginList.vb in the DataReceive subroutine.  I'm not a VB guy, but I was able to find a solution that sends all the updates to "D"igits to the plugins.  I'll submit a pull request back to GitHub soon. 

 

This has unblocked my project--happy to report.  Onward with the new features!

 

Thanks for the replies.  Greatly appreciated!

 

-Randy