Skip to content

Commit 7ae2a39

Browse files
committed
api: Update to new coil and switch definitions.
1 parent fd833d6 commit 7ae2a39

File tree

6 files changed

+50
-50
lines changed

6 files changed

+50
-50
lines changed

VisualPinball.Engine.PinMAME.Unity/Editor/PinMameGamelogicEngineInspector.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
using PinMame;
2323
using UnityEditor;
2424
using UnityEngine;
25+
using VisualPinball.Engine.Common;
26+
using VisualPinball.Engine.Game.Engines;
2527
using VisualPinball.Engine.PinMAME.Games;
2628
using VisualPinball.Unity;
2729
using VisualPinball.Unity.Editor;
@@ -36,7 +38,7 @@ public class PinMameGamelogicEngineInspector : UnityEditor.Editor
3638
private PinMameGamelogicEngine _gle;
3739
private PinMameGame[] _games;
3840
private string[] _gameNames;
39-
private string[] _romNames = new string[0];
41+
private string[] _romNames = Array.Empty<string>();
4042

4143
private int _selectedGameIndex;
4244
private int _selectedRomIndex;
@@ -99,7 +101,7 @@ public override void OnInspectorGUI()
99101
} else {
100102
_gle.Game = null;
101103
_gle.romId = string.Empty;
102-
_romNames = new string[0];
104+
_romNames = Array.Empty<string>();
103105
}
104106
}
105107

VisualPinball.Engine.PinMAME/Games/AttackFromMars.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class AttackFromMars : Wpc
4545

