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.
Pixel Plotting
Re: Pixel Plotting
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.
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();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Re: Pixel Plotting
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.
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;
}
Re: Pixel Plotting
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.
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();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}