Logan's Run Segment Display Conversion to Flex
So, i thought i'd try adding a flex
DMD to another system 80 table,
Logan's Run (which is a reskin and uses the rom of Gottlieb's Arena 1987) as a reskin the result may be of interest to users outside the real
DMD owners group too (there's no need to stick to segment displays for stuff that isn't an authentic recreation is there?!).
As a system 80 rom so we already have the code the dictionary/lookup for segment display codes to character conversions with a font file we can use, but this time i wanted to try and add the code to the table embedding all the FlexDMD dependencies within the vpx table file itself (so no external folder dependencies for font files etc in the VPX table folder).
As we can't embed a .fnt file within VPX this presents a few issues with the standard code, instead of dealing with the display as two lines of 20 characters which we pass as two strings to flex dmd to display using a font file we need to deal with the display as 40 distinct locations for characters on screen, and use changing character images in each one (with the images stored in the VPX file). This will introduce more overhead to the table script as the work won't be just palmed straight off to FlexDMD to deal with in it's own thread, and it'll need a bit more work in the table script (but luckily JP has already done something similar for Deadpool so i knew it could be done!).
First step build a load of small images for each character that will be displayed. Basic maths tells us a 6x11 image for 40 locations on a 128x32 screen and should give us a few pixels free. Lot's of images to build... A-Z, 0-9, a few symbols and then 0-9 repeated with a dot included (it's a system 80, see last post re dot spacing), most character images will use the top left 5x10 pixels of the 6x11 with the bottom right pixel reserved for the dot.
e.g.

etc..
Link to complete set
here
Then import to the table file;

