VGA

Feb 5, 2012 at 11:28 PM

hi i am making a simple os all i want to do is set the pixel 1,1 to red but its not working it ends up looking like

top row 1cm deep is blue vertical strips with little random colored pixels in between some

then for the rest of the top of the screen to mid way  same thing but yellow

then a little bit down from midway rand coloured small squares

btw probably easier if you compile source your self and see what i mean

WHY and how do i fix this?

here is source

using System;
using System.Collections.Generic;
using System.Text;
using Sys = Cosmos.System;

namespace CosmosKernel2
{

    public class Kernel : Sys.Kernel
    {
        //values

        Cosmos.Hardware.VGAScreen VGA = new Cosmos.Hardware.VGAScreen();
        public byte[] Red = {255,0,0};
        //End of values

        protected override void BeforeRun()
        {
           //tell user the os is booting
            Console.WriteLine("Booting...");
            Console.WriteLine("Starting VGA Screen");
            ColourInsert(1, Red);
            VGA.SetMode320x200x8();
            VGA.SetPixel320x200x8(1, 1, 1);
           
        }

        protected override void Run()
        {
           
          
          
        }
        public void ColourInsert(int index, byte[] arr)
        {
            VGA.SetPalette(index, arr);
        }

    }
}

 

 

Feb 6, 2012 at 12:10 AM
SuperByte wrote:

hi i am making a simple os all i want to do is set the pixel 1,1 to red but its not working it ends up looking like

top row 1cm deep is blue vertical strips with little random colored pixels in between some

then for the rest of the top of the screen to mid way  same thing but yellow

then a little bit down from midway rand coloured small squares

btw probably easier if you compile source your self and see what i mean

WHY and how do i fix this?

here is source

using System;
using System.Collections.Generic;
using System.Text;
using Sys = Cosmos.System;

namespace CosmosKernel2
{

    public class Kernel : Sys.Kernel
    {
        //values

        Cosmos.Hardware.VGAScreen VGA = new Cosmos.Hardware.VGAScreen();
        public byte[] Red = {255,0,0};
        //End of values

        protected override void BeforeRun()
        {
           //tell user the os is booting
            Console.WriteLine("Booting...");
            Console.WriteLine("Starting VGA Screen");
            ColourInsert(1, Red);
            VGA.SetMode320x200x8();
            VGA.SetPixel320x200x8(1, 1, 1);
           
        }

        protected override void Run()
        {
           
          
          
        }
        public void ColourInsert(int index, byte[] arr)
        {
            VGA.SetPalette(index, arr);
        }

    }
}

 

 

You didn't clear the screen =). Hope it helps - Matt

Feb 6, 2012 at 12:19 AM
Thanks matt

On Mon, Feb 6, 2012 at 11:10 AM, civilwarrock <notifications@codeplex.com> wrote:

From: civilwarrock

SuperByte wrote:

hi i am making a simple os all i want to do is set the pixel 1,1 to red but its not working it ends up looking like

top row 1cm deep is blue vertical strips with little random colored pixels in between some

then for the rest of the top of the screen to mid way same thing but yellow

then a little bit down from midway rand coloured small squares

btw probably easier if you compile source your self and see what i mean

WHY and how do i fix this?

here is source

using System;
using System.Collections.Generic;
using System.Text;
using Sys = Cosmos.System;

namespace CosmosKernel2
{

public class Kernel : Sys.Kernel
{
//values

Cosmos.Hardware.VGAScreen VGA = new Cosmos.Hardware.VGAScreen();
public byte[] Red = {255,0,0};
//End of values

protected override void BeforeRun()
{
//tell user the os is booting
Console.WriteLine("Booting...");
Console.WriteLine("Starting VGA Screen");
ColourInsert(1, Red);
VGA.SetMode320x200x8();
VGA.SetPixel320x200x8(1, 1, 1);

}

protected override void Run()
{



}
public void ColourInsert(int index, byte[] arr)
{
VGA.SetPalette(index, arr);
}

}
}

You didn't clear the screen =). Hope it helps - Matt

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com




--
---------------------------
Jacksen Kline
Super Byte

Feb 6, 2012 at 1:04 AM

No problem buddy. Thanks - Matt

Developer
Feb 6, 2012 at 2:02 PM

This occurs because the memory that the VGA screen uses isn't cleared before it gets used. What your seeing is whatever is in the memory.