Pixel Plotting

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
TheGuy
Posts: 13
Joined: Wed Jul 08, 2009 11:14 pm

Pixel Plotting

Post by TheGuy »

I need a little bit of help, it deals with pixel plotting.

1. Why are there gaps? Do I need to make the colour attribute different? (I notice there are no gaps in some areas).
2. How can I draw to the full 640 by 480 pixels? I can't get past 1000-2000.

Image
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Pixel Plotting

Post by neon »

Hello,

Is this 640x480x4 VGA mode or are you using VBE? If VBE, whats your exact mode? Also, how are you plotting the pixels to video memory? I suspect its VBE do to comment 2. If it is, look into changing bank switching (in the VBE manual) or using a LFB mode to solve the issue. Cant solve problem 1 without knowing your video mode and how you are writing to it.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
TheGuy
Posts: 13
Joined: Wed Jul 08, 2009 11:14 pm

Re: Pixel Plotting

Post by TheGuy »

Sorry.

I'm calling interrupt ten with
AX: 0x4F02
BX: 0x112

which sets to 640x480x24 (Direct Pixel), this has changed from the image above. I still crash if I go above 1000.

Here is my TEST code.

Code: Select all

unsigned int *vid = (unsigned int*)0XA0000;
for(; vid < 0XA1000; ++vid)
{
		*(vid) = vid;
}
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Pixel Plotting

Post by neon »

Hello,

Your mode number - 0x4F02 has bit 14 set which enables the mode for an LFB. You need to use int 0x10 VBE function 1 (return VBE mode info) and use PhysBasePtr member of the returned ModeInfoBlock structure. Use this pointer as video display - it may not be 0xa0000 do to it being a large LFB video mode. Information on this interrupt can be found online and in the VBE documentation.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Post Reply