Kod kompajliram naredbom tcc pixel.c
Evo koda:
#include <dos.h>
void set_video_mode(unsigned char mode)
{
union REGS regs;
regs.h.ah = 0x00;
regs.h.al = mode;
int86(0x10,®s,®s);
return;
}
void plot_pixel_fast(int x,int y,unsigned char color)
{
unsigned char *VGA = (unsigned char *)0xA0000000L;
unsigned short offset = 320*y+x;
VGA[offset] = color;
return;
}
void main()
{
set_video_mode(0x13);/*256 color video mode*/
plot_pixel_fast(10,10,15);
return;
}