diff --git a/Library/AssemblyCommentAttribute.cs b/Library/AssemblyCommentAttribute.cs deleted file mode 100644 index 3dec478..0000000 --- a/Library/AssemblyCommentAttribute.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Jellyfish.Library -{ - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] - public sealed class AssemblyCommentAttribute : Attribute - { - public AssemblyCommentAttribute(string comment) - { - Comment = comment; - } - - public string Comment { get; private set; } - } -} diff --git a/Library/AssemblyMetadataAttribute.cs b/Library/AssemblyMetadataAttribute.cs new file mode 100644 index 0000000..e885b60 --- /dev/null +++ b/Library/AssemblyMetadataAttribute.cs @@ -0,0 +1,17 @@ +using System; + +namespace Jellyfish.Library +{ + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] + public sealed class AssemblyMetadataAttribute : Attribute + { + public AssemblyMetadataAttribute(string key, string value) + { + Key = key; + Value = value; + } + + public string Key { get; private set; } + public string Value { get; private set; } + } +} diff --git a/Library/CustomDictionary.xml b/Library/CustomDictionary.xml index ae15117..8f2033b 100644 --- a/Library/CustomDictionary.xml +++ b/Library/CustomDictionary.xml @@ -2,7 +2,6 @@ - Alloc x y diff --git a/Library/GeneralSecurity.cs b/Library/GeneralSecurity.cs deleted file mode 100644 index dbe354c..0000000 --- a/Library/GeneralSecurity.cs +++ /dev/null @@ -1,266 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using System.Runtime.InteropServices; -using System.Security; -using System.Security.AccessControl; -using System.Security.Principal; - -namespace Jellyfish.Library -{ - [StructLayout(LayoutKind.Sequential)] - public sealed class SecurityAttributes - { - public SecurityAttributes() - { - _length = Marshal.SizeOf(typeof(SecurityAttributes)); - } - - public int Length { get { return _length; } } - public IntPtr SecurityDescriptor { get { return _securityDescriptor; } set { _securityDescriptor = value; } } - public bool InheritHandle { get { return _inheritHandle; } set { _inheritHandle = value; } } - - private int _length; - private IntPtr _securityDescriptor; - private bool _inheritHandle; - } - - public sealed class GeneralAccessRule : AccessRule - { - public GeneralAccessRule(IdentityReference identity, int rights, AccessControlType type) : - base(identity, rights, false, InheritanceFlags.None, PropagationFlags.None, type) - { - } - - public GeneralAccessRule(IdentityReference identity, int rights, InheritanceFlags inheritance, PropagationFlags propagation, AccessControlType type) : - base(identity, rights, false, inheritance, propagation, type) - { - } - - public GeneralAccessRule(IdentityReference identity, int rights, bool isInherited, InheritanceFlags inheritance, PropagationFlags propagation, AccessControlType type) : - base(identity, rights, isInherited, inheritance, propagation, type) - { - } - - public int AccessRights { get { return AccessMask; } } - } - - public sealed class GeneralAuditRule : AuditRule - { - public GeneralAuditRule(IdentityReference identity, int rights, AuditFlags audit) : - base(identity, rights, false, InheritanceFlags.None, PropagationFlags.None, audit) - { - } - - public GeneralAuditRule(IdentityReference identity, int rights, InheritanceFlags inheritance, PropagationFlags propagation, AuditFlags audit) : - base(identity, rights, false, inheritance, propagation, audit) - { - } - - public GeneralAuditRule(IdentityReference identity, int rights, bool isInherited, InheritanceFlags inheritance, PropagationFlags propagation, AuditFlags audit) : - base(identity, rights, isInherited, inheritance, propagation, audit) - { - } - - public int AccessRights { get { return AccessMask; } } - } - - public sealed class GeneralSecurity : NativeObjectSecurity - { - public GeneralSecurity(bool isContainer, ResourceType resourceType) : - base(isContainer, resourceType) - { - } - - [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] - public GeneralSecurity(bool isContainer, ResourceType resourceType, SafeHandle handle, AccessControlSections includeSections = AccessControlSections.Access | AccessControlSections.Group | AccessControlSections.Owner) : - base(isContainer, resourceType, handle, includeSections) - { - } - - [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] - public GeneralSecurity(bool isContainer, ResourceType resourceType, string name, AccessControlSections includeSections = AccessControlSections.Access | AccessControlSections.Group | AccessControlSections.Owner) : - base(isContainer, resourceType, name, includeSections) - { - } - - public override AccessRule AccessRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type) - { - return new GeneralAccessRule(identityReference, accessMask, isInherited, inheritanceFlags, propagationFlags, type); - } - - public override AuditRule AuditRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags) - { - return new GeneralAuditRule(identityReference, accessMask, isInherited, inheritanceFlags, propagationFlags, flags); - } - - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] - public void AddAccessRule(GeneralAccessRule rule) - { - base.AddAccessRule(rule); - } - - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] - public void AddAuditRule(GeneralAuditRule rule) - { - base.AddAuditRule(rule); - } - - [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] - [SecurityCritical] - public void GetSecurityAttributes(Action action, bool inheritable = false) - { - GetSecurityAttributes(this, action, inheritable); - } - - [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] - [SecurityCritical] - public static void GetSecurityAttributes(ObjectSecurity security, Action action, bool inheritable = false) - { - if (action == null) - { - throw new ArgumentNullException("action"); - } - - if (security != null) - { - GCHandleHelpers.Pin(security.GetSecurityDescriptorBinaryForm(), securityDescriptor => - { - action(new SecurityAttributes() { SecurityDescriptor = securityDescriptor, InheritHandle = inheritable }); - }); - } - else if (inheritable) - { - action(new SecurityAttributes() { InheritHandle = inheritable }); - } - else - { - action(null); - } - } - - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] - public bool RemoveAccessRule(GeneralAccessRule rule) - { - return base.RemoveAccessRule(rule); - } - - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] - public void RemoveAccessRuleAll(GeneralAccessRule rule) - { - base.RemoveAccessRuleAll(rule); - } - - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] - public void RemoveAccessRuleSpecific(GeneralAccessRule rule) - { - base.RemoveAccessRuleSpecific(rule); - } - - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] - public bool RemoveAuditRule(GeneralAuditRule rule) - { - return base.RemoveAuditRule(rule); - } - - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] - public void RemoveAuditRuleAll(GeneralAuditRule rule) - { - base.RemoveAuditRuleAll(rule); - } - - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] - public void RemoveAuditRuleSpecific(GeneralAuditRule rule) - { - base.RemoveAuditRuleSpecific(rule); - } - - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] - public void ResetAccessRule(GeneralAccessRule rule) - { - base.ResetAccessRule(rule); - } - - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] - public void SetAccessRule(GeneralAccessRule rule) - { - base.SetAccessRule(rule); - } - - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] - public void SetAuditRule(GeneralAuditRule rule) - { - base.SetAuditRule(rule); - } - - public void Persist(SafeHandle handle) - { - WriteLock(); - try - { - var sectionsModified = GetAccessControlSectionsModified(); - if (sectionsModified != AccessControlSections.None) - { - Persist(handle, sectionsModified); - ResetAccessControlSectionsModified(); - } - } - finally - { - WriteUnlock(); - } - } - - public void Persist(string name) - { - WriteLock(); - try - { - var sectionsModified = GetAccessControlSectionsModified(); - if (sectionsModified != AccessControlSections.None) - { - Persist(name, sectionsModified); - ResetAccessControlSectionsModified(); - } - } - finally - { - WriteUnlock(); - } - } - - private AccessControlSections GetAccessControlSectionsModified() - { - var sectionsModified = AccessControlSections.None; - if (AccessRulesModified) - { - sectionsModified = AccessControlSections.Access; - } - if (AuditRulesModified) - { - sectionsModified |= AccessControlSections.Audit; - } - if (OwnerModified) - { - sectionsModified |= AccessControlSections.Owner; - } - if (GroupModified) - { - sectionsModified |= AccessControlSections.Group; - } - - return sectionsModified; - } - - private void ResetAccessControlSectionsModified() - { - AccessRulesModified = false; - AuditRulesModified = false; - OwnerModified = false; - GroupModified = false; - } - - public override Type AccessRightType { get { return typeof(int); } } - public override Type AccessRuleType { get { return typeof(GeneralAccessRule); } } - public override Type AuditRuleType { get { return typeof(GeneralAuditRule); } } - } -} diff --git a/Library/Jellyfish.Library.FxCop b/Library/Jellyfish.Library.FxCop deleted file mode 100644 index 8733a56..0000000 --- a/Library/Jellyfish.Library.FxCop +++ /dev/null @@ -1,44 +0,0 @@ - - - - True - $(FxCopDir)\Xml\FxCopReport.xsl - - - - - - True - True - True - 10 - 1 - - False - - True - 120 - True - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Library/Jellyfish.Library.sln b/Library/Jellyfish.Library.sln index cc7449c..29538dd 100644 --- a/Library/Jellyfish.Library.sln +++ b/Library/Jellyfish.Library.sln @@ -1,122 +1,24 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Silverlight", "Silverlight\Jellyfish.Library.Silverlight.csproj", "{99CA7796-B72A-4F8C-BCDB-0D688220A331}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Silverlight.Phone", "Silverlight\Phone\Jellyfish.Library.Silverlight.Phone.csproj", "{D4880706-29A6-449C-A2A6-3058C37583DA}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Wpf", "Wpf\Jellyfish.Library.Wpf.csproj", "{93900841-7250-4D3A-837E-43EE3FD118DC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Xna", "Xna\Jellyfish.Library.Xna.csproj", "{82F56318-A1FD-4078-A42F-06CAB8B97F63}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Xna.Phone", "Xna\Jellyfish.Library.Xna.Phone.csproj", "{46B2BD23-3D45-4268-9979-B9CF136CC982}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Xna.Xbox", "Xna\Jellyfish.Library.Xna.Xbox.csproj", "{222412EE-A626-493F-AE72-344657A6840D}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Windows Phone = Debug|Windows Phone - Debug|x86 = Debug|x86 - Debug|Xbox 360 = Debug|Xbox 360 Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Windows Phone = Release|Windows Phone - Release|x86 = Release|x86 - Release|Xbox 360 = Release|Xbox 360 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Any CPU.Build.0 = Debug|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Windows Phone.ActiveCfg = Debug|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|x86.ActiveCfg = Debug|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Any CPU.ActiveCfg = Release|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Any CPU.Build.0 = Release|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Windows Phone.ActiveCfg = Release|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|x86.ActiveCfg = Release|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Xbox 360.ActiveCfg = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Windows Phone.ActiveCfg = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|x86.ActiveCfg = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Any CPU.Build.0 = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Windows Phone.ActiveCfg = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|x86.ActiveCfg = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Xbox 360.ActiveCfg = Release|Any CPU {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Windows Phone.ActiveCfg = Debug|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|x86.ActiveCfg = Debug|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Any CPU.ActiveCfg = Release|Any CPU {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Any CPU.Build.0 = Release|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Windows Phone.ActiveCfg = Release|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|x86.ActiveCfg = Release|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Xbox 360.ActiveCfg = Release|Any CPU - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Any CPU.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Windows Phone.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Windows Phone.Build.0 = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|x86.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|x86.Build.0 = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Xbox 360.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Xbox 360.Build.0 = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Any CPU.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Mixed Platforms.Build.0 = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Windows Phone.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Windows Phone.Build.0 = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|x86.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|x86.Build.0 = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Xbox 360.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Xbox 360.Build.0 = Release|x86 - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Any CPU.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Mixed Platforms.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Mixed Platforms.Build.0 = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Windows Phone.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Windows Phone.Build.0 = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|x86.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Xbox 360.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Xbox 360.Build.0 = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Any CPU.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Mixed Platforms.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Mixed Platforms.Build.0 = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Windows Phone.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Windows Phone.Build.0 = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|x86.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Xbox 360.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Xbox 360.Build.0 = Release|Windows Phone - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Any CPU.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Mixed Platforms.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Mixed Platforms.Build.0 = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Windows Phone.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|x86.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Xbox 360.Build.0 = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Any CPU.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Mixed Platforms.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Mixed Platforms.Build.0 = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Windows Phone.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|x86.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Xbox 360.Build.0 = Release|Xbox 360 + {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Any CPU.Build.0 = Debug|Any CPU + {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Any CPU.ActiveCfg = Release|Any CPU + {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Library/Lazy.cs b/Library/Lazy.cs deleted file mode 100644 index 22245b9..0000000 --- a/Library/Lazy.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; - -namespace Jellyfish.Library -{ - public sealed class Lazy where T : class - { - public Lazy(Func initializer) - { - _initializer = initializer; - } - - public T Value - { - get - { - if (_value == null) - { - lock (_lock) - { - if (_value == null) - { - _value = _initializer(); - } - } - } - - return _value; - } - } - - private Func _initializer; - private readonly object _lock = new object(); - private volatile T _value; - } -} diff --git a/Library/SafeAllocHandle.cs b/Library/SafeAllocHandle.cs deleted file mode 100644 index d5409a4..0000000 --- a/Library/SafeAllocHandle.cs +++ /dev/null @@ -1,149 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using System.Runtime.ConstrainedExecution; -using System.Runtime.InteropServices; -using System.Security; -using Microsoft.Win32.SafeHandles; - -namespace Jellyfish.Library -{ - [SecurityCritical] - public abstract class SafeAllocHandle : SafeHandleZeroOrMinusOneIsInvalid - { - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - protected SafeAllocHandle(bool ownsHandle) : - base(ownsHandle) - { - } - } - - [SecurityCritical] - public sealed class SafeGlobalAllocHandle : SafeAllocHandle - { - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - public SafeGlobalAllocHandle() : - base(ownsHandle: true) - { - } - - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - public SafeGlobalAllocHandle(IntPtr existingHandle, bool ownsHandle) : - base(ownsHandle) - { - SetHandle(existingHandle); - } - - [SecurityCritical] - public static SafeGlobalAllocHandle Allocate(byte[] value) - { - if (value == null) - { - throw new ArgumentNullException("value"); - } - - var alloc = Allocate(value.Length); - Marshal.Copy(value, 0, alloc.DangerousGetHandle(), value.Length); - - return alloc; - } - - [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] - [SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "flags")] - [SecurityCritical] - public static SafeGlobalAllocHandle Allocate(int size, uint flags = 0x0) - { - var alloc = NativeMethods.GlobalAlloc(flags, (IntPtr)size); - if (alloc.IsInvalid) - { - Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); - } - - return alloc; - } - - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - [SecurityCritical] - protected override bool ReleaseHandle() - { - return (NativeMethods.GlobalFree(handle) == IntPtr.Zero); - } - - [SecurityCritical] - [SuppressUnmanagedCodeSecurity] - private static class NativeMethods - { - [SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage")] - [DllImport("kernel32.dll", SetLastError = true)] - public static extern SafeGlobalAllocHandle GlobalAlloc(uint dwFlags, IntPtr sizetBytes); - - [DllImport("kernel32.dll", SetLastError = true)] - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - public static extern IntPtr GlobalFree(IntPtr hMem); - } - } - - [SecurityCritical] - public sealed class SafeLocalAllocHandle : SafeAllocHandle - { - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - public SafeLocalAllocHandle() : - base(ownsHandle: true) - { - } - - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - public SafeLocalAllocHandle(IntPtr existingHandle, bool ownsHandle) : - base(ownsHandle) - { - SetHandle(existingHandle); - } - - [SecurityCritical] - public static SafeLocalAllocHandle Allocate(byte[] value) - { - if (value == null) - { - throw new ArgumentNullException("value"); - } - - var alloc = Allocate(value.Length); - Marshal.Copy(value, 0, alloc.DangerousGetHandle(), value.Length); - - return alloc; - } - - [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] - [SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "flags")] - [SecurityCritical] - public static SafeLocalAllocHandle Allocate(int size, uint flags = 0x0) - { - var alloc = NativeMethods.LocalAlloc(flags, (IntPtr)size); - if (alloc.IsInvalid) - { - Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); - } - - return alloc; - } - - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - [SecurityCritical] - protected override bool ReleaseHandle() - { - return (NativeMethods.LocalFree(handle) == IntPtr.Zero); - } - - [SecurityCritical] - [SuppressUnmanagedCodeSecurity] - private static class NativeMethods - { - [SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage")] - [DllImport("kernel32.dll", SetLastError = true)] - public static extern SafeLocalAllocHandle LocalAlloc(uint dwFlags, IntPtr sizetBytes); - - [DllImport("kernel32.dll", SetLastError = true)] - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - public static extern IntPtr LocalFree(IntPtr hMem); - } - } -} diff --git a/Library/SafeFileHandle.cs b/Library/SafeFileHandle.cs deleted file mode 100644 index d1d8b2d..0000000 --- a/Library/SafeFileHandle.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Runtime.ConstrainedExecution; -using System.Runtime.InteropServices; -using System.Security; -using System.Security.AccessControl; -using Microsoft.Win32.SafeHandles; - -namespace Jellyfish.Library -{ - [SecurityCritical] - public sealed class SafeFileHandle : SafeHandleZeroOrMinusOneIsInvalid - { - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - public SafeFileHandle() : - base(ownsHandle: true) - { - } - - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - public SafeFileHandle(IntPtr existingHandle, bool ownsHandle) : - base(ownsHandle) - { - SetHandle(existingHandle); - } - - [SecurityCritical] - public static SafeFileHandle CreateFile(string fileName, FileAccess fileAccess, FileShare fileShare, FileMode fileMode, GeneralSecurity fileSecurity) - { - if (fileMode == FileMode.Append) - { - throw new NotImplementedException(); - } - - bool inheritable = ((fileShare & FileShare.Inheritable) != 0); - fileShare &= ~FileShare.Inheritable; - - return CreateFile(fileName, (uint)fileAccess, (uint)fileShare, (uint)fileMode, 0x0, fileSecurity, inheritable); - } - - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - [SecurityCritical] - protected override bool ReleaseHandle() - { - return NativeMethods.CloseHandle(handle); - } - - [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] - public GeneralSecurity GetAccessControl() - { - return new GeneralSecurity(false, ResourceType.FileObject, this); - } - - public void SetAccessControl(GeneralSecurity fileSecurity) - { - if (fileSecurity == null) - { - throw new ArgumentNullException("fileSecurity"); - } - - fileSecurity.Persist(this); - } - - [SecurityCritical] - private static SafeFileHandle CreateFile(string fileName, uint fileAccess, uint fileShare, uint fileMode, uint fileOptions, GeneralSecurity fileSecurity, - bool inheritable = false) - { - var file = new SafeFileHandle(); - - GeneralSecurity.GetSecurityAttributes(fileSecurity, securityAttributes => - { - file = NativeMethods.CreateFile(fileName, fileAccess, fileShare, securityAttributes, fileMode, fileOptions, IntPtr.Zero); - if (file.IsInvalid) - { - Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); - } - }, inheritable); - - return file; - } - - [SecurityCritical] - [SuppressUnmanagedCodeSecurity] - private static class NativeMethods - { - [DllImport("kernel32.dll", SetLastError = true)] - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool CloseHandle(IntPtr handle); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] - public static extern SafeFileHandle CreateFile(string lpFileName, uint dwDesiredAccess, uint dwShareMode, SecurityAttributes lpSecurityAttributes, - uint dwCreationDisposition, uint dwFlagsAndAttributes, IntPtr hTemplateFile); - } - } -} diff --git a/Library/Silverlight/ApplicationBase.cs b/Library/Silverlight/ApplicationBase.cs index 221fc3f..d1c085c 100644 --- a/Library/Silverlight/ApplicationBase.cs +++ b/Library/Silverlight/ApplicationBase.cs @@ -2,11 +2,6 @@ using System.Diagnostics; using System.Text; using System.Windows; -#if WINDOWS_PHONE -using System.Windows.Navigation; -using Microsoft.Phone.Controls; -using Microsoft.Phone.Shell; -#endif namespace Jellyfish.Library { @@ -33,7 +28,6 @@ protected ApplicationBase(string name) } } -#if !WINDOWS_PHONE protected void InitializeOutOfBrowserUpdate() { if (IsRunningOutOfBrowser) @@ -42,20 +36,6 @@ protected void InitializeOutOfBrowserUpdate() CheckAndDownloadUpdateAsync(); } } -#endif - -#if WINDOWS_PHONE - protected void InitializePhoneApplication() - { - if (!_phoneApplicationInitialized) - { - RootFrame = new PhoneApplicationFrame(); - RootFrame.Navigated += OnRootFrameNavigated; - RootFrame.NavigationFailed += OnRootFrameNavigationFailed; - _phoneApplicationInitialized = true; - } - } -#endif private string GetExceptionCaption(string title, bool isTerminating = false) { @@ -73,7 +53,6 @@ private string GetExceptionCaption(string title, bool isTerminating = false) return caption.ToString(); } -#if !WINDOWS_PHONE private void OnApplicationCheckAndDownloadUpdateCompleted(object sender, CheckAndDownloadUpdateCompletedEventArgs e) { if (e.Error != null) @@ -92,7 +71,6 @@ private void OnApplicationCheckAndDownloadUpdateCompleted(object sender, CheckAn MessageBox.Show("An application update was downloaded. Restart the application to run the latest version."); } } -#endif private void OnApplicationUnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) { @@ -112,30 +90,6 @@ private void OnApplicationUnhandledException(object sender, ApplicationUnhandled // } //} -#if WINDOWS_PHONE - private void OnRootFrameNavigated(object sender, NavigationEventArgs e) - { - if (RootVisual != RootFrame) - { - RootVisual = RootFrame; - } - RootFrame.Navigated -= OnRootFrameNavigated; - } - - private void OnRootFrameNavigationFailed(object sender, NavigationFailedEventArgs e) - { - if (Debugger.IsAttached) - { - Debugger.Break(); - } - } -#endif - public string Name { get; private set; } -#if WINDOWS_PHONE - public PhoneApplicationFrame RootFrame { get; private set; } - - private bool _phoneApplicationInitialized; -#endif } } diff --git a/Library/Silverlight/Jellyfish.Library.Silverlight.csproj b/Library/Silverlight/Jellyfish.Library.Silverlight.csproj index 1beb110..87eaadb 100644 --- a/Library/Silverlight/Jellyfish.Library.Silverlight.csproj +++ b/Library/Silverlight/Jellyfish.Library.Silverlight.csproj @@ -68,8 +68,8 @@ - - AssemblyCommentAttribute.cs + + AssemblyMetadataAttribute.cs DispatcherExtensions.cs @@ -90,9 +90,6 @@ MathHelpers.cs - - SingletonFactory.cs - StreamExtensions.cs diff --git a/Library/Silverlight/Jellyfish.Library.Silverlight.sln b/Library/Silverlight/Jellyfish.Library.Silverlight.sln index 8efa74d..4c4bae8 100644 --- a/Library/Silverlight/Jellyfish.Library.Silverlight.sln +++ b/Library/Silverlight/Jellyfish.Library.Silverlight.sln @@ -1,10 +1,8 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Silverlight", "Jellyfish.Library.Silverlight.csproj", "{99CA7796-B72A-4F8C-BCDB-0D688220A331}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Silverlight.Phone", "Phone\Jellyfish.Library.Silverlight.Phone.csproj", "{D4880706-29A6-449C-A2A6-3058C37583DA}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,10 +13,6 @@ Global {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Any CPU.Build.0 = Debug|Any CPU {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Any CPU.ActiveCfg = Release|Any CPU {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Any CPU.Build.0 = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Library/Silverlight/Phone/FrameRateCounter.xaml b/Library/Silverlight/Phone/FrameRateCounter.xaml deleted file mode 100644 index b116f0f..0000000 --- a/Library/Silverlight/Phone/FrameRateCounter.xaml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/Library/Silverlight/Phone/FrameRateCounter.xaml.cs b/Library/Silverlight/Phone/FrameRateCounter.xaml.cs deleted file mode 100644 index 3a91b3d..0000000 --- a/Library/Silverlight/Phone/FrameRateCounter.xaml.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Media; - -namespace Jellyfish.Library -{ - public sealed partial class FrameRateCounter : UserControl - { - public FrameRateCounter() - { - InitializeComponent(); - - CompositionTarget.Rendering += OnCompositionTargetRendering; - } - - private void OnCompositionTargetRendering(object sender, EventArgs e) - { - _frameCount++; - - long time = DateTime.UtcNow.Ticks; - if (time - _lastTime >= TimeSpan.TicksPerSecond) - { - _lastTime = time; - FrameRate = _frameCount; - _frameCount = 0; - } - } - - public static readonly DependencyProperty FrameRateProperty = DependencyProperty.Register("FrameRate", typeof(int), typeof(FrameRateCounter), - new PropertyMetadata(0)); - - public int FrameRate - { - get { return (int)GetValue(FrameRateProperty); } - set { SetValue(FrameRateProperty, value); } - } - - private int _frameCount; - private long _lastTime; - } -} diff --git a/Library/Silverlight/Phone/Jellyfish.Library.Silverlight.Phone.csproj b/Library/Silverlight/Phone/Jellyfish.Library.Silverlight.Phone.csproj deleted file mode 100644 index 914ea03..0000000 --- a/Library/Silverlight/Phone/Jellyfish.Library.Silverlight.Phone.csproj +++ /dev/null @@ -1,131 +0,0 @@ - - - - Debug - AnyCPU - 10.0.20506 - 2.0 - {D4880706-29A6-449C-A2A6-3058C37583DA} - {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Jellyfish.Library - Jellyfish.Library - v4.0 - $(TargetFrameworkVersion) - WindowsPhone - Silverlight - false - true - true - - - true - full - false - bin\ - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE;CODE_ANALYSIS - true - true - prompt - 4 - true - AllRules.ruleset - false - - - pdbonly - true - bin\ - TRACE;SILVERLIGHT;WINDOWS_PHONE;CODE_ANALYSIS - true - true - prompt - 4 - true - AllRules.ruleset - false - - - false - - - ..\..\..\..\Jellyfish\StrongName.snk - - - - - - - - - - - - - AssemblyCommentAttribute.cs - - - DispatcherExtensions.cs - - - DisposableBase.cs - - - GlobalSuppressions.cs - - - IEnumerableExtensions.cs - - - Lazy.cs - - - MathHelpers.cs - - - SingletonFactory.cs - - - StreamExtensions.cs - - - StringBuilderExtensions.cs - - - WaveFormat.cs - - - ApplicationBase.cs - - - WaveMediaStreamSource.cs - - - - FrameRateCounter.xaml - - - - - - MSBuild:Compile - Designer - - - - - CustomDictionary.xml - - - - - - - \ No newline at end of file diff --git a/Library/Silverlight/Phone/Properties/AssemblyInfo.cs b/Library/Silverlight/Phone/Properties/AssemblyInfo.cs deleted file mode 100644 index 915a683..0000000 --- a/Library/Silverlight/Phone/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Reflection; -using System.Resources; -using System.Runtime.InteropServices; -using Jellyfish.Library; - -[assembly: AssemblyTitle("Library")] -[assembly: AssemblyDescription("Common Library")] -[assembly: AssemblyProduct("Jellyfish.Library.Silverlight.Phone")] -[assembly: AssemblyCompany("Digital Jellyfish Design Ltd")] -[assembly: AssemblyCopyright("Copyright © 2009-2012 Digital Jellyfish Design Ltd")] -[assembly: AssemblyComment("Developed by Sean Fausett")] - -[assembly: AssemblyVersion("0.3.0.0")] -[assembly: AssemblyFileVersion("0.3.0.0")] -[assembly: AssemblyInformationalVersion("0.3.0.0")] - -[assembly: CLSCompliant(false)] -[assembly: ComVisible(false)] -[assembly: Guid("66034b9e-9f0b-47b0-aac4-cade9a748891")] - -[assembly: NeutralResourcesLanguage("en")] diff --git a/Library/Silverlight/Phone/StringFormatConverter.cs b/Library/Silverlight/Phone/StringFormatConverter.cs deleted file mode 100644 index ecb203a..0000000 --- a/Library/Silverlight/Phone/StringFormatConverter.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; - -namespace Jellyfish.Library -{ - public sealed class StringFormatConverter : IValueConverter // SL is missing Binding.StringFormat - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (targetType != typeof(string)) - { - return DependencyProperty.UnsetValue; - } - - if (value == null) - { - return string.Empty; - } - - string format = parameter as string; - if (!string.IsNullOrEmpty(format)) - { - if (format.IndexOf('{') < 0) - { - format = "{0:" + format + "}"; - } - - return string.Format(culture, format, value); - } - - return value.ToString(); - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return DependencyProperty.UnsetValue; // one way only - } - } -} diff --git a/Library/Silverlight/Properties/AssemblyInfo.cs b/Library/Silverlight/Properties/AssemblyInfo.cs index 425d974..3e6b2b3 100644 --- a/Library/Silverlight/Properties/AssemblyInfo.cs +++ b/Library/Silverlight/Properties/AssemblyInfo.cs @@ -9,11 +9,11 @@ [assembly: AssemblyProduct("Jellyfish.Library.Silverlight")] [assembly: AssemblyCompany("Digital Jellyfish Design Ltd")] [assembly: AssemblyCopyright("Copyright © 2009-2012 Digital Jellyfish Design Ltd")] -[assembly: AssemblyComment("Developed by Sean Fausett")] +[assembly: AssemblyMetadata("Developer", "Sean Fausett")] -[assembly: AssemblyVersion("0.3.0.0")] -[assembly: AssemblyFileVersion("0.3.0.0")] -[assembly: AssemblyInformationalVersion("0.3.0.0")] +[assembly: AssemblyVersion("0.4.0.0")] +[assembly: AssemblyFileVersion("0.4.0.0")] +[assembly: AssemblyInformationalVersion("0.4.0.0")] [assembly: CLSCompliant(false)] [assembly: ComVisible(false)] diff --git a/Library/SingletonFactory.cs b/Library/SingletonFactory.cs deleted file mode 100644 index 66e91fb..0000000 --- a/Library/SingletonFactory.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -namespace Jellyfish.Library -{ - public static class SingletonFactory where T : class, new() - { - [SuppressMessage("Microsoft.Design", "CA1000:DoNotDeclareStaticMembersOnGenericTypes")] - public static T Create() - { - return _instance; - } - - [SuppressMessage("Microsoft.Design", "CA1000:DoNotDeclareStaticMembersOnGenericTypes")] - public static T Instance { get { return _instance; } } - - private static readonly T _instance = new T(); - } -} diff --git a/Library/StringBuilderExtensions.cs b/Library/StringBuilderExtensions.cs index d00a7cd..5935c60 100644 --- a/Library/StringBuilderExtensions.cs +++ b/Library/StringBuilderExtensions.cs @@ -49,20 +49,6 @@ public static StringBuilder AppendWithoutGarbage(this StringBuilder builder, int return builder; } -#if WINDOWS_PHONE || XBOX - public static StringBuilder Clear(this StringBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException("builder"); - } - - builder.Length = 0; - - return builder; - } -#endif - private static readonly char[] Digits = new char[] { '9', '8', '7', '6', '5', '4', '3', '2', '1', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; } } diff --git a/Library/Wpf/Jellyfish.Library.Wpf.csproj b/Library/Wpf/Jellyfish.Library.Wpf.csproj index f26e716..4351007 100644 --- a/Library/Wpf/Jellyfish.Library.Wpf.csproj +++ b/Library/Wpf/Jellyfish.Library.Wpf.csproj @@ -10,9 +10,8 @@ Properties Jellyfish.Library Jellyfish.Library - v4.0 + v4.5 512 - Client true @@ -54,9 +53,6 @@ - - AssemblyCommentAttribute.cs - DirectSound.cs @@ -76,9 +72,6 @@ GCHandleHelpers.cs - - GeneralSecurity.cs - GlobalSuppressions.cs @@ -91,15 +84,6 @@ MathHelpers.cs - - SafeAllocHandle.cs - - - SafeFileHandle.cs - - - SingletonFactory.cs - StreamExtensions.cs diff --git a/Library/Wpf/Jellyfish.Library.Wpf.sln b/Library/Wpf/Jellyfish.Library.Wpf.sln index 5652dbd..063cef4 100644 --- a/Library/Wpf/Jellyfish.Library.Wpf.sln +++ b/Library/Wpf/Jellyfish.Library.Wpf.sln @@ -1,6 +1,6 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Wpf", "Jellyfish.Library.Wpf.csproj", "{93900841-7250-4D3A-837E-43EE3FD118DC}" EndProject Global diff --git a/Library/Wpf/Properties/AssemblyInfo.cs b/Library/Wpf/Properties/AssemblyInfo.cs index 7294c8f..614c061 100644 --- a/Library/Wpf/Properties/AssemblyInfo.cs +++ b/Library/Wpf/Properties/AssemblyInfo.cs @@ -9,11 +9,11 @@ [assembly: AssemblyProduct("Jellyfish.Library.Wpf")] [assembly: AssemblyCompany("Digital Jellyfish Design Ltd")] [assembly: AssemblyCopyright("Copyright © 2009-2012 Digital Jellyfish Design Ltd")] -[assembly: AssemblyComment("Developed by Sean Fausett")] +[assembly: AssemblyMetadata("Developer", "Sean Fausett")] -[assembly: AssemblyVersion("0.3.0.0")] -[assembly: AssemblyFileVersion("0.3.0.0")] -[assembly: AssemblyInformationalVersion("0.3.0.0")] +[assembly: AssemblyVersion("0.4.0.0")] +[assembly: AssemblyFileVersion("0.4.0.0")] +[assembly: AssemblyInformationalVersion("0.4.0.0")] [assembly: CLSCompliant(false)] [assembly: ComVisible(false)] diff --git a/Library/XmlSerializerHelpers.cs b/Library/XmlSerializerHelpers.cs deleted file mode 100644 index 971e3a0..0000000 --- a/Library/XmlSerializerHelpers.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Xml; -using System.Xml.Serialization; - -namespace Jellyfish.Library -{ - public static class XmlSerializerHelpers - { - [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")] - [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] - public static T Deserialize(Stream stream, string defaultNamespace = null) - { - using (var reader = XmlReader.Create(stream)) - { - var serializer = new XmlSerializer(typeof(T), defaultNamespace); - return (T)serializer.Deserialize(reader); - } - } - - [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] - public static void Serialize(Stream stream, T instance, string defaultNamespace = null) - { - using (var writer = XmlWriter.Create(stream)) - { - var serializer = new XmlSerializer(typeof(T), defaultNamespace); - serializer.Serialize(writer, instance); - } - } - } -} diff --git a/Library/Xna/FrameRateCounter.cs b/Library/Xna/FrameRateCounter.cs deleted file mode 100644 index 12e567b..0000000 --- a/Library/Xna/FrameRateCounter.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using System.Text; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; - -namespace Jellyfish.Library -{ - public sealed class FrameRateCounter : DrawableGameComponent - { - public FrameRateCounter(GameBase game) : - base(game) - { - FontColor = Color.White; - FontName = "Default"; - } - - protected override void LoadContent() - { - _spriteBatch = new SpriteBatch(GraphicsDevice); - _spriteFont = Game.Content.Load(FontName); - - var titleSafeArea = Game.GraphicsDevice.Viewport.TitleSafeArea; - Position = new Vector2(titleSafeArea.X, titleSafeArea.Y); - } - - [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] - public override void Draw(GameTime gameTime) - { - _frameCount++; - - _frameRateBuilder.Clear().AppendWithoutGarbage(_frameRate).Append(" fps"); - - _spriteBatch.Begin(); - //_spriteBatch.DrawString(_spriteFont, _frameRateBuilder, Position - Vector2.UnitX, Color.Black); // rough outline - //_spriteBatch.DrawString(_spriteFont, _frameRateBuilder, Position + Vector2.UnitX, Color.Black); - //_spriteBatch.DrawString(_spriteFont, _frameRateBuilder, Position - Vector2.UnitY, Color.Black); - //_spriteBatch.DrawString(_spriteFont, _frameRateBuilder, Position + Vector2.UnitY, Color.Black); - _spriteBatch.DrawString(_spriteFont, _frameRateBuilder, Position, FontColor); - _spriteBatch.End(); - } - - [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] - public override void Update(GameTime gameTime) - { - if (gameTime == null) - { - throw new ArgumentNullException("gameTime"); - } - - _elapsedTime += gameTime.ElapsedGameTime.Ticks; - - if (_elapsedTime >= TimeSpan.TicksPerSecond) - { - _elapsedTime -= TimeSpan.TicksPerSecond; - _frameRate = _frameCount; - _frameCount = 0; - } - } - - public Color FontColor { get; set; } - public string FontName { get; set; } - public Vector2 Position { get; set; } - - private SpriteBatch _spriteBatch; - private SpriteFont _spriteFont; - private long _elapsedTime; - private int _frameCount; - private int _frameRate; - private StringBuilder _frameRateBuilder = new StringBuilder(); // cache builder; avoids garbage - } -} diff --git a/Library/Xna/GameBase.cs b/Library/Xna/GameBase.cs deleted file mode 100644 index 3f4266d..0000000 --- a/Library/Xna/GameBase.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Threading; -using Microsoft.Xna.Framework; -#if XBOX -using Microsoft.Xna.Framework.GamerServices; -#endif -using Microsoft.Xna.Framework.Graphics; -using Microsoft.Xna.Framework.Input; - -namespace Jellyfish.Library -{ - public abstract class GameBase : Game - { - protected GameBase(string name) - { - Name = name; - - Content.RootDirectory = "Content"; - GraphicsDeviceManager = new GraphicsDeviceManager(this); -#if WINDOWS_PHONE - GraphicsDeviceManager.IsFullScreen = true; - GraphicsDeviceManager.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight; - TargetElapsedTime = TimeSpan.FromTicks(333333); // 30 fps -#elif XBOX - GraphicsDeviceManager.IsFullScreen = true; - Components.Add(new GamerServicesComponent(this)); -#elif WINDOWS - SynchronizationContext = new System.Windows.Forms.WindowsFormsSynchronizationContext(); -#endif - GraphicsDeviceService = (IGraphicsDeviceService)Services.GetService(typeof(IGraphicsDeviceService)); - - if (!string.IsNullOrEmpty(Name)) - { - Window.Title = Name; - } - } - - public string Name { get; private set; } - public GraphicsDeviceManager GraphicsDeviceManager { get; private set; } - public IGraphicsDeviceService GraphicsDeviceService { get; private set; } -#if WINDOWS - public SynchronizationContext SynchronizationContext { get; private set; } -#endif - } -} diff --git a/Library/Xna/Jellyfish.Library.Xna.Phone.csproj b/Library/Xna/Jellyfish.Library.Xna.Phone.csproj deleted file mode 100644 index c20f8d8..0000000 --- a/Library/Xna/Jellyfish.Library.Xna.Phone.csproj +++ /dev/null @@ -1,138 +0,0 @@ - - - - {46B2BD23-3D45-4268-9979-B9CF136CC982} - {6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Debug - Windows Phone - Library - Properties - Jellyfish.Library - Jellyfish.Library - v4.0 - Client - v4.0 - Windows Phone - Reach - f1d4203f-e8dd-43ff-81b2-e4562d3ae0b6 - Library - - - true - full - false - bin\Windows Phone\ - DEBUG;TRACE;WINDOWS_PHONE;CODE_ANALYSIS - prompt - 4 - true - false - true - true - AllRules.ruleset - false - default - - - pdbonly - true - bin\Windows Phone\ - TRACE;WINDOWS_PHONE;CODE_ANALYSIS - prompt - 4 - true - false - true - true - AllRules.ruleset - false - default - - - false - - - ..\..\..\Jellyfish\StrongName.snk - - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - 4.0 - False - - - False - - - - - AssemblyCommentAttribute.cs - - - DisposableBase.cs - - - GlobalSuppressions.cs - - - IEnumerableExtensions.cs - - - Lazy.cs - - - MathHelpers.cs - - - SingletonFactory.cs - - - StreamExtensions.cs - - - StringBuilderExtensions.cs - - - - - - - - - - - - CustomDictionary.xml - - - - - - \ No newline at end of file diff --git a/Library/Xna/Jellyfish.Library.Xna.Xbox.csproj b/Library/Xna/Jellyfish.Library.Xna.Xbox.csproj deleted file mode 100644 index 6bc6db0..0000000 --- a/Library/Xna/Jellyfish.Library.Xna.Xbox.csproj +++ /dev/null @@ -1,153 +0,0 @@ - - - - {222412EE-A626-493F-AE72-344657A6840D} - {6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Debug - Xbox 360 - Library - Properties - Jellyfish.Library - Jellyfish.Library - v4.0 - Client - v4.0 - Xbox 360 - Reach - f1d4203f-e8dd-43ff-81b2-e4562d3ae0b6 - Library - - - true - full - false - bin\Xbox 360\ - DEBUG;TRACE;XBOX;XBOX360;CODE_ANALYSIS - prompt - 4 - true - false - true - true - AllRules.ruleset - false - default - - - pdbonly - true - bin\Xbox 360\ - TRACE;XBOX;XBOX360;CODE_ANALYSIS - prompt - 4 - true - false - true - true - AllRules.ruleset - false - default - - - false - - - ..\..\..\Jellyfish\StrongName.snk - - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - 4.0 - False - - - False - - - - - AssemblyCommentAttribute.cs - - - DisposableBase.cs - - - GlobalSuppressions.cs - - - IEnumerableExtensions.cs - - - Lazy.cs - - - MathHelpers.cs - - - SingletonFactory.cs - - - StreamExtensions.cs - - - StringBuilderExtensions.cs - - - - - - - - - - - - CustomDictionary.xml - - - - - - \ No newline at end of file diff --git a/Library/Xna/Jellyfish.Library.Xna.csproj b/Library/Xna/Jellyfish.Library.Xna.csproj deleted file mode 100644 index 7deeeb4..0000000 --- a/Library/Xna/Jellyfish.Library.Xna.csproj +++ /dev/null @@ -1,168 +0,0 @@ - - - - {82F56318-A1FD-4078-A42F-06CAB8B97F63} - {6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Debug - x86 - Library - Properties - Jellyfish.Library - Jellyfish.Library - v4.0 - Client - v4.0 - Windows - Reach - f1d4203f-e8dd-43ff-81b2-e4562d3ae0b6 - Library - - - true - full - false - bin\x86\ - DEBUG;TRACE;WINDOWS;CODE_ANALYSIS - prompt - 4 - true - false - x86 - true - true - AllRules.ruleset - false - - - pdbonly - true - bin\x86\ - TRACE;WINDOWS;CODE_ANALYSIS - prompt - 4 - true - false - x86 - true - true - AllRules.ruleset - false - - - false - - - ..\..\..\Jellyfish\StrongName.snk - - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - 4.0 - False - - - False - - - False - - - - - AssemblyCommentAttribute.cs - - - DisposableBase.cs - - - GCHandleHelpers.cs - - - GeneralSecurity.cs - - - GlobalSuppressions.cs - - - IEnumerableExtensions.cs - - - MarshalHelpers.cs - - - MathHelpers.cs - - - SafeAllocHandle.cs - - - SafeFileHandle.cs - - - SingletonFactory.cs - - - StreamExtensions.cs - - - StringBuilderExtensions.cs - - - - - - - - - - - - CustomDictionary.xml - - - - - - \ No newline at end of file diff --git a/Library/Xna/Jellyfish.Library.Xna.sln b/Library/Xna/Jellyfish.Library.Xna.sln deleted file mode 100644 index 9365562..0000000 --- a/Library/Xna/Jellyfish.Library.Xna.sln +++ /dev/null @@ -1,62 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Xna", "Jellyfish.Library.Xna.csproj", "{82F56318-A1FD-4078-A42F-06CAB8B97F63}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Xna.Phone", "Jellyfish.Library.Xna.Phone.csproj", "{46B2BD23-3D45-4268-9979-B9CF136CC982}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Xna.Xbox", "Jellyfish.Library.Xna.Xbox.csproj", "{222412EE-A626-493F-AE72-344657A6840D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Windows Phone = Debug|Windows Phone - Debug|x86 = Debug|x86 - Debug|Xbox 360 = Debug|Xbox 360 - Release|Mixed Platforms = Release|Mixed Platforms - Release|Windows Phone = Release|Windows Phone - Release|x86 = Release|x86 - Release|Xbox 360 = Release|Xbox 360 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Windows Phone.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|x86.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|x86.Build.0 = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Xbox 360.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Mixed Platforms.Build.0 = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Windows Phone.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|x86.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|x86.Build.0 = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Xbox 360.ActiveCfg = Release|x86 - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Mixed Platforms.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Mixed Platforms.Build.0 = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Windows Phone.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Windows Phone.Build.0 = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|x86.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Xbox 360.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Mixed Platforms.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Mixed Platforms.Build.0 = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Windows Phone.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Windows Phone.Build.0 = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|x86.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Xbox 360.ActiveCfg = Release|Windows Phone - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Mixed Platforms.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Mixed Platforms.Build.0 = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Windows Phone.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|x86.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Xbox 360.Build.0 = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Mixed Platforms.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Mixed Platforms.Build.0 = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Windows Phone.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|x86.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Xbox 360.Build.0 = Release|Xbox 360 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Library/Xna/Properties/AssemblyInfo.cs b/Library/Xna/Properties/AssemblyInfo.cs deleted file mode 100644 index ed6d66a..0000000 --- a/Library/Xna/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Reflection; -using System.Resources; -using System.Runtime.InteropServices; -using Jellyfish.Library; - -[assembly: AssemblyTitle("Library")] -[assembly: AssemblyDescription("Common Library")] -#if WINDOWS_PHONE -[assembly: AssemblyProduct("Jellyfish.Library.Xna.Phone")] -#elif XBOX -[assembly: AssemblyProduct("Jellyfish.Library.Xna.Xbox")] -#else -[assembly: AssemblyProduct("Jellyfish.Library.Xna")] -#endif -[assembly: AssemblyCompany("Digital Jellyfish Design Ltd")] -[assembly: AssemblyCopyright("Copyright © 2009-2012 Digital Jellyfish Design Ltd")] -[assembly: AssemblyComment("Developed by Sean Fausett")] - -[assembly: AssemblyVersion("0.3.0.0")] -[assembly: AssemblyFileVersion("0.3.0.0")] -[assembly: AssemblyInformationalVersion("0.3.0.0")] - -[assembly: CLSCompliant(false)] -[assembly: ComVisible(false)] -[assembly: Guid("66034b9e-9f0b-47b0-aac4-cade9a748891")] - -[assembly: NeutralResourcesLanguage("en")] diff --git a/Library/Xna/TouchButton.cs b/Library/Xna/TouchButton.cs deleted file mode 100644 index 7930a63..0000000 --- a/Library/Xna/TouchButton.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Input.Touch; - -namespace Jellyfish.Library -{ - public sealed class TouchButton : TouchRegion - { - public bool HasValue { get { return Touch.HasValue; } } - public bool IsButtonDown { get { var touch = Touch.Value; return ((touch.State == TouchLocationState.Pressed) || (touch.State == TouchLocationState.Moved)); } } - public Vector2 Position { get { return Touch.Value.Position; } } - } -} diff --git a/Library/Xna/TouchJoystick.cs b/Library/Xna/TouchJoystick.cs deleted file mode 100644 index 058572b..0000000 --- a/Library/Xna/TouchJoystick.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Input.Touch; - -namespace Jellyfish.Library -{ - public sealed class TouchJoystick : TouchRegion - { - [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] - public Vector2 GetJoystick() - { - TouchLocation touch; - bool isValid; - if (KeepLast && LastTouch.HasValue) - { - touch = LastTouch.Value; - isValid = (touch.State != TouchLocationState.Invalid); - } - else - { - touch = Touch.Value; - isValid = (touch.State == TouchLocationState.Pressed) || (touch.State == TouchLocationState.Moved); - } - if (isValid) - { - var center = Center; - var joystick = new Vector2((touch.Position.X - center.X) / Radius, (center.Y - touch.Position.Y) / Radius); - if (joystick.LengthSquared() > 1) - { - joystick.Normalize(); - } - return joystick; - } - - return Vector2.Zero; - } - - public void SetRadius(float radius) // scaled - { - Radius = (int)(radius * Math.Min(TouchPanel.DisplayWidth, TouchPanel.DisplayHeight)); - } - - public int Radius { get; set; } - public bool KeepLast { get; set; } - - public Vector2 Center { get { return FirstTouch.Value.Position; } } - public bool HasValue { get { return ((KeepLast && LastTouch.HasValue) || Touch.HasValue); } } - public Vector2 Position { get { return (KeepLast && LastTouch.HasValue) ? LastTouch.Value.Position : Touch.Value.Position; } } - } -} diff --git a/Library/Xna/TouchRegion.cs b/Library/Xna/TouchRegion.cs deleted file mode 100644 index ef0b2bf..0000000 --- a/Library/Xna/TouchRegion.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Input.Touch; - -namespace Jellyfish.Library -{ - public class TouchRegion - { - public void SetBounds(float x, float y, float width, float height) // scaled - { - Bounds = new Rectangle((int)(x * TouchPanel.DisplayWidth), (int)(y * TouchPanel.DisplayHeight), (int)(width * TouchPanel.DisplayWidth), (int)(height * TouchPanel.DisplayHeight)); - } - - public Rectangle Bounds { get; set; } - public int Order { get; set; } - - internal TouchLocation? Touch { get; set; } - internal TouchLocation? FirstTouch { get; set; } - internal TouchLocation? LastTouch { get; set; } - } -} diff --git a/Library/Xna/TouchRegionCollection.cs b/Library/Xna/TouchRegionCollection.cs deleted file mode 100644 index 21c3f58..0000000 --- a/Library/Xna/TouchRegionCollection.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System.Collections.ObjectModel; -using System.Diagnostics.CodeAnalysis; -using Microsoft.Xna.Framework.Input.Touch; - -namespace Jellyfish.Library -{ - public sealed class TouchRegionCollection : Collection - { - public TouchRegionCollection() - { - } - - [SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")] - public void Update(ref TouchCollection touches) - { - for (int i = 0; i < base.Count; i++) - { - base[i].Touch = null; - } - - for (int i = 0; i < touches.Count; i++) - { - var touch = touches[i]; - if (UpdateById(ref touch)) - { - continue; - } - - TouchLocation prevTouch; - if (touch.TryGetPreviousLocation(out prevTouch)) - { - UpdateByPosition(ref prevTouch); - } - else - { - UpdateByPosition(ref touch); - } - } - } - - private bool UpdateById(ref TouchLocation touch) - { - for (int i = 0; i < base.Count; i++) - { - var region = base[i]; - if (region.LastTouch.HasValue && (region.LastTouch.Value.Id == touch.Id)) - { - region.Touch = touch; - region.LastTouch = touch; - return true; - } - } - - return false; - } - - private void UpdateByPosition(ref TouchLocation touch) - { - if ((touch.State == TouchLocationState.Pressed) || (touch.State == TouchLocationState.Moved)) - { - TouchRegion topMostRegion = null; - - for (int i = 0; i < base.Count; i++) - { - var region = base[i]; - if (region.Bounds.Contains((int)touch.Position.X, (int)touch.Position.Y) && ((topMostRegion == null) || (topMostRegion.Order < region.Order))) - { - topMostRegion = region; - } - } - - if ((topMostRegion != null) && !topMostRegion.Touch.HasValue) - { - topMostRegion.Touch = touch; - topMostRegion.FirstTouch = touch; - topMostRegion.LastTouch = touch; - } - } - } - } -} diff --git a/Virtu/CustomDictionary.xml b/Virtu/CustomDictionary.xml index 31c5309..c706f7a 100644 --- a/Virtu/CustomDictionary.xml +++ b/Virtu/CustomDictionary.xml @@ -9,6 +9,7 @@ Annunciator + Cpu Dsk Prg Unpause diff --git a/Virtu/DiskDsk.cs b/Virtu/DiskDsk.cs index 7b2b6f1..90cc81a 100644 --- a/Virtu/DiskDsk.cs +++ b/Virtu/DiskDsk.cs @@ -6,7 +6,7 @@ namespace Jellyfish.Virtu { public enum SectorSkew { None = 0, Dos, ProDos }; - public class DiskDsk : Disk525 + public sealed class DiskDsk : Disk525 { public DiskDsk(string name, byte[] data, bool isWriteProtected, SectorSkew sectorSkew) : base(name, data, isWriteProtected) diff --git a/Virtu/GamePort.cs b/Virtu/GamePort.cs index 1787a4c..1c5320e 100644 --- a/Virtu/GamePort.cs +++ b/Virtu/GamePort.cs @@ -23,9 +23,7 @@ public override void Initialize() _gamePortService = Machine.Services.GetService(); JoystickDeadZone = 0.4f; -#if WINDOWS_PHONE - UseTouch = true; -#endif + InvertPaddles = true; // Raster Blaster SwapPaddles = true; Joystick0TouchX = 0.35f; diff --git a/Virtu/Jellyfish.Virtu.FxCop b/Virtu/Jellyfish.Virtu.FxCop deleted file mode 100644 index 0b7057e..0000000 --- a/Virtu/Jellyfish.Virtu.FxCop +++ /dev/null @@ -1,44 +0,0 @@ - - - - True - $(FxCopDir)\Xml\FxCopReport.xsl - - - - - - True - True - True - 10 - 1 - - False - - True - 120 - True - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Virtu/Jellyfish.Virtu.sln b/Virtu/Jellyfish.Virtu.sln index dbec855..ef948ce 100644 --- a/Virtu/Jellyfish.Virtu.sln +++ b/Virtu/Jellyfish.Virtu.sln @@ -1,228 +1,36 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Silverlight", "..\Library\Silverlight\Jellyfish.Library.Silverlight.csproj", "{99CA7796-B72A-4F8C-BCDB-0D688220A331}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Silverlight.Phone", "..\Library\Silverlight\Phone\Jellyfish.Library.Silverlight.Phone.csproj", "{D4880706-29A6-449C-A2A6-3058C37583DA}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Wpf", "..\Library\Wpf\Jellyfish.Library.Wpf.csproj", "{93900841-7250-4D3A-837E-43EE3FD118DC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Xna", "..\Library\Xna\Jellyfish.Library.Xna.csproj", "{82F56318-A1FD-4078-A42F-06CAB8B97F63}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Xna.Phone", "..\Library\Xna\Jellyfish.Library.Xna.Phone.csproj", "{46B2BD23-3D45-4268-9979-B9CF136CC982}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Xna.Xbox", "..\Library\Xna\Jellyfish.Library.Xna.Xbox.csproj", "{222412EE-A626-493F-AE72-344657A6840D}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Virtu.Silverlight", "Silverlight\Jellyfish.Virtu.Silverlight.csproj", "{F8DB6D3A-807D-4E2D-92D5-469273E088DA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Virtu.Silverlight.Phone", "Silverlight\Phone\Jellyfish.Virtu.Silverlight.Phone.csproj", "{9F1025D2-E23B-4CDC-AC63-150941013963}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Virtu.Wpf", "Wpf\Jellyfish.Virtu.Wpf.csproj", "{C152D47E-BBC1-4C35-8646-465180720A72}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Virtu.Xna", "Xna\Jellyfish.Virtu.Xna.csproj", "{3D0AE444-357F-4986-859F-602CC9BB4EF6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Virtu.Xna.Content", "Xna\Content\Jellyfish.Virtu.Xna.Content.contentproj", "{C138ADC9-8F2B-414A-930D-12B489A96BBB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Virtu.Xna.Phone", "Xna\Jellyfish.Virtu.Xna.Phone.csproj", "{AE4C0489-3A21-4264-BE20-EA6C72B24B2C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Virtu.Xna.Xbox", "Xna\Jellyfish.Virtu.Xna.Xbox.csproj", "{1400371E-AC2E-4BC5-8A52-077616F716C4}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Windows Phone = Debug|Windows Phone - Debug|x86 = Debug|x86 - Debug|Xbox 360 = Debug|Xbox 360 Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Windows Phone = Release|Windows Phone - Release|x86 = Release|x86 - Release|Xbox 360 = Release|Xbox 360 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Any CPU.Build.0 = Debug|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Windows Phone.ActiveCfg = Debug|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|x86.ActiveCfg = Debug|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Any CPU.ActiveCfg = Release|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Any CPU.Build.0 = Release|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Windows Phone.ActiveCfg = Release|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|x86.ActiveCfg = Release|Any CPU - {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Xbox 360.ActiveCfg = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Windows Phone.ActiveCfg = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|x86.ActiveCfg = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Any CPU.Build.0 = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Windows Phone.ActiveCfg = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|x86.ActiveCfg = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Xbox 360.ActiveCfg = Release|Any CPU {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Windows Phone.ActiveCfg = Debug|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|x86.ActiveCfg = Debug|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Any CPU.ActiveCfg = Release|Any CPU {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Any CPU.Build.0 = Release|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Windows Phone.ActiveCfg = Release|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|x86.ActiveCfg = Release|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Xbox 360.ActiveCfg = Release|Any CPU - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Any CPU.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Windows Phone.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|x86.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|x86.Build.0 = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Xbox 360.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Any CPU.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Mixed Platforms.Build.0 = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Windows Phone.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|x86.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|x86.Build.0 = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Xbox 360.ActiveCfg = Release|x86 - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Any CPU.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Mixed Platforms.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Mixed Platforms.Build.0 = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Windows Phone.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Windows Phone.Build.0 = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|x86.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Xbox 360.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Any CPU.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Mixed Platforms.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Mixed Platforms.Build.0 = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Windows Phone.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Windows Phone.Build.0 = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|x86.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Xbox 360.ActiveCfg = Release|Windows Phone - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Any CPU.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Mixed Platforms.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Mixed Platforms.Build.0 = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Windows Phone.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|x86.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Xbox 360.Build.0 = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Any CPU.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Mixed Platforms.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Mixed Platforms.Build.0 = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Windows Phone.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|x86.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Xbox 360.Build.0 = Release|Xbox 360 + {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Any CPU.Build.0 = Debug|Any CPU + {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Any CPU.ActiveCfg = Release|Any CPU + {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Any CPU.Build.0 = Release|Any CPU + {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C152D47E-BBC1-4C35-8646-465180720A72}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C152D47E-BBC1-4C35-8646-465180720A72}.Release|Any CPU.Build.0 = Release|Any CPU {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Debug|Windows Phone.ActiveCfg = Debug|Any CPU - {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Debug|x86.ActiveCfg = Debug|Any CPU - {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Release|Any CPU.ActiveCfg = Release|Any CPU {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Release|Any CPU.Build.0 = Release|Any CPU - {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Release|Windows Phone.ActiveCfg = Release|Any CPU - {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Release|x86.ActiveCfg = Release|Any CPU - {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Release|Xbox 360.ActiveCfg = Release|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Debug|Windows Phone.ActiveCfg = Debug|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Debug|x86.ActiveCfg = Debug|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Release|Any CPU.Build.0 = Release|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Release|Windows Phone.ActiveCfg = Release|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Release|x86.ActiveCfg = Release|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Release|Xbox 360.ActiveCfg = Release|Any CPU - {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|Any CPU.ActiveCfg = Debug|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|Windows Phone.ActiveCfg = Debug|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|x86.ActiveCfg = Debug|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|x86.Build.0 = Debug|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|Xbox 360.ActiveCfg = Debug|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Release|Any CPU.ActiveCfg = Release|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Release|Mixed Platforms.Build.0 = Release|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Release|Windows Phone.ActiveCfg = Release|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Release|x86.ActiveCfg = Release|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Release|x86.Build.0 = Release|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Release|Xbox 360.ActiveCfg = Release|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Debug|Any CPU.ActiveCfg = Debug|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Debug|Windows Phone.ActiveCfg = Debug|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Debug|x86.ActiveCfg = Debug|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Debug|x86.Build.0 = Debug|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Debug|Xbox 360.ActiveCfg = Debug|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Release|Any CPU.ActiveCfg = Release|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Release|Mixed Platforms.Build.0 = Release|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Release|Windows Phone.ActiveCfg = Release|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Release|x86.ActiveCfg = Release|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Release|x86.Build.0 = Release|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Release|Xbox 360.ActiveCfg = Release|x86 - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Debug|Windows Phone.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Debug|x86.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Release|Windows Phone.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Release|x86.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Release|Xbox 360.ActiveCfg = Debug|Any CPU - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|Any CPU.ActiveCfg = Debug|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|Mixed Platforms.ActiveCfg = Debug|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|Mixed Platforms.Build.0 = Debug|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|Windows Phone.ActiveCfg = Debug|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|Windows Phone.Build.0 = Debug|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|Windows Phone.Deploy.0 = Debug|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|x86.ActiveCfg = Debug|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|Xbox 360.ActiveCfg = Debug|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|Any CPU.ActiveCfg = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|Mixed Platforms.ActiveCfg = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|Mixed Platforms.Build.0 = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|Windows Phone.ActiveCfg = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|Windows Phone.Build.0 = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|Windows Phone.Deploy.0 = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|x86.ActiveCfg = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|Xbox 360.ActiveCfg = Release|Windows Phone - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|Any CPU.ActiveCfg = Debug|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|Mixed Platforms.ActiveCfg = Debug|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|Mixed Platforms.Build.0 = Debug|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|Windows Phone.ActiveCfg = Debug|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|x86.ActiveCfg = Debug|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|Xbox 360.Build.0 = Debug|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|Xbox 360.Deploy.0 = Debug|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|Any CPU.ActiveCfg = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|Mixed Platforms.ActiveCfg = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|Mixed Platforms.Build.0 = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|Windows Phone.ActiveCfg = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|x86.ActiveCfg = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|Xbox 360.Build.0 = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|Xbox 360.Deploy.0 = Release|Xbox 360 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Virtu/Machine.cs b/Virtu/Machine.cs index febbb4d..0b66ad8 100644 --- a/Virtu/Machine.cs +++ b/Virtu/Machine.cs @@ -230,7 +230,7 @@ private void Run() // machine thread Uninitialize(); } - public const string Version = "0.9.3.0"; + public const string Version = "0.9.4.0"; public MachineEvents Events { get; private set; } public MachineServices Services { get; private set; } diff --git a/Virtu/Properties/Strings.Designer.cs b/Virtu/Properties/Strings.Designer.cs index cbf407b..c2fae9e 100644 --- a/Virtu/Properties/Strings.Designer.cs +++ b/Virtu/Properties/Strings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.544 +// Runtime Version:4.0.30319.17626 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/Virtu/Services/DebugService.cs b/Virtu/Services/DebugService.cs index 3cf916c..ecdef36 100644 --- a/Virtu/Services/DebugService.cs +++ b/Virtu/Services/DebugService.cs @@ -26,7 +26,7 @@ public void WriteMessage(string format, params object[] args) protected virtual void OnWriteMessage(string message) { -#if SILVERLIGHT || WINDOWS_PHONE || XBOX +#if SILVERLIGHT Debug.WriteLine(message); #else Trace.WriteLine(message); @@ -45,11 +45,7 @@ private string FormatMessage(string format, params object[] args) } catch (FormatException ex) { -#if WINDOWS_PHONE || XBOX - WriteMessage("[DebugService.FormatMessage] format: {0}; exception: {1}", format, ex.Message); -#else WriteMessage("[DebugService.FormatMessage] format: {0}; args: {1}; exception: {2}", format, string.Join(", ", args), ex.Message); -#endif } } else diff --git a/Virtu/Silverlight/Jellyfish.Virtu.Silverlight.sln b/Virtu/Silverlight/Jellyfish.Virtu.Silverlight.sln index 1e0a2a0..0a356c6 100644 --- a/Virtu/Silverlight/Jellyfish.Virtu.Silverlight.sln +++ b/Virtu/Silverlight/Jellyfish.Virtu.Silverlight.sln @@ -1,14 +1,10 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Silverlight", "..\..\Library\Silverlight\Jellyfish.Library.Silverlight.csproj", "{99CA7796-B72A-4F8C-BCDB-0D688220A331}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Silverlight.Phone", "..\..\Library\Silverlight\Phone\Jellyfish.Library.Silverlight.Phone.csproj", "{D4880706-29A6-449C-A2A6-3058C37583DA}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Virtu.Silverlight", "Jellyfish.Virtu.Silverlight.csproj", "{F8DB6D3A-807D-4E2D-92D5-469273E088DA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Virtu.Silverlight.Phone", "Phone\Jellyfish.Virtu.Silverlight.Phone.csproj", "{9F1025D2-E23B-4CDC-AC63-150941013963}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -19,18 +15,10 @@ Global {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Debug|Any CPU.Build.0 = Debug|Any CPU {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Any CPU.ActiveCfg = Release|Any CPU {99CA7796-B72A-4F8C-BCDB-0D688220A331}.Release|Any CPU.Build.0 = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D4880706-29A6-449C-A2A6-3058C37583DA}.Release|Any CPU.Build.0 = Release|Any CPU {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Debug|Any CPU.Build.0 = Debug|Any CPU {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Release|Any CPU.ActiveCfg = Release|Any CPU {F8DB6D3A-807D-4E2D-92D5-469273E088DA}.Release|Any CPU.Build.0 = Release|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9F1025D2-E23B-4CDC-AC63-150941013963}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Virtu/Silverlight/Phone/AppIcon.png b/Virtu/Silverlight/Phone/AppIcon.png deleted file mode 100644 index 1ed11ff..0000000 Binary files a/Virtu/Silverlight/Phone/AppIcon.png and /dev/null differ diff --git a/Virtu/Silverlight/Phone/Background.png b/Virtu/Silverlight/Phone/Background.png deleted file mode 100644 index e94bded..0000000 Binary files a/Virtu/Silverlight/Phone/Background.png and /dev/null differ diff --git a/Virtu/Silverlight/Phone/Jellyfish.Virtu.Silverlight.Phone.csproj b/Virtu/Silverlight/Phone/Jellyfish.Virtu.Silverlight.Phone.csproj deleted file mode 100644 index 9ea1b59..0000000 --- a/Virtu/Silverlight/Phone/Jellyfish.Virtu.Silverlight.Phone.csproj +++ /dev/null @@ -1,262 +0,0 @@ - - - - Debug - AnyCPU - 10.0.20506 - 2.0 - {9F1025D2-E23B-4CDC-AC63-150941013963} - {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Jellyfish.Virtu - Jellyfish.Virtu - v4.0 - $(TargetFrameworkVersion) - WindowsPhone - Silverlight - true - - - true - true - Jellyfish.Virtu.xap - Properties\AppManifest.xml - Jellyfish.Virtu.MainApp - true - true - - - true - full - false - bin\ - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE;CODE_ANALYSIS - true - true - prompt - 4 - true - AllRules.ruleset - false - - - pdbonly - true - bin\ - TRACE;SILVERLIGHT;WINDOWS_PHONE;CODE_ANALYSIS - true - true - prompt - 4 - true - AllRules.ruleset - false - - - false - - - ..\..\..\..\Jellyfish\StrongName.snk - - - false - - - http://timestamp.verisign.com/scripts/timestamp.dll - - - 462E2816DD15CF75ED0DB781E8C7AD957C048679 - - - ..\..\..\..\Jellyfish\CodeSign.pfx - - - - - - - - - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MainApp.xaml - - - MainPage.xaml - - - - - Core\Cassette.cs - - - Core\Cpu.cs - - - Core\CpuData.cs - - - Core\Disk525.cs - - - Core\DiskDsk.cs - - - Core\DiskIIController.cs - - - Core\DiskIIDrive.cs - - - Core\DiskNib.cs - - - Core\GamePort.cs - - - GlobalSuppressions.cs - - - Core\Keyboard.cs - - - Core\Machine.cs - - - Core\MachineComponent.cs - - - Core\MachineEvents.cs - - - Core\Memory.cs - - - Core\MemoryData.cs - - - Core\NoSlotClock.cs - - - Core\PeripheralCard.cs - - - Properties\Strings.Designer.cs - True - True - Strings.resx - - - Services\AudioService.cs - - - Services\DebugService.cs - - - Services\GamePortService.cs - - - Services\IsolatedStorageService.cs - - - Services\KeyboardService.cs - - - Services\MachineService.cs - - - Services\MachineServices.cs - - - Services\StorageService.cs - - - Services\VideoService.cs - - - Core\Speaker.cs - - - Core\Video.cs - - - Core\VideoData.cs - - - Services\SilverlightAudioService.cs - - - Services\SilverlightDebugService.cs - - - Services\SilverlightKeyboardService.cs - - - Services\SilverlightVideoService.cs - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - - - - Properties\Strings.resx - ResXFileCodeGenerator - Strings.Designer.cs - - - - - Disks\Default.dsk - - - Roms\AppleIIe.rom - - - Roms\DiskII.rom - - - - - CustomDictionary.xml - - - - - {D4880706-29A6-449C-A2A6-3058C37583DA} - Jellyfish.Library.Silverlight.Phone - - - - - - - \ No newline at end of file diff --git a/Virtu/Silverlight/Phone/MainApp.xaml b/Virtu/Silverlight/Phone/MainApp.xaml deleted file mode 100644 index b712f40..0000000 --- a/Virtu/Silverlight/Phone/MainApp.xaml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - diff --git a/Virtu/Silverlight/Phone/MainApp.xaml.cs b/Virtu/Silverlight/Phone/MainApp.xaml.cs deleted file mode 100644 index 3586ec0..0000000 --- a/Virtu/Silverlight/Phone/MainApp.xaml.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Jellyfish.Library; - -namespace Jellyfish.Virtu -{ - public sealed partial class MainApp : ApplicationBase - { - public MainApp() : - base("Virtu") - { - InitializeComponent(); - InitializePhoneApplication(); - } - } -} diff --git a/Virtu/Silverlight/Phone/MainPage.xaml b/Virtu/Silverlight/Phone/MainPage.xaml deleted file mode 100644 index ac117c4..0000000 --- a/Virtu/Silverlight/Phone/MainPage.xaml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/Virtu/Silverlight/Phone/MainPage.xaml.cs b/Virtu/Silverlight/Phone/MainPage.xaml.cs deleted file mode 100644 index e9f8f4c..0000000 --- a/Virtu/Silverlight/Phone/MainPage.xaml.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.ComponentModel; -using System.Windows; -using System.Windows.Media; -using Jellyfish.Virtu.Services; -using Microsoft.Phone.Controls; - -namespace Jellyfish.Virtu -{ - public sealed partial class MainPage : PhoneApplicationPage, IDisposable - { - public MainPage() - { - InitializeComponent(); - - if (!DesignerProperties.IsInDesignTool) - { - _debugService = DebugService.Default; - _storageService = new IsolatedStorageService(_machine); - _keyboardService = new SilverlightKeyboardService(_machine, this); - _gamePortService = new GamePortService(_machine); // not connected - _audioService = new SilverlightAudioService(_machine, this, _media); - _videoService = new SilverlightVideoService(_machine, this, _image); - - _machine.Services.AddService(typeof(DebugService), _debugService); - _machine.Services.AddService(typeof(StorageService), _storageService); - _machine.Services.AddService(typeof(KeyboardService), _keyboardService); - _machine.Services.AddService(typeof(GamePortService), _gamePortService); - _machine.Services.AddService(typeof(AudioService), _audioService); - _machine.Services.AddService(typeof(VideoService), _videoService); - - Loaded += (sender, e) => _machine.Start(); - CompositionTarget.Rendering += OnCompositionTargetRendering; - Application.Current.Exit += (sender, e) => _machine.Stop(); - - //_disk1Button.Click += (sender, e) => OnDiskButtonClick(0); // TODO - //_disk2Button.Click += (sender, e) => OnDiskButtonClick(1); - } - } - - public void Dispose() - { - _machine.Dispose(); - _debugService.Dispose(); - _storageService.Dispose(); - _keyboardService.Dispose(); - _gamePortService.Dispose(); - _audioService.Dispose(); - _videoService.Dispose(); - } - - public void WriteMessage(string message) - { - _debugText.Text += message + Environment.NewLine; - _debugScrollViewer.UpdateLayout(); - _debugScrollViewer.ScrollToVerticalOffset(double.MaxValue); - } - - private void OnCompositionTargetRendering(object sender, EventArgs e) - { - _keyboardService.Update(); - _gamePortService.Update(); - _videoService.Update(); - } - - //private void OnDiskButtonClick(int drive) // TODO - //{ - // var dialog = new OpenFileDialog() { Filter = "Disk Files (*.do;*.dsk;*.nib;*.po)|*.do;*.dsk;*.nib;*.po|All Files (*.*)|*.*" }; - // bool? result = dialog.ShowDialog(); - // if (result.HasValue && result.Value) - // { - // _machine.Pause(); - // StorageService.LoadFile(dialog.File, stream => _machine.BootDiskII.Drives[drive].InsertDisk(dialog.File.Name, stream, false)); - // _machine.Unpause(); - // } - //} - - private Machine _machine = new Machine(); - - private DebugService _debugService; - private StorageService _storageService; - private KeyboardService _keyboardService; - private GamePortService _gamePortService; - private AudioService _audioService; - private VideoService _videoService; - } -} diff --git a/Virtu/Silverlight/Phone/Properties/AppManifest.xml b/Virtu/Silverlight/Phone/Properties/AppManifest.xml deleted file mode 100644 index 8bcc1ca..0000000 --- a/Virtu/Silverlight/Phone/Properties/AppManifest.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - diff --git a/Virtu/Silverlight/Phone/Properties/AssemblyInfo.cs b/Virtu/Silverlight/Phone/Properties/AssemblyInfo.cs deleted file mode 100644 index f14c12d..0000000 --- a/Virtu/Silverlight/Phone/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Reflection; -using System.Resources; -using System.Runtime.InteropServices; -using Jellyfish.Library; -using Jellyfish.Virtu; - -[assembly: AssemblyTitle("Virtu")] -[assembly: AssemblyDescription("Apple IIe Emulator")] -[assembly: AssemblyProduct("Jellyfish.Virtu.Silverlight.Phone")] -[assembly: AssemblyCompany("Digital Jellyfish Design Ltd")] -[assembly: AssemblyCopyright("Copyright © 1995-2012 Digital Jellyfish Design Ltd")] -[assembly: AssemblyComment("Developed by Sean Fausett & Nick Westgate")] - -[assembly: AssemblyVersion(Machine.Version)] -[assembly: AssemblyFileVersion(Machine.Version)] -[assembly: AssemblyInformationalVersion(Machine.Version)] - -[assembly: CLSCompliant(false)] -[assembly: ComVisible(false)] -[assembly: Guid("89a50370-1ed9-4cf1-ad08-043b6e6f3c90")] - -[assembly: NeutralResourcesLanguage("en")] diff --git a/Virtu/Silverlight/Phone/Properties/WMAppManifest.xml b/Virtu/Silverlight/Phone/Properties/WMAppManifest.xml deleted file mode 100644 index 9d4dcbe..0000000 --- a/Virtu/Silverlight/Phone/Properties/WMAppManifest.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - AppIcon.png - - - - - - - - - - - - - - - - - - - - Background.png - 0 - Virtu - - - - - diff --git a/Virtu/Silverlight/Phone/SplashScreenImage.jpg b/Virtu/Silverlight/Phone/SplashScreenImage.jpg deleted file mode 100644 index 353b192..0000000 Binary files a/Virtu/Silverlight/Phone/SplashScreenImage.jpg and /dev/null differ diff --git a/Virtu/Silverlight/Properties/AssemblyInfo.cs b/Virtu/Silverlight/Properties/AssemblyInfo.cs index 471d9ed..037c342 100644 --- a/Virtu/Silverlight/Properties/AssemblyInfo.cs +++ b/Virtu/Silverlight/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyProduct("Jellyfish.Virtu.Silverlight")] [assembly: AssemblyCompany("Digital Jellyfish Design Ltd")] [assembly: AssemblyCopyright("Copyright © 1995-2012 Digital Jellyfish Design Ltd")] -[assembly: AssemblyComment("Developed by Sean Fausett & Nick Westgate")] +[assembly: AssemblyMetadata("Developers", "Sean Fausett & Nick Westgate")] [assembly: AssemblyVersion(Machine.Version)] [assembly: AssemblyFileVersion(Machine.Version)] diff --git a/Virtu/Silverlight/Services/SilverlightAudioService.cs b/Virtu/Silverlight/Services/SilverlightAudioService.cs index f254b8c..c64f4e4 100644 --- a/Virtu/Silverlight/Services/SilverlightAudioService.cs +++ b/Virtu/Silverlight/Services/SilverlightAudioService.cs @@ -23,9 +23,7 @@ public SilverlightAudioService(Machine machine, UserControl page, MediaElement m _media.SetSource(_mediaSource); page.Loaded += (sender, e) => _media.Play(); -#if !WINDOWS_PHONE page.Unloaded += (sender, e) => _media.Stop(); -#endif } public override void SetVolume(float volume) diff --git a/Virtu/Silverlight/Services/SilverlightKeyboardService.cs b/Virtu/Silverlight/Services/SilverlightKeyboardService.cs index b7131e2..208ed41 100644 --- a/Virtu/Silverlight/Services/SilverlightKeyboardService.cs +++ b/Virtu/Silverlight/Services/SilverlightKeyboardService.cs @@ -99,12 +99,10 @@ private void OnPageKeyUp(object sender, KeyEventArgs e) { Machine.Video.IsMonochrome ^= true; } -#if !WINDOWS_PHONE else if (control && (e.Key == Key.Subtract)) { Machine.Video.IsFullScreen ^= true; } -#endif Update(); } @@ -303,7 +301,7 @@ private int GetAsciiKey(Key key, int platformKeyCode) return shift ? '>' : '.'; } break; -#if !WINDOWS_PHONE + case PlatformID.MacOSX: switch (platformKeyCode) { @@ -341,7 +339,7 @@ private int GetAsciiKey(Key key, int platformKeyCode) return shift ? '>' : '.'; } break; -#endif + case PlatformID.Unix: switch (platformKeyCode) { diff --git a/Virtu/Silverlight/Services/SilverlightVideoService.cs b/Virtu/Silverlight/Services/SilverlightVideoService.cs index 36d4613..da8b4e0 100644 --- a/Virtu/Silverlight/Services/SilverlightVideoService.cs +++ b/Virtu/Silverlight/Services/SilverlightVideoService.cs @@ -4,9 +4,6 @@ using System.Windows.Controls; using System.Windows.Media.Imaging; using Jellyfish.Library; -#if WINDOWS_PHONE -using Microsoft.Phone.Controls; -#endif namespace Jellyfish.Virtu.Services { @@ -28,17 +25,12 @@ public SilverlightVideoService(Machine machine, UserControl page, Image image) : _image = image; _image.Source = _bitmap; -#if !WINDOWS_PHONE _page.LayoutUpdated += (sender, e) => SetWindowSizeToContent(); -#else - ((PhoneApplicationPage)_page).OrientationChanged += (sender, e) => SetImageSize(swapOrientation: (e.Orientation & PageOrientation.Landscape) != 0); -#endif _page.SizeChanged += (sender, e) => SetImageSize(); } public override void SetFullScreen(bool isFullScreen) { -#if !WINDOWS_PHONE _page.Dispatcher.Send(() => { var application = Application.Current; @@ -51,7 +43,6 @@ public override void SetFullScreen(bool isFullScreen) } } }); -#endif } [SuppressMessage("Microsoft.Usage", "CA2233:OperationsShouldNotOverflow")] @@ -82,7 +73,6 @@ private void SetImageSize(bool swapOrientation = false) _image.Height = uniformScale * BitmapHeight; } -#if !WINDOWS_PHONE private void SetWindowSizeToContent() { var application = Application.Current; @@ -95,7 +85,6 @@ private void SetWindowSizeToContent() window.Height = size.Height; } } -#endif private const int BitmapWidth = 560; private const int BitmapHeight = 384; @@ -105,8 +94,6 @@ private void SetWindowSizeToContent() private WriteableBitmap _bitmap = new WriteableBitmap(BitmapWidth, BitmapHeight); private int[] _pixels = new int[BitmapWidth * BitmapHeight]; private bool _pixelsDirty; -#if !WINDOWS_PHONE private bool _sizedToContent; -#endif } } diff --git a/Virtu/Speaker.cs b/Virtu/Speaker.cs index 189d8fb..e1cf991 100644 --- a/Virtu/Speaker.cs +++ b/Virtu/Speaker.cs @@ -16,11 +16,7 @@ public override void Initialize() { _audioService = Machine.Services.GetService(); -#if WINDOWS_PHONE - Volume = 0.85f; -#else Volume = 0.5f; -#endif Machine.Events.AddEvent(CyclesPerFlush * Machine.Cpu.Multiplier, _flushOutputEvent); } diff --git a/Virtu/Wpf/Jellyfish.Virtu.Wpf.csproj b/Virtu/Wpf/Jellyfish.Virtu.Wpf.csproj index 16f6a17..49d8bda 100644 --- a/Virtu/Wpf/Jellyfish.Virtu.Wpf.csproj +++ b/Virtu/Wpf/Jellyfish.Virtu.Wpf.csproj @@ -2,7 +2,7 @@ Debug - x86 + AnyCPU 8.0.30703 2.0 {C152D47E-BBC1-4C35-8646-465180720A72} @@ -10,15 +10,14 @@ Properties Jellyfish.Virtu Jellyfish.Virtu - v4.0 - Client + v4.5 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 AppIcon.ico - - x86 + + AnyCPU true full false @@ -29,11 +28,9 @@ true AllRules.ruleset false - - - - x86 + + AnyCPU pdbonly true bin\ @@ -43,8 +40,6 @@ true AllRules.ruleset false - - Jellyfish.Virtu.MainApp diff --git a/Virtu/Wpf/Jellyfish.Virtu.Wpf.sln b/Virtu/Wpf/Jellyfish.Virtu.Wpf.sln index 151513f..0e69568 100644 --- a/Virtu/Wpf/Jellyfish.Virtu.Wpf.sln +++ b/Virtu/Wpf/Jellyfish.Virtu.Wpf.sln @@ -1,6 +1,6 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Wpf", "..\..\Library\Wpf\Jellyfish.Library.Wpf.csproj", "{93900841-7250-4D3A-837E-43EE3FD118DC}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Virtu.Wpf", "Jellyfish.Virtu.Wpf.csproj", "{C152D47E-BBC1-4C35-8646-465180720A72}" @@ -8,33 +8,17 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Debug|x86.ActiveCfg = Debug|Any CPU {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Any CPU.ActiveCfg = Release|Any CPU {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Any CPU.Build.0 = Release|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {93900841-7250-4D3A-837E-43EE3FD118DC}.Release|x86.ActiveCfg = Release|Any CPU - {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|Any CPU.ActiveCfg = Debug|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|x86.ActiveCfg = Debug|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|x86.Build.0 = Debug|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Release|Any CPU.ActiveCfg = Release|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Release|Mixed Platforms.Build.0 = Release|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Release|x86.ActiveCfg = Release|x86 - {C152D47E-BBC1-4C35-8646-465180720A72}.Release|x86.Build.0 = Release|x86 + {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C152D47E-BBC1-4C35-8646-465180720A72}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C152D47E-BBC1-4C35-8646-465180720A72}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C152D47E-BBC1-4C35-8646-465180720A72}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Virtu/Wpf/MainApp.xaml.cs b/Virtu/Wpf/MainApp.xaml.cs index 9d01f58..af1ea1d 100644 --- a/Virtu/Wpf/MainApp.xaml.cs +++ b/Virtu/Wpf/MainApp.xaml.cs @@ -1,11 +1,11 @@ -using System.Security.Permissions; +using System.Security; using Jellyfish.Library; namespace Jellyfish.Virtu { public sealed partial class MainApp : ApplicationBase { - [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] + [SecurityCritical] public MainApp() : base("Virtu") { diff --git a/Virtu/Wpf/Properties/AssemblyInfo.cs b/Virtu/Wpf/Properties/AssemblyInfo.cs index 63393b3..198f9bc 100644 --- a/Virtu/Wpf/Properties/AssemblyInfo.cs +++ b/Virtu/Wpf/Properties/AssemblyInfo.cs @@ -11,7 +11,7 @@ [assembly: AssemblyProduct("Jellyfish.Virtu.Wpf")] [assembly: AssemblyCompany("Digital Jellyfish Design Ltd")] [assembly: AssemblyCopyright("Copyright © 1995-2012 Digital Jellyfish Design Ltd")] -[assembly: AssemblyComment("Developed by Sean Fausett & Nick Westgate")] +[assembly: AssemblyMetadata("Developers", "Sean Fausett & Nick Westgate")] [assembly: AssemblyVersion(Machine.Version)] [assembly: AssemblyFileVersion(Machine.Version)] diff --git a/Virtu/Xna/App.config b/Virtu/Xna/App.config deleted file mode 100644 index 779d88d..0000000 --- a/Virtu/Xna/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/Virtu/Xna/AppIcon.ico b/Virtu/Xna/AppIcon.ico deleted file mode 100644 index e07564d..0000000 Binary files a/Virtu/Xna/AppIcon.ico and /dev/null differ diff --git a/Virtu/Xna/AppThumbnail.png b/Virtu/Xna/AppThumbnail.png deleted file mode 100644 index 9f54bda..0000000 Binary files a/Virtu/Xna/AppThumbnail.png and /dev/null differ diff --git a/Virtu/Xna/Background.png b/Virtu/Xna/Background.png deleted file mode 100644 index e94bded..0000000 Binary files a/Virtu/Xna/Background.png and /dev/null differ diff --git a/Virtu/Xna/Content/Consolas.spritefont b/Virtu/Xna/Content/Consolas.spritefont deleted file mode 100644 index e9bee31..0000000 --- a/Virtu/Xna/Content/Consolas.spritefont +++ /dev/null @@ -1,17 +0,0 @@ - - - - Consolas - 12 - 0 - true - - * - - - - ~ - - - - diff --git a/Virtu/Xna/Content/Jellyfish.Virtu.Xna.Content.contentproj b/Virtu/Xna/Content/Jellyfish.Virtu.Xna.Content.contentproj deleted file mode 100644 index 3566f98..0000000 --- a/Virtu/Xna/Content/Jellyfish.Virtu.Xna.Content.contentproj +++ /dev/null @@ -1,56 +0,0 @@ - - - - {C138ADC9-8F2B-414A-930D-12B489A96BBB} - {96E2B04D-8817-42c6-938A-82C39BA4D311};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Debug - x86 - Library - Properties - v4.0 - v4.0 - bin\$(Platform)\$(Configuration) - Content - - - Jellyfish.Virtu.Xna.Content - - - AllRules.ruleset - - - - False - - - False - - - False - - - False - - - False - - - False - - - - - Consolas - FontDescriptionImporter - FontDescriptionProcessor - - - - - \ No newline at end of file diff --git a/Virtu/Xna/Jellyfish.Virtu.Xna.Phone.csproj b/Virtu/Xna/Jellyfish.Virtu.Xna.Phone.csproj deleted file mode 100644 index 75b79de..0000000 --- a/Virtu/Xna/Jellyfish.Virtu.Xna.Phone.csproj +++ /dev/null @@ -1,270 +0,0 @@ - - - - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C} - {6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Debug - Windows Phone - Library - Properties - Jellyfish.Virtu - Jellyfish.Virtu - v4.0 - Client - v4.0 - Windows Phone - Reach - 48ae3b16-efe9-4694-85f0-23da456b4bc4 - Game - $(AssemblyName).xap - Properties\AppManifest.xml - Properties\WMAppManifest.xml - AppIcon.ico - AppThumbnail.png - Jellyfish.Virtu.MainGame - Background.png - Virtu - - - true - full - false - bin\Windows Phone\ - DEBUG;TRACE;XNA;WINDOWS_PHONE;CODE_ANALYSIS - prompt - 4 - true - false - true - true - AllRules.ruleset - false - default - - - pdbonly - true - bin\Windows Phone\ - TRACE;XNA;WINDOWS_PHONE;CODE_ANALYSIS - prompt - 4 - true - false - true - true - AllRules.ruleset - false - default - - - false - - - ..\..\..\Jellyfish\StrongName.snk - - - false - - - http://timestamp.verisign.com/scripts/timestamp.dll - - - 462E2816DD15CF75ED0DB781E8C7AD957C048679 - - - ..\..\..\Jellyfish\CodeSign.pfx - - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - - - Core\Cassette.cs - - - Core\Cpu.cs - - - Core\CpuData.cs - - - Core\Disk525.cs - - - Core\DiskDsk.cs - - - Core\DiskIIController.cs - - - Core\DiskIIDrive.cs - - - Core\DiskNib.cs - - - Core\GamePort.cs - - - GlobalSuppressions.cs - - - Core\Keyboard.cs - - - Core\Machine.cs - - - Core\MachineComponent.cs - - - Core\MachineEvents.cs - - - Core\Memory.cs - - - Core\MemoryData.cs - - - Core\NoSlotClock.cs - - - Core\PeripheralCard.cs - - - Properties\Strings.Designer.cs - True - True - Strings.resx - - - Services\AudioService.cs - - - Services\DebugService.cs - - - Services\GamePortService.cs - - - Services\IsolatedStorageService.cs - - - Services\KeyboardService.cs - - - Services\MachineService.cs - - - Services\MachineServices.cs - - - Services\StorageService.cs - - - Services\VideoService.cs - - - Core\Speaker.cs - - - Core\Video.cs - - - Core\VideoData.cs - - - - - - - - - - - - true - - - true - - - - - - - - true - - - - - Properties\Strings.resx - ResXFileCodeGenerator - Strings.Designer.cs - - - - - Disks\Default.dsk - - - Roms\AppleIIe.rom - - - Roms\DiskII.rom - - - - - CustomDictionary.xml - - - - - {46B2BD23-3D45-4268-9979-B9CF136CC982} - Jellyfish.Library.Xna.Phone - - - Jellyfish.Virtu.Xna.Content - Content - - - - - - \ No newline at end of file diff --git a/Virtu/Xna/Jellyfish.Virtu.Xna.Xbox.csproj b/Virtu/Xna/Jellyfish.Virtu.Xna.Xbox.csproj deleted file mode 100644 index 444f352..0000000 --- a/Virtu/Xna/Jellyfish.Virtu.Xna.Xbox.csproj +++ /dev/null @@ -1,268 +0,0 @@ - - - - {1400371E-AC2E-4BC5-8A52-077616F716C4} - {6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Debug - Xbox 360 - Exe - Properties - Jellyfish.Virtu - Jellyfish.Virtu - v4.0 - Client - v4.0 - Xbox 360 - Reach - 48ae3b16-efe9-4694-85f0-23da456b4bc4 - Game - AppIcon.ico - AppThumbnail.png - - - true - full - false - bin\Xbox 360\ - DEBUG;TRACE;XNA;XBOX;XBOX360;CODE_ANALYSIS - prompt - 4 - true - false - true - true - AllRules.ruleset - false - default - - - pdbonly - true - bin\Xbox 360\ - TRACE;XNA;XBOX;XBOX360;CODE_ANALYSIS - prompt - 4 - true - false - true - true - AllRules.ruleset - false - default - - - false - - - ..\..\..\Jellyfish\StrongName.snk - - - false - - - http://timestamp.verisign.com/scripts/timestamp.dll - - - 462E2816DD15CF75ED0DB781E8C7AD957C048679 - - - ..\..\..\Jellyfish\CodeSign.pfx - - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - - - Core\Cassette.cs - - - Core\Cpu.cs - - - Core\CpuData.cs - - - Core\Disk525.cs - - - Core\DiskDsk.cs - - - Core\DiskIIController.cs - - - Core\DiskIIDrive.cs - - - Core\DiskNib.cs - - - Core\GamePort.cs - - - GlobalSuppressions.cs - - - Core\Keyboard.cs - - - Core\Machine.cs - - - Core\MachineComponent.cs - - - Core\MachineEvents.cs - - - Core\Memory.cs - - - Core\MemoryData.cs - - - Core\NoSlotClock.cs - - - Core\PeripheralCard.cs - - - Properties\Strings.Designer.cs - True - True - Strings.resx - - - Services\AudioService.cs - - - Services\DebugService.cs - - - Services\GamePortService.cs - - - Services\KeyboardService.cs - - - Services\MachineService.cs - - - Services\MachineServices.cs - - - Services\StorageService.cs - - - Services\VideoService.cs - - - Core\Speaker.cs - - - Core\Video.cs - - - Core\VideoData.cs - - - - - - - - - - - - - - - - - - - - Properties\Strings.resx - ResXFileCodeGenerator - Strings.Designer.cs - - - - - Disks\Default.dsk - - - Roms\AppleIIe.rom - - - Roms\DiskII.rom - - - - - CustomDictionary.xml - - - - - {222412EE-A626-493F-AE72-344657A6840D} - Jellyfish.Library.Xna.Xbox - - - Jellyfish.Virtu.Xna.Content - Content - - - - - - \ No newline at end of file diff --git a/Virtu/Xna/Jellyfish.Virtu.Xna.csproj b/Virtu/Xna/Jellyfish.Virtu.Xna.csproj deleted file mode 100644 index 6fd3535..0000000 --- a/Virtu/Xna/Jellyfish.Virtu.Xna.csproj +++ /dev/null @@ -1,272 +0,0 @@ - - - - {3D0AE444-357F-4986-859F-602CC9BB4EF6} - {6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Debug - x86 - WinExe - Properties - Jellyfish.Virtu - Jellyfish.Virtu - v4.0 - Client - v4.0 - Windows - Reach - 48ae3b16-efe9-4694-85f0-23da456b4bc4 - Game - AppIcon.ico - AppThumbnail.png - - - true - full - false - bin\x86\ - DEBUG;TRACE;XNA;WINDOWS;CODE_ANALYSIS - prompt - 4 - true - false - x86 - true - true - AllRules.ruleset - false - - - pdbonly - true - bin\x86\ - TRACE;XNA;WINDOWS;CODE_ANALYSIS - prompt - 4 - true - false - x86 - true - true - AllRules.ruleset - false - - - Jellyfish.Virtu.MainApp - - - false - - - ..\..\..\Jellyfish\StrongName.snk - - - false - - - http://timestamp.verisign.com/scripts/timestamp.dll - - - 462E2816DD15CF75ED0DB781E8C7AD957C048679 - - - ..\..\..\Jellyfish\CodeSign.pfx - - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - - False - - - False - - - False - - - - - Core\Cassette.cs - - - Core\Cpu.cs - - - Core\CpuData.cs - - - Core\Disk525.cs - - - Core\DiskDsk.cs - - - Core\DiskIIController.cs - - - Core\DiskIIDrive.cs - - - Core\DiskNib.cs - - - Core\GamePort.cs - - - GlobalSuppressions.cs - - - Core\Keyboard.cs - - - Core\Machine.cs - - - Core\MachineComponent.cs - - - Core\MachineEvents.cs - - - Core\Memory.cs - - - Core\MemoryData.cs - - - Core\NoSlotClock.cs - - - Core\PeripheralCard.cs - - - Properties\Strings.Designer.cs - True - True - Strings.resx - - - Services\AudioService.cs - - - Services\DebugService.cs - - - Services\GamePortService.cs - - - Services\KeyboardService.cs - - - Services\MachineService.cs - - - Services\MachineServices.cs - - - Services\StorageService.cs - - - Services\VideoService.cs - - - Core\Speaker.cs - - - Core\Video.cs - - - Core\VideoData.cs - - - - - - - - - - - - - - - - - - - - Properties\Strings.resx - ResXFileCodeGenerator - Strings.Designer.cs - - - - - Disks\Default.dsk - - - Roms\AppleIIe.rom - - - Roms\DiskII.rom - - - - - CustomDictionary.xml - - - - - {82F56318-A1FD-4078-A42F-06CAB8B97F63} - Jellyfish.Library.Xna - - - Jellyfish.Virtu.Xna.Content - Content - - - - - - \ No newline at end of file diff --git a/Virtu/Xna/Jellyfish.Virtu.Xna.sln b/Virtu/Xna/Jellyfish.Virtu.Xna.sln deleted file mode 100644 index 11ca4c4..0000000 --- a/Virtu/Xna/Jellyfish.Virtu.Xna.sln +++ /dev/null @@ -1,134 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Xna", "..\..\Library\Xna\Jellyfish.Library.Xna.csproj", "{82F56318-A1FD-4078-A42F-06CAB8B97F63}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Xna.Phone", "..\..\Library\Xna\Jellyfish.Library.Xna.Phone.csproj", "{46B2BD23-3D45-4268-9979-B9CF136CC982}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Library.Xna.Xbox", "..\..\Library\Xna\Jellyfish.Library.Xna.Xbox.csproj", "{222412EE-A626-493F-AE72-344657A6840D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Virtu.Xna", "Jellyfish.Virtu.Xna.csproj", "{3D0AE444-357F-4986-859F-602CC9BB4EF6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Virtu.Xna.Content", "Content\Jellyfish.Virtu.Xna.Content.contentproj", "{C138ADC9-8F2B-414A-930D-12B489A96BBB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Virtu.Xna.Phone", "Jellyfish.Virtu.Xna.Phone.csproj", "{AE4C0489-3A21-4264-BE20-EA6C72B24B2C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfish.Virtu.Xna.Xbox", "Jellyfish.Virtu.Xna.Xbox.csproj", "{1400371E-AC2E-4BC5-8A52-077616F716C4}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Windows Phone = Debug|Windows Phone - Debug|x86 = Debug|x86 - Debug|Xbox 360 = Debug|Xbox 360 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Windows Phone = Release|Windows Phone - Release|x86 = Release|x86 - Release|Xbox 360 = Release|Xbox 360 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Any CPU.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Windows Phone.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|x86.ActiveCfg = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|x86.Build.0 = Debug|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Debug|Xbox 360.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Any CPU.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Mixed Platforms.Build.0 = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Windows Phone.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|x86.ActiveCfg = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|x86.Build.0 = Release|x86 - {82F56318-A1FD-4078-A42F-06CAB8B97F63}.Release|Xbox 360.ActiveCfg = Release|x86 - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Any CPU.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Mixed Platforms.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Mixed Platforms.Build.0 = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Windows Phone.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Windows Phone.Build.0 = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|x86.ActiveCfg = Debug|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Debug|Xbox 360.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Any CPU.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Mixed Platforms.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Mixed Platforms.Build.0 = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Windows Phone.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Windows Phone.Build.0 = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|x86.ActiveCfg = Release|Windows Phone - {46B2BD23-3D45-4268-9979-B9CF136CC982}.Release|Xbox 360.ActiveCfg = Release|Windows Phone - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Any CPU.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Mixed Platforms.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Mixed Platforms.Build.0 = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Windows Phone.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|x86.ActiveCfg = Debug|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Xbox 360.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Debug|Xbox 360.Build.0 = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Any CPU.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Mixed Platforms.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Mixed Platforms.Build.0 = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Windows Phone.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|x86.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 - {222412EE-A626-493F-AE72-344657A6840D}.Release|Xbox 360.Build.0 = Release|Xbox 360 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Debug|Any CPU.ActiveCfg = Debug|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Debug|Windows Phone.ActiveCfg = Release|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Debug|x86.ActiveCfg = Debug|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Debug|x86.Build.0 = Debug|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Debug|Xbox 360.ActiveCfg = Release|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Release|Any CPU.ActiveCfg = Release|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Release|Mixed Platforms.Build.0 = Release|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Release|Windows Phone.ActiveCfg = Release|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Release|x86.ActiveCfg = Release|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Release|x86.Build.0 = Release|x86 - {3D0AE444-357F-4986-859F-602CC9BB4EF6}.Release|Xbox 360.ActiveCfg = Release|x86 - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Debug|Windows Phone.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Debug|x86.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Release|Windows Phone.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Release|x86.ActiveCfg = Debug|Any CPU - {C138ADC9-8F2B-414A-930D-12B489A96BBB}.Release|Xbox 360.ActiveCfg = Debug|Any CPU - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|Any CPU.ActiveCfg = Debug|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|Mixed Platforms.ActiveCfg = Debug|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|Mixed Platforms.Build.0 = Debug|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|Windows Phone.ActiveCfg = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|Windows Phone.Build.0 = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|Windows Phone.Deploy.0 = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|x86.ActiveCfg = Debug|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Debug|Xbox 360.ActiveCfg = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|Any CPU.ActiveCfg = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|Mixed Platforms.ActiveCfg = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|Mixed Platforms.Build.0 = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|Windows Phone.ActiveCfg = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|Windows Phone.Build.0 = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|Windows Phone.Deploy.0 = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|x86.ActiveCfg = Release|Windows Phone - {AE4C0489-3A21-4264-BE20-EA6C72B24B2C}.Release|Xbox 360.ActiveCfg = Release|Windows Phone - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|Any CPU.ActiveCfg = Debug|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|Mixed Platforms.ActiveCfg = Debug|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|Mixed Platforms.Build.0 = Debug|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|Windows Phone.ActiveCfg = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|x86.ActiveCfg = Debug|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|Xbox 360.ActiveCfg = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|Xbox 360.Build.0 = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Debug|Xbox 360.Deploy.0 = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|Any CPU.ActiveCfg = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|Mixed Platforms.ActiveCfg = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|Mixed Platforms.Build.0 = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|Windows Phone.ActiveCfg = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|x86.ActiveCfg = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|Xbox 360.Build.0 = Release|Xbox 360 - {1400371E-AC2E-4BC5-8A52-077616F716C4}.Release|Xbox 360.Deploy.0 = Release|Xbox 360 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Virtu/Xna/MainApp.cs b/Virtu/Xna/MainApp.cs deleted file mode 100644 index c8772a8..0000000 --- a/Virtu/Xna/MainApp.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Jellyfish.Virtu -{ -#if WINDOWS || XBOX - static class MainApp - { - static void Main() - { - using (var game = new MainGame()) - { - game.Run(); - } - } - } -#endif -} diff --git a/Virtu/Xna/MainGame.cs b/Virtu/Xna/MainGame.cs deleted file mode 100644 index c173b91..0000000 --- a/Virtu/Xna/MainGame.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Jellyfish.Library; -using Jellyfish.Virtu.Services; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Microsoft.Xna.Framework.Input; -using Microsoft.Xna.Framework.Input.Touch; - -namespace Jellyfish.Virtu -{ - public sealed class MainGame : GameBase - { - public MainGame() : - base("Virtu") - { -#if WINDOWS - IsMouseVisible = true; -#endif - var frameRateCounter = new FrameRateCounter(this); // no initializers; avoids CA2000 - Components.Add(frameRateCounter); - frameRateCounter.DrawOrder = 1; - frameRateCounter.FontName = "Consolas"; - - _debugService = DebugService.Default; -#if WINDOWS_PHONE - _storageService = new IsolatedStorageService(_machine); -#else - _storageService = new XnaStorageService(_machine, this); -#endif - _keyboardService = new XnaKeyboardService(_machine); - _gamePortService = new XnaGamePortService(_machine); - _audioService = new XnaAudioService(_machine, this); - _videoService = new XnaVideoService(_machine, this); - - _machine.Services.AddService(typeof(DebugService), _debugService); - _machine.Services.AddService(typeof(StorageService), _storageService); - _machine.Services.AddService(typeof(KeyboardService), _keyboardService); - _machine.Services.AddService(typeof(GamePortService), _gamePortService); - _machine.Services.AddService(typeof(AudioService), _audioService); - _machine.Services.AddService(typeof(VideoService), _videoService); - } - - protected override void Dispose(bool disposing) - { - if (disposing) - { - _machine.Dispose(); - _debugService.Dispose(); - _storageService.Dispose(); - _keyboardService.Dispose(); - _gamePortService.Dispose(); - _audioService.Dispose(); - _videoService.Dispose(); - } - - base.Dispose(disposing); - } - - protected override void BeginRun() - { - _machine.Start(); - } - - protected override void Update(GameTime gameTime) - { - var keyboardState = Microsoft.Xna.Framework.Input.Keyboard.GetState(); - var gamePadState = GamePad.GetState(PlayerIndex.One); - var touches = TouchPanel.GetState(); - - if (gamePadState.Buttons.Back == ButtonState.Pressed) - { - Exit(); - } - - _keyboardService.Update(ref keyboardState, ref gamePadState); - _gamePortService.Update(ref gamePadState, ref touches); - - base.Update(gameTime); - } - - protected override void Draw(GameTime gameTime) - { - GraphicsDevice.Clear(Color.Black); - _videoService.Update(); - - base.Draw(gameTime); - } - - protected override void EndRun() - { - _machine.Stop(); - } - - private Machine _machine = new Machine(); - - private DebugService _debugService; - private StorageService _storageService; - private XnaKeyboardService _keyboardService; - private XnaGamePortService _gamePortService; - private AudioService _audioService; - private VideoService _videoService; - } -} diff --git a/Virtu/Xna/Properties/AppManifest.xml b/Virtu/Xna/Properties/AppManifest.xml deleted file mode 100644 index 8bcc1ca..0000000 --- a/Virtu/Xna/Properties/AppManifest.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - diff --git a/Virtu/Xna/Properties/AssemblyInfo.cs b/Virtu/Xna/Properties/AssemblyInfo.cs deleted file mode 100644 index 756e741..0000000 --- a/Virtu/Xna/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Reflection; -using System.Resources; -using System.Runtime.InteropServices; -using Jellyfish.Library; -using Jellyfish.Virtu; - -[assembly: AssemblyTitle("Virtu")] -[assembly: AssemblyDescription("Apple IIe Emulator")] -#if WINDOWS_PHONE -[assembly: AssemblyProduct("Jellyfish.Virtu.Xna.Phone")] -#elif XBOX -[assembly: AssemblyProduct("Jellyfish.Virtu.Xna.Xbox")] -#else -[assembly: AssemblyProduct("Jellyfish.Virtu.Xna")] -#endif -[assembly: AssemblyCompany("Digital Jellyfish Design Ltd")] -[assembly: AssemblyCopyright("Copyright © 1995-2012 Digital Jellyfish Design Ltd")] -[assembly: AssemblyComment("Developed by Sean Fausett & Nick Westgate")] - -[assembly: AssemblyVersion(Machine.Version)] -[assembly: AssemblyFileVersion(Machine.Version)] -[assembly: AssemblyInformationalVersion(Machine.Version)] - -[assembly: CLSCompliant(false)] -[assembly: ComVisible(false)] -[assembly: Guid("89a50370-1ed9-4cf1-ad08-043b6e6f3c90")] - -[assembly: NeutralResourcesLanguage("en")] diff --git a/Virtu/Xna/Properties/WMAppManifest.xml b/Virtu/Xna/Properties/WMAppManifest.xml deleted file mode 100644 index 9b050be..0000000 --- a/Virtu/Xna/Properties/WMAppManifest.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - AppThumbnail.png - - - - - - - - - - - - - - - - - - - - AppThumbnail.png - 0 - Virtu - - - - - diff --git a/Virtu/Xna/Services/XnaAudioService.cs b/Virtu/Xna/Services/XnaAudioService.cs deleted file mode 100644 index fac643c..0000000 --- a/Virtu/Xna/Services/XnaAudioService.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using Jellyfish.Library; -using Microsoft.Xna.Framework.Audio; - -namespace Jellyfish.Virtu.Services -{ - public sealed class XnaAudioService : AudioService - { - public XnaAudioService(Machine machine, GameBase game) : - base(machine) - { - if (game == null) - { - throw new ArgumentNullException("game"); - } - - _game = game; - - _dynamicSoundEffect.BufferNeeded += OnDynamicSoundEffectBufferNeeded; - _game.Exiting += (sender, e) => _dynamicSoundEffect.Stop(); - - _dynamicSoundEffect.SubmitBuffer(SampleZero); - _dynamicSoundEffect.Play(); - } - - public override void SetVolume(float volume) - { - _dynamicSoundEffect.Volume = volume; - } - - protected override void Dispose(bool disposing) - { - if (disposing) - { - _dynamicSoundEffect.Dispose(); - } - - base.Dispose(disposing); - } - - private void OnDynamicSoundEffectBufferNeeded(object sender, EventArgs e) // audio thread - { - //if (_count++ % (1000 / SampleLatency) == 0) - //{ - // DebugService.WriteLine("OnDynamicSoundEffectBufferNeeded"); - //} - - _dynamicSoundEffect.SubmitBuffer(Source, 0, SampleSize); - Update(); - } - - private GameBase _game; - private DynamicSoundEffectInstance _dynamicSoundEffect = new DynamicSoundEffectInstance(SampleRate, (AudioChannels)SampleChannels); - //private int _count; - } -} diff --git a/Virtu/Xna/Services/XnaGamePortService.cs b/Virtu/Xna/Services/XnaGamePortService.cs deleted file mode 100644 index 8e93682..0000000 --- a/Virtu/Xna/Services/XnaGamePortService.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using Jellyfish.Library; -using Microsoft.Xna.Framework.Input; -using Microsoft.Xna.Framework.Input.Touch; - -namespace Jellyfish.Virtu.Services -{ - public sealed class XnaGamePortService : GamePortService - { - public XnaGamePortService(Machine machine) : - base(machine) - { - _touchRegions = new TouchRegionCollection { _touchJoystick0, _touchJoystick1, _touchButton0, _touchButton1, _touchButton2 }; - } - - [SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")] - public void Update(ref GamePadState gamePadState, ref TouchCollection touches) // main thread - { - _lastState = _state; - _state = gamePadState; - - var gamePort = Machine.GamePort; - - if (_state.IsConnected && (_state != _lastState)) - { - var left = _state.ThumbSticks.Left; - var right = _state.ThumbSticks.Right; - var dpad = _state.DPad; - var buttons = _state.Buttons; - - Paddle0 = (int)((1 + left.X) * GamePort.PaddleScale); - Paddle1 = (int)((1 - left.Y) * GamePort.PaddleScale); // invert y - Paddle2 = (int)((1 + right.X) * GamePort.PaddleScale); - Paddle3 = (int)((1 - right.Y) * GamePort.PaddleScale); // invert y - - IsJoystick0Up = ((left.Y > gamePort.JoystickDeadZone) || (dpad.Up == ButtonState.Pressed)); - IsJoystick0Left = ((left.X < -gamePort.JoystickDeadZone) || (dpad.Left == ButtonState.Pressed)); - IsJoystick0Right = ((left.X > gamePort.JoystickDeadZone) || (dpad.Right == ButtonState.Pressed)); - IsJoystick0Down = ((left.Y < -gamePort.JoystickDeadZone) || (dpad.Down == ButtonState.Pressed)); - - IsJoystick1Up = (right.Y > gamePort.JoystickDeadZone); - IsJoystick1Left = (right.X < -gamePort.JoystickDeadZone); - IsJoystick1Right = (right.X > gamePort.JoystickDeadZone); - IsJoystick1Down = (right.Y < -gamePort.JoystickDeadZone); - - IsButton0Down = ((buttons.A == ButtonState.Pressed) || (buttons.LeftShoulder == ButtonState.Pressed)); - IsButton1Down = ((buttons.B == ButtonState.Pressed) || (buttons.RightShoulder == ButtonState.Pressed)); - IsButton2Down = (buttons.X == ButtonState.Pressed); - } - - if (gamePort.UseTouch) // override - { - UpdateTouch(ref touches); - } - - base.Update(); - } - - private void UpdateTouch(ref TouchCollection touches) - { - var gamePort = Machine.GamePort; - - _touchJoystick0.SetBounds(gamePort.Joystick0TouchX, gamePort.Joystick0TouchY, gamePort.Joystick0TouchWidth, gamePort.Joystick0TouchHeight); - _touchJoystick0.SetRadius(gamePort.Joystick0TouchRadius); - _touchJoystick0.KeepLast = gamePort.Joystick0TouchKeepLast; - _touchJoystick0.Order = gamePort.Joystick0TouchOrder; - _touchJoystick1.SetBounds(gamePort.Joystick1TouchX, gamePort.Joystick1TouchY, gamePort.Joystick1TouchWidth, gamePort.Joystick1TouchHeight); - _touchJoystick1.SetRadius(gamePort.Joystick1TouchRadius); - _touchJoystick1.KeepLast = gamePort.Joystick1TouchKeepLast; - _touchJoystick1.Order = gamePort.Joystick1TouchOrder; - _touchButton0.SetBounds(gamePort.Button0TouchX, gamePort.Button0TouchY, gamePort.Button0TouchWidth, gamePort.Button0TouchHeight); - _touchButton0.Order = gamePort.Button0TouchOrder; - _touchButton1.SetBounds(gamePort.Button1TouchX, gamePort.Button1TouchY, gamePort.Button1TouchWidth, gamePort.Button1TouchHeight); - _touchButton1.Order = gamePort.Button1TouchOrder; - _touchButton2.SetBounds(gamePort.Button2TouchX, gamePort.Button2TouchY, gamePort.Button2TouchWidth, gamePort.Button2TouchHeight); - _touchButton2.Order = gamePort.Button2TouchOrder; - - _touchRegions.Update(ref touches); - - if (_touchJoystick0.HasValue) - { - var joystick = _touchJoystick0.GetJoystick(); - - Paddle0 = (int)((1 + joystick.X) * GamePort.PaddleScale); - Paddle1 = (int)((1 - joystick.Y) * GamePort.PaddleScale); // invert y - - IsJoystick0Up = (joystick.Y > gamePort.JoystickDeadZone); - IsJoystick0Left = (joystick.X < -gamePort.JoystickDeadZone); - IsJoystick0Right = (joystick.X > gamePort.JoystickDeadZone); - IsJoystick0Down = (joystick.Y < -gamePort.JoystickDeadZone); - } - if (_touchJoystick1.HasValue) - { - var joystick = _touchJoystick1.GetJoystick(); - - Paddle2 = (int)((1 + joystick.X) * GamePort.PaddleScale); - Paddle3 = (int)((1 - joystick.Y) * GamePort.PaddleScale); // invert y - - IsJoystick1Up = (joystick.Y > gamePort.JoystickDeadZone); - IsJoystick1Left = (joystick.X < -gamePort.JoystickDeadZone); - IsJoystick1Right = (joystick.X > gamePort.JoystickDeadZone); - IsJoystick1Down = (joystick.Y < -gamePort.JoystickDeadZone); - } - if (_touchButton0.HasValue) - { - IsButton0Down = _touchButton0.IsButtonDown; - } - if (_touchButton1.HasValue) - { - IsButton1Down = _touchButton1.IsButtonDown; - } - if (_touchButton2.HasValue) - { - IsButton2Down = _touchButton2.IsButtonDown; - } - } - - private GamePadState _state; - private GamePadState _lastState; - private TouchJoystick _touchJoystick0 = new TouchJoystick(); - private TouchJoystick _touchJoystick1 = new TouchJoystick(); - private TouchButton _touchButton0 = new TouchButton(); - private TouchButton _touchButton1 = new TouchButton(); - private TouchButton _touchButton2 = new TouchButton(); - private TouchRegionCollection _touchRegions; - } -} diff --git a/Virtu/Xna/Services/XnaKeyboardService.cs b/Virtu/Xna/Services/XnaKeyboardService.cs deleted file mode 100644 index d7f45fb..0000000 --- a/Virtu/Xna/Services/XnaKeyboardService.cs +++ /dev/null @@ -1,332 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Input; - -namespace Jellyfish.Virtu.Services -{ - public sealed class XnaKeyboardService : KeyboardService - { - public XnaKeyboardService(Machine machine) : - base(machine) - { - } - - public override bool IsKeyDown(int key) - { - return IsKeyDown((Keys)key); - } - - [SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")] - public void Update(ref KeyboardState keyboardState, ref GamePadState gamePadState) // main thread - { - _lastState = _state; - _state = keyboardState; - - var gamePadButtons = gamePadState.Buttons; - bool gamePadControl = (gamePadButtons.LeftStick == ButtonState.Pressed); - - if (_state != _lastState) - { - IsAnyKeyDown = false; - for (int i = 0; i < KeyValues.Length; i++) // xna doesn't support buffered input; loses input order and could lose keys between updates - { - var key = KeyValues[i]; - if (_state.IsKeyDown(key)) - { - IsAnyKeyDown = true; - if (!_lastState.IsKeyDown(key)) - { - _lastKey = key; - _lastTime = DateTime.UtcNow.Ticks; - _repeatTime = RepeatDelay; - OnKeyDown(key, gamePadControl); - } - } - else - { - if (key == _lastKey) - { - _lastKey = Keys.None; - } - if (_lastState.IsKeyDown(key)) - { - OnKeyUp(key, gamePadControl); - } - } - } - } - - if (_lastKey != Keys.None) // repeat last key - { - long time = DateTime.UtcNow.Ticks; - if (time - _lastTime >= _repeatTime) - { - _lastTime = time; - _repeatTime = RepeatSpeed; - OnKeyDown(_lastKey, gamePadControl); - } - } - - IsControlKeyDown = IsKeyDown(Keys.LeftControl) || IsKeyDown(Keys.RightControl); - IsShiftKeyDown = IsKeyDown(Keys.LeftShift) || IsKeyDown(Keys.RightShift); - - IsOpenAppleKeyDown = IsKeyDown(Keys.LeftAlt) || IsKeyDown(Keys.NumPad0) || (gamePadButtons.LeftShoulder == ButtonState.Pressed); - IsCloseAppleKeyDown = IsKeyDown(Keys.RightAlt) || IsKeyDown(Keys.Decimal) || (gamePadButtons.RightShoulder == ButtonState.Pressed); - IsResetKeyDown = (IsControlKeyDown && IsKeyDown(Keys.Back)) || (gamePadControl && (gamePadButtons.Start == ButtonState.Pressed)); - - base.Update(); - } - - private bool IsKeyDown(Keys key) - { - return _state.IsKeyDown(key); - } - - private void OnKeyDown(Keys key, bool gamePadControl) - { - //DebugService.WriteLine("OnKeyDn: Key='{0}'", key); - - int asciiKey = GetAsciiKey(key, gamePadControl); - if (asciiKey >= 0) - { - Machine.Keyboard.Latch = asciiKey; - } - } - - private void OnKeyUp(Keys key, bool gamePadControl) - { - //DebugService.WriteLine("OnKeyUp: Key='{0}'", key); - - bool control = IsKeyDown(Keys.LeftControl) || IsKeyDown(Keys.RightControl); - - if (key == Keys.CapsLock) - { - _capsLock ^= true; - } - else if ((control && (key == Keys.Divide)) || (gamePadControl && (key == Keys.D8))) - { - Machine.Cpu.IsThrottled ^= true; - } - else if ((control && (key == Keys.Multiply)) || (gamePadControl && (key == Keys.D9))) - { - Machine.Video.IsMonochrome ^= true; - } -#if WINDOWS - else if ((control && (key == Keys.Subtract)) || (gamePadControl && (key == Keys.D0))) - { - Machine.Video.IsFullScreen ^= true; - } -#endif - } - - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode")] - private int GetAsciiKey(Keys key, bool gamePadControl) - { - bool control = IsKeyDown(Keys.LeftControl) || IsKeyDown(Keys.RightControl) || gamePadControl; - bool shift = IsKeyDown(Keys.LeftShift) || IsKeyDown(Keys.RightShift); - bool capsLock = shift ^ _capsLock; - bool green = IsKeyDown(Keys.ChatPadGreen); - bool orange = IsKeyDown(Keys.ChatPadOrange); - - switch (key) - { - case Keys.Left: - return 0x08; - - case Keys.Tab: - return 0x09; - - case Keys.Down: - return 0x0A; - - case Keys.Up: - return 0x0B; - - case Keys.Enter: - return 0x0D; - - case Keys.Right: - return 0x15; - - case Keys.Escape: - return 0x1B; - - case Keys.Back: - return control ? -1 : 0x7F; - - case Keys.Space: - return ' '; - - case Keys.D1: - return shift ? '!' : '1'; - - case Keys.D2: - return control ? 0x00 : shift ? '@' : '2'; - - case Keys.D3: - return shift ? '#' : '3'; - - case Keys.D4: - return shift ? '$' : '4'; - - case Keys.D5: - return shift ? '%' : '5'; - - case Keys.D6: - return control ? 0x1E : shift ? '^' : '6'; - - case Keys.D7: - return shift ? '&' : '7'; - - case Keys.D8: - return gamePadControl ? -1 : shift ? '*' : '8'; - - case Keys.D9: - return gamePadControl ? -1 : shift ? '(' : '9'; - - case Keys.D0: - return gamePadControl ? -1 : shift ? ')' : '0'; - - case Keys.A: - return control ? 0x01 : green ? '~' : capsLock ? 'A' : 'a'; - - case Keys.B: - return control ? 0x02 : green ? '|' : orange ? '+' : capsLock ? 'B' : 'b'; - - case Keys.C: - return control ? 0x03 : capsLock ? 'C' : 'c'; - - case Keys.D: - return control ? 0x04 : green ? '{' : capsLock ? 'D' : 'd'; - - case Keys.E: - return control ? 0x05 : capsLock ? 'E' : 'e'; - - case Keys.F: - return control ? 0x06 : green ? '}' : capsLock ? 'F' : 'f'; - - case Keys.G: - return control ? 0x07 : capsLock ? 'G' : 'g'; - - case Keys.H: - return control ? 0x08 : green ? '/' : orange ? '\\' : capsLock ? 'H' : 'h'; - - case Keys.I: - return control ? 0x09 : green ? '*' : capsLock ? 'I' : 'i'; - - case Keys.J: - return control ? 0x0A : green ? '\'' : orange ? '"' : capsLock ? 'J' : 'j'; - - case Keys.K: - return control ? 0x0B : green ? '[' : capsLock ? 'K' : 'k'; - - case Keys.L: - return control ? 0x0C : green ? ']' : capsLock ? 'L' : 'l'; - - case Keys.M: - return control ? 0x0D : green ? '>' : capsLock ? 'M' : 'm'; - - case Keys.N: - return control ? 0x0E : green ? '<' : capsLock ? 'N' : 'n'; - - case Keys.O: - return control ? 0x0F : green ? '(' : capsLock ? 'O' : 'o'; - - case Keys.P: - return control ? 0x10 : green ? ')' : orange ? '=' : capsLock ? 'P' : 'p'; - - case Keys.Q: - return control ? 0x11 : green ? '!' : capsLock ? 'Q' : 'q'; - - case Keys.R: - return control ? 0x12 : green ? '#' : orange ? '$' : capsLock ? 'R' : 'r'; - - case Keys.S: - return control ? 0x13 : capsLock ? 'S' : 's'; - - case Keys.T: - return control ? 0x14 : green ? '%' : capsLock ? 'T' : 't'; - - case Keys.U: - return control ? 0x15 : green ? '&' : capsLock ? 'U' : 'u'; - - case Keys.V: - return control ? 0x16 : green ? '-' : orange ? '_' : capsLock ? 'V' : 'v'; - - case Keys.W: - return control ? 0x17 : green ? '@' : capsLock ? 'W' : 'w'; - - case Keys.X: - return control ? 0x18 : capsLock ? 'X' : 'x'; - - case Keys.Y: - return control ? 0x19 : green ? '^' : capsLock ? 'Y' : 'y'; - - case Keys.Z: - return control ? 0x1A : green ? '`' : capsLock ? 'Z' : 'z'; - - case Keys.OemSemicolon: - return shift ? ':' : ';'; - - case Keys.OemQuestion: - return shift ? '?' : '/'; - - case Keys.OemTilde: - return shift ? '~' : '`'; - - case Keys.OemOpenBrackets: - return shift ? '{' : '['; - - case Keys.OemBackslash: - case Keys.OemPipe: - return control ? 0x1C : shift ? '|' : '\\'; - - case Keys.OemCloseBrackets: - return control ? 0x1D : shift ? '}' : ']'; - - case Keys.OemQuotes: - return shift ? '"' : '\''; - - case Keys.OemMinus: - return control ? 0x1F : shift ? '_' : '-'; - - case Keys.OemPlus: - return shift ? '+' : '='; - - case Keys.OemComma: - return shift ? '<' : green ? ':' : orange ? ';' : ','; - - case Keys.OemPeriod: - return shift ? '>' : green ? '?' : '.'; - } - - return -1; - } - - private static readonly Keys[] KeyValues = -#if WINDOWS_PHONE || XBOX - (from key in - (from field in typeof(Keys).GetFields() // missing Enum.GetValues; use reflection - where field.IsLiteral - select (Keys)field.GetValue(typeof(Keys))) - where (key != Keys.None) // filter Keys.None - select key).ToArray(); -#else - (from key in (Keys[])Enum.GetValues(typeof(Keys)) - where (key != Keys.None) // filter Keys.None - select key).ToArray(); -#endif - private static readonly long RepeatDelay = TimeSpan.FromMilliseconds(500).Ticks; - private static readonly long RepeatSpeed = TimeSpan.FromMilliseconds(32).Ticks; - - private KeyboardState _state; - private KeyboardState _lastState; - private bool _capsLock; - private Keys _lastKey; - private long _lastTime; - private long _repeatTime; - } -} diff --git a/Virtu/Xna/Services/XnaStorageService.cs b/Virtu/Xna/Services/XnaStorageService.cs deleted file mode 100644 index e2ae277..0000000 --- a/Virtu/Xna/Services/XnaStorageService.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.IO; -using Jellyfish.Library; -using Microsoft.Xna.Framework.Storage; - -namespace Jellyfish.Virtu.Services -{ - public sealed class XnaStorageService : StorageService - { - public XnaStorageService(Machine machine, GameBase game) : - base(machine) - { - if (game == null) - { - throw new ArgumentNullException("game"); - } - - _game = game; - } - - protected override void OnLoad(string fileName, Action reader) - { - if (reader == null) - { - throw new ArgumentNullException("reader"); - } - - using (var storageContainer = OpenContainer()) - { - using (var stream = storageContainer.OpenFile(fileName, FileMode.Open, FileAccess.Read, FileShare.Read)) - { - reader(stream); - } - } - } - - protected override void OnSave(string fileName, Action writer) - { - if (writer == null) - { - throw new ArgumentNullException("writer"); - } - - using (var storageContainer = OpenContainer()) - { - using (var stream = storageContainer.OpenFile(fileName, FileMode.Create, FileAccess.Write, FileShare.None)) - { - writer(stream); - } - } - } - - private StorageContainer OpenContainer() - { - return _storageDevice.Value.EndOpenContainer(_storageDevice.Value.BeginOpenContainer(_game.Name, null, null)); - } - - private GameBase _game; - private Lazy _storageDevice = new Lazy(() => StorageDevice.EndShowSelector(StorageDevice.BeginShowSelector(null, null))); - } -} diff --git a/Virtu/Xna/Services/XnaVideoService.cs b/Virtu/Xna/Services/XnaVideoService.cs deleted file mode 100644 index d3e8f32..0000000 --- a/Virtu/Xna/Services/XnaVideoService.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -#if WINDOWS -using System.Windows; -#endif -using Jellyfish.Library; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; - -namespace Jellyfish.Virtu.Services -{ - public sealed class XnaVideoService : VideoService - { - public XnaVideoService(Machine machine, GameBase game) : - base(machine) - { - if (game == null) - { - throw new ArgumentNullException("game"); - } - - _game = game; -#if WINDOWS || XBOX - _game.GraphicsDeviceManager.PreparingDeviceSettings += OnGraphicsDeviceManagerPreparingDeviceSettings; -#endif - _game.GraphicsDeviceService.DeviceCreated += OnGraphicsDeviceServiceDeviceCreated; - } - -#if WINDOWS - public override void SetFullScreen(bool isFullScreen) - { - var graphicsDeviceManager = _game.GraphicsDeviceManager; - if (graphicsDeviceManager.IsFullScreen != isFullScreen) - { - graphicsDeviceManager.IsFullScreen = isFullScreen; - _game.SynchronizationContext.Send(state => graphicsDeviceManager.ApplyChanges(), null); - } - } -#endif - - [SuppressMessage("Microsoft.Usage", "CA2233:OperationsShouldNotOverflow")] - public override void SetPixel(int x, int y, uint color) - { - _pixels[y * TextureWidth + x] = color; - _pixelsDirty = true; - } - - public override void Update() // main thread - { - if (_pixelsDirty) - { - _pixelsDirty = false; - _texture.SetData(_pixels); - } - - var viewport = _graphicsDevice.Viewport; - int scale = Math.Max(1, Math.Min(viewport.Width / TextureWidth, viewport.Height / TextureHeight)); - var position = new Vector2((viewport.Width - scale * TextureWidth) / 2, (viewport.Height - scale * TextureHeight) / 2); - - _spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Opaque, SamplerState.PointClamp, null, null); - _spriteBatch.Draw(_texture, position, null, Color.White, 0, Vector2.Zero, scale, SpriteEffects.None, 0); - _spriteBatch.End(); - } - - protected override void Dispose(bool disposing) - { - if (disposing) - { - _spriteBatch.Dispose(); - _texture.Dispose(); - } - - base.Dispose(disposing); - } - -#if WINDOWS || XBOX - private void OnGraphicsDeviceManagerPreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e) - { - var presentationParameters = e.GraphicsDeviceInformation.PresentationParameters; -#if WINDOWS - if (!presentationParameters.IsFullScreen) - { - var maxScale = Math.Max(1, Math.Min((int)SystemParameters.FullPrimaryScreenWidth / TextureWidth, (int)SystemParameters.FullPrimaryScreenHeight / TextureHeight)); - presentationParameters.BackBufferWidth = maxScale * TextureWidth; - presentationParameters.BackBufferHeight = maxScale * TextureHeight; - } - else -#endif - { - var displayMode = e.GraphicsDeviceInformation.Adapter.CurrentDisplayMode; // use display mode - presentationParameters.BackBufferWidth = displayMode.Width; - presentationParameters.BackBufferHeight = displayMode.Height; - } - } -#endif - - private void OnGraphicsDeviceServiceDeviceCreated(object sender, EventArgs e) - { - _graphicsDevice = _game.GraphicsDevice; - _spriteBatch = new SpriteBatch(_graphicsDevice); - _texture = new Texture2D(_graphicsDevice, TextureWidth, TextureHeight, false, SurfaceFormat.Color); - } - - private const int TextureWidth = 560; - private const int TextureHeight = 384; - - private GameBase _game; - private GraphicsDevice _graphicsDevice; - private SpriteBatch _spriteBatch; - private Texture2D _texture; - - private uint[] _pixels = new uint[TextureWidth * TextureHeight]; - private bool _pixelsDirty; - } -}