'Last Updated in VBS v3.61 ' Modified by Wiesshund to address the staged flips used in a few tables, such as Grand Lizard. Option Explicit LoadCore Private Sub LoadCore On Error Resume Next If VPBuildVersion < 0 Or Err Then Dim fso : Set fso = CreateObject("Scripting.FileSystemObject") : Err.Clear ExecuteGlobal fso.OpenTextFile("core.vbs", 1).ReadAll : If Err Then MsgBox "Can't open ""core.vbs""" : Exit Sub ExecuteGlobal fso.OpenTextFile("VPMKeys.vbs", 1).ReadAll : If Err Then MsgBox "Can't open ""vpmkeys.vbs""" : Exit Sub Else ExecuteGlobal GetTextFile("core.vbs") : If Err Then MsgBox "Can't open ""core.vbs""" : Exit Sub ExecuteGlobal GetTextFile("VPMKeys.vbs") : If Err Then MsgBox "Can't open ""vpmkeys.vbs""" : Exit Sub End If End Sub '------------------------- ' S11 Data '------------------------- ' Flipper Solenoid Const GameOnSolenoid = 23 ' Cabinet switches Const swAdvance = -7 Const swUpDown = -6 Const swCPUDiag = -5 Const swSoundDiag = -4 Const swTilt = 1 Const swBallRollTilt = 2 Const swStartButton = 3 Const swCoin3 = 4 Const swCoin2 = 5 Const swCoin1 = 6 Const swSlamTilt = 7 Const swHiScoreReset = 8 Const swLRFlip = 82 Const swLLFlip = 84 Const swURFlip = 81 Const swULFlip = 83 ' Help Window vpmSystemHelp = "Williams System 9/11 keys:" & vbNewLine &_ vpmKeyName(keyInsertCoin1) & vbTab & "Insert Coin #1" & vbNewLine &_ vpmKeyName(keyInsertCoin2) & vbTab & "Insert Coin #2" & vbNewLine &_ vpmKeyName(keyInsertCoin3) & vbTab & "Insert Coin #3" & vbNewLine &_ vpmKeyName(keyHiscoreReset) & vbTab & "Hiscore Reset" & vbNewLine &_ vpmKeyName(keyAdvance) & vbTab & "Advance" & vbNewLine &_ vpmKeyName(keyUpDown) & vbTab & "Up/Down" & vbNewLine &_ vpmKeyName(keyCPUDiag) & vbTab & "Cpu Diagnostic" & vbNewLine &_ vpmKeyName(keySoundDiag) & vbTab & "Sound Diagnostic" & vbNewLine &_ vpmKeyName(keySlamDoorHit) & vbTab & "Slam Tilt" ' Dip Switch / Options Menu Private Sub s11ShowDips If Not IsObject(vpmDips) Then ' First time Set vpmDips = New cvpmDips With vpmDips .AddForm 150, 45, "DIP Switches" .AddChk 0,0,100, Array("Germany", &H0001) End With End If vpmDips.ViewDips End Sub Set vpmShowDips = GetRef("s11ShowDips") Private vpmDips ' Keyboard handlers Function vpmKeyDown(ByVal keycode) vpmKeyDown = True ' Assume we handle the key With Controller Select Case keycode Case LeftFlipperKey .Switch(swLLFlip) = True : vpmKeyDown = False : vpmFlips.FlipL True If keycode = keyStagedFlipperL Then ' as vbs will not evaluate the Case keyStagedFlipperL then, also handle it here vpmFlips.FlipUL True If vpmFlips.FlipperSolNumber(2) <> 0 Then .Switch(swULFlip) = True End If Case RightFlipperKey .Switch(swLRFlip) = True : vpmKeyDown = False : vpmFlips.FlipR True If keycode = keyStagedFlipperR Then ' as vbs will not evaluate the Case keyStagedFlipperR then, also handle it here vpmFlips.FlipUR True If vpmFlips.FlipperSolNumber(3) <> 0 Then .Switch(swURFlip) = True End If Case keyStagedFlipperL vpmFlips.FlipUL True : If vpmFlips.FlipperSolNumber(2) <> 0 Then .Switch(swULFlip) = True Case keyStagedFlipperR vpmFlips.FlipUR True : If vpmFlips.FlipperSolNumber(3) <> 0 Then .Switch(swURFlip) = True Case keyInsertCoin1 vpmTimer.AddTimer 750,"vpmTimer.PulseSw swCoin1'" : If Not IsEmpty(Eval("SCoin")) Then Playsound SCoin Case keyInsertCoin2 vpmTimer.AddTimer 750,"vpmTimer.PulseSw swCoin2'" : If Not IsEmpty(Eval("SCoin")) Then Playsound SCoin Case keyInsertCoin3 vpmTimer.AddTimer 750,"vpmTimer.PulseSw swCoin3'" : If Not IsEmpty(Eval("SCoin")) Then Playsound SCoin Case StartGameKey .Switch(swStartButton) = True Case keyUpDown .Switch(swUpDown) = Not .Switch(swUpDown) Case keyAdvance .Switch(swAdvance) = True Case keyCPUDiag .Switch(swCPUDiag) = True Case keySoundDiag .Switch(swSoundDiag) = True Case keyHiscoreReset .Switch(swHiscoreReset) = True Case keySlamDoorHit .Switch(swSlamTilt) = True Case keyBangBack vpmNudge.DoNudge 0, 6 Case LeftTiltKey vpmNudge.DoNudge 75, 2 Case RightTiltKey vpmNudge.DoNudge 285, 2 Case CenterTiltKey vpmNudge.DoNudge 0, 2 Case keyVPMVolume vpmVol Case Else vpmKeyDown = False End Select End With End Function Function vpmKeyUp(ByVal keycode) vpmKeyUp = True ' Assume we handle the key With Controller Select Case keycode Case LeftFlipperKey .Switch(swLLFlip) = False : vpmKeyUp = False : vpmFlips.FlipL False If keycode = keyStagedFlipperL Then ' as vbs will not evaluate the Case keyStagedFlipperL then, also handle it here vpmFlips.FlipUL False If vpmFlips.FlipperSolNumber(2) <> 0 Then .Switch(swULFlip) = False End If Case RightFlipperKey .Switch(swLRFlip) = False : vpmKeyUp = False : vpmFlips.FlipR False If keycode = keyStagedFlipperR Then ' as vbs will not evaluate the Case keyStagedFlipperR then, also handle it here vpmFlips.FlipUR False If vpmFlips.FlipperSolNumber(3) <> 0 Then .Switch(swURFlip) = False End If Case keyStagedFlipperL vpmFlips.FlipUL False : If vpmFlips.FlipperSolNumber(2) <> 0 Then .Switch(swULFlip) = False Case keyStagedFlipperR vpmFlips.FlipUR False : If vpmFlips.FlipperSolNumber(3) <> 0 Then .Switch(swURFlip) = False Case StartGameKey .Switch(swStartButton) = False Case keyAdvance .Switch(swAdvance) = False Case keyCPUDiag .Switch(swCPUDiag) = False Case keySoundDiag .Switch(swSoundDiag) = False Case keyHiscoreReset .Switch(swHiscoreReset) = False Case keySlamDoorHit .Switch(swSlamTilt) = False Case keyShowOpts .Pause = True : vpmShowOptions : .Pause = False Case keyShowKeys .Pause = True : vpmShowHelp : .Pause = False Case keyShowDips If IsObject(vpmShowDips) Then .Pause = True : vpmShowDips : .Pause = False Case keyAddBall .Pause = True : vpmAddBall : .Pause = False Case keyReset .Stop : BeginModal : .Run : vpmTimer.Reset : EndModal Case keyFrame .LockDisplay = Not .LockDisplay Case keyDoubleSize .DoubleSize = Not .DoubleSize Case Else vpmKeyUp = False End Select End With End Function