4646
protected override GamelogicEngineSwitch[] Switches { get; } = {
4747
new GamelogicEngineSwitch("11") { Description = "Launch Ball", InputActionHint = InputConstants.ActionPlunger },
48-
48+
4949
new GamelogicEngineSwitch("13") { Description = "Start Button", InputActionHint = InputConstants.ActionStartGame },
5050
new GamelogicEngineSwitch("14") { Description = "Plumb Bolt Tilt" },
5151

@@ -78,7 +78,7 @@ public class AttackFromMars : Wpc
7878
new GamelogicEngineSwitch("46") { Description = "Center Motor Bank" },
7979
new GamelogicEngineSwitch("47") { Description = "Right Motor Bank" },
8080
new GamelogicEngineSwitch("48") { Description = "Right Top Lane" },
81-
81+
8282
new GamelogicEngineSwitch("51") { Description = "Left Slingshot (Kicker)" },
8383
new GamelogicEngineSwitch("52") { Description = "Right Slingshot (Kicker)" },
8484
new GamelogicEngineSwitch("53") { Description = "Left Jet Bumper" },
@@ -182,7 +182,7 @@ public class AttackFromMars : Wpc
182182

183183
protected override GamelogicEngineCoil[] GameCoils { get; } = {
184184
new GamelogicEngineCoil("01", 1) { Description = "Auto Plunger", DeviceHint = "Plunger", DeviceItemHint = Plunger.FireCoilId },
185-
new GamelogicEngineCoil("02", 2) { Description = "Trough Eject", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = Trough.EjectCoilId },
185+
new GamelogicEngineCoil("02", 2) { Description = "Trough Eject", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = "eject_coil" },
186186
new GamelogicEngineCoil("03", 3) { Description = "Left Popper" },
187187
new GamelogicEngineCoil("04", 4) { Description = "Right Popper" },
188188
new GamelogicEngineCoil("05", 5) { Description = "Left Alien Low" },
@@ -211,8 +211,8 @@ public class AttackFromMars : Wpc
211211
new GamelogicEngineCoil("28") { Description = "Left Side Low" },
212212
new GamelogicEngineCoil("33") { Description = "Right Gate" },
213213
new GamelogicEngineCoil("34") { Description = "Left Gate" },
214-
new GamelogicEngineCoil("35") { Description = "Diverter Power" },
215-
new GamelogicEngineCoil("36") { Description = "Diverter Hold", MainCoilIdOfHoldCoil = "35" },
214+
new GamelogicEngineCoil("35") { Description = "Diverter Power" },
215+
new GamelogicEngineCoil("36") { Description = "Diverter Hold" },
216216
new GamelogicEngineCoil("37") { Description = "L.E.D. Clock", IsLamp = true },
217217
new GamelogicEngineCoil("38") { Description = "L.E.D. Data", IsLamp = true },
218218
new GamelogicEngineCoil("39") { Description = "Strobe Light", IsLamp = true },

VisualPinball.Engine.PinMAME/Games/CreatureFromTheBlackLagoon.cs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class CreatureFromTheBlackLagoon : Wpc
4444
protected override GamelogicEngineSwitch[] Switches { get; } = {
4545
new GamelogicEngineSwitch("13") { Description = "Start Button", InputActionHint = InputConstants.ActionStartGame },
4646
new GamelogicEngineSwitch("14") { Description = "Plumb Bolt Tilt" },
47-
new GamelogicEngineSwitch("15") { Description = "Top Left Rollover" },
47+
new GamelogicEngineSwitch("15") { Description = "Top Left Rollover" },
4848
new GamelogicEngineSwitch("16") { Description = "Left Subway" },
4949
new GamelogicEngineSwitch("17") { Description = "Center Subway" },
5050
new GamelogicEngineSwitch("18") { Description = "Center Shot" },
@@ -58,35 +58,35 @@ public class CreatureFromTheBlackLagoon : Wpc
5858
new GamelogicEngineSwitch("28") { Description = "P-A-I-(D)" },
5959

6060
new GamelogicEngineSwitch("33") { Description = "Bottom Jet" },
61-
new GamelogicEngineSwitch("34") { Description = "Right Popper" },
62-
new GamelogicEngineSwitch("35") { Description = "Right Ramp Enter" },
63-
new GamelogicEngineSwitch("36") { Description = "Left Ramp Enter" },
64-
new GamelogicEngineSwitch("37") { Description = "Lower Right Popper" },
65-
new GamelogicEngineSwitch("38") { Description = "Ramp Up/Down" },
66-
61+
new GamelogicEngineSwitch("34") { Description = "Right Popper" },
62+
new GamelogicEngineSwitch("35") { Description = "Right Ramp Enter" },
63+
new GamelogicEngineSwitch("36") { Description = "Left Ramp Enter" },
64+
new GamelogicEngineSwitch("37") { Description = "Lower Right Popper" },
65+
new GamelogicEngineSwitch("38") { Description = "Ramp Up/Down" },
66+
6767
new GamelogicEngineSwitch("41") { Description = "Cola" },
6868
new GamelogicEngineSwitch("42") { Description = "Hot Dog" },
69-
new GamelogicEngineSwitch("43") { Description = "Popcorn" },
70-
new GamelogicEngineSwitch("44") { Description = "Ice Cream" },
71-
new GamelogicEngineSwitch("45") { Description = "Left Jet" },
72-
new GamelogicEngineSwitch("46") { Description = "Right Jet" },
73-
new GamelogicEngineSwitch("47") { Description = "Left Slingshot" },
74-
new GamelogicEngineSwitch("48") { Description = "Right Slingshot" },
75-
69+
new GamelogicEngineSwitch("43") { Description = "Popcorn" },
70+
new GamelogicEngineSwitch("44") { Description = "Ice Cream" },
71+
new GamelogicEngineSwitch("45") { Description = "Left Jet" },
72+
new GamelogicEngineSwitch("46") { Description = "Right Jet" },
73+
new GamelogicEngineSwitch("47") { Description = "Left Slingshot" },
74+
new GamelogicEngineSwitch("48") { Description = "Right Slingshot" },
75+
7676
new GamelogicEngineSwitch("51") { Description = "Left Out Lane" },
7777
new GamelogicEngineSwitch("52") { Description = "Left Return Lane" },
78-
new GamelogicEngineSwitch("53") { Description = "Start Combo" },
79-
new GamelogicEngineSwitch("54") { Description = "Right Out Lane" },
80-
new GamelogicEngineSwitch("55") { Description = "Outhole", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = Trough.EntrySwitchId },
81-
new GamelogicEngineSwitch("56") { Description = "Right Trough", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = "1" },
82-
new GamelogicEngineSwitch("57") { Description = "Center Trough", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = "2" },
83-
new GamelogicEngineSwitch("58") { Description = "Left Trough", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = "3" },
78+
new GamelogicEngineSwitch("53") { Description = "Start Combo" },
79+
new GamelogicEngineSwitch("54") { Description = "Right Out Lane" },
80+
new GamelogicEngineSwitch("55") { Description = "Outhole", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = "drain_switch" },
81+
new GamelogicEngineSwitch("56") { Description = "Right Trough", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = "1" },
82+
new GamelogicEngineSwitch("57") { Description = "Center Trough", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = "2" },
83+
new GamelogicEngineSwitch("58") { Description = "Left Trough", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = "3" },
8484

8585
new GamelogicEngineSwitch("61") { Description = "Right Ramp Exit" },
8686
new GamelogicEngineSwitch("62") { Description = "Left Ramp Exit" },
87-
new GamelogicEngineSwitch("63") { Description = "Center Lane Exit" },
88-
new GamelogicEngineSwitch("64") { Description = "Upper Ramp" },
89-
new GamelogicEngineSwitch("65") { Description = "Bowl" },
87+
new GamelogicEngineSwitch("63") { Description = "Center Lane Exit" },
88+
new GamelogicEngineSwitch("64") { Description = "Upper Ramp" },
89+
new GamelogicEngineSwitch("65") { Description = "Bowl" },
9090
new GamelogicEngineSwitch("66") { Description = "Shooter" },
9191
};
9292

@@ -168,16 +168,16 @@ public class CreatureFromTheBlackLagoon : Wpc
168168
new GamelogicEngineCoil("01", 1) { Description = "Top Right Popper" },
169169
new GamelogicEngineCoil("02", 2) { Description = "Left Subway Enter Flasher", IsLamp = true },
170170
new GamelogicEngineCoil("03", 3) { Description = "Lower Right Popper" },
171-
new GamelogicEngineCoil("04", 4) { Description = "Trough Eject", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = Trough.EjectCoilId },
171+
new GamelogicEngineCoil("04", 4) { Description = "Trough Eject", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = "eject_coil" },
172172
new GamelogicEngineCoil("05", 5) { Description = "Right Slingshot" },
173173
new GamelogicEngineCoil("06", 6) { Description = "Left Slingshot" },
174174
new GamelogicEngineCoil("07", 7) { Description = "Knocker" },
175175
new GamelogicEngineCoil("08", 8) { Description = "Bottom Right Flasher", IsLamp = true },
176176
new GamelogicEngineCoil("09", 9) { Description = "Back Flashers", IsLamp = true },
177177
new GamelogicEngineCoil("10") { Description = "Bowl Flasher", IsLamp = true },
178178
new GamelogicEngineCoil("11") { Description = "Creature Flasher", IsLamp = true },
179-
new GamelogicEngineCoil("12") { Description = "Outhole", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = Trough.EntryCoilId },
180-
new GamelogicEngineCoil("13") { Description = "Left Jet" },
179+
new GamelogicEngineCoil("12") { Description = "Outhole", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = "entry_coil" },
180+
new GamelogicEngineCoil("13") { Description = "Left Jet" },
181181
new GamelogicEngineCoil("14") { Description = "Right Jet" },
182182
new GamelogicEngineCoil("15") { Description = "Bottom Jet" },
183183
new GamelogicEngineCoil("16") { Description = "Right Popper Flasher", IsLamp = true },

VisualPinball.Engine.PinMAME/Games/MedievalMadness.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
using VisualPinball.Engine.Game.Engines;
2020
using VisualPinball.Engine.PinMAME.MPUs;
2121
using VisualPinball.Engine.VPT.Plunger;
22-
using VisualPinball.Engine.VPT.Trough;
2322

2423
namespace VisualPinball.Engine.PinMAME.Games
2524
{
@@ -178,11 +177,11 @@ public class MedievalMadness : Wpc
178177

179178
protected override GamelogicEngineCoil[] GameCoils { get; } = {
180179
new GamelogicEngineCoil("01", 1) { Description = "Auto Plunger", DeviceHint = "Plunger", DeviceItemHint = Plunger.FireCoilId },
181-
new GamelogicEngineCoil("02", 2) { Description = "Trough Eject", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = Trough.EjectCoilId },
180+
new GamelogicEngineCoil("02", 2) { Description = "Trough Eject", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = "eject_coil" },
182181
new GamelogicEngineCoil("03", 3) { Description = "Left Popper" },
183182
new GamelogicEngineCoil("04", 4) { Description = "Castle" },
184-
new GamelogicEngineCoil("05", 5) { Description = "Castle Gate" },
185-
new GamelogicEngineCoil("06", 6) { Description = "Castle Gate (hold)", MainCoilIdOfHoldCoil = "05" },
183+
new GamelogicEngineCoil("05", 5) { Description = "Castle Gate (Power)" },
184+
new GamelogicEngineCoil("06", 6) { Description = "Castle Gate (Hold)" },
186185
new GamelogicEngineCoil("07", 7) { Description = "Knocker" },
187186
new GamelogicEngineCoil("08", 8) { Description = "Catapult" },
188187
new GamelogicEngineCoil("09", 9) { Description = "Right Eject" },
@@ -191,8 +190,8 @@ public class MedievalMadness : Wpc
191190
new GamelogicEngineCoil("12") { Description = "Left Jet Bumper" },
192191
new GamelogicEngineCoil("13") { Description = "Bottom Jet Bumper" },
193192
new GamelogicEngineCoil("14") { Description = "Right Jet Bumper" },
194-
new GamelogicEngineCoil("15") { Description = "Tower Diverter" },
195-
new GamelogicEngineCoil("16") { Description = "Tower Diverter (hold)", MainCoilIdOfHoldCoil = "15" },
193+
new GamelogicEngineCoil("15") { Description = "Tower Diverter (Power)" },
194+
new GamelogicEngineCoil("16") { Description = "Tower Diverter (Hold)" },
196195
new GamelogicEngineCoil("17") { Description = "Left Side Low Flashers", IsLamp = true },
197196
new GamelogicEngineCoil("18") { Description = "Left Ramp Flashers", IsLamp = true },
198197
new GamelogicEngineCoil("19") { Description = "Left Side High Flashers", IsLamp = true },
@@ -209,10 +208,10 @@ public class MedievalMadness : Wpc
209208
// new GamelogicEngineCoil("30") { Description = "Lower Right Flipper (hold)", MainCoilIdOfHoldCoil = "29" },
210209
// new GamelogicEngineCoil("31", 48) { Description = "Lower Left Flipper (power)", PlayfieldItemHint = "^(LeftFlipper|LFlipper|FlipperLeft|FlipperL)$" },
211210
// new GamelogicEngineCoil("32") { Description = "Lower Left Flipper (hold)", MainCoilIdOfHoldCoil = "31" },
212-
new GamelogicEngineCoil("33") { Description = "Left Troll" },
213-
new GamelogicEngineCoil("34") { Description = "Left Troll (hold)", MainCoilIdOfHoldCoil = "33" },
214-
new GamelogicEngineCoil("35") { Description = "Right Troll" },
215-
new GamelogicEngineCoil("36") { Description = "Right Troll (hold)", MainCoilIdOfHoldCoil = "35" },
211+
new GamelogicEngineCoil("33") { Description = "Left Troll (Power)" },
212+
new GamelogicEngineCoil("34") { Description = "Left Troll (Hold)" },
213+
new GamelogicEngineCoil("35") { Description = "Right Troll (Power)" },
214+
new GamelogicEngineCoil("36") { Description = "Right Troll (Hold)" },
216215
new GamelogicEngineCoil("37") { Description = "Drawbridge Motor" },
217216
};
218217
}

VisualPinball.Engine.PinMAME/Games/Terminator2.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
using VisualPinball.Engine.Common;
1919
using VisualPinball.Engine.Game.Engines;
2020
using VisualPinball.Engine.PinMAME.MPUs;
21-
using VisualPinball.Engine.VPT.Trough;
2221

2322
namespace VisualPinball.Engine.PinMAME.Games
2423
{
@@ -180,12 +179,12 @@ public class Terminator2 : Wpc
180179
new GamelogicEngineCoil("01") { Description = "Ball Popper" },
181180
new GamelogicEngineCoil("02") { Description = "Gun Kicker" },
182181
new GamelogicEngineCoil("03") { Description = "Outhole" },
183-
new GamelogicEngineCoil("04") { Description = "Trough", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = Trough.EjectCoilId },
182+
new GamelogicEngineCoil("04") { Description = "Trough", DeviceHint = "^Trough\\s*\\d?", DeviceItemHint = "eject_coil" },
184183
new GamelogicEngineCoil("05") { Description = "Right Sling" },
185184
new GamelogicEngineCoil("06") { Description = "Left Sling" },
186185
new GamelogicEngineCoil("07") { Description = "Knocker" },
187186
new GamelogicEngineCoil("08") { Description = "Kickback" },
188-
new GamelogicEngineCoil("09") { Description = "Plunger", PlayfieldItemHint = "Plunger" },
187+
new GamelogicEngineCoil("09") { Description = "Plunger", DeviceHint = "Plunger" },
189188
new GamelogicEngineCoil("10") { Description = "Top Lock" },
190189
new GamelogicEngineCoil("11") { Description = "Gun Motor" },
191190
new GamelogicEngineCoil("12") { Description = "Knock Down" },
@@ -206,8 +205,8 @@ public class Terminator2 : Wpc
206205
new GamelogicEngineCoil("27") { Description = "Right Popper" },
207206
new GamelogicEngineCoil("28") { Description = "Flashlamps Drop Target" },
208207

209-
new GamelogicEngineCoil(CoilFlipperLowerRight, 46) { Description = "Lower Right Flipper", PlayfieldItemHint = "^RightFlipper$"},
210-
new GamelogicEngineCoil(CoilFlipperLowerLeft, 48) { Description = "Lower Left Flipper", PlayfieldItemHint = "^LeftFlipper$"},
208+
new GamelogicEngineCoil(CoilFlipperLowerRight, 46) { Description = "Lower Right Flipper", DeviceHint = "^RightFlipper$"},
209+
new GamelogicEngineCoil(CoilFlipperLowerLeft, 48) { Description = "Lower Left Flipper", DeviceHint = "^LeftFlipper$"},
211210

212211
new GamelogicEngineCoil(CoilFlipperUpperRight, 34) { IsUnused = true },
213212
new GamelogicEngineCoil(CoilFlipperUpperLeft, 36) { IsUnused = true },

VisualPinball.Engine.PinMAME/PinMameGame.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public abstract class PinMameGame
7979
/// These coils are common to all games.
8080
/// </summary>
8181
private readonly GamelogicEngineCoil[] _coils = {
82-
new GamelogicEngineCoil(CoilFlipperLowerRight, 46) { Description = "Lower Right Flipper", PlayfieldItemHint = "^(RightFlipper|RFlipper|FlipperRight|FlipperR)$"},
83-
new GamelogicEngineCoil(CoilFlipperLowerLeft, 48) { Description = "Lower Left Flipper", PlayfieldItemHint = "^(LeftFlipper|LFlipper|FlipperLeft|FlipperL)$"},
82+
new GamelogicEngineCoil(CoilFlipperLowerRight, 46) { Description = "Lower Right Flipper", DeviceHint = "^(RightFlipper|RFlipper|FlipperRight|FlipperR)$"},
83+
new GamelogicEngineCoil(CoilFlipperLowerLeft, 48) { Description = "Lower Left Flipper", DeviceHint = "^(LeftFlipper|LFlipper|FlipperLeft|FlipperL)$"},
8484
new GamelogicEngineCoil(CoilFlipperUpperRight, 34) { Description = "Upper Right Flipper"},
8585
new GamelogicEngineCoil(CoilFlipperUpperLeft, 36) { Description = "Upper Left Flipper"},
8686
};

0 commit comments

Comments
 (0)