fix up previous commit
This commit is contained in:
parent
7dec3af0de
commit
ae104deac3
|
@ -255,19 +255,21 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
||||||
|
|
||||||
private static bool DetectPal(GameInfo game, byte[] rom)
|
private static bool DetectPal(GameInfo game, byte[] rom)
|
||||||
{
|
{
|
||||||
|
// give the emu a minimal of input\output connections so it doesn't crash
|
||||||
var comm = new CoreComm(null, null);
|
var comm = new CoreComm(null, null);
|
||||||
comm.InputCallback = new InputCallbackSystem();
|
comm.InputCallback = new InputCallbackSystem();
|
||||||
|
using (Atari2600 emu = new Atari2600(new CoreComm(null, null), game, rom, null, null))
|
||||||
|
{
|
||||||
|
emu.Controller = new NullController();
|
||||||
|
|
||||||
Atari2600 emu = new Atari2600(new CoreComm(null, null), game, rom, null, null);
|
List<int> framecounts = new List<int>();
|
||||||
emu.Controller = new NullController();
|
emu._tia.FrameEndCallBack = (i) => framecounts.Add(i);
|
||||||
|
for (int i = 0; i < 71; i++) // run for 71 * 262 lines, since we're in NTSC mode
|
||||||
List<int> framecounts = new List<int>();
|
emu.FrameAdvance(false, false);
|
||||||
emu._tia.FrameEndCallBack = (i) => framecounts.Add(i);
|
int numpal = framecounts.Count((i) => i > 287);
|
||||||
for (int i = 0; i < 71; i++) // run for 71 * 262 lines, since we're in NTSC mode
|
Console.WriteLine("{0} PAL", numpal);
|
||||||
emu.FrameAdvance(false, false);
|
return numpal >= 25;
|
||||||
int numpal = framecounts.Where((i) => i > 287).Count();
|
}
|
||||||
Console.WriteLine("{0} PAL", numpal);
|
|
||||||
return numpal >= 25;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue