2019-01-29 17:21:23 -05:00
|
|
|
|
using Mesen.GUI.Config;
|
|
|
|
|
using Mesen.GUI.Forms;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Mesen.GUI.Debugger
|
|
|
|
|
{
|
|
|
|
|
public partial class frmWatchWindow : BaseForm
|
|
|
|
|
{
|
|
|
|
|
private InteropEmu.NotificationListener _notifListener;
|
|
|
|
|
|
|
|
|
|
public frmWatchWindow()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
if(!DesignMode) {
|
2019-10-06 19:58:51 -04:00
|
|
|
|
RestoreLocation(ConfigManager.Config.DebugInfo.WatchWindowLocation, ConfigManager.Config.DebugInfo.WatchWindowSize);
|
2019-01-31 19:45:25 -05:00
|
|
|
|
this.toolTip.SetToolTip(picWatchHelp, ctrlWatch.GetTooltipText());
|
2019-01-29 17:21:23 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnLoad(EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnLoad(e);
|
|
|
|
|
|
|
|
|
|
if(!DesignMode) {
|
|
|
|
|
_notifListener = new InteropEmu.NotificationListener(ConfigManager.Config.DebugInfo.DebugConsoleId);
|
|
|
|
|
_notifListener.OnNotification += _notifListener_OnNotification;
|
|
|
|
|
ctrlWatch.UpdateWatch(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnFormClosing(FormClosingEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnFormClosing(e);
|
|
|
|
|
|
|
|
|
|
ConfigManager.Config.DebugInfo.WatchWindowSize = this.WindowState != FormWindowState.Normal ? this.RestoreBounds.Size : this.Size;
|
|
|
|
|
ConfigManager.Config.DebugInfo.WatchWindowLocation = this.WindowState != FormWindowState.Normal ? this.RestoreBounds.Location : this.Location;
|
|
|
|
|
ConfigManager.ApplyChanges();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnFormClosed(FormClosedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnFormClosed(e);
|
|
|
|
|
|
|
|
|
|
if(_notifListener != null) {
|
|
|
|
|
_notifListener.Dispose();
|
|
|
|
|
_notifListener = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void _notifListener_OnNotification(InteropEmu.NotificationEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
switch(e.NotificationType) {
|
|
|
|
|
case InteropEmu.ConsoleNotificationType.PpuFrameDone:
|
2019-11-20 19:14:07 -05:00
|
|
|
|
this.BeginInvoke((MethodInvoker)(() => {
|
|
|
|
|
ctrlWatch.UpdateWatch(false);
|
|
|
|
|
}));
|
2019-01-29 17:21:23 -05:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case InteropEmu.ConsoleNotificationType.CodeBreak:
|
|
|
|
|
this.BeginInvoke((MethodInvoker)(() => {
|
|
|
|
|
ctrlWatch.UpdateWatch(false);
|
|
|
|
|
}));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|