diff options
Diffstat (limited to 'Noddybox.Emulation.EightBit/Binary.cs')
-rw-r--r-- | Noddybox.Emulation.EightBit/Binary.cs | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/Noddybox.Emulation.EightBit/Binary.cs b/Noddybox.Emulation.EightBit/Binary.cs deleted file mode 100644 index 0b1928b..0000000 --- a/Noddybox.Emulation.EightBit/Binary.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System;
-using System.Net;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Documents;
-using System.Windows.Ink;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
-using System.Windows.Shapes;
-
-namespace Noddybox.Emulation.EightBit
-{
- /// <summary>
- /// Provides helpers for shifting smaller values around without casts all over the shop.
- /// </summary>
- public static class Binary
- {
- /// <summary>
- /// Shift 8-bits to the left.
- /// </summary>
- /// <param name="b">The byte.</param>
- /// <param name="shift">How many bits to shift.</param>
- /// <returns>The shifted value.</returns>
- public static byte ShiftLeft(byte b, int shift)
- {
- return (byte)((b << shift) & 0xff);
- }
-
- /// <summary>
- /// Shift 8-bits to the right.
- /// </summary>
- /// <param name="b">The byte.</param>
- /// <param name="shift">How many bits to shift.</param>
- /// <returns>The shifted value.</returns>
- public static byte ShiftRight(byte b, int shift)
- {
- return (byte)((b >> shift) & 0xff);
- }
-
- /// <summary>
- /// Shift 16-bits to the left.
- /// </summary>
- /// <param name="w">The word.</param>
- /// <param name="shift">How many bits to shift.</param>
- /// <returns>The shifted value.</returns>
- public static ushort ShiftLeft(ushort w, int shift)
- {
- return (ushort)((w << shift) & 0xffff);
- }
-
- /// <summary>
- /// Shift 16-bits to the right.
- /// </summary>
- /// <param name="w">The word.</param>
- /// <param name="shift">How many bits to shift.</param>
- /// <returns>The shifted value.</returns>
- public static ushort ShiftRight(ushort w, int shift)
- {
- return (ushort)((w >> shift) & 0xffff);
- }
- }
-}
|