예제 #1
0
파일: vga.c 프로젝트: mattstock/bexkat1
void main() {
  unsigned char ch = 0x00;
  vga_set_mode(VGA_MODE_TEXT);
  for (int y=0; y < 40; y++) {
    for (int x=0; x < 80; x++) {
      vga_fb[80*y+x] = ch++;
    }
  }
  while (1);
}
예제 #2
0
파일: vbe.c 프로젝트: AjayMashi/x-tier
static void
vbe_104f02(struct bregs *regs)
{
    dprintf(1, "VBE mode set: %x\n", regs->bx);

    int mode = regs->bx & ~MF_VBEFLAGS;
    int flags = regs->bx & MF_VBEFLAGS;
    int ret = vga_set_mode(mode, flags);

    regs->ah = ret;
    regs->al = 0x4f;
}
예제 #3
0
파일: gfx.c 프로젝트: harnold/ducks
void gfx_exit(void)
{
    if (gfx_mode_info.mode != gfx_saved_vga_mode) {
        vga_set_mode(gfx_saved_vga_mode);
        gfx_mode_info.mode = gfx_saved_vga_mode;
    }

    if (gfx_framebuffer_address != 0) {
        if (dpmi_unmap_physical_address(gfx_framebuffer_address) != 0)
            error("Unmapping graphics card framebuffer failed");
        gfx_framebuffer_address = 0;
    }
}
예제 #4
0
파일: fmand.c 프로젝트: mattstock/bexkat1
void main(void) {
  double a = -0.9; //= 0.1;
  double b = -0.2; //= 0.0;
  double c = 0.001; //= 0.008;
  int x = 0;

  printf("Defining palette 0\n");
  for (x=0; x < 256; x++)
    vga_palette(0, x, x | (x << 8));

  vga_set_mode(VGA_MODE_NORMAL);

  printf("starting (%f, %f, %f)\n", a, b, c);
  clear();
  mandelbrot_float(a,b,c);
}
예제 #5
0
파일: vga.c 프로젝트: chaos4ever/chaos
// Set up the given video mode.
static bool mode_set(unsigned int width, unsigned int height, unsigned int bpp, unsigned int type)
{
    for (int search = 0; search < num_video_modes; search++)
    {
        if (width == mode[search].width &&
            height == mode[search].height &&
            bpp == mode[search].bpp &&
            type == mode[search].type)
        {
            vga_set_mode(mode[search].mode);
            current_mode = &mode[search];

            return TRUE;
        }
    }

    return FALSE;
}
예제 #6
0
int vga_ioctl(unsigned long request, void *data) {
	int ret;

	switch (request) {
		case SETVGAMODE: {
			enum vga_mode mode = (enum vga_mode)data;
			vga_set_mode(mode);
			ret = 0;
			break;
		}
		case FLUSHVGA: {
			char *user_buffer = (char*)data;
			vga_write_buf(user_buffer);
			ret = 0;
			break;
		}
		default: {
			ret = -1;
		}
	}

	return ret;
}
예제 #7
0
파일: ifftest.c 프로젝트: CDarrow/DXX-Retro
main(int argc,char **argv)
{
	int ret;
	grs_bitmap my_bitmap;
	ubyte my_palette[256*3];
	grs_bitmap *bm_list[100];
	int n_bitmaps;
	char key;

#if 0
	{
		int new_len,i;
		new_len=rle_span(new_span,test_span,sizeof(test_span));
		printf("old span (%d): ",sizeof(test_span));
		for (i=0;i<sizeof(test_span);i++) printf("%d ",test_span[i]);
		printf("\nnew span (%d): ",new_len);
		for (i=0;i<new_len;i++) printf("%d ",new_span[i]);
		exit(0);
	}
#endif

#ifdef ANIM_TEST
	ret = iff_read_animbrush(argv[1],bm_list,100,&n_bitmaps,&my_palette);
#else
	ret = iff_read_bitmap(argv[1],&my_bitmap,BM_LINEAR,&my_palette);
	bm_list[0] = &my_bitmap;
	n_bitmaps = 1;
#endif

	printf("ret = %d\n",ret);
	printf("error message = <%s>",iff_errormsg(ret));

	if (ret == IFF_NO_ERROR) {
		int i;

		vga_init();
		gr_init();
		vga_set_mode(SM_320x200C);

		for (i=0;i<n_bitmaps;) {

			if (argc>2) {
				ret = iff_write_bitmap(argv[2],bm_list[i],&my_palette);
				printf("ret = %d\n",ret);
			}

			//gr_pal_setblock(0,256,&my_palette);
			gr_palette_load(&my_palette);
			//gr_pal_fade_in(grd_curscreen->pal);	//in case palette is blacked

			gr_ubitmap(0,0,bm_list[i]);

			key = getch();

			if (key=='-') {if (i) i--;}
			else i++;

		}

		gr_close();

		for (i=0;i<n_bitmaps;i++) {
			free(bm_list[i]->bm_data);

			#ifdef ANIM_TEST
				free(bm_list[i]);
			#endif

		}
	}

}
예제 #8
0
파일: gui.c 프로젝트: jbussdieker/EOS
void gui_main(int argc, char **argv)
{
	extern unsigned long BootPageDirectory;
	paging_map(&BootPageDirectory, (void *)0xC0400000, (void *)0x400000, 1024*1024*8, 0x7);


	lx = x = GUI_WIDTH/2;
	ly = y = GUI_HEIGHT/2;
	x = y = 50;

	task_create(gui_daemon, 0, "moused", 0);
	
	unsigned long frames = 0;
	unsigned long tickstart = kinfo.ticks;
	while (1)
	{
		if (running == 0)
		{
			if (kinfo.gui == 1)
			{
				vga_set_mode(vgadev, GUI_WIDTH, GUI_HEIGHT, GUI_BPP);
				running = 1;
				tickstart = kinfo.ticks;
				frames = 0;
			}
			continue;
		}
		else if (kinfo.gui == 0)
		{
			vga_unset_mode(vgadev);
			running = 0;
			tty_scrolldown();
			continue;
		}
		
		frames++;
		
		// Clear
		vga_clear(vgadev, COLORBG);
		
		// Destop text
		vga_draw_string(vgadev, 0, 0, COLOR4, "EOS (Built %s %s)\n", __DATE__, __TIME__);
		vga_draw_string(vgadev, 0, 8, COLOR4, "Processor: %s", kinfo.cpuname);
		vga_draw_string(vgadev, 0, 16, COLOR4, "Memory: %dMB", kinfo.memory / 1024);
		vga_draw_string(vgadev, 0, 24, COLOR4, "Memory Used: %d", mm_used());

		vga_draw_string(vgadev, 0, 40, COLOR4, "mSPF %d", (kinfo.ticks-tickstart)/frames);
		if (kinfo.ticks - tickstart > 100)
			vga_draw_string(vgadev, 0, 48, COLOR4, "FPS %d", frames / ((kinfo.ticks-tickstart)/100));
		
		// Desktop icons
		//gui_draw_icon(vgadev, 8, 8);
		int winxnow, winynow;
		winxnow = winx;
		winynow = winy;
		gui_draw_window(vgadev, winxnow, winynow, 320, 240);
		gui_draw_icon(vgadev, winxnow+24, winynow+64);
		vga_draw_string(vgadev, winxnow+64, winynow+68, COLOR4, "Devices");
		gui_draw_icon(vgadev, winxnow+24, winynow+96);
		vga_draw_string(vgadev, winxnow+64, winynow+100, COLOR4, "Users");

		gui_draw_widget(vgadev, x, y);
		vga_flip(vgadev);
	}
}