public const int TOTAL_COG_MEMORY = 0x200; // 512 longs of memory /// @brief Default constructor. public Cog(PropellerCPU host, uint programAddress, uint param, uint frequency, PLLGroup pll) { Hub = host; Memory = new uint[TOTAL_COG_MEMORY]; ProgramAddress = programAddress; ParamAddress = param; FreqA = new FreqGenerator(host, pll, true); FreqB = new FreqGenerator(host, pll, false); Video = new VideoGenerator(host); PhaseLockedLoop = pll; // Attach the video generator to PLLs PhaseLockedLoop.SetupPLL(Video); PC = 0; BreakPointCogCursor = -1; // Breakpoint disabled initially // We are in boot time load Memory[(int)Assembly.RegisterAddress.PAR] = param; State = CogRunState.WAIT_LOAD_PROGRAM; StateCount = 0; // Clear the special purpose registers for (int i = (int)Assembly.RegisterAddress.CNT; i <= 0x1FF; i++) { this[i] = 0; } SetClock(frequency); }
public void RemoveHook(VideoGenerator vgn) { if (AuralHooks.Contains(vgn)) { AuralHooks.Remove(vgn); } return; }
public void AttachHook(VideoGenerator vgn) { if (!AuralHooks.Contains(vgn)) { AuralHooks.Add(vgn); } return; }
public void Destroy() { Partner = null; AuralHooks.Clear(); }
public void SetupPLL(VideoGenerator partner) { Partner = partner; AuralHooks.Clear(); }