With the characters all built and imported it should be just a copy and paste of the standard code now with a few tweaks here and there so that instead of dealing with the display as two lines of text for flexDMD it's dealt with as 40 images instead.
Add constants for each character image added to the table file. When passed to flexDMD the "VPX." prefix tells it to use the iamge in the table file (rather than a path);
'flexdmd image constants
Const DMD_A = "VPX.DMD_A"
Const DMD_B = "VPX.DMD_B"
Const DMD_C = "VPX.DMD_C"
Const DMD_D = "VPX.DMD_D"
Const DMD_E = "VPX.DMD_E"
Const DMD_F = "VPX.DMD_F"
Const DMD_G = "VPX.DMD_G"
Const DMD_H = "VPX.DMD_H"
Const DMD_I = "VPX.DMD_I"
Const DMD_J = "VPX.DMD_J"
Const DMD_K = "VPX.DMD_K"
Const DMD_L = "VPX.DMD_L"
Const DMD_M = "VPX.DMD_M"
Const DMD_N = "VPX.DMD_N"
Const DMD_O = "VPX.DMD_O"
Const DMD_P = "VPX.DMD_P"
Const DMD_Q = "VPX.DMD_Q"
Const DMD_R = "VPX.DMD_R"
Const DMD_S = "VPX.DMD_S"
Const DMD_T = "VPX.DMD_T"
Const DMD_U = "VPX.DMD_U"
Const DMD_V = "VPX.DMD_V"
Const DMD_W = "VPX.DMD_W"
Const DMD_X = "VPX.DMD_X"
Const DMD_Y = "VPX.DMD_Y"
Const DMD_Z = "VPX.DMD_Z"
Const DMD_1 = "VPX.DMD_1"
Const DMD_2 = "VPX.DMD_2"
Const DMD_3 = "VPX.DMD_3"
Const DMD_4 = "VPX.DMD_4"
Const DMD_6 = "VPX.DMD_6"
Const DMD_7 = "VPX.DMD_7"
Const DMD_8 = "VPX.DMD_8"
Const DMD_9 = "VPX.DMD_9"
Const DMD_1dot = "VPX.DMD_1dot"
Const DMD_2dot = "VPX.DMD_2dot"
Const DMD_3dot = "VPX.DMD_3dot"
Const DMD_4dot = "VPX.DMD_4dot"
Const DMD_6dot = "VPX.DMD_6dot"
Const DMD_7dot = "VPX.DMD_7dot"
Const DMD_8dot = "VPX.DMD_8dot"
Const DMD_9dot = "VPX.DMD_9dot"
Const DMD_Odot = "VPX.DMD_Odot"
Const DMD_Sdot = "VPX.DMD_Sdot"
Const DMD_Space = "VPX.DMD_Space"
Const DMD_SpaceDot = "VPX.DMD_SpaceDot"
Const DMD_Ampersand = "VPX.DMD_Ampersand"
Const DMD_Asterick = "VPX.DMD_Asterick"
Const DMD_BSlash = "VPX.DMD_BSlash"
Const DMD_CloseBracket = "VPX.DMD_CloseBracket"
Const DMD_Colon = "VPX.DMD_Colon"
Const DMD_Dollar = "VPX.DMD_Dollar"
Const DMD_Equals = "VPX.DMD_Equals"
Const DMD_Exclamation = "VPX.DMD_Exclamation"
Const DMD_FSlash = "VPX.DMD_FSlash"
Const DMD_GreaterThan = "VPX.DMD_GreaterThan"
Const DMD_Hash = "VPX.DMD_Hash"
Const DMD_LessThan = "VPX.DMD_LessThan"
Const DMD_Minus = "VPX.DMD_Minus"
Const DMD_OpenBracket = "VPX.DMD_OpenBracket"
Const DMD_Percent = "VPX.DMD_Percent"
Const DMD_Plus = "VPX.DMD_Plus"
Const DMD_Question = "VPX.DMD_Question"
Const DMD_Quote = "VPX.DMD_Quote"
Const DMD_SemiColon = "VPX.DMD_SemiColon"
Const DMD_SingleQuote = "VPX.DMD_SingleQuote"
Declare the flex objects and the toggle on/off flag in the script;
Const UseFlexDMD = 0 ' 1 is on
Dim FlexDMD
DIm FlexDMDDict
Dim FlexDMDScene
Then create the routines
Sub FlexDMD_Init (add a call to this from table_init) needs updating to populate the 40 image locations (seg 0-39) with flex images (using spaces/blanks initially), and to set the .TableFile property first so flexdmd knows what table file to use;
Sub FlexDMD_Init() 'default/startup values
' flex dmd variables
DIm FlexDMDFont
Dim FlexPath
' populate the lookup dictionary for mapping display characters
FlexDictionary_Init
'setup flex dmd
Set FlexDMD = CreateObject("FlexDMD.FlexDMD")
If Not FlexDMD is Nothing Then
FlexDMD.GameName = cGameName
FlexDMD.TableFile = Table1.Filename & ".vpx"
FlexDMD.RenderMode = 2
FlexDMD.Width = 128
FlexDMD.Height = 32
FlexDMD.Clear = True
FlexDMD.Run = True
FlexDMD.LockRenderThread
Set FlexDMDScene = FlexDMD.NewGroup("Scene")
With FlexDMDScene
'populate blank display
.AddActor FlexDMD.NewImage("Back", "VPX.DMD_Background")
'40 segment display holders
.AddActor FlexDMD.NewImage("Seg0", DMD_Space)
.GetImage("Seg0").SetAlignedPosition 4,0,0
.AddActor FlexDMD.NewImage("Seg1", DMD_Space)
.GetImage("Seg1").SetAlignedPosition 10,0,0
.AddActor FlexDMD.NewImage("Seg2", DMD_Space)
.GetImage("Seg2").SetAlignedPosition 16,0,0
.AddActor FlexDMD.NewImage("Seg3", DMD_Space)
.GetImage("Seg3").SetAlignedPosition 22,0,0
.AddActor FlexDMD.NewImage("Seg4", DMD_Space)
.GetImage("Seg4").SetAlignedPosition 28,0,0
.AddActor FlexDMD.NewImage("Seg5", DMD_Space)
.GetImage("Seg5").SetAlignedPosition 34,0,0
.AddActor FlexDMD.NewImage("Seg6", DMD_Space)
.GetImage("Seg6").SetAlignedPosition 40,0,0
.AddActor FlexDMD.NewImage("Seg7", DMD_Space)
.GetImage("Seg7").SetAlignedPosition 46,0,0
.AddActor FlexDMD.NewImage("Seg8", DMD_Space)
.GetImage("Seg8").SetAlignedPosition 52,0,0
.AddActor FlexDMD.NewImage("Seg9", DMD_Space)
.GetImage("Seg9").SetAlignedPosition 58,0,0
.AddActor FlexDMD.NewImage("Seg10", DMD_Space)
.GetImage("Seg10").SetAlignedPosition 64,0,0
.AddActor FlexDMD.NewImage("Seg11", DMD_Space)
.GetImage("Seg11").SetAlignedPosition 70,0,0
.AddActor FlexDMD.NewImage("Seg12", DMD_Space)
.GetImage("Seg12").SetAlignedPosition 76,0,0
.AddActor FlexDMD.NewImage("Seg13", DMD_Space)
.GetImage("Seg13").SetAlignedPosition 82,0,0
.AddActor FlexDMD.NewImage("Seg14", DMD_Space)
.GetImage("Seg14").SetAlignedPosition 88,0,0
.AddActor FlexDMD.NewImage("Seg15", DMD_Space)
.GetImage("Seg15").SetAlignedPosition 94,0,0
.AddActor FlexDMD.NewImage("Seg16", DMD_Space)
.GetImage("Seg16").SetAlignedPosition 100,0,0
.AddActor FlexDMD.NewImage("Seg17", DMD_Space)
.GetImage("Seg17").SetAlignedPosition 106,0,0
.AddActor FlexDMD.NewImage("Seg18", DMD_Space)
.GetImage("Seg18").SetAlignedPosition 112,0,0
.AddActor FlexDMD.NewImage("Seg19", DMD_Space)
.GetImage("Seg19").SetAlignedPosition 118,0,0
.AddActor FlexDMD.NewImage("Seg20", DMD_Space)
.GetImage("Seg20").SetAlignedPosition 4,16,0
.AddActor FlexDMD.NewImage("Seg21", DMD_Space)
.GetImage("Seg21").SetAlignedPosition 10,16,0
.AddActor FlexDMD.NewImage("Seg22", DMD_Space)
.GetImage("Seg22").SetAlignedPosition 16,16,0
.AddActor FlexDMD.NewImage("Seg23", DMD_Space)
.GetImage("Seg23").SetAlignedPosition 22,16,0
.AddActor FlexDMD.NewImage("Seg24", DMD_Space)
.GetImage("Seg24").SetAlignedPosition 28,16,0
.AddActor FlexDMD.NewImage("Seg25", DMD_Space)
.GetImage("Seg25").SetAlignedPosition 34,16,0
.AddActor FlexDMD.NewImage("Seg26", DMD_Space)
.GetImage("Seg26").SetAlignedPosition 40,16,0
.AddActor FlexDMD.NewImage("Seg27", DMD_Space)
.GetImage("Seg27").SetAlignedPosition 46,16,0
.AddActor FlexDMD.NewImage("Seg28", DMD_Space)
.GetImage("Seg28").SetAlignedPosition 52,16,0
.AddActor FlexDMD.NewImage("Seg29", DMD_Space)
.GetImage("Seg29").SetAlignedPosition 58,16,0
.AddActor FlexDMD.NewImage("Seg30", DMD_Space)
.GetImage("Seg30").SetAlignedPosition 64,16,0
.AddActor FlexDMD.NewImage("Seg31", DMD_Space)
.GetImage("Seg31").SetAlignedPosition 70,16,0
.AddActor FlexDMD.NewImage("Seg32", DMD_Space)
.GetImage("Seg32").SetAlignedPosition 76,16,0
.AddActor FlexDMD.NewImage("Seg33", DMD_Space)
.GetImage("Seg33").SetAlignedPosition 82,16,0
.AddActor FlexDMD.NewImage("Seg34", DMD_Space)
.GetImage("Seg34").SetAlignedPosition 88,16,0
.AddActor FlexDMD.NewImage("Seg35", DMD_Space)
.GetImage("Seg35").SetAlignedPosition 94,16,0
.AddActor FlexDMD.NewImage("Seg36", DMD_Space)
.GetImage("Seg36").SetAlignedPosition 100,16,0
.AddActor FlexDMD.NewImage("Seg37", DMD_Space)
.GetImage("Seg37").SetAlignedPosition 106,16,0
.AddActor FlexDMD.NewImage("Seg38", DMD_Space)
.GetImage("Seg38").SetAlignedPosition 112,16,0
.AddActor FlexDMD.NewImage("Seg39", DMD_Space)
.GetImage("Seg39").SetAlignedPosition 118,16,0
End With
FlexDMD.Stage.AddActor FlexDMDScene
FlexDMD.Show = True
FlexDMD.UnlockRenderThread
End If
End Sub
Yeah i know... maybe i could have done all the .AddActors & .GetImage lines in a loop, but this is more readable and obvious what is happening (to me anyway)
Then in the FlexDictionary_Init change the dictionary lookup to use the VPX. image constants rather than characters;
Sub FlexDictionary_Init
Set FlexDMDDict = CreateObject("Scripting.Dictionary")
FlexDMDDict.Add 0, DMD_Space
FlexDMDDict.Add 63, DMD_O
FlexDMDDict.Add 8704, DMD_1
FlexDMDDict.Add 2139, DMD_2
FlexDMDDict.Add 2127, DMD_3
FlexDMDDict.Add 2150, DMD_4
FlexDMDDict.Add 2157, DMD_S
FlexDMDDict.Add 2173, DMD_6
FlexDMDDict.Add 7, DMD_7
FlexDMDDict.Add 2175,DMD_8
FlexDMDDict.Add 2159,DMD_9
FlexDMDDict.Add 191,DMD_Odot
FlexDMDDict.Add 8832, DMD_1dot
FlexDMDDict.Add 2267, DMD_2dot
FlexDMDDict.Add 2255, DMD_3dot
FlexDMDDict.Add 2278, DMD_4dot
FlexDMDDict.Add 2285, DMD_Sdot
FlexDMDDict.Add 2301, DMD_6dot
FlexDMDDict.Add 135, DMD_7dot
FlexDMDDict.Add 2303, DMD_8dot
FlexDMDDict.Add 2287, DMD_9dot
FlexDMDDict.Add 2167, DMD_A
FlexDMDDict.Add 10767, DMD_B
FlexDMDDict.Add 57, DMD_C
FlexDMDDict.Add 8719, DMD_D
FlexDMDDict.Add 121, DMD_E
FlexDMDDict.Add 113, DMD_F
FlexDMDDict.Add 2109, DMD_G
FlexDMDDict.Add 2166, DMD_H
FlexDMDDict.Add 8713, DMD_I
FlexDMDDict.Add 30, DMD_J
FlexDMDDict.Add 5232, DMD_K
FlexDMDDict.Add 56, DMD_L
FlexDMDDict.Add 1334, DMD_M
FlexDMDDict.Add 4406, DMD_N
' "O" = 0
FlexDMDDict.Add 2163, DMD_P
FlexDMDDict.Add 4159, DMD_Q
FlexDMDDict.Add 6259, DMD_R
' "S" = 5
FlexDMDDict.Add 8705, DMD_T
FlexDMDDict.Add 62, DMD_U
FlexDMDDict.Add 17456, DMD_V
FlexDMDDict.Add 20534, DMD_W
FlexDMDDict.Add 21760, DMD_X
FlexDMDDict.Add 9472, DMD_Y
FlexDMDDict.Add 17417, DMD_Z
FlexDMDDict.Add &h400,DMD_SingleQuote
FlexDMDDict.Add 16640, DMD_CloseBracket
FlexDMDDict.Add 5120, DMD_OpenBracket
FlexDMDDict.Add 2120, DMD_Equals
FlexDMDDict.Add 10275, DMD_Question
FlexDMDDict.Add 2112, DMD_Minus
FlexDMDDict.Add 10861, DMD_Dollar
FlexDMDDict.Add 6144, DMD_GreaterThan
FlexDMDDict.Add 65535, DMD_Hash
FlexDMDDict.Add 32576, DMD_Asterick
FlexDMDDict.Add 10816, DMD_Plus
End sub
The base table doesn't have a desktop segment score display so there is no existing DisplayTimer_Timer event with a call to ChangedLEDs to use, so add a timer to the the table and a cut down version of the DisplayTimer_Timer code (as no need to loop through individual segments for desktop scoring like in most cases).
Sub DisplayTimer_Timer
If UseFlexDMD then
Dim ChgLED, ii, num, stat
ChgLED=Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
If Not IsEmpty(ChgLED)Then
If Not FlexDMD is Nothing Then FlexDMD.LockRenderThread
For ii=0 To UBound(chgLED)
num=chgLED(ii, 0) : stat=chgLED(ii, 2)
UpdateFlexChar num, stat
Next
If Not FlexDMD is Nothing Then FlexDMD.UnlockRenderThread
End if
Else
DisplayTimer.Enabled = False
End If
End Sub
Note that the flexdmd render thread is locked/unlocked in the DisplayTimer_Timer event as well now instead of in a FlexDMDUpdate sub (as we don't need to concatanate strings for flexDMD to use with a font file, a FlexDMDUpdate sub won't be used in this code).
Last add the code translation sub, to map the segment display id and value from the rom to an image location on the dmd and the characters image for flex to use;
Sub UpdateFlexChar(id, value)
If id < 40 Then
if FlexDMDDict.Exists (value) then
FlexDMDScene.GetImage("Seg" & id).Bitmap = FlexDMD.NewImage("", FlexDMDDict.Item (value)).Bitmap
Else
FlexDMDScene.GetImage("Seg" & id).Bitmap = FlexDMD.NewImage("", DMD_Space).Bitmap
end if
End If
End Sub
Add the usual code to cleanup flexdmd objects on table_exit
Sub Table1_Exit()
Controller.Pause = False
Controller.Stop
If UseFlexDMD then
If Not FlexDMD is Nothing Then
FlexDMD.Show = False
FlexDMD.Run = False
FlexDMD = NULL
End if
End if
End Sub
and the result when UseFlexDMD is set to 1 (with the default freezy display on top for comparison) gives;

