1

Closed

Compiler Plug needed

description

I had just started programming in C#. Right now I wanted to try out Mouse support and GUI, so I had this code:
 
using System;
using Cosmos.Compiler.Builder;
using Cosmos.Kernel;
using Cosmos.Hardware;
using Cosmos.Sys;
using Cosmos.Debug;
using Cosmos.IL2CPU;
 
namespace CosmosBoot
{
class Program
{
    #region Cosmos Builder logic
    // Most users wont touch this. This will call the Cosmos Build tool
    [STAThread]
    static void Main(string[] args)
    {
        BuildUI.Run();
    }
    #endregion
 
    // Main entry point of the kernel
    public static void Init()
    {
        var xBoot = new Cosmos.Sys.Boot();
        xBoot.Execute();
        VGAScreen.SetMode320x200x8();
        VGAScreen.SetPaletteEntry(0, 0, 0, 0);
        VGAScreen.SetPaletteEntry(1, 63, 0, 0);
        VGAScreen.SetPaletteEntry(2, 63, 63, 63);
        VGAScreen.Clear(0);
        uint x = (uint)Mouse.X;
        uint y = (uint)Mouse.Y;
        uint oc = 0;
        while (true)
        {
            uint mx = (uint)Mouse.X;
            uint my = (uint)Mouse.Y;
            if (mx != x || my != y)
            {
                if (Mouse.Buttons == Mouse.MouseState.Left)
                    VGAScreen.SetPixel320x200x8(x, y, 1);
                else if (Mouse.Buttons == Mouse.MouseState.Right)
                    VGAScreen.SetPixel320x200x8(x, y, 0);
                else VGAScreen.SetPixel320x200x8(x, y, oc);
                x = mx;
                y = my;
                oc = VGAScreen.GetPixel320x200x8(x, y);
                VGAScreen.SetPixel320x200x8(x, y, 2);
            }
        }
    }
}
}
 
But, when i compile it, I get this error:
 
System.Exception: Plug needed. System.Boolean System.Runtime.CompilerSevices.RuntimeHelper.Equals(System.Object, System.Object)
at Cosmos.IL2CPU.ILScanner.ScanMethod(MethodBase aMethod, Boolean aIsPlug)
at Cosmos.IL2CPU.ILScanner.ScanQueue()
at Cosmos.IL2CPU.ILScanner.Execute(MethodBase aStartMethod)
at Cosmos.Compiler.Builder.Builder.RunEngine(Object aParam)
 
What must I do to resolve this problem?
Thanks in advance
Closed Apr 24, 2012 at 2:46 PM by kudzu
http://cosmos.codeplex.com/wikipage?title=Plugs&referringTitle=FAQ

comments