2017-08-29 13:18:28 +00:00
using System ;
using System.ComponentModel ;
using Newtonsoft.Json ;
using BizHawk.Common ;
using BizHawk.Emulation.Common ;
namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
{
public partial class GBHawk : IEmulator , IStatable , ISettable < GBHawk . GBSettings , GBHawk . GBSyncSettings >
{
public GBSettings GetSettings ( )
{
return _settings . Clone ( ) ;
}
public GBSyncSettings GetSyncSettings ( )
{
return _syncSettings . Clone ( ) ;
}
public bool PutSettings ( GBSettings o )
{
_settings = o ;
return false ;
}
public bool PutSyncSettings ( GBSyncSettings o )
{
bool ret = GBSyncSettings . NeedsReboot ( _syncSettings , o ) ;
_syncSettings = o ;
return ret ;
}
private GBSettings _settings = new GBSettings ( ) ;
public GBSyncSettings _syncSettings = new GBSyncSettings ( ) ;
public class GBSettings
{
2017-11-22 19:42:12 +00:00
public enum PaletteType
{
BW ,
Gr
}
2018-01-17 01:00:42 +00:00
[DisplayName("Color Mode")]
[Description("Pick Between Green scale and Grey scale colors")]
2017-11-22 19:42:12 +00:00
[DefaultValue(PaletteType.BW)]
public PaletteType Palette { get ; set ; }
2017-08-29 13:18:28 +00:00
public GBSettings Clone ( )
{
return ( GBSettings ) MemberwiseClone ( ) ;
}
}
public class GBSyncSettings
{
private string _port1 = GBHawkControllerDeck . DefaultControllerName ;
[JsonIgnore]
public string Port1
{
get { return _port1 ; }
set
{
if ( ! GBHawkControllerDeck . ValidControllerTypes . ContainsKey ( value ) )
{
throw new InvalidOperationException ( "Invalid controller type: " + value ) ;
}
_port1 = value ;
}
}
2018-03-24 13:11:23 +00:00
public enum ConsoleModeType
{
Auto ,
GB ,
GBC
}
[DisplayName("Console Mode")]
[Description("Pick which console to run, 'Auto' chooses from ROM extension, 'GB' and 'GBC' chooses the respective system")]
[DefaultValue(ConsoleModeType.Auto)]
public ConsoleModeType ConsoleMode { get ; set ; }
2018-03-25 21:58:21 +00:00
[DisplayName("CGB in GBA")]
[Description("Emulate GBA hardware running a CGB game, instead of CGB hardware. Relevant only for titles that detect the presense of a GBA, such as Shantae.")]
[DefaultValue(false)]
public bool GBACGB { get ; set ; }
2017-11-24 20:44:29 +00:00
[DisplayName("RTC Initial Time")]
2017-11-25 16:04:07 +00:00
[Description("Set the initial RTC time in terms of elapsed seconds.")]
2017-11-24 20:44:29 +00:00
[DefaultValue(0)]
public int RTCInitialTime
{
get { return _RTCInitialTime ; }
set { _RTCInitialTime = Math . Max ( 0 , Math . Min ( 1024 * 24 * 60 * 60 , value ) ) ; }
}
2017-11-25 16:04:07 +00:00
[DisplayName("Use Existing SaveRAM")]
[Description("When true, existing SaveRAM will be loaded at boot up")]
[DefaultValue(false)]
public bool Use_SRAM { get ; set ; }
2017-11-24 20:44:29 +00:00
[JsonIgnore]
private int _RTCInitialTime ;
2017-08-29 13:18:28 +00:00
public GBSyncSettings Clone ( )
{
return ( GBSyncSettings ) MemberwiseClone ( ) ;
}
public static bool NeedsReboot ( GBSyncSettings x , GBSyncSettings y )
{
return ! DeepEquality . DeepEquals ( x , y ) ;
}
}
}
}