fix BANDAI FCG 1 Boards without barcode reader
This commit is contained in:
parent
09f9d50f46
commit
10e38e7bc9
|
@ -67,6 +67,8 @@ namespace BizHawk.Emulation.Common
|
|||
public void Register<T>(T provider)
|
||||
where T : IEmulatorService
|
||||
{
|
||||
if (provider == null)
|
||||
throw new ArgumentNullException("provider");
|
||||
Services[typeof(T)] = provider;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
|
||||
if (board is BANDAI_FCG_1)
|
||||
{
|
||||
(ServiceProvider as BasicServiceProvider).Register<DatachBarcode>((board as BANDAI_FCG_1).reader);
|
||||
var reader = (board as BANDAI_FCG_1).reader;
|
||||
// not all BANDAI FCG 1 boards have a barcode reader
|
||||
if (reader != null)
|
||||
(ServiceProvider as BasicServiceProvider).Register<DatachBarcode>(reader);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue