示例#1
0
文件: Cog.cs 项目: mbaeten/gear-emu
        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);
        }
示例#2
0
 public void RemoveHook(VideoGenerator vgn)
 {
     if (AuralHooks.Contains(vgn))
     {
         AuralHooks.Remove(vgn);
     }
     return;
 }
示例#3
0
 public void AttachHook(VideoGenerator vgn)
 {
     if (!AuralHooks.Contains(vgn))
     {
         AuralHooks.Add(vgn);
     }
     return;
 }
示例#4
0
 public void Destroy()
 {
     Partner = null;
     AuralHooks.Clear();
 }
示例#5
0
        public void SetupPLL(VideoGenerator partner)
        {
            Partner = partner;

            AuralHooks.Clear();
        }