-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathClass of 1812 - NZ&TT 1.0.vbs
915 lines (797 loc) · 34.7 KB
/
Class of 1812 - NZ&TT 1.0.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
'
' .EM;. iM@BXi:7Z778@B. LB@@@BOj. :8@, 7J. : .r. , iv:. .
' :Lr:GB@B@B@B@B@B@B@B@M@B@Li P@B@BM@@B@B@@O. 2B@@@B@uOB7 .B@B@BOv@B. iq@B@@@B8: :B@qJvOB,
' .BBM0@MBuvE@@:B@ :B@:uB@: @@S rr7k8M@B@ @Bvirk@B@B, uB1ir2@@@B 7G@BGBM0@B@B@M. .,7k@B@B@B@BJ
' r@B,B@BuO, J@B:5@Bj O@7 r@B@B@ :B@M7 @B, uO OB: iN YM@B@BMi@J r@B@Bv L@@BOB@M. .,
' r@Bi @@@1@: MB@:vB@M @@ v M@ .@B@L 0B@BBPBMOB@B@BPr LB@B8OBMOB@@@Bki 7B@L B@0rO@: X@B@B LB@B@@1r0B@O8M0
' @B@. B@BPBi .M@@B@@L7@BB i@u Oq .B@Br i@BYZB@@B@BX5kM@@@B1 @B08@B@@@BE2GB@B@B7 O@B @@GiM8J0NP7F@BO8@B@B@B@qrM@BBB@:
' B@Br @B@iMk : ;8@@77B@q r@k:B@2jk5k@B@r @@@r....vrS77::..M@B@B@Y.:i:jEJiii: :B@B7 :@BB B@O7BZ;ZGL 7@@B@N: 2@BM.@B@
' MB@O;B@: B2 :Z@B@BrF@O MB@B@B@@@B@@k :@B@B@@@B@@@@@B@F B@B@B@B@B@B@B@B@B@,.B@2 i@@B @@@iMMLiir0B@@@ [email protected]@B
' i@B@BB @i rB@ uB@Z@7 ,rU BB@1 :LLOO. i@BM.@B :LLXu7 r@Bi,@B. @B@q7Bu B7 u@BM q@BM.@B@
' r@B@@@5rBF75M@B@v B@B@B@B@M2 :2PB@B@5; ZB@B1.:.0B@B@B@Fr. .10:i@B v8@B@BBk7. ,N2.:@O :@@@Bq @. r@@BL EB@M B@@.
' .OB@B@B@B@B@BS F@@B@@@B@B@B@B@BMJMB@B@B@JXB@@@B@@GUkN@B@@@B@BNq@7 @B@250@B@B@B@B10M; :@B@B@@8@P8@B@v P@BX:@B@.
' .7kO@B@05, :@@7. :u@O i@5 7@Bv EB8 M@U: :ii:u@@@2: J@X:,rNNruX@B@L :2@B@B@B@S, ,;. qBMO@B@:
' ri :::. .:r1v: . .B@@@B@@@B@Xi
' O@MO@S 7O@@B@B8r rPM0O1 PB@B@B@B@B@i:YZ M@ruB@BS:
' r@B@B@B@ 7@@B@B@B@B@@Y @@@B@B@ @B@B@B@B@B@B@
' ;OB@B@B@B@L MB@B@BqB@B@@@B .vP@B@B@B@U @B@B@B@B78@B@BM
' j@B@@@B@B@BL vB@B@N @: E@B@r 2@B@B@B@B@B: LB@@@@P iB@@@B
' GB@B@B@B@B@v S@B@B vB@Bi @B@B@B@B@B@ j@@U. B@@@B@
' G@B@B@B@B@BL B@@B@Y B@B@ @@B@B@B@B@B SB B@@@B@O
' :@. .@B@@@O @B@B@;.:uB@B@. 7X@: 5@B@B@ X@ 7B@B@@@8
' 7B B@@@B1 B@@@B@B@B@B@B: .B 8B@@@B 5B@B@@@M@
' J@B@@@i B@@@@@B@B@B@B@B@ i@ Z@B@B@ @B@B@B@ :@
' @B@B@B7 B@B@@uBS ..YB@@@B@ YB@B@M j@B@B@B1
' B@@@B@i J@B@BJ BM B@B@BL B@B@BE 0@B@B@B
' @@@B@@r @B@B@. 5@ B@B@M .@B@B@E B@B@B@M
' :@8GB@B@B@B@B@B@BZ @B@B@ ::uB@B@B@r:B@B@B@BU .;;uY.
' EB@B@@@B@B@B@@@B@@v B@@B@B@B@B@B@B@B@B@B@B@B@@@B@B@B@B@.
' M@B@@@B@B@B@B@B@B@@@Yi;ij@B@B@B@B@@@B@B@B@B@B@B@B@B@B@@@B@B@BB
' @@@B@B@B@@@B@B@B@B@B@@@B@B@B@SLB@@@B@B@B@B@B@B@B@@@B@@@B@B@B@BL
' FEkB@M@B@B@BGr Y@@@B@B@@@B@q MB@B@@@@@B@B@B@B@B@B@B@B@B@B@F7,
' OM iB ,rjU1v7i.ZO EG @
' B@ B@ L@v
' :5 Mi ,q.
'
'
'
'
'IPD No. 528 - 4 players
'© Gottlieb 1991
'VPX recreation by tom tower & ninuzzu
' Thalamus 2018-07-23
' This tables has already "Positional Sound Playback Functions" and "Supporting Ball & Sound Functions"
' Changed UseSolenoids=1 to 2
' No special SSF tweaks yet.
Option Explicit
Randomize
Const BallSize = 52
Const BallMass = 1.2
' Thal : Added because of useSolenoid=2
Const cSingleLFlip = 0
Const cSingleRFlip = 0
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
On Error Goto 0
Dim DesktopMode:DesktopMode = Table1.ShowDT
Const cGameName= "clas1812"
LoadVPM "02800000", "Class1812.VBS", 3.50
'********************
'Standard definitions
'********************
Const UseSolenoids = 2
Const UseLamps = 1
Const UseSync = 1
Const UseGI = 0
' Standard Sounds
Const SSolenoidOn = "SolenoidOn"
Const SSolenoidOff = "SolenoidOff"
Const SCoin = "fx_Coin"
'******************************************************
' Initialize the table
'******************************************************
Dim bsSaucer,bsScoop, bsTK, dtBankL, dtBankR, xx
Sub Table1_Init
With Controller
.GameName = cGameName
If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
.SplashInfoLine = "Class of 1812 (Gottlieb 1991)"
.HandleKeyboard = 0
.ShowTitle = 0
.ShowDMDOnly = 1
.ShowFrame = 0
.HandleMechanics = 0
.dip(0) = &H00 'Set DIP to USA
.Hidden = 1
On Error Resume Next
.Run 'GetPlayerHWnd
If Err Then MsgBox Err.Description
On Error Goto 0
End With
'** Main Timer init
PinMAMETimer.Interval = PinMAMEInterval
PinMAMETimer.Enabled = 1
'** Nudging
vpmNudge.TiltSwitch = 151
vpmNudge.Sensitivity = 4
vpmNudge.TiltObj = Array(sw10, sw11, sw12, sw13, sw14)
'** Scoop
Set bsScoop = new cvpmSaucer
With bsScoop
.InitKicker Sw52, 52, 200, 25, 1
.InitSounds "fx_kicker_catch", SoundFX("CenterEject",DOFContactors), SoundFX("CenterEject",DOFContactors)
.CreateEvents "bsScoop", sw52
End With
'** Top Kicker
Set bsTK = new cvpmSaucer
With bsTK
.InitKicker Sw53k, 53, -30, 25, 0
.InitSounds "fx_metal_hit_1", SoundFX("LeftEject",DOFContactors), SoundFX("LeftEject",DOFContactors)
.CreateEvents "bsTK", sw53k
End With
'** DropTargets Bank (Left)
Set dtBankL = new cvpmDropTarget
With dtBankL
.InitDrop Array(sw16,sw26,sw36,sw46),Array(16,26,36,46)
.Initsnd SoundFX("CenterDropBankDown",DOFDropTargets), SoundFX("CenterDropBankUp",DOFDropTargets)
End With
'** DropTargets Bank (Right)
Set dtBankR = new cvpmDropTarget
With dtBankR
.InitDrop Array(sw17,sw27,sw37,sw47),Array(17,27,37,47)
.Initsnd SoundFX("CenterDropBankDown",DOFDropTargets), SoundFX("CenterDropBankUp",DOFDropTargets)
End With
'** Other Suff
InitRolling:InitLamps:InitTrough:DiverterOn.IsDropped=1
SideRails.visible=DesktopMode
End Sub
'******************************************************
' Keys
'******************************************************
Sub Table1_KeyDown(ByVal keycode)
If keycode = LeftTiltKey Then Nudge 90, 5:PlaySoundAt SoundFX("fx_nudge",0), CardLeft
If keycode = RightTiltKey Then Nudge 270, 5:PlaySoundAt SoundFX("fx_nudge",0), CardRight
If keycode = CenterTiltKey Then Nudge 0, 6:PlaySoundAt SoundFX("fx_nudge",0), Drain
If keycode = PlungerKey Then Plunger.PullBack:PlaySoundAt "fx_plungerpull",Plunger
If keycode = LeftFlipperKey then Controller.switch(4)=1
If keycode = RightFlipperKey then Controller.switch(5)=1
If vpmKeyDown(keycode) Then Exit Sub
End Sub
Sub Table1_KeyUp(ByVal keycode)
If keycode = PlungerKey Then Plunger.Fire:StopSound "plungerpull":PlaySoundAt "fx_plunger",Plunger
If keycode = LeftFlipperKey then Controller.switch(4)=0
If keycode = RightFlipperKey then Controller.switch(5)=0
if vpmKeyUp(keycode) Then Exit Sub
End Sub
Sub Table1_Paused:Controller.Pause = True:End Sub
Sub Table1_unPaused:Controller.Pause = False:End Sub
Sub Table1_exit():Controller.Pause = False:Controller.Stop:End Sub
'******************************************************
' Solenoids Map
'******************************************************
'(**) Used in backbox (translite)
'SolCallback(1) = "" '1 - Left Bumper
'SolCallback(2) = "" '2 - Right Bumper
'SolCallback(3) = "" '3 - Bottom Bumper
'SolCallback(4) = "" '4 - Left Slingshot
'SolCallback(5) = "" '5 - Right Slingshot
SolCallback(6) = "SolVUK" '6 - Bottom Scoop
SolCallback(7) = "bsTK.SolOut" '7 - Top Upkicker
SolCallback(8) = "dtBankL.SolDropUp" '8 - Left Bank Reset
SolCallback(9) = "dtBankR.SolDropUp" '9 - Right Bank Reset
SolCallback(10) = "SolDiv" '10 - Diverter
SolCallback(11) = "SolHeart" '11 - Heart
SolCallback(12) = "SolTeeth" '12 - Teeth
'SolCallback(13) = "setlamp 143," '13 - Flasher:Lightning (3) **
'SolCallback(14) = "setlamp 144," '14 - Flasher:Willie Wolf (2) **
'SolCallback(15) = "setlamp 145," '15 - Flasher:Belly LaGhost (2) **
'SolCallback(16) = "setlamp 146," '16 - Flasher:Vamp do Tramp (2) **
'SolCallback(17) = "setlamp 147," '17 - Flasher:Mumsy N. Law (2) **
'SolCallback(18) = "setlamp 148," '18 - Flasher:Zom McCoffin (2) **
'SolCallback(19) = "setlamp 149," '19 - Flasher:Zom McCoffin (2) **
'SolCallback(20) = "setlamp 150," '20 - Flasher:Grover Cleaever (2) **
'SolCallback(21) = "setlamp 151," '21 - Flasher:Peter PieceMeal (2) **
SolCallback(22) = "SetLamp 152," '22 - Flasher:Ramps #1 (2)
SolCallback(23) = "SetLamp 153," '23 - Flasher:Ramps #2 (2)
SolCallback(24) = "SetLamp 154," '24 - Flasher:Ramps #3 (2)
SolCallback(25) = "SetLamp 155," '25 - Flasher:Heart (2)
SolCallback(26) = "GIRelay" '26 - LightBox Relay
SolCallback(27) = "" '27 - Ticket/Coin Meter
SolCallback(28) = "ReleaseBall" '28 - Ball Release
SolCallback(29) = "SolOuthole" '29 - Outhole.
SolCallback(30) = "SolKnocker" '30 - Knocker
SolCallback(31) = "TiltRelay" '31 - Tilt Relay
SolCallback(32) = "vpmNudge.SolGameOn" '32 - Game Over Relay
SolCallback(sLRFlipper) = "SolRFlipper"
SolCallback(sLLFlipper) = "SolLFlipper"
'******************************************************
' TROUGH BASED ON FOZZY'S
'******************************************************
'Init Trough
Sub InitTrough
Slot1.CreateSizedballWithMass Ballsize/2,Ballmass
Slot2.CreateSizedballWithMass Ballsize/2,Ballmass
Controller.Switch(44) = 1
Controller.Switch(54) = 0
End Sub
'Handle Trough
Sub Slot2_Hit():UpdateTrough:End Sub
Sub Slot1_Hit():Controller.Switch(44) = 1:UpdateTrough:End Sub
Sub Slot1_UnHit():Controller.Switch(44) = 0:UpdateTrough:End Sub
Sub UpdateTrough()
Slot1.TimerInterval = 300
Slot1.TimerEnabled = 1
End Sub
Sub Slot1_Timer()
Me.TimerEnabled = 0
If Slot1.BallCntOver = 0 Then Slot2.kick 60, 9
End Sub
'Drain & Release
Sub Drain_Hit()
PlaySoundAt "fx_drain",Drain
UpdateTrough
Controller.Switch(54) = 1
End Sub
Sub Drain_UnHit()
Controller.Switch(54) = 0
End Sub
Sub SolOuthole(enabled)
If enabled Then
Drain.kick 60,20
PlaySoundAt SoundFX(SSolenoidOn, DOFContactors), Drain
Else
PlaySoundAt SSolenoidOff, Drain
End If
End Sub
Sub ReleaseBall(enabled)
If enabled Then
PlaySoundAt SoundFX("fx_ballrel",DOFContactors), Drain
Slot1.kick 60, 9
UpdateTrough
End If
End Sub
'******************************************************
' Solenoids Routines
'******************************************************
'*********** Knocker
Sub SolKnocker(enabled)
If Enabled Then
PlaySoundAt SoundFX("Knocker",DOFKnocker), l82
End If
End Sub
'*********** Flippers
Sub SolLFlipper(Enabled)
If Enabled Then
PlaySoundAt SoundFX("fx_flipperup", DOFFlippers), LeftFlipper
LeftFlipper.RotateToEnd
Else
PlaySoundAt SoundFX("fx_flipperdown", DOFFlippers), LeftFlipper
LeftFlipper.RotateToStart
End If
End Sub
Sub SolRFlipper(Enabled)
If Enabled Then
PlaySoundAt SoundFX("fx_flipperup", DOFFlippers), RightFlipper
RightFlipper.RotateToEnd
Else
PlaySoundAt SoundFX("fx_flipperdown", DOFFlippers), RightFlipper
RightFlipper.RotateToStart
End If
End Sub
'*********** Scoop
Sub SolVUK(enabled)
If Enabled Then
sw52.timerinterval=500:sw52.timerEnabled=1
CenterHole.Enabled=0
bsScoop.ExitSol_On
sw52p.transZ=30
End If
End Sub
sub sw52_timer:me.timerEnabled=0:CenterHole.Enabled=1:sw52p.transZ=0:end Sub
'*********** Diverter
Dim DiverterDir
Sub SolDiv(Enabled)
If Enabled Then
DiverterOff.IsDropped=1
DiverterOn.IsDropped=0
DiverterDir = -1
Diverter.Interval = 5:Diverter.Enabled = 1
PlaySoundAt SoundFX("DiverterOn",DOFContactors),DiverterP
Else
DiverterOff.IsDropped=0
DiverterOn.IsDropped=1
DiverterDir = +1
Diverter.Interval = 5:Diverter.Enabled = 1
PlaySoundAt SoundFX("DiverterOff",DOFContactors),DiverterP
End If
End Sub
Sub Diverter_Timer()
DiverterP.RotZ=DiverterP.RotZ+DiverterDir
If DiverterP.RotZ>5 AND DiverterDir=1 Then Me.Enabled=0:DiverterP.RotZ=5
If DiverterP.RotZ<-35 AND DiverterDir=-1 Then Me.Enabled=0:DiverterP.RotZ=-35
End Sub
'********* Heart
Sub SolHeart(enabled)
If enabled Then
heartMove.enabled=1:PlaySoundAt SoundFX(SSolenoidOn,DOFContactors),heart
Else
PlaySoundAt SoundFX(SSolenoidOff,DOFContactors),heart
End If
End Sub
dim pump, heartD
sub heartMove_timer()
pump=pump+10
heartD=dsin(pump)
if pump>180 then pump=0:heart.size_y=1:Me.enabled=0
heart.size_y=(heartD/8)+1.2
end sub
'********* Teeth
Sub SolTeeth(enabled)
If enabled Then
BottomTeeth.RotX=0
Else
BottomTeeth.RotX=-25
End If
End Sub
'******************************************************
' Switches
'******************************************************
'Bumpers
Sub sw10_Hit() : vpmTimer.PulseSw 10 : PlaySoundAt SoundFX("LeftJet",DOFContactors), ActiveBall: End Sub
Sub sw11_Hit() : vpmTimer.PulseSw 11 : PlaySoundAt SoundFX("RightJet",DOFContactors), ActiveBall: End Sub
Sub sw12_Hit() : vpmTimer.PulseSw 12 : PlaySoundAt SoundFX("BottomJet",DOFContactors), ActiveBall: End Sub
'Slings
Dim LStep,RStep
Sub sw13_Slingshot
PlaySoundAt SoundFX("LeftSlingShot",DOFContactors), ActiveBall
vpmTimer.PulseSw 13
LSling.Visible = 0
LSling1.Visible = 1
sling1.TransZ = -20
LStep = 0
Me.TimerInterval = 20
Me.TimerEnabled = 1
End Sub
Sub sw13_Timer
Select Case LStep
Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling1.TransZ = -10
Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling1.TransZ = 0:Me.TimerEnabled = 0
End Select
LStep = LStep + 1
End Sub
Sub sw14_Slingshot
PlaySoundAt SoundFX("RightSlingShot",DOFContactors), ActiveBall
vpmTimer.PulseSw 14
RSling.Visible = 0
RSling1.Visible = 1
sling2.TransZ = -20
RStep = 0
Me.TimerInterval = 20
Me.TimerEnabled = 1
End Sub
Sub sw14_Timer
Select Case RStep
Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling2.TransZ = -10
Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling2.TransZ = 0:Me.TimerEnabled = 0
End Select
RStep = RStep + 1
End Sub
'Spinner
Sub sw15_Spin: vpmtimer.pulsesw 15:End Sub
'Drop Targets
Sub sw16_dropped:dtBankL.Hit 1:End Sub
Sub sw26_dropped:dtBankL.Hit 2:End Sub
Sub sw36_dropped:dtBankL.Hit 3:End Sub
Sub sw46_dropped:dtBankL.Hit 4:End Sub
Sub sw17_dropped:dtBankR.Hit 1:End Sub
Sub sw27_dropped:dtBankR.Hit 2:End Sub
Sub sw37_dropped:dtBankR.Hit 3:End Sub
Sub sw47_dropped:dtBankR.Hit 4:End Sub
'Standup Targets
Sub Sw20_Hit():vpmTimer.PulseSw 20: PlaysoundAt SoundFX("fx_target",DOFTargets), ActiveBall: End Sub
Sub Sw30_Hit():vpmTimer.PulseSw 30: PlaysoundAt SoundFX("fx_target",DOFTargets), ActiveBall: End Sub
Sub Sw40_Hit():vpmTimer.PulseSw 40: PlaysoundAt SoundFX("fx_target",DOFTargets), ActiveBall: End Sub
Sub Sw21_Hit():vpmTimer.PulseSw 21: PlaysoundAt SoundFX("fx_target",DOFTargets), ActiveBall: End Sub
Sub Sw31_Hit():vpmTimer.PulseSw 31: PlaysoundAt SoundFX("fx_target",DOFTargets), ActiveBall: End Sub
Sub Sw41_Hit():vpmTimer.PulseSw 41: PlaysoundAt SoundFX("fx_target",DOFTargets), ActiveBall: End Sub
Sub Sw22_Hit():vpmTimer.PulseSw 22: PlaysoundAt SoundFX("fx_target",DOFTargets), ActiveBall: End Sub
Sub Sw32_Hit():vpmTimer.PulseSw 32: PlaysoundAt SoundFX("fx_target",DOFTargets), ActiveBall: End Sub
Sub Sw42_Hit():vpmTimer.PulseSw 42: PlaysoundAt SoundFX("fx_target",DOFTargets), ActiveBall: End Sub
'Rollovers
Sub Sw23_Hit:Controller.Switch(23)=1: PlaysoundAt "fx_sensor", ActiveBall: End Sub
Sub Sw23_UnHit:Controller.Switch(23)=0: End Sub
Sub Sw24_Hit:Controller.Switch(24)=1: PlaysoundAt "fx_sensor", ActiveBall: End Sub
Sub Sw24_UnHit:Controller.Switch(24)=0: End Sub
Sub Sw25_Hit:Controller.Switch(25)=1: PlaysoundAt "fx_sensor", ActiveBall: End Sub
Sub Sw25_UnHit:Controller.Switch(25)=0: End Sub
Sub Sw33_Hit:Controller.Switch(33)=1: PlaysoundAt "fx_sensor", ActiveBall: End Sub
Sub Sw33_UnHit:Controller.Switch(33)=0: End Sub
Sub Sw34_Hit:Controller.Switch(34)=1: PlaysoundAt "fx_sensor", ActiveBall: End Sub
Sub Sw34_UnHit:Controller.Switch(34)=0: End Sub
Sub Sw35_Hit:Controller.Switch(35)=1: PlaysoundAt "fx_sensor", ActiveBall: End Sub
Sub Sw35_UnHit:Controller.Switch(35)=0: End Sub
Sub Sw43_Hit:Controller.Switch(43)=1: PlaysoundAt "fx_sensor", ActiveBall: End Sub
Sub Sw43_UnHit:Controller.Switch(43)=0: End Sub
Sub Sw45_Hit:Controller.Switch(45)=1: PlaysoundAt "fx_sensor", ActiveBall: End Sub
Sub Sw45_UnHit:Controller.Switch(45)=0: End Sub
Sub Sw55_Hit:Controller.Switch(55)=1: PlaysoundAt "fx_sensor", ActiveBall: End Sub
Sub Sw55_UnHit:Controller.Switch(55)=0: End Sub
'Optos
Sub Sw50_Hit():vpmTimer.PulseSw 50: PlaysoundAt "fx_plasticrolling", ActiveBall: End Sub
Sub Sw51_Hit():vpmTimer.PulseSw 51: PlaysoundAt "fx_plasticrolling", ActiveBall: End Sub
'******************************************************
' GENERAL ILLUMINATION
'******************************************************
Sub GIRelay(enabled)
If Enabled Then
for each xx in GI:xx.State=0:Next
' for each xx in GIbulbs:xx.intensityscale=0:Next
Table1.ColorGradeImage = "ColorGrade_1"
PlaysoundAt "fx_relay_off", BackWall
Else
for each xx in GI:xx.State=1:Next
' for each xx in GIbulbs:xx.intensityscale=1:Next
Table1.ColorGradeImage = "ColorGrade_8"
PlaysoundAt "fx_relay_on", BackWall
End If
End Sub
Sub TiltRelay(enabled)
If Enabled Then
for each xx in GI:xx.State=0:Next
' for each xx in GIbulbs:xx.intensityscale=0:Next
Table1.ColorGradeImage = "ColorGrade_1"
PlaysoundAt "fx_relay_off", BackWall
Else
for each xx in GI:xx.State=1:Next
' for each xx in GIbulbs:xx.intensityscale=1:Next
Table1.ColorGradeImage = "ColorGrade_8"
PlaysoundAt "fx_relay_on", BackWall
End If
End Sub
' *********************************************************************
' Lighting
' *********************************************************************
Dim LampState(200)
Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashLevel(200)
Sub InitLamps
On Error Resume Next
Dim i
For i=0 To 200: Execute "Lights(" & i & ") = Array (L" & i & ",L" & i & "a)": Next
For i = 0 to 200
LampState(i) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
FlashSpeedUp(i) = 0.5 ' faster speed when turning on the flasher
FlashSpeedDown(i) = 0.35 ' slower speed when turning off the flasher
FlashLevel(i) = 0 ' the intensity of the flashers, usually from 0 to 1
Next
LampTimer.Interval = 30:LampTimer.Enabled = 1
End Sub
Sub LampTimer_Timer()
Dim i
For i=0 to 128:LampState(i) = ABS(Controller.Lamp(i)):Next
'Bulbs
SwapTex 2, TopTeeth, "teeth", "teeth_on" 'teeth
SwapTex 2, BottomTeeth, "teeth", "teeth_on" 'teeth
AddLamp 2, Li2 'teeth
AddLamp 10, bulb9 'BAT-o-Meter "5.000"
AddLamp 11, bulb8 'BAT-o-Meter "10.000"
AddLamp 12, bulb7 'BAT-o-Meter "20.000"
AddLamp 13, bulb6 'BAT-o-Meter "EXTRA BALL"
AddLamp 14, bulb5 'BAT-o-Meter "SPECIAL"
AddLamp 10, Li10 'BAT-o-Meter "5.000"
AddLamp 11, Li11 'BAT-o-Meter "10.000"
AddLamp 12, Li12 'BAT-o-Meter "20.000"
AddLamp 13, Li13 'BAT-o-Meter "EXTRA BALL"
AddLamp 14, Li14 'BAT-o-Meter "SPECIAL"
AddLamp 36, bulb1 'Left Ramp Add Letter (Left)
AddLamp 37, bulb2 'Left Ramp Million (Right)
AddLamp 46, bulb3 'Right Ramp Add Letter (Left)
AddLamp 47, bulb4 'Right Ramp Million (Right)
AddLamp 67, bulb10 '"TO CRYPT"
'Flashers
AddLamp 152, domeYB 'Yellow Dome Bottom
AddLamp 152, F22
AddLamp 152, F22r1
AddLamp 152, F22r2
AddLamp 152, domeW 'White Dome
AddLamp 152, F22a
AddLamp 152, F22r3
AddLamp 152, F22r4
AddLamp 153, domeYT 'Yellow Dome Top
AddLamp 153, F22x
AddLamp 153, F22r1x
AddLamp 153, F22r2x
AddLamp 153, domeR 'Red Dome
AddLamp 153, F23
AddLamp 153, F23r
AddLamp 154, F24 'Under The Ramp
AddLamp 154, domeB 'Blue Dome
AddLamp 154, F24a
AddLamp 154, F24r1
AddLamp 154, F24r2
AddLamp 155, F25 'Flasher:Heart #1
SwapTex 155, heart, "hearttext", "hearttext" 'Flasher:Heart #2
If LampState(152)=1 AND LampState(153)=1 Then HideLamp True
If LampState(152)=0 OR LampState(153)=0 Then HideLamp False
End Sub
Sub SetLamp(nr, enabled)
If enabled Then
LampState(nr) = 1
Else
LampState(nr) = 0
End If
End Sub
Sub HideLamp (enabled)
F22x.visible=NOT enabled
F22r1x.visible=NOT enabled
F22r2x.visible=NOT enabled
End Sub
Sub AddLamp(nr, object)
Select Case LampState(nr)
Case 0 'off
FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
If FlashLevel(nr) < 0 Then FlashLevel(nr) = 0
If TypeName(object) = "Light" Then
Object.State = 0
End If
If TypeName(object) = "Flasher" Then
Object.IntensityScale = FlashLevel(nr)
End If
If TypeName(object) = "Primitive" Then
Object.DisableLighting = 0
End If
Case 1 ' on
FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
If FlashLevel(nr) > 1 Then FlashLevel(nr) = 1
If TypeName(object) = "Light" Then
Object.State = 1
End If
If TypeName(object) = "Flasher" Then
Object.IntensityScale = FlashLevel(nr)
End If
If TypeName(object) = "Primitive" Then
Object.DisableLighting = 1
End If
End Select
End Sub
Sub SwapTex (nr,object, texoff, texon)
Select Case LampState(nr)
Case 0 'off
Object.DisableLighting = 0
Object.image = texoff
Case 1 ' on
Object.DisableLighting = 1
Object.image = texon
End Select
End Sub
' *********************************************************************
' Supporting Ball & Sound Functions
' *********************************************************************
Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
Vol = Csng(BallVel(ball) ^2 / 2000)
End Function
Function AudioPan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
Dim tmp
tmp = ball.x * 2 / table1.width-1
If tmp > 0 Then
AudioPan = Csng(tmp ^10)
Else
AudioPan = Csng(-((- tmp) ^10) )
End If
End Function
Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
Pitch = BallVel(ball) * 20
End Function
Function BallVel(ball) 'Calculates the ball speed
BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
End Function
Function AudioFade(ball)
Dim tmp
tmp = ball.y * 2 / Table1.height-1
If tmp > 0 Then
AudioFade = Csng(tmp ^10)
Else
AudioFade = Csng(-((- tmp) ^10) )
End If
End Function
'*********************************************************************
' Positional Sound Playback Routines
'*********************************************************************
Sub PlaySoundXY(soundname, loopcount, volume, useexisting, tableobj)
If Table1.VersionMinor > 3 OR Table1.VersionMajor > 10 Then
PlaySound soundname, loopcount, volume, AudioPan(tableobj), 0, Pitch(tableobj), useexisting, 0, AudioFade(tableobj)
Else
PlaySound soundname, loopcount, volume, AudioPan(tableobj), 0, Pitch(tableobj), useexisting, 0
End If
End Sub
Sub PlaySoundAt(soundname, tableobj)
If Table1.VersionMinor > 3 OR Table1.VersionMajor > 10 Then
PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
Else
PlaySound soundname, 1, 1, AudioPan(tableobj)
End If
End Sub
Sub PlaySoundAtBall(soundname)
If Table1.VersionMinor > 3 OR Table1.VersionMajor > 10 Then
PlaySound soundname, 0, 10*Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
Else
PlaySound soundname, 0, 10*Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
End If
End Sub
' *********************************************************************
' Maths
' *********************************************************************
Const Pi = 3.1415927
Function dSin(degrees)
dsin = sin(degrees * Pi/180)
End Function
Function dCos(degrees)
dcos = cos(degrees * Pi/180)
End Function
Function RndNum(min, max)
RndNum = Int(Rnd() * (max-min + 1) ) + min ' Sets a random number between min and max
End Function
' *********************************************************************
' Other Sound FX
' *********************************************************************
'Ball Collision
Sub OnBallBallCollision(ball1, ball2, velocity)
PlaySoundXY "fx_collide", 0, Csng(velocity) ^2 / 500, 0, ball1
End Sub
'Gates Collision
Sub LGate_hit():PlaysoundAt "fx_gate4", ActiveBall:End Sub
Sub RGate_hit():PlaysoundAt "fx_gate4", ActiveBall:End Sub
'Flippers Collision
Sub LeftFlipper_Collide(parm):RandomSoundFlipper:End Sub
Sub Rightflipper_Collide(parm):RandomSoundFlipper:End Sub
'Rubber Posts Collision
Sub RubberPosts_Hit()
dim finalspeed
finalspeed=SQR((activeball.velx ^2) + (activeball.vely ^2))
If finalspeed > 20 then
PlaySoundAtBall "fx_rubber"
End if
If finalspeed >= 6 AND finalspeed <= 20 then
RandomSoundRubber()
End If
End Sub
'Rubber Collision
Sub Rubbers_Hit(idx)
dim finalspeed
finalspeed=SQR((activeball.velx ^2) + (activeball.vely ^2))
If finalspeed > 20 then
PlaySoundAtBall "fx_rubber"
End if
If finalspeed >= 6 AND finalspeed <= 20 then
RandomSoundRubber()
End If
End Sub
Sub RandomSoundRubber()
Select Case RndNum(1,3)
Case 1 : PlaySoundAtBall "fx_rubber_hit_1"
Case 2 : PlaySoundAtBall "fx_rubber_hit_2"
Case 3 : PlaySoundAtBall "fx_rubber_hit_3"
End Select
End Sub
Sub RandomSoundFlipper()
Select Case RndNum(1,3)
Case 1 : PlaySoundAtBall "fx_flip_hit_1"
Case 2 : PlaySoundAtBall "fx_flip_hit_2"
Case 3 : PlaySoundAtBall "fx_flip_hit_3"
End Select
End Sub
' *********************************************************************
' Ball Drop & Ramp Sounds
' *********************************************************************
'left ramp
Sub LREnter_Hit():If ActiveBall.VelY < 0 Then PlaySoundAt "fx_rrenter", ActiveBall:End If:End Sub 'ball is going up
Sub LREnter_UnHit():If ActiveBall.VelY > 0 Then StopSound "fx_rrenter":End If:End Sub 'ball is going down
Sub LRHelp1_hit():PlaySoundAt "fx_rturn", ActiveBall:End Sub
Sub LRail_hit():StopSound "fx_plasticrolling":PlaySoundAt "fx_wireramp", ActiveBall:End Sub
Sub LRExit_Hit:StopSound "fx_wireramp":PlaysoundAt "fx_wireramp_exit", ActiveBall:Me.TimerInterval=200:Me.TimerEnabled=1:End Sub
Sub LRExit_timer:Me.TimerEnabled=0:PlaysoundAt "fx_balldrop", LRExit:End Sub
'right ramp
Sub RREnter_Hit():If ActiveBall.VelY < 0 Then PlaySoundAt "fx_rrenter", ActiveBall:End If:End Sub 'ball is going up
Sub RREnter_UnHit():If ActiveBall.VelY > 0 Then StopSound "fx_rrenter":End If:End Sub 'ball is going down
Sub RRHelp1_hit():PlaySoundAt "fx_rturn", ActiveBall:End Sub
Sub RRHelp2_hit():PlaySoundAt "fx_rh1", ActiveBall:End Sub
Sub RRHelp3_Hit:If ActiveBall.Z>80 Then PlaySoundAt "fx_rh2", ActiveBall:Me.TimerInterval=200:Me.TimerEnabled=1:End If:End Sub
Sub RRHelp3_timer:Me.TimerEnabled=0:PlaysoundAt "fx_balldrop", RRHelp2:End Sub
Sub RRail_Hit:StopSound "fx_plasticrolling":PlaySoundAt "fx_wireramp", ActiveBall:End Sub
Sub RRExit_Hit:StopSound "fx_wireramp":PlaysoundAt "fx_wireramp_exit", ActiveBall:Me.TimerInterval=200:Me.TimerEnabled=1:End Sub
Sub RRExit_timer:Me.TimerEnabled=0:PlaysoundAt "fx_balldrop", RRExit:End Sub
'******************************************************
' RealTime Updates
'******************************************************
Set MotorCallback = GetRef("RealTimeUpdates")
Sub RealTimeUpdates()
RollingSoundUpdate
BallShadowUpdate
Prim_LeftFlipper.RotY=LeftFlipper.currentangle-90
Prim_RightFlipper.RotY=RightFlipper.currentangle-90
FlipperLSh.RotZ = LeftFlipper.currentangle
FlipperRSh.RotZ = RightFlipper.currentangle
LeftGate.RotX = - LGate.currentangle
RightGate.RotX = - RGate.currentangle
sw15s.RotX = - sw15.currentangle
End Sub
'*********** ROLLING SOUND *********************************
Const tnob = 2 ' total number of balls : 2 (trough)
ReDim rolling(tnob)
Sub InitRolling:Dim i:For i=0 to (tnob-1):rolling(i) = False:Next:End Sub
Sub RollingSoundUpdate()
Dim BOT,b
BOT = GetBalls
' play the rolling sound for each ball
For b = 0 to Ubound(BOT)
If BallVel(BOT(b)) > 1 AND BOT(b).z < 30 Then
rolling(b) = True
PlaySoundXY "fx_ballrolling" & (b+1), -1, Vol(BOT(b)), 1, BOT(b)
Else
If rolling(b) = True Then
StopSound("fx_ballrolling" & (b+1))
rolling(b) = False
End If
End If
Next
End Sub
'*********** BALL SHADOW *********************************
Dim BallShadow
BallShadow = Array (BallShadow1, BallShadow2)
Sub BallShadowUpdate()
Dim BOT, b
BOT = GetBalls
' render the shadow for each ball
For b = 0 to Ubound(BOT)
If BOT(b).X < Table1.Width/2 Then
BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/10)) + 10
Else
BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/10)) - 10
End If
ballShadow(b).Y = BOT(b).Y + 15
If BOT(b).Z > 20 Then
BallShadow(b).visible = 1
Else
BallShadow(b).visible = 0
End If
Next
End Sub
'**********************************************************************************************************
'Digital Display
'**********************************************************************************************************
Dim Digits(40)
Digits(0) = Array(a00, a05, a0c, a0d, a08, a01, a06, a0f, a02, a03, a04, a07, a0b, a0a, a09, a0e)
Digits(1) = Array(a10, a15, a1c, a1d, a18, a11, a16, a1f, a12, a13, a14, a17, a1b, a1a, a19, a1e)
Digits(2) = Array(a20, a25, a2c, a2d, a28, a21, a26, a2f, a22, a23, a24, a27, a2b, a2a, a29, a2e)
Digits(3) = Array(a30, a35, a3c, a3d, a38, a31, a36, a3f, a32, a33, a34, a37, a3b, a3a, a39, a3e)
Digits(4) = Array(a40, a45, a4c, a4d, a48, a41, a46, a4f, a42, a43, a44, a47, a4b, a4a, a49, a4e)
Digits(5) = Array(a50, a55, a5c, a5d, a58, a51, a56, a5f, a52, a53, a54, a57, a5b, a5a, a59, a5e)
Digits(6) = Array(a60, a65, a6c, a6d, a68, a61, a66, a6f, a62, a63, a64, a67, a6b, a6a, a69, a6e)
Digits(7) = Array(a70, a75, a7c, a7d, a78, a71, a76, a7f, a72, a73, a74, a77, a7b, a7a, a79, a7e)
Digits(8) = Array(a80, a85, a8c, a8d, a88, a81, a86, a8f, a82, a83, a84, a87, a8b, a8a, a89, a8e)
Digits(9) = Array(a90, a95, a9c, a9d, a98, a91, a96, a9f, a92, a93, a94, a97, a9b, a9a, a99, a9e)
Digits(10) = Array(aa0, aa5, aac, aad, aa8, aa1, aa6, aaf, aa2, aa3, aa4, aa7, aab, aaa, aa9, aae)
Digits(11) = Array(ab0, ab5, abc, abd, ab8, ab1, ab6, abf, ab2, ab3, ab4, ab7, abb, aba, ab9, abe)
Digits(12) = Array(ac0, ac5, acc, acd, ac8, ac1, ac6, acf, ac2, ac3, ac4, ac7, acb, aca, ac9, ace)
Digits(13) = Array(ad0, ad5, adc, add, ad8, ad1, ad6, adf, ad2, ad3, ad4, ad7, adb, ada, ad9, ade)
Digits(14) = Array(ae0, ae5, aec, aed, ae8, ae1, ae6, aef, ae2, ae3, ae4, ae7, aeb, aea, ae9, aee)
Digits(15) = Array(af0, af5, afc, afd, af8, af1, af6, aff, af2, af3, af4, af7, afb, afa, af9, afe)
Digits(16) = Array(b00, b05, b0c, b0d, b08, b01, b06, b0f, b02, b03, b04, b07, b0b, b0a, b09, b0e)
Digits(17) = Array(b10, b15, b1c, b1d, b18, b11, b16, b1f, b12, b13, b14, b17, b1b, b1a, b19, b1e)
Digits(18) = Array(b20, b25, b2c, b2d, b28, b21, b26, b2f, b22, b23, b24, b27, b2b, b2a, b29, b2e)
Digits(19) = Array(b30, b35, b3c, b3d, b38, b31, b36, b3f, b32, b33, b34, b37, b3b, b3a, b39, b3e)
Digits(20) = Array(b40, b45, b4c, b4d, b48, b41, b46, b4f, b42, b43, b44, b47, b4b, b4a, b49, b4e)
Digits(21) = Array(b50, b55, b5c, b5d, b58, b51, b56, b5f, b52, b53, b54, b57, b5b, b5a, b59, b5e)
Digits(22) = Array(b60, b65, b6c, b6d, b68, b61, b66, b6f, b62, b63, b64, b67, b6b, b6a, b69, b6e)
Digits(23) = Array(b70, b75, b7c, b7d, b78, b71, b76, b7f, b72, b73, b74, b77, b7b, b7a, b79, b7e)
Digits(24) = Array(b80, b85, b8c, b8d, b88, b81, b86, b8f, b82, b83, b84, b87, b8b, b8a, b89, b8e)
Digits(25) = Array(b90, b95, b9c, b9d, b98, b91, b96, b9f, b92, b93, b94, b97, b9b, b9a, b99, b9e)
Digits(26) = Array(ba0, ba5, bac, bad, ba8, ba1, ba6, baf, ba2, ba3, ba4, ba7, bab, baa, ba9, bae)
Digits(27) = Array(bb0, bb5, bbc, bbd, bb8, bb1, bb6, bbf, bb2, bb3, bb4, bb7, bbb, bba, bb9, bbe)
Digits(28) = Array(bc0, bc5, bcc, bcd, bc8, bc1, bc6, bcf, bc2, bc3, bc4, bc7, bcb, bca, bc9, bce)
Digits(29) = Array(bd0, bd5, bdc, bdd, bd8, bd1, bd6, bdf, bd2, bd3, bd4, bd7, bdb, bda, bd9, bde)
Digits(30) = Array(be0, be5, bec, bed, be8, be1, be6, bef, be2, be3, be4, be7, beb, bea, be9, bee)
Digits(31) = Array(bf0, bf5, bfc, bfd, bf8, bf1, bf6, bff, bf2, bf3, bf4, bf7, bfb, bfa, bf9, bfe)
Digits(32) = Array(c00, c05, c0c, c0d, c08, c01, c06, c0f, c02, c03, c04, c07, c0b, c0a, c09, c0e)
Digits(33) = Array(c10, c15, c1c, c1d, c18, c11, c16, c1f, c12, c13, c14, c17, c1b, c1a, c19, c1e)
Digits(34) = Array(c20, c25, c2c, c2d, c28, c21, c26, c2f, c22, c23, c24, c27, c2b, c2a, c29, c2e)
Digits(35) = Array(c30, c35, c3c, c3d, c38, c31, c36, c3f, c32, c33, c34, c37, c3b, c3a, c39, c3e)
Digits(36) = Array(c40, c45, c4c, c4d, c48, c41, c46, c4f, c42, c43, c44, c47, c4b, c4a, c49, c4e)
Digits(37) = Array(c50, c55, c5c, c5d, c58, c51, c56, c5f, c52, c53, c54, c57, c5b, c5a, c59, c5e)
Digits(38) = Array(c60, c65, c6c, c6d, c68, c61, c66, c6f, c62, c63, c64, c67, c6b, c6a, c69, c6e)
Digits(39) = Array(c70, c75, c7c, c7d, c78, c71, c76, c7f, c72, c73, c74, c77, c7b, c7a, c79, c7e)
Sub DisplayTimer_Timer
Dim ChgLED, ii, num, chg, stat, obj
ChgLED=Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
If DesktopMode Then
If Not IsEmpty(ChgLED)Then
For ii=0 To UBound(chgLED)
num=chgLED(ii, 0) : chg=chgLED(ii, 1) : stat=chgLED(ii, 2)
For Each obj In Digits(num)
If chg And 1 Then obj.State=stat And 1
chg=chg\2 : stat=stat\2
Next
Next
End If
End If
End Sub