In the final version i also added some checks and extra images to be used as overlay to add some Logan's Run game specific text instead of Arena game text (e.g. 'PREMIER WARRIORS' is overlayed with 'PREMIER RUNNERS'), i won't describe them here, but you should be able to see the differences where used in the final code below compared with the code above
Dim FlexDMD
DIm FlexDMDDict
Dim FlexDMDScene
Dim PremierFlag, BottomLine(19)
Sub FlexDMD_Init() 'default/startup values
' flex dmd variables
DIm FlexDMDFont
Dim FlexPath
' populate the lookup dictionary for mapping display characters
FlexDictionary_Init
dim i
for i = 0 to 19
BottomLine(i) = 0
next
PremierFlag = False
'setup flex dmd
Set FlexDMD = CreateObject("FlexDMD.FlexDMD")
If Not FlexDMD is Nothing Then
FlexDMD.GameName = cGameName
FlexDMD.TableFile = Table1.Filename & ".vpx"
FlexDMD.RenderMode = 2
FlexDMD.Width = 128
FlexDMD.Height = 32
FlexDMD.Clear = True
FlexDMD.Run = True
FlexDMD.LockRenderThread
Set FlexDMDScene = FlexDMD.NewGroup("Scene")
With FlexDMDScene
'populate blank display
.AddActor FlexDMD.NewImage("Back", "VPX.DMD_Background")
'40 segment display holders
.AddActor FlexDMD.NewImage("Seg0", DMD_Space)
.GetImage("Seg0").SetAlignedPosition 4,0,0
.AddActor FlexDMD.NewImage("Seg1", DMD_Space)
.GetImage("Seg1").SetAlignedPosition 10,0,0
.AddActor FlexDMD.NewImage("Seg2", DMD_Space)
.GetImage("Seg2").SetAlignedPosition 16,0,0
.AddActor FlexDMD.NewImage("Seg3", DMD_Space)
.GetImage("Seg3").SetAlignedPosition 22,0,0
.AddActor FlexDMD.NewImage("Seg4", DMD_Space)
.GetImage("Seg4").SetAlignedPosition 28,0,0
.AddActor FlexDMD.NewImage("Seg5", DMD_Space)
.GetImage("Seg5").SetAlignedPosition 34,0,0
.AddActor FlexDMD.NewImage("Seg6", DMD_Space)
.GetImage("Seg6").SetAlignedPosition 40,0,0
.AddActor FlexDMD.NewImage("Seg7", DMD_Space)
.GetImage("Seg7").SetAlignedPosition 46,0,0
.AddActor FlexDMD.NewImage("Seg8", DMD_Space)
.GetImage("Seg8").SetAlignedPosition 52,0,0
.AddActor FlexDMD.NewImage("Seg9", DMD_Space)
.GetImage("Seg9").SetAlignedPosition 58,0,0
.AddActor FlexDMD.NewImage("Seg10", DMD_Space)
.GetImage("Seg10").SetAlignedPosition 64,0,0
.AddActor FlexDMD.NewImage("Seg11", DMD_Space)
.GetImage("Seg11").SetAlignedPosition 70,0,0
.AddActor FlexDMD.NewImage("Seg12", DMD_Space)
.GetImage("Seg12").SetAlignedPosition 76,0,0
.AddActor FlexDMD.NewImage("Seg13", DMD_Space)
.GetImage("Seg13").SetAlignedPosition 82,0,0
.AddActor FlexDMD.NewImage("Seg14", DMD_Space)
.GetImage("Seg14").SetAlignedPosition 88,0,0
.AddActor FlexDMD.NewImage("Seg15", DMD_Space)
.GetImage("Seg15").SetAlignedPosition 94,0,0
.AddActor FlexDMD.NewImage("Seg16", DMD_Space)
.GetImage("Seg16").SetAlignedPosition 100,0,0
.AddActor FlexDMD.NewImage("Seg17", DMD_Space)
.GetImage("Seg17").SetAlignedPosition 106,0,0
.AddActor FlexDMD.NewImage("Seg18", DMD_Space)
.GetImage("Seg18").SetAlignedPosition 112,0,0
.AddActor FlexDMD.NewImage("Seg19", DMD_Space)
.GetImage("Seg19").SetAlignedPosition 118,0,0
.AddActor FlexDMD.NewImage("Seg20", DMD_Space)
.GetImage("Seg20").SetAlignedPosition 4,16,0
.AddActor FlexDMD.NewImage("Seg21", DMD_Space)
.GetImage("Seg21").SetAlignedPosition 10,16,0
.AddActor FlexDMD.NewImage("Seg22", DMD_Space)
.GetImage("Seg22").SetAlignedPosition 16,16,0
.AddActor FlexDMD.NewImage("Seg23", DMD_Space)
.GetImage("Seg23").SetAlignedPosition 22,16,0
.AddActor FlexDMD.NewImage("Seg24", DMD_Space)
.GetImage("Seg24").SetAlignedPosition 28,16,0
.AddActor FlexDMD.NewImage("Seg25", DMD_Space)
.GetImage("Seg25").SetAlignedPosition 34,16,0
.AddActor FlexDMD.NewImage("Seg26", DMD_Space)
.GetImage("Seg26").SetAlignedPosition 40,16,0
.AddActor FlexDMD.NewImage("Seg27", DMD_Space)
.GetImage("Seg27").SetAlignedPosition 46,16,0
.AddActor FlexDMD.NewImage("Seg28", DMD_Space)
.GetImage("Seg28").SetAlignedPosition 52,16,0
.AddActor FlexDMD.NewImage("Seg29", DMD_Space)
.GetImage("Seg29").SetAlignedPosition 58,16,0
.AddActor FlexDMD.NewImage("Seg30", DMD_Space)
.GetImage("Seg30").SetAlignedPosition 64,16,0
.AddActor FlexDMD.NewImage("Seg31", DMD_Space)
.GetImage("Seg31").SetAlignedPosition 70,16,0
.AddActor FlexDMD.NewImage("Seg32", DMD_Space)
.GetImage("Seg32").SetAlignedPosition 76,16,0
.AddActor FlexDMD.NewImage("Seg33", DMD_Space)
.GetImage("Seg33").SetAlignedPosition 82,16,0
.AddActor FlexDMD.NewImage("Seg34", DMD_Space)
.GetImage("Seg34").SetAlignedPosition 88,16,0
.AddActor FlexDMD.NewImage("Seg35", DMD_Space)
.GetImage("Seg35").SetAlignedPosition 94,16,0
.AddActor FlexDMD.NewImage("Seg36", DMD_Space)
.GetImage("Seg36").SetAlignedPosition 100,16,0
.AddActor FlexDMD.NewImage("Seg37", DMD_Space)
.GetImage("Seg37").SetAlignedPosition 106,16,0
.AddActor FlexDMD.NewImage("Seg38", DMD_Space)
.GetImage("Seg38").SetAlignedPosition 112,16,0
.AddActor FlexDMD.NewImage("Seg39", DMD_Space)
.GetImage("Seg39").SetAlignedPosition 118,16,0
'score text overlays last
.AddActor FlexDMD.NewImage("PremierRunners", "VPX.DMD_PremierRunners")
.GetImage("PremierRunners").Visible = False
.AddActor FlexDMD.NewImage("LogansRun", "VPX.DMD_LogansRunLogo")
.GetImage("LogansRun").Visible = False
End With
FlexDMD.Stage.AddActor FlexDMDScene
FlexDMD.Show = True
FlexDMD.UnlockRenderThread
End If
End Sub
Sub FlexDictionary_Init
Set FlexDMDDict = CreateObject("Scripting.Dictionary")
FlexDMDDict.Add 0, DMD_Space
FlexDMDDict.Add 63, DMD_O
FlexDMDDict.Add 8704, DMD_1
FlexDMDDict.Add 2139, DMD_2
FlexDMDDict.Add 2127, DMD_3
FlexDMDDict.Add 2150, DMD_4
FlexDMDDict.Add 2157, DMD_S
FlexDMDDict.Add 2173, DMD_6
FlexDMDDict.Add 7, DMD_7
FlexDMDDict.Add 2175,DMD_8
FlexDMDDict.Add 2159,DMD_9
FlexDMDDict.Add 191,DMD_Odot
FlexDMDDict.Add 8832, DMD_1dot
FlexDMDDict.Add 2267, DMD_2dot
FlexDMDDict.Add 2255, DMD_3dot
FlexDMDDict.Add 2278, DMD_4dot
FlexDMDDict.Add 2285, DMD_Sdot
FlexDMDDict.Add 2301, DMD_6dot
FlexDMDDict.Add 135, DMD_7dot
FlexDMDDict.Add 2303, DMD_8dot
FlexDMDDict.Add 2287, DMD_9dot
FlexDMDDict.Add 2167, DMD_A
FlexDMDDict.Add 10767, DMD_B
FlexDMDDict.Add 57, DMD_C
FlexDMDDict.Add 8719, DMD_D
FlexDMDDict.Add 121, DMD_E
FlexDMDDict.Add 113, DMD_F
FlexDMDDict.Add 2109, DMD_G
FlexDMDDict.Add 2166, DMD_H
FlexDMDDict.Add 8713, DMD_I
FlexDMDDict.Add 30, DMD_J
FlexDMDDict.Add 5232, DMD_K
FlexDMDDict.Add 56, DMD_L
FlexDMDDict.Add 1334, DMD_M
FlexDMDDict.Add 4406, DMD_N
' "O" = 0
FlexDMDDict.Add 2163, DMD_P
FlexDMDDict.Add 4159, DMD_Q
FlexDMDDict.Add 6259, DMD_R
' "S" = 5
FlexDMDDict.Add 8705, DMD_T
FlexDMDDict.Add 62, DMD_U
FlexDMDDict.Add 17456, DMD_V
FlexDMDDict.Add 20534, DMD_W
FlexDMDDict.Add 21760, DMD_X
FlexDMDDict.Add 9472, DMD_Y
FlexDMDDict.Add 17417, DMD_Z
FlexDMDDict.Add &h400,DMD_SingleQuote
FlexDMDDict.Add 16640, DMD_CloseBracket
FlexDMDDict.Add 5120, DMD_OpenBracket
FlexDMDDict.Add 2120, DMD_Equals
FlexDMDDict.Add 10275, DMD_Question
FlexDMDDict.Add 2112, DMD_Minus
FlexDMDDict.Add 10861, DMD_Dollar
FlexDMDDict.Add 6144, DMD_GreaterThan
FlexDMDDict.Add 65535, DMD_Hash
FlexDMDDict.Add 32576, DMD_Asterick
FlexDMDDict.Add 10816, DMD_Plus
End sub
Sub UpdateFlexChar(id, value)
If id < 40 Then
if FlexDMDDict.Exists (value) then
FlexDMDScene.GetImage("Seg" & id).Bitmap = FlexDMD.NewImage("", FlexDMDDict.Item (value)).Bitmap
Else
FlexDMDScene.GetImage("Seg" & id).Bitmap = FlexDMD.NewImage("", DMD_Space).Bitmap
end if
'basic text tracking
if id =2 then
if value = 2163 Then
PremierFlag = True
Else
PremierFlag = False
end if
End if
if id > 19 Then
BottomLine(id - 20) = value
end if
End If
If Controller.Solenoid(10) = True Then
'ball in play. Hide premier runners / logans run text
FlexDMDScene.GetImage("LogansRun").Visible = False
FlexDMDScene.GetImage("PremierRunners").Visible = False
Else
'overwrite text with image checks
if PremierFlag = True Then
FlexDMDScene.GetImage("LogansRun").Visible = False
FlexDMDScene.GetImage("PremierRunners").Visible = True
elseif join(BottomLine,"") = 0 Then
FlexDMDScene.GetImage("LogansRun").Visible = True
FlexDMDScene.GetImage("PremierRunners").Visible = False
Else
'in game
FlexDMDScene.GetImage("LogansRun").Visible = False
FlexDMDScene.GetImage("PremierRunners").Visible = False
End If
End if
End Sub
Sub DisplayTimer_Timer
If UseFlexDMD then
Dim ChgLED, ii, num, stat
ChgLED=Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
If Not IsEmpty(ChgLED)Then
If Not FlexDMD is Nothing Then FlexDMD.LockRenderThread
For ii=0 To UBound(chgLED)
num=chgLED(ii, 0) : stat=chgLED(ii, 2)
UpdateFlexChar num, stat
Next
If Not FlexDMD is Nothing Then FlexDMD.UnlockRenderThread
End if
Else
DisplayTimer.Enabled = False
End If
End Sub
Note - as i've updated the table.vpx file rather than just add a .vbs script and external files i now count this as a 'table mod'. It will be up to the table author if he wants to release it (he has a copy), i won't post a link to the table here other than the main table download page.
Edited by scutters, 20 October 2021 - 05:44 PM.