Atari 2600 Debugger - implement Step Into button

This commit is contained in:
adelikat 2014-05-26 19:38:02 +00:00
parent af60a42003
commit e68e691e3c
2 changed files with 63 additions and 45 deletions

View File

@ -141,7 +141,7 @@ namespace BizHawk.Client.EmuHawk
public bool UpdateBefore
{
get { return false; } // TODO: think about this
get { return false; }
}
public void UpdateValues()
@ -242,39 +242,19 @@ namespace BizHawk.Client.EmuHawk
}
}
#region Events
private void BreakpointCallback()
{
GlobalWin.MainForm.PauseEmulator();
UpdateValues();
}
#region Menu
private void ExitMenuItem_Click(object sender, EventArgs e)
{
Close();
}
private void StepBtn_Click(object sender, EventArgs e)
{
_core.CycleAdvance();
UpdateValues();
}
private void ScanlineAdvanceBtn_Click(object sender, EventArgs e)
{
_core.ScanlineAdvance();
UpdateValues();
}
private void FrameAdvButton_Click(object sender, EventArgs e)
{
_core.FrameAdvance(true, true);
UpdateValues();
}
private void RefreshFloatingWindowControl()
{
Owner = Global.Config.RamSearchSettings.FloatingWindow ? null : GlobalWin.MainForm;
}
#endregion
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
{
AutoloadMenuItem.Checked = Global.Config.Atari2600DebuggerAutoload;
@ -312,12 +292,59 @@ namespace BizHawk.Client.EmuHawk
RefreshFloatingWindowControl();
}
#endregion
#region Dialog Events
protected override void OnShown(EventArgs e)
{
RefreshFloatingWindowControl();
base.OnShown(e);
}
private void StepBtn_Click(object sender, EventArgs e)
{
var size = opsize[_core.Op];
for (int i = 0; i < size; i++)
{
_core.CycleAdvance();
}
UpdateValues();
}
private void ScanlineAdvanceBtn_Click(object sender, EventArgs e)
{
_core.ScanlineAdvance();
UpdateValues();
}
private void FrameAdvButton_Click(object sender, EventArgs e)
{
_core.FrameAdvance(true, true);
UpdateValues();
}
private void AddBreakpointButton_Click(object sender, EventArgs e)
{
var b = new AddBreakpointDialog();
if (b.ShowDialog() == DialogResult.OK)
{
Breakpoints.Add(b.Address, b.BreakType);
}
BreakpointView.ItemCount = Breakpoints.Count;
}
private void RefreshFloatingWindowControl()
{
Owner = Global.Config.RamSearchSettings.FloatingWindow ? null : GlobalWin.MainForm;
}
#endregion
// TODO: these can be generic to any debugger
#region Breakpoint Classes
@ -397,23 +424,6 @@ namespace BizHawk.Client.EmuHawk
}
}
private void AddBreakpointButton_Click(object sender, EventArgs e)
{
var b = new AddBreakpointDialog();
if (b.ShowDialog() == DialogResult.OK)
{
Breakpoints.Add(b.Address, b.BreakType);
}
BreakpointView.ItemCount = Breakpoints.Count;
}
private void BreakpointCallback()
{
GlobalWin.MainForm.PauseEmulator();
UpdateValues();
}
#endregion
}
}

View File

@ -193,6 +193,14 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
};
}
public byte Op
{
get
{
return Cpu.PeekMemory(Cpu.PC);
}
}
public bool StartAsyncSound() { return true; }
public void EndAsyncSound() { }