From 38a11e91fb93c0c8c03fbd3103d47a0a624bede9 Mon Sep 17 00:00:00 2001 From: zeromus Date: Mon, 13 Jun 2011 05:39:01 +0000 Subject: [PATCH] check out this awesome extension method --- BizHawk.Emulation/Util.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BizHawk.Emulation/Util.cs b/BizHawk.Emulation/Util.cs index 71b88cd30e..c7a50dcf9a 100644 --- a/BizHawk.Emulation/Util.cs +++ b/BizHawk.Emulation/Util.cs @@ -88,6 +88,11 @@ namespace BizHawk return true; } + public static bool Bit(this byte b, int index) + { + return (b & (1 << index)) != 0; + } + public static string GetPrecedingString(this string str, string value) { int index = str.IndexOf(value);