ZXHawk: Media menu to change tapes and disks
This commit is contained in:
parent
651ec7f122
commit
63593b4e2c
|
@ -386,6 +386,10 @@
|
|||
this.ZXSpectrumControllerConfigurationMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.ZXSpectrumAudioSettingsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.ZXSpectrumNonSyncSettingsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.ZXSpectrumPokeMemoryMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.ZXSpectrumMediaMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.ZXSpectrumTapesSubMenu = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.ZXSpectrumDisksSubMenu = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.Atari7800HawkCoreMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.MainStatusBar = new StatusStripEx();
|
||||
this.DumpStatusButton = new System.Windows.Forms.ToolStripDropDownButton();
|
||||
|
@ -458,7 +462,8 @@
|
|||
this.ShowMenuContextMenuSeparator = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.ShowMenuContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.timerMouseIdle = new System.Windows.Forms.Timer(this.components);
|
||||
this.ZXSpectrumPokeMemoryMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.zxt1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.zxt2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.MainformMenu.SuspendLayout();
|
||||
this.MainStatusBar.SuspendLayout();
|
||||
this.MainFormContextMenu.SuspendLayout();
|
||||
|
@ -3403,7 +3408,8 @@
|
|||
this.ZXSpectrumControllerConfigurationMenuItem,
|
||||
this.ZXSpectrumAudioSettingsMenuItem,
|
||||
this.ZXSpectrumNonSyncSettingsMenuItem,
|
||||
this.ZXSpectrumPokeMemoryMenuItem});
|
||||
this.ZXSpectrumPokeMemoryMenuItem,
|
||||
this.ZXSpectrumMediaMenuItem});
|
||||
this.zXSpectrumToolStripMenuItem.Name = "zXSpectrumToolStripMenuItem";
|
||||
this.zXSpectrumToolStripMenuItem.Size = new System.Drawing.Size(87, 19);
|
||||
this.zXSpectrumToolStripMenuItem.Text = "ZX Spectrum";
|
||||
|
@ -3437,6 +3443,41 @@
|
|||
this.ZXSpectrumNonSyncSettingsMenuItem.Text = "Non-Sync Settings";
|
||||
this.ZXSpectrumNonSyncSettingsMenuItem.Click += new System.EventHandler(this.ZXSpectrumNonSyncSettingsMenuItem_Click);
|
||||
//
|
||||
// ZXSpectrumPokeMemoryMenuItem
|
||||
//
|
||||
this.ZXSpectrumPokeMemoryMenuItem.Name = "ZXSpectrumPokeMemoryMenuItem";
|
||||
this.ZXSpectrumPokeMemoryMenuItem.Size = new System.Drawing.Size(201, 22);
|
||||
this.ZXSpectrumPokeMemoryMenuItem.Text = "POKE Memory";
|
||||
this.ZXSpectrumPokeMemoryMenuItem.Click += new System.EventHandler(this.ZXSpectrumPokeMemoryMenuItem_Click);
|
||||
//
|
||||
// ZXSpectrumMediaMenuItem
|
||||
//
|
||||
this.ZXSpectrumMediaMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.ZXSpectrumTapesSubMenu,
|
||||
this.ZXSpectrumDisksSubMenu});
|
||||
this.ZXSpectrumMediaMenuItem.Name = "ZXSpectrumMediaMenuItem";
|
||||
this.ZXSpectrumMediaMenuItem.Size = new System.Drawing.Size(201, 22);
|
||||
this.ZXSpectrumMediaMenuItem.Text = "Media";
|
||||
this.ZXSpectrumMediaMenuItem.DropDownOpened += new System.EventHandler(this.ZXSpectrumMediaMenuItem_DropDownOpened);
|
||||
//
|
||||
// ZXSpectrumTapesSubMenu
|
||||
//
|
||||
this.ZXSpectrumTapesSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.zxt1ToolStripMenuItem});
|
||||
this.ZXSpectrumTapesSubMenu.Name = "ZXSpectrumTapesSubMenu";
|
||||
this.ZXSpectrumTapesSubMenu.Size = new System.Drawing.Size(152, 22);
|
||||
this.ZXSpectrumTapesSubMenu.Text = "Tapes";
|
||||
this.ZXSpectrumTapesSubMenu.DropDownOpened += new System.EventHandler(this.ZXSpectrumTapesSubMenu_DropDownOpened);
|
||||
//
|
||||
// ZXSpectrumDisksSubMenu
|
||||
//
|
||||
this.ZXSpectrumDisksSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.zxt2ToolStripMenuItem});
|
||||
this.ZXSpectrumDisksSubMenu.Name = "ZXSpectrumDisksSubMenu";
|
||||
this.ZXSpectrumDisksSubMenu.Size = new System.Drawing.Size(152, 22);
|
||||
this.ZXSpectrumDisksSubMenu.Text = "Disks";
|
||||
this.ZXSpectrumDisksSubMenu.DropDownOpened += new System.EventHandler(this.ZXSpectrumDisksSubMenu_DropDownOpened);
|
||||
//
|
||||
// Atari7800HawkCoreMenuItem
|
||||
//
|
||||
this.Atari7800HawkCoreMenuItem.Name = "Atari7800HawkCoreMenuItem";
|
||||
|
@ -4063,12 +4104,17 @@
|
|||
this.timerMouseIdle.Interval = 2000;
|
||||
this.timerMouseIdle.Tick += new System.EventHandler(this.TimerMouseIdle_Tick);
|
||||
//
|
||||
// ZXSpectrumPokeMemoryMenuItem
|
||||
// zxt1ToolStripMenuItem
|
||||
//
|
||||
this.ZXSpectrumPokeMemoryMenuItem.Name = "ZXSpectrumPokeMemoryMenuItem";
|
||||
this.ZXSpectrumPokeMemoryMenuItem.Size = new System.Drawing.Size(201, 22);
|
||||
this.ZXSpectrumPokeMemoryMenuItem.Text = "POKE Memory";
|
||||
this.ZXSpectrumPokeMemoryMenuItem.Click += new System.EventHandler(this.ZXSpectrumPokeMemoryMenuItem_Click);
|
||||
this.zxt1ToolStripMenuItem.Name = "zxt1ToolStripMenuItem";
|
||||
this.zxt1ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.zxt1ToolStripMenuItem.Text = "zxt1";
|
||||
//
|
||||
// zxt2ToolStripMenuItem
|
||||
//
|
||||
this.zxt2ToolStripMenuItem.Name = "zxt2ToolStripMenuItem";
|
||||
this.zxt2ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.zxt2ToolStripMenuItem.Text = "zxt2";
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
|
@ -4540,5 +4586,10 @@
|
|||
private System.Windows.Forms.ToolStripMenuItem ZXSpectrumNonSyncSettingsMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem ZXSpectrumAudioSettingsMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem ZXSpectrumPokeMemoryMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem ZXSpectrumMediaMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem ZXSpectrumTapesSubMenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem ZXSpectrumDisksSubMenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem zxt1ToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem zxt2ToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ using BizHawk.Emulation.Cores.Computers.AppleII;
|
|||
using BizHawk.Client.ApiHawk;
|
||||
using BizHawk.Emulation.Cores.Computers.Commodore64;
|
||||
using BizHawk.Emulation.Cores.Nintendo.Gameboy;
|
||||
using BizHawk.Emulation.Cores.Computers.SinclairSpectrum;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
|
@ -2492,6 +2493,77 @@ namespace BizHawk.Client.EmuHawk
|
|||
new ZXSpectrumPokeMemory().ShowDialog();
|
||||
}
|
||||
|
||||
private void ZXSpectrumMediaMenuItem_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
if (Emulator is ZXSpectrum)
|
||||
{
|
||||
ZXSpectrumTapesSubMenu.Enabled = ((ZXSpectrum)Emulator)._tapeInfo.Count > 0;
|
||||
ZXSpectrumDisksSubMenu.Enabled = ((ZXSpectrum)Emulator)._diskInfo.Count > 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void ZXSpectrumTapesSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
ZXSpectrumTapesSubMenu.DropDownItems.Clear();
|
||||
|
||||
if (Emulator is ZXSpectrum)
|
||||
{
|
||||
var speccy = (ZXSpectrum)Emulator;
|
||||
var currSel = speccy._machine.TapeMediaIndex;
|
||||
|
||||
for (int i = 0; i < speccy._tapeInfo.Count; i++)
|
||||
{
|
||||
string name = speccy._tapeInfo[i].Name;
|
||||
|
||||
var menuItem = new ToolStripMenuItem
|
||||
{
|
||||
Name = i + "_" + name,
|
||||
Text = i + ": " + name,
|
||||
Checked = currSel == i
|
||||
};
|
||||
|
||||
int dummy = i;
|
||||
menuItem.Click += (o, ev) =>
|
||||
{
|
||||
speccy._machine.TapeMediaIndex = dummy;
|
||||
};
|
||||
|
||||
ZXSpectrumTapesSubMenu.DropDownItems.Add(menuItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ZXSpectrumDisksSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
ZXSpectrumDisksSubMenu.DropDownItems.Clear();
|
||||
|
||||
if (Emulator is ZXSpectrum)
|
||||
{
|
||||
var speccy = (ZXSpectrum)Emulator;
|
||||
var currSel = speccy._machine.DiskMediaIndex;
|
||||
|
||||
for (int i = 0; i < speccy._diskInfo.Count; i++)
|
||||
{
|
||||
string name = speccy._diskInfo[i].Name;
|
||||
|
||||
var menuItem = new ToolStripMenuItem
|
||||
{
|
||||
Name = i + "_" + name,
|
||||
Text = i + ": " + name,
|
||||
Checked = currSel == i
|
||||
};
|
||||
|
||||
int dummy = i;
|
||||
menuItem.Click += (o, ev) =>
|
||||
{
|
||||
speccy._machine.DiskMediaIndex = dummy;
|
||||
};
|
||||
|
||||
ZXSpectrumDisksSubMenu.DropDownItems.Add(menuItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Help
|
||||
|
|
Loading…
Reference in New Issue