protected TranslationCPU(string cpuType, Machine machine, Endianess endianness)
{
if(cpuType == null)
{
throw new RecoverableException(new ArgumentNullException("cpuType"));
}
oldMaximumBlockSize = -1;
Endianness = endianness;
PerformanceInMips = 100;
currentCountThreshold = 5000;
this.cpuType = cpuType;
DisableInterruptsWhileStepping = true;
ClockSource = new BaseClockSource();
ClockSource.NumberOfEntriesChanged += (oldValue, newValue) =>
{
if(oldValue > newValue)
{
Misc.Swap(ref oldValue, ref newValue);
}
if(oldValue == 0 && newValue != 0)
{
ClearTranslationCache();
}
};
this.translationCacheSize = DefaultTranslationCacheSize;
this.machine = machine;
started = false;
isHalted = false;
translationCacheSync = new object();
pagesAccessedByIo = new HashSet<long>();
pauseGuard = new CpuThreadPauseGuard(this);
InitializeRegisters();
InitInterruptEvents();
Init();
InitDisas();
}