From fdf9a97714ea0f335ad1cbea560fa8990295cec0 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 20 Jul 2014 17:23:04 +0000 Subject: [PATCH] pretty up Jabo enum value names, since they show up in the gui --- .../N64/N64SyncSettings.Controller.cs | 74 ++++++++++++++++ .../Nintendo/N64/N64SyncSettings.Jabo.cs | 85 ++++++++++--------- 2 files changed, 117 insertions(+), 42 deletions(-) create mode 100644 BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Controller.cs diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Controller.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Controller.cs new file mode 100644 index 0000000000..ec5f0e4fdb --- /dev/null +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Controller.cs @@ -0,0 +1,74 @@ +using System.ComponentModel; +using Newtonsoft.Json; + +namespace BizHawk.Emulation.Cores.Nintendo.N64 +{ + public partial class N64SyncSettings + { + public class N64ControllerSettings + { + /// + /// Enumeration defining the different N64 controller pak types + /// + public enum N64ControllerPakType + { + [Description("None")] + NO_PAK = 1, + + [Description("Memory Card")] + MEMORY_CARD = 2, + + [Description("Rumble Pak")] + RUMBLE_PAK = 3, + + [Description("Transfer Pak")] + TRANSFER_PAK = 4 + } + + [JsonIgnore] + private N64ControllerPakType _type = N64ControllerPakType.NO_PAK; + + /// + /// Type of the pak inserted in the controller + /// Currently only NO_PAK and MEMORY_CARD are + /// supported. Other values may be set and + /// are recognized but they have no function + /// yet. e.g. TRANSFER_PAK makes the N64 + /// recognize a transfer pak inserted in + /// the controller but there is no + /// communication to the transfer pak. + /// + public N64ControllerPakType PakType + { + get { return _type; } + set { _type = value; } + } + + [JsonIgnore] + private bool _isConnected = true; + + /// + /// Connection status of the controller i.e.: + /// Is the controller plugged into the N64? + /// + public bool IsConnected + { + get { return _isConnected; } + set { _isConnected = value; } + } + + /// + /// Clones this object + /// + /// New object with the same values + public N64ControllerSettings Clone() + { + return new N64ControllerSettings + { + PakType = PakType, + IsConnected = IsConnected + }; + } + } + } +} diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Jabo.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Jabo.cs index 4f6b5b30e6..dc6cf9a5a4 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Jabo.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Jabo.cs @@ -13,7 +13,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 { public N64JaboPluginSettings() { - anisotropic_level = ANISOTROPIC_FILTERING_LEVEL.four_times; + anisotropic_level = ANISOTROPIC_FILTERING_LEVEL.FourTimes; brightness = 100; super2xsal = false; texture_filter = false; @@ -26,7 +26,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 copy_framebuffer = false; resolution_width = -1; resolution_height = -1; - clear_mode = DIRECT3D_CLEAR_MODE.def; + clear_mode = Direct3DClearMode.Default; } public PluginType GetPluginType() @@ -56,104 +56,105 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 return dictionary; } - public enum ANISOTROPIC_FILTERING_LEVEL - { - [Description("Off")] - off = 0, - - [Description("2X")] - two_times = 1, - - [Description("4X")] - four_times = 2, - - [Description("8X")] - eight_times = 3, - - [Description("16X")] - sixteen_times = 4 - } - - [DefaultValue(ANISOTROPIC_FILTERING_LEVEL.four_times)] + [DefaultValue(ANISOTROPIC_FILTERING_LEVEL.FourTimes)] + [DisplayName("Anisotropic filtering")] [Description("Anisotropic filtering level")] - //[DisplayName("Anisotropic filtering")] public ANISOTROPIC_FILTERING_LEVEL anisotropic_level { get; set; } [DefaultValue(100)] + [DisplayName("Brightness")] [Description("Brightness level, 100%-190%")] - //[DisplayName("Brightness")] public int brightness { get; set; } [DefaultValue(false)] + [DisplayName("Super2xSal textures")] [Description("Enables Super2xSal textures")] - //[DisplayName("Super2xSal textures")] public bool super2xsal { get; set; } [DefaultValue(false)] + [DisplayName("Always use texture filter")] [Description("Always use texture filter")] - //[DisplayName("Always use texture filter")] public bool texture_filter { get; set; } [DefaultValue(false)] + [DisplayName("Adjust game aspect ratio to match yours")] [Description("Adjust game aspect ratio to match yours")] - //[DisplayName("Adjust game aspect ratio to match yours")] public bool adjust_aspect_ratio { get; set; } [DefaultValue(false)] + [DisplayName("Use legacy pixel pipeline")] [Description("Use legacy pixel pipeline")] - //[DisplayName("Use legacy pixel pipeline")] public bool legacy_pixel_pipeline { get; set; } [DefaultValue(false)] + [DisplayName("Force alpha blending")] [Description("Force alpha blending")] - //[DisplayName("Force alpha blending")] public bool alpha_blending { get; set; } [DefaultValue(false)] + [DisplayName("Wireframe rendering")] [Description("Wireframe rendering")] - //[DisplayName("Wireframe rendering")] public bool wireframe { get; set; } [DefaultValue(false)] + [DisplayName("Use Direct3D trans pipeline")] [Description("Use Direct3D transformation pipeline")] - //[DisplayName("Use Direct3D transformation pipeline")] public bool direct3d_transformation_pipeline { get; set; } [DefaultValue(false)] + [DisplayName("Force Z Compare")] [Description("Force Z Compare")] - //[DisplayName("Force Z Compare")] public bool z_compare { get; set; } [DefaultValue(false)] + [DisplayName("Copy framebuffer")] [Description("Copy framebuffer to RDRAM")] - //[DisplayName("Copy framebuffer to RDRAM")] public bool copy_framebuffer { get; set; } [DefaultValue(-1)] + [DisplayName("Emulated Width")] [Description("Emulated Width")] - //[DisplayName("Emulated Width")] public int resolution_width { get; set; } [DefaultValue(-1)] + [DisplayName("Emulated Height")] [Description("Emulated Height")] - //[DisplayName("Emulated Height")] public int resolution_height { get; set; } - public enum DIRECT3D_CLEAR_MODE + [DefaultValue(Direct3DClearMode.Default)] + [DisplayName("Direct3D Clear Mode")] + [Description("Direct3D Clear Mode")] + public Direct3DClearMode clear_mode { get; set; } + + public enum ANISOTROPIC_FILTERING_LEVEL + { + [Description("Off")] + Off = 0, + + [Description("2X")] + TwoTimes = 1, + + [Description("4X")] + FourTimes = 2, + + [Description("8X")] + EightTimes = 3, + + [Description("16X")] + SixteenTimes = 4 + } + + public enum Direct3DClearMode { [Description("Default")] - def = 0, + Default = 0, [Description("Only Per Frame")] - per_frame = 1, + PerFrame = 1, [Description("Always")] - always = 2 + Always = 2 } - [DefaultValue(DIRECT3D_CLEAR_MODE.def)] - [Description("Direct3D Clear Mode")] - //[DisplayName("Direct3D Clear Mode")] - public DIRECT3D_CLEAR_MODE clear_mode { get; set; } public N64JaboPluginSettings Clone() {