kill some warnings and add handy util methods

This commit is contained in:
zeromus 2011-06-20 09:07:38 +00:00
parent 30296e4f5b
commit dc7f00b862
3 changed files with 22 additions and 4 deletions

View File

@ -21,7 +21,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
case "NAMCOT-3405": //side pocket (J)
AssertPrg(128); AssertChr(32); AssertVram(0); AssertWram(0);
throw new Exception("TODO - test please");
break;
//break;
case "NAMCOT-3406": //karnov (J)
AssertPrg(128); AssertChr(64); AssertVram(0); AssertWram(0);
break;
@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
case "NAMCOT-3413": //pro yakyuu family stadium (J)
AssertPrg(64); AssertChr(32); AssertVram(0); AssertWram(0);
throw new Exception("TODO - test please");
break;
//break;
case "NAMCOT-3414": //family boxing (J)
AssertPrg(64); AssertChr(64); AssertVram(0); AssertWram(0);
break;
@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
//(is this game older than the other namcot 109 games?)
AssertPrg(32); AssertChr(32); AssertVram(0); AssertWram(0);
throw new Exception("TODO - test please");
break;
//break;
default:
return false;

View File

@ -134,7 +134,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
case 0x4010: case 0x4011: case 0x4012: case 0x4013:
return apu.ReadReg(addr);
case 0x4014: /*OAM DMA*/ break;
case 0x4015: return apu.ReadReg(addr); break;
case 0x4015: return apu.ReadReg(addr);
case 0x4016:
case 0x4017:
return read_joyport(addr);

View File

@ -412,6 +412,24 @@ namespace BizHawk
public static class Util
{
public static string Hash_MD5(byte[] data, int offset, int len)
{
using (var md5 = System.Security.Cryptography.MD5.Create())
{
md5.TransformFinalBlock(data, offset, len);
return Util.BytesToHexString(md5.Hash);
}
}
public static string Hash_SHA1(byte[] data, int offset, int len)
{
using (var sha1 = System.Security.Cryptography.SHA1.Create())
{
sha1.TransformFinalBlock(data, offset, len);
return Util.BytesToHexString(sha1.Hash);
}
}
public static bool IsPowerOfTwo(int x)
{
if (x == 0) return true;