From 65345077a8c3c259f2d4a2b210c889a237e9f23e Mon Sep 17 00:00:00 2001 From: pjgat09 Date: Sun, 20 Jul 2014 16:00:56 +0000 Subject: [PATCH] N64: Fixed sync settings not being passed to the plugins as a result of changing the fields to properties. Jabo setting are now passed. --- .../Consoles/Nintendo/N64/N64SyncSettings.Glide.cs | 10 +++++++--- .../Consoles/Nintendo/N64/N64SyncSettings.GlideMk2.cs | 10 +++++++--- .../Consoles/Nintendo/N64/N64SyncSettings.Jabo.cs | 10 +++++++--- .../Consoles/Nintendo/N64/N64SyncSettings.Rice.cs | 10 +++++++--- .../Nintendo/N64/NativeAPI/mupen64plusCoreApi.cs | 4 ++++ 5 files changed, 32 insertions(+), 12 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Glide.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Glide.cs index 77d6f9200c..0db8eed3d3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Glide.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Glide.cs @@ -3,6 +3,7 @@ using System.ComponentModel; using Newtonsoft.Json; using BizHawk.Emulation.Common; +using System.Reflection; namespace BizHawk.Emulation.Cores.Nintendo.N64 { @@ -340,11 +341,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 { //TODO: deal witn the game depedent settings var dictionary = new Dictionary(); - var members = this.GetType().GetFields(); + var members = this.GetType().GetMembers(); foreach (var member in members) { - var field = this.GetType().GetField(member.Name).GetValue(this); - dictionary.Add(member.Name, field); + if (member.MemberType == MemberTypes.Property) + { + var field = this.GetType().GetProperty(member.Name).GetValue(this, null); + dictionary.Add(member.Name, field); + } } return dictionary; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GlideMk2.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GlideMk2.cs index db834b115d..f985685d57 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GlideMk2.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GlideMk2.cs @@ -3,6 +3,7 @@ using System.ComponentModel; using Newtonsoft.Json; using BizHawk.Emulation.Common; +using System.Reflection; namespace BizHawk.Emulation.Cores.Nintendo.N64 { @@ -288,11 +289,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 { //TODO: deal witn the game depedent settings var dictionary = new Dictionary(); - var members = this.GetType().GetFields(); + var members = this.GetType().GetMembers(); foreach (var member in members) { - var field = this.GetType().GetField(member.Name).GetValue(this); - dictionary.Add(member.Name, field); + if (member.MemberType == MemberTypes.Property) + { + var field = this.GetType().GetProperty(member.Name).GetValue(this, null); + dictionary.Add(member.Name, field); + } } return dictionary; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Jabo.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Jabo.cs index cf11d31fa9..ad251f54e3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Jabo.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Jabo.cs @@ -3,6 +3,7 @@ using System.ComponentModel; using Newtonsoft.Json; using BizHawk.Emulation.Common; +using System.Reflection; namespace BizHawk.Emulation.Cores.Nintendo.N64 { @@ -43,11 +44,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 { //TODO: deal witn the game depedent settings var dictionary = new Dictionary(); - var members = this.GetType().GetFields(); + var members = this.GetType().GetMembers(); foreach (var member in members) { - var field = this.GetType().GetField(member.Name).GetValue(this); - dictionary.Add(member.Name, field); + if (member.MemberType == MemberTypes.Property) + { + var field = this.GetType().GetProperty(member.Name).GetValue(this, null); + dictionary.Add(member.Name, field); + } } return dictionary; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Rice.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Rice.cs index 92b6f08693..7f28867a98 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Rice.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Rice.cs @@ -3,6 +3,7 @@ using System.ComponentModel; using Newtonsoft.Json; using BizHawk.Emulation.Common; +using System.Reflection; namespace BizHawk.Emulation.Cores.Nintendo.N64 { @@ -376,11 +377,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 { //TODO: deal witn the game depedent settings var dictionary = new Dictionary(); - var members = this.GetType().GetFields(); + var members = this.GetType().GetMembers(); foreach (var member in members) { - var field = this.GetType().GetField(member.Name).GetValue(this); - dictionary.Add(member.Name, field); + if (member.MemberType == MemberTypes.Property) + { + var field = this.GetType().GetProperty(member.Name).GetValue(this, null); + dictionary.Add(member.Name, field); + } } return dictionary; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusCoreApi.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusCoreApi.cs index 1e89af35dc..977a4baeaf 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusCoreApi.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusCoreApi.cs @@ -487,6 +487,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi { m64pConfigOpenSection("Video-Glide64mk2", ref video_plugin_section); } + else if (video_settings.Plugin == PluginType.JABO) + { + m64pConfigOpenSection("Video-Jabo", ref video_plugin_section); + } else { return;