Disable features using Win32 unless on Windows host

forms: GBAGPUView, GBGPUView, LogWindow, SNESGraphicsDebugger,
SynclessRecordingTools; features: A/V recording, logging to AWE(?)
This commit is contained in:
YoshiRulz 2019-12-21 18:26:49 +10:00
parent 580aa2eaf9
commit 784c800ca2
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
6 changed files with 26 additions and 12 deletions

View File

@ -19,7 +19,9 @@ namespace BizHawk.Client.Common
if (DefaultToAWE) if (DefaultToAWE)
{ {
return new StreamStringLog(false); return OSTailoredCode.IsUnixHost
? throw new InvalidOperationException("logging to AWE is only available on Windows for now")
: new StreamStringLog(false);
} }
return new ListStringLog(); return new ListStringLog();

View File

@ -15,7 +15,7 @@ namespace BizHawk.Client.EmuHawk
/// Component wrapping access to the Browse For Folder common dialog box. /// Component wrapping access to the Browse For Folder common dialog box.
/// Call the ShowDialog() method to bring the dialog box up. /// Call the ShowDialog() method to bring the dialog box up.
/// </summary> /// </summary>
public sealed class FolderBrowserEx : Component public sealed class FolderBrowserEx : Component //TODO inherit CommonDialog
{ {
private const int MAX_PATH = 260; private const int MAX_PATH = 260;

View File

@ -2865,6 +2865,7 @@
this.GBASubMenu.Name = "GBASubMenu"; this.GBASubMenu.Name = "GBASubMenu";
this.GBASubMenu.Size = new System.Drawing.Size(39, 17); this.GBASubMenu.Size = new System.Drawing.Size(39, 17);
this.GBASubMenu.Text = "GBA"; this.GBASubMenu.Text = "GBA";
this.GBASubMenu.DropDownOpened += new System.EventHandler(this.GBASubMenu_DropDownOpened);
// //
// GBACoreSelectionSubMenu // GBACoreSelectionSubMenu
// //

View File

@ -284,11 +284,12 @@ namespace BizHawk.Client.EmuHawk
StopAVIMenuItem.ShortcutKeyDisplayString = Config.HotkeyBindings["Stop A/V"].Bindings; StopAVIMenuItem.ShortcutKeyDisplayString = Config.HotkeyBindings["Stop A/V"].Bindings;
CaptureOSDMenuItem.Checked = Config.AVI_CaptureOSD; CaptureOSDMenuItem.Checked = Config.AVI_CaptureOSD;
RecordAVMenuItem.Enabled = !string.IsNullOrEmpty(Config.VideoWriter) && _currAviWriter == null; RecordAVMenuItem.Enabled = OSTailoredCode.IsUnixHost || !string.IsNullOrEmpty(Global.Config.VideoWriter) && _currAviWriter == null;
SynclessRecordingMenuItem.Enabled = !OSTailoredCode.IsUnixHost;
if (_currAviWriter == null) if (_currAviWriter == null)
{ {
ConfigAndRecordAVMenuItem.Enabled = true; ConfigAndRecordAVMenuItem.Enabled = !OSTailoredCode.IsUnixHost;
StopAVIMenuItem.Enabled = false; StopAVIMenuItem.Enabled = false;
} }
else else
@ -751,6 +752,8 @@ namespace BizHawk.Client.EmuHawk
DisplayLagCounterMenuItem.Enabled = Emulator.CanPollInput(); DisplayLagCounterMenuItem.Enabled = Emulator.CanPollInput();
DisplayMessagesMenuItem.Checked = Config.DisplayMessages; DisplayMessagesMenuItem.Checked = Config.DisplayMessages;
DisplayLogWindowMenuItem.Enabled = !OSTailoredCode.IsUnixHost;
} }
private void WindowSizeSubMenu_DropDownOpened(object sender, EventArgs e) private void WindowSizeSubMenu_DropDownOpened(object sender, EventArgs e)
@ -2108,6 +2111,7 @@ namespace BizHawk.Client.EmuHawk
private void GBSubMenu_DropDownOpened(object sender, EventArgs e) private void GBSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
LoadGBInSGBMenuItem.Checked = Config.GB_AsSGB; LoadGBInSGBMenuItem.Checked = Config.GB_AsSGB;
GBGPUViewerMenuItem.Enabled = !OSTailoredCode.IsUnixHost;
} }
private void GBCoreSettingsMenuItem_Click(object sender, EventArgs e) private void GBCoreSettingsMenuItem_Click(object sender, EventArgs e)
@ -2168,6 +2172,11 @@ namespace BizHawk.Client.EmuHawk
FlagNeedsReboot(); FlagNeedsReboot();
} }
private void GBASubMenu_DropDownOpened(object sender, EventArgs e)
{
GbaGpuViewerMenuItem.Enabled = !OSTailoredCode.IsUnixHost;
}
private void GBACoreSelectionSubMenu_DropDownOpened(object sender, EventArgs e) private void GBACoreSelectionSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
GBAmGBAMenuItem.Checked = Config.GBA_UsemGBA; GBAmGBAMenuItem.Checked = Config.GBA_UsemGBA;
@ -2231,6 +2240,7 @@ namespace BizHawk.Client.EmuHawk
} }
SNESControllerConfigurationMenuItem.Enabled = !MovieSession.Movie.IsActive; SNESControllerConfigurationMenuItem.Enabled = !MovieSession.Movie.IsActive;
SnesGfxDebuggerMenuItem.Enabled = !OSTailoredCode.IsUnixHost;
} }
private void SNESControllerConfigurationMenuItem_Click(object sender, EventArgs e) private void SNESControllerConfigurationMenuItem_Click(object sender, EventArgs e)

