|
18 | 18 | using System.Collections.Generic; |
19 | 19 | using System.Linq; |
20 | 20 | using System.Runtime.InteropServices; |
21 | | -using System.Text; |
22 | 21 | using NLog; |
23 | 22 | using PinMame; |
24 | 23 | using UnityEngine; |
@@ -105,13 +104,13 @@ public void OnInit(Player player, TableApi tableApi, BallManager ballManager) |
105 | 104 | _pinMame = PinMame.PinMame.Instance(48000, @"D:\Pinball\Visual Pinball\VPinMAME"); |
106 | 105 | _pinMame.OnGameStarted += GameStarted; |
107 | 106 | _pinMame.OnGameEnded += GameEnded; |
108 | | - _pinMame.OnDisplayUpdate += DisplayUpdated; |
109 | | - _pinMame.OnSolenoid += SolenoidChanged; |
| 107 | + _pinMame.OnDisplayUpdated += DisplayUpdated; |
| 108 | + _pinMame.OnSolenoidUpdated += SolenoidUpdated; |
110 | 109 | _player = player; |
111 | 110 |
|
112 | 111 | try { |
113 | | - //_pinMame.StartGame("fh_906h"); |
114 | | - _pinMame.StartGame(romId); |
| 112 | + _pinMame.StartGame("fh_906h"); |
| 113 | + //_pinMame.StartGame(romId); |
115 | 114 |
|
116 | 115 | } catch (Exception e) { |
117 | 116 | Logger.Error(e); |
@@ -204,14 +203,14 @@ private void UpdateSegDisp(int index, PinMameDisplayLayout displayLayout, IntPtr |
204 | 203 | Marshal.Copy(framePtr, _frameBuffer[index], 0, displayLayout.length * 2); |
205 | 204 |
|
206 | 205 | lock (_dispatchQueue) { |
207 | | - Logger.Info($"[PinMAME] Seg data ({index}): {BitConverter.ToString(_frameBuffer[index])}" ); |
| 206 | + //Logger.Info($"[PinMAME] Seg data ({index}): {BitConverter.ToString(_frameBuffer[index])}" ); |
208 | 207 | _dispatchQueue.Enqueue(() => OnDisplayFrame?.Invoke(this, |
209 | 208 | new DisplayFrameData($"{DisplayPrefix}{index}", GetDisplayType(displayLayout.type), _frameBuffer[index]))); |
210 | 209 | } |
211 | 210 |
|
212 | 211 | } |
213 | 212 |
|
214 | | - private void SolenoidChanged(object sender, EventArgs e, int internalId, bool isActive) |
| 213 | + private void SolenoidUpdated(object sender, EventArgs e, int internalId, bool isActive) |
215 | 214 | { |
216 | 215 | if (_coils.ContainsKey(internalId)) { |
217 | 216 | Logger.Info($"[PinMAME] <= coil {_coils[internalId].Id} ({internalId}): {isActive} | {_coils[internalId].Description}"); |
@@ -274,7 +273,8 @@ private void OnDestroy() |
274 | 273 | _pinMame.StopGame(); |
275 | 274 | _pinMame.OnGameStarted -= GameStarted; |
276 | 275 | _pinMame.OnGameEnded -= GameEnded; |
277 | | - _pinMame.OnDisplayUpdate -= DisplayUpdated; |
| 276 | + _pinMame.OnDisplayUpdated -= DisplayUpdated; |
| 277 | + _pinMame.OnSolenoidUpdated -= SolenoidUpdated; |
278 | 278 | } |
279 | 279 | } |
280 | 280 |
|
|
0 commit comments