quicknes: reject (with the appropriate unsupported exception) any bootgod positive euro rom

This commit is contained in:
goyuken 2014-10-29 18:58:43 +00:00
parent 84fa4feba1
commit ff95066672
5 changed files with 31 additions and 16 deletions

View File

@ -433,7 +433,7 @@ namespace BizHawk.Client.Common
ex = ex.InnerException;
// Specific hack here, as we get more cores of the same system, this isn't scalable
if (ex is UnsupportedMapperException)
if (ex is UnsupportedGameException)
{
return LoadRom(path, nextComm, forceAccurateCore: true);
}

View File

@ -10,9 +10,12 @@ namespace BizHawk.Emulation.Common
}
}
public class UnsupportedMapperException : InvalidOperationException
/// <summary>
/// indicates that this core does not support the game, but it may be valid
/// </summary>
public class UnsupportedGameException : InvalidOperationException
{
public UnsupportedMapperException(string message)
public UnsupportedGameException(string message)
: base(message)
{

View File

@ -414,9 +414,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
case 0x08: break;
case 0x09: break;
case 0x0b: throw new UnsupportedMapperException("\"MM01\" Mapper not supported!");
case 0x0c: throw new UnsupportedMapperException("\"MM01\" Mapper not supported!");
case 0x0d: throw new UnsupportedMapperException("\"MM01\" Mapper not supported!");
case 0x0b: throw new UnsupportedGameException("\"MM01\" Mapper not supported!");
case 0x0c: throw new UnsupportedGameException("\"MM01\" Mapper not supported!");
case 0x0d: throw new UnsupportedGameException("\"MM01\" Mapper not supported!");
case 0x0f: break;
case 0x10: break;
@ -424,9 +424,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
case 0x12: break;
case 0x13: break;
case 0x15: throw new UnsupportedMapperException("\"MBC4\" Mapper not supported!");
case 0x16: throw new UnsupportedMapperException("\"MBC4\" Mapper not supported!");
case 0x17: throw new UnsupportedMapperException("\"MBC4\" Mapper not supported!");
case 0x15: throw new UnsupportedGameException("\"MBC4\" Mapper not supported!");
case 0x16: throw new UnsupportedGameException("\"MBC4\" Mapper not supported!");
case 0x17: throw new UnsupportedGameException("\"MBC4\" Mapper not supported!");
case 0x19: break;
case 0x1a: break;
@ -435,14 +435,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
case 0x1d: break; // rumble
case 0x1e: break; // rumble
case 0x20: throw new UnsupportedMapperException("\"MBC6\" Mapper not supported!");
case 0x22: throw new UnsupportedMapperException("\"MBC7\" Mapper not supported!");
case 0x20: throw new UnsupportedGameException("\"MBC6\" Mapper not supported!");
case 0x22: throw new UnsupportedGameException("\"MBC7\" Mapper not supported!");
case 0xfc: throw new UnsupportedMapperException("\"Pocket Camera\" Mapper not supported!");
case 0xfd: throw new UnsupportedMapperException("\"Bandai TAMA5\" Mapper not supported!");
case 0xfe: throw new UnsupportedMapperException("\"HuC3\" Mapper not supported!");
case 0xfc: throw new UnsupportedGameException("\"Pocket Camera\" Mapper not supported!");
case 0xfd: throw new UnsupportedGameException("\"Bandai TAMA5\" Mapper not supported!");
case 0xfe: throw new UnsupportedGameException("\"HuC3\" Mapper not supported!");
case 0xff: break;
default: throw new UnsupportedMapperException(string.Format("Unknown mapper: {0:x2}", romdata[0x147]));
default: throw new UnsupportedGameException(string.Format("Unknown mapper: {0:x2}", romdata[0x147]));
}
return;
}

View File

@ -226,7 +226,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
string s = Marshal.PtrToStringAnsi(p);
if (s == "Unsupported mapper" || s == "Not an iNES file") // Not worth making a new exception for the iNES error, they ultimately are the same problem
{
throw new Emulation.Common.UnsupportedMapperException("Quicknes unsupported mapper");
throw new Emulation.Common.UnsupportedGameException("Quicknes unsupported mapper");
}
else
{

View File

@ -10,6 +10,7 @@ using Newtonsoft.Json;
using BizHawk.Common.BufferExtensions;
using BizHawk.Emulation.Common;
using BizHawk.Common;
using BizHawk.Common.CollectionExtensions;
namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
{
@ -395,6 +396,17 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
if (carts.Count > 0)
{
Console.WriteLine("BootGod entry found: {0}", carts[0].name);
switch (carts[0].system)
{
case "NES-PAL":
case "NES-PAL-A":
case "NES-PAL-B":
case "Dendy":
Console.WriteLine("Bad region {0}! Failing over...", carts[0].system);
throw new UnsupportedGameException("Unsupported region!");
default:
break;
}
BootGodStatus = RomStatus.GoodDump;
BootGodName = carts[0].name;
}