/// @brief Default Constructor. /// @param chip CPU to reference the view. public LogicView(PropellerCPU chip) : base(chip) { InitializeComponent(); MonoFont = new Font(FontFamily.GenericMonospace, 10); if (MonoFont == null) { MonoFont = this.Font; } viewOffset.LargeChange = 1; //retrieve the default settings for grid TimeScale = Properties.Settings.Default.LastTimeFrame; Marker = Properties.Settings.Default.LastTickMarkGrid; //Set international localized text for timeFrame & tickMark text boxes timeFrameBox.Text = TimeScale.ToString("0.00000000"); tickMarkBox.Text = Marker.ToString("0.00000000"); Pins = new List <LogicRow>(); DigitalPins = new LogicDigital[64]; for (int i = 0; i < DigitalPins.Length; i++) { DigitalPins[i] = new LogicDigital(i); } for (int i = 0; i < 32; i++) { Pins.Add(DigitalPins[i]); } }
public SpinView(PropellerCPU chip) : base(chip) { MonoSpace = new Font(FontFamily.GenericMonospace, 8); if (MonoSpace == null) { MonoSpace = Font; } lineHeight = TextRenderer.MeasureText("0000:", MonoSpace).Height; InitializeComponent(); colorBrushes = new Brush[] { Brushes.Gray, Brushes.White, Brushes.LightYellow, Brushes.LightGray, Brushes.LightBlue, Brushes.LightPink, Brushes.LavenderBlush, Brushes.LightGreen, Brushes.Yellow, }; for (int i = 0; i < colorMap.Length; i++) { colorMap[i] = 0; } }
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)CogSpecialAddress.PAR] = param; State = CogRunState.WAIT_LOAD_PROGRAM; StateCount = 0; // Clear the special purpose registers for (int i = (int)CogSpecialAddress.CNT; i <= 0x1FF; i++) { this[i] = 0; } SetClock(frequency); }
/// @brief Default Constructor. /// @param[in] source Binary program loaded (path & name) public Emulator(string source) { Chip = new PropellerCPU(this); Source = source; FloatControls = new List <Control>(); InitializeComponent(); this.Text = "Propeller: " + source; // Create default layout for (int i = 0; i < PropellerCPU.TOTAL_COGS; i++) //using constant TOTAL_COGS { AttachPlugin(new CogView(i, Chip)); } AttachPlugin(new MemoryView(Chip)); AttachPlugin(new SpinView(Chip)); AttachPlugin(new LogicProbe.LogicView(Chip)); //changed to logicprobe be the last tab documentsTab.SelectedIndex = 0; // TEMPORARY RUN FUNCTION runTimer = new Timer(); runTimer.Interval = 10; runTimer.Tick += new EventHandler(RunEmulatorStep); hubView.Host = Chip; }
/// @brief Default Constructor public MemoryWatch(PropellerCPU chip) : base(chip) { Watches = new List <MemWatcher>(); InitializeComponent(); OnReset(); }
/// @brief Default constructor for a Cog running in PASM mode. /// @param host PropellerCPU where this cog resides. /// @param programAddress Start of program to load from main memory. /// @param paramAddress PARAM value given to the Cog. /// @param frequency Frequency running the cog (the same as the Propeller). /// @param pll PLL Multiplier running the cog (the same as the Propeller). public NativeCog(PropellerCPU host, uint programAddress, uint paramAddress, uint frequency, PLLGroup pll) : base(host, programAddress, paramAddress, frequency, pll) { Carry = false; Zero = false; }
public VideoGenerator(PropellerCPU chip) { // Clear our phase accumulator PhaseAccumulator = 0; Chip = chip; // Scale is dirty ScaleDirty = true; }
public FreqGenerator(PropellerCPU host, PLLGroup phaseLockLoop, bool freqA) { Host = host; OutA = false; OutB = false; FreqA = freqA; PhaseLockLoop = phaseLockLoop; }
public MemoryView(PropellerCPU chip) : base(chip) { MonoFont = new Font(FontFamily.GenericMonospace, 10); if (MonoFont == null) { MonoFont = this.Font; } InitializeComponent(); positionScrollBar.Minimum = 0; }
//Constructor for the initialization of your plugin public YourClassName(PropellerCPU chip) : base(chip) { //Include here your initialization code only for attributes you add to //your class or interface objects (example create user controls for //the tab window). If you don't use any, don't add code here, but you //must not delete this method. //If you wish to use DrivePin() for initial setup of pins, call it //inside of OnReset() method, instead of here. OnReset(); // Put your code here: }
/// @brief Create a new Watch for a Main memory location. /// @param chip Reference to %PropellerCPU to inspect its memory. /// @param name Name to associate the Watch. /// @param address Memory address to inspect. public MemWatcher(PropellerCPU chip, string name, uint address) { IsCogBased = false; _chip = chip; _cog = null; Addr = address; //this assignment validate the value or throw an exception Name = name; Value = chip.ReadLong(Addr); ComparedValue = 0; isStoppedBy = false; Mode = StopMode.none; }
public SpinView(PropellerCPU chip) : base(chip) { MonoSpace = new Font(FontFamily.GenericMonospace, 8); if (MonoSpace == null) { MonoSpace = Font; } InitializeComponent(); Colorize = new Brush[0x10000]; for (int i = 0; i < Colorize.Length; i++) { Colorize[i] = Brushes.Gray; } }
public CogView(int hostId, PropellerCPU chip) : base(chip) { HostID = hostId; InterpAddress = new uint[80]; // Allow for up to 80 lines of displayed interpreted text displayAsHexadecimal = false; useShortOpcodes = true; MonoFont = new Font(FontFamily.GenericMonospace, 10); if (MonoFont == null) { MonoFont = this.Font; } MonoFontBold = new Font(MonoFont, FontStyle.Bold); InitializeComponent(); }
/// @brief Create a new Watch for a %Cog memory location. /// @param cog Reference to %Cog to inspect its memory. /// @param name Name to associate the Watch. /// @param address Memory address to inspect. public MemWatcher(Cog cog, string name, uint address) { IsCogBased = true; _chip = null; _cog = cog; Addr = address; //this assignment validate the value or throw an exception //CogSpecialAddress tmp; //if (Enum.IsDefined(typeof(CogSpecialAddress), Addr) && // Enum.TryParse(Addr, out tmp)) //{ // specialAddr = tmp; // Name = specialAddr.ToString(); //} Name = name; if (string.IsNullOrEmpty(Name)) { Name = name; } Value = cog.ReadLong(Addr); ComparedValue = 0; isStoppedBy = false; Mode = StopMode.none; }
/// @brief Constructor to initialize with the PropellerCPU reference. /// This avoid to declare in each plugin the following example code: /// @code{.cs} /// class PinNoise : PluginBase /// { /// private PropellerCPU Chip; //<== this line will not be necesary to declare in every plugin anymore. /// ... /// @endcode /// @version V15.03.26 - Added. public PluginBase(PropellerCPU chip) { Chip = chip; }
/// @brief Points to propeller instance. /// @note Asterisk's: Occurs once the plugin is loaded. It gives you a reference to the /// propeller chip (so you can drive the pins). /// @note Source: <a href="http://forums.parallax.com/showthread.php/91084-GEAR-Propeller-Debugging-Environment?p=625629&viewfull=1#post625629"> /// API GEAR described on GEAR original Post</a> //#pragma warning disable 618 public virtual void PresentChip(PropellerCPU host) { }