View File

@ -1,4 +1,6 @@
using System.Linq; using System.Linq;
using BizHawk.Common;
using BizHawk.Emulation.Common.IEmulatorExtensions; using BizHawk.Emulation.Common.IEmulatorExtensions;
using BizHawk.Emulation.Cores.Nintendo.Gameboy; using BizHawk.Emulation.Cores.Nintendo.Gameboy;
@ -102,7 +104,8 @@ namespace BizHawk.Client.EmuHawk
_exitRequestPending = true; _exitRequestPending = true;
break; break;
case "Record A/V": case "Record A/V":
RecordAv(); if (OSTailoredCode.IsUnixHost) GlobalWin.OSD.AddMessage("(A/V only available on Windows for now)");
else RecordAv();
break; break;
case "Stop A/V": case "Stop A/V":
StopAv(); StopAv();

View File

@ -223,7 +223,7 @@ namespace BizHawk.Client.EmuHawk
InitializeComponent(); InitializeComponent();
SetImages(); SetImages();
Game = GameInfo.NullInstance; Game = GameInfo.NullInstance;
if (Config.ShowLogWindow) if (Config.ShowLogWindow && !OSTailoredCode.IsUnixHost)
{ {
LogConsole.ShowConsole(); LogConsole.ShowConsole();
DisplayLogWindowMenuItem.Checked = true; DisplayLogWindowMenuItem.Checked = true;
@ -493,7 +493,8 @@ namespace BizHawk.Client.EmuHawk
// start dumping, if appropriate // start dumping, if appropriate
if (_argParser.cmdDumpType != null && _argParser.cmdDumpName != null) if (_argParser.cmdDumpType != null && _argParser.cmdDumpName != null)
{ {
RecordAv(_argParser.cmdDumpType, _argParser.cmdDumpName); if (OSTailoredCode.IsUnixHost) Console.WriteLine("A/V dump requires Win32 API calls, ignored");
else RecordAv(_argParser.cmdDumpType, _argParser.cmdDumpName);
} }
SetMainformMovieInfo(); SetMainformMovieInfo();
@ -511,7 +512,7 @@ namespace BizHawk.Client.EmuHawk
public int ProgramRunLoop() public int ProgramRunLoop()
{ {
CheckMessages(); // can someone leave a note about why this is needed? CheckMessages(); // can someone leave a note about why this is needed?
LogConsole.PositionConsole(); if (!OSTailoredCode.IsUnixHost) LogConsole.PositionConsole();
// needs to be done late, after the log console snaps on top // needs to be done late, after the log console snaps on top
// fullscreen should snap on top even harder! // fullscreen should snap on top even harder!
@ -3218,10 +3219,7 @@ namespace BizHawk.Client.EmuHawk
/// </summary> /// </summary>
private void RecordAvBase(string videoWriterName, string filename, bool unattended) private void RecordAvBase(string videoWriterName, string filename, bool unattended)
{ {
if (_currAviWriter != null) if (_currAviWriter != null || OSTailoredCode.IsUnixHost) return;
{
return;
}
// select IVideoWriter to use // select IVideoWriter to use
IVideoWriter aw; IVideoWriter aw;