Ejemplo n.º 1
0
void fly_init (int x0, int y0, int rows, int cols, char *font)
{
    TID       tid;
    int       rc;
    ULONG     reset;

    tiled1 = _tmalloc (tiled_size);
    if (tiled1 == NULL) fly_error ("cannot allocate tiled memory\n");
    us1_16 = _tmalloc (sizeof(USHORT));
    us2_16 = _tmalloc (sizeof(USHORT));
    pci = _tmalloc (sizeof(VIOCURSORINFO));

    rc = DosCreateMutexSem (NULL, &mtx_Queue, 0, FALSE);
    debug_tools ("rc = %d after DosCreateMutexSem\n", rc);

    rc = DosCreateMutexSem (NULL, &mtx_Video, 0, FALSE);
    debug_tools ("rc = %d after DosCreateMutexSem\n", rc);

    rc = DosCreateEventSem (NULL, &hev_NewMessage, 0, FALSE);
    debug_tools ("rc = %d after DosCreateEventSem\n", rc);

    rc = DosCreateEventSem (NULL, &hev_VideoReady, 0, FALSE);
    debug_tools ("rc = %d after DosCreateEventSem\n", rc);
    
    grab_video ();
    if (rows != -1 && cols != -1)
        video_init (rows, cols);
    else
        video_init (25, 80);
    release_video ();

    DosResetEventSem (hev_VideoReady, &reset);
    rc = DosCreateThread (&tid, interface_thread, 0, 0, 32786);
    debug_tools ("rc = %d after DosCreateThread\n", rc);

    DosWaitEventSem (hev_VideoReady, SEM_INDEFINITE_WAIT);
    fl_opt.initialized = TRUE;
    DosSleep (300);

    if (font != NULL)
        fly_set_font (font);

    //debug_tools ("rows = %d, cols = %d in fly_init\n", rows, cols);
    if (rows != -1 && cols != -1)
        video_set_window_size (rows, cols);
    
    debug_tools ("x0 = %d, y0 = %d in fly_init\n", x0, y0);
    if (x0 >= 0 && y0 >= 0)
        video_set_window_pos (x0, y0);
}
Ejemplo n.º 2
0
void emulator_init(int width, int height, void *user)
{
	LOG_INIT();
	video_init(width, height, user);
	mapper_init();
	emulator_last_tick = 0;
}
Ejemplo n.º 3
0
kmain() {
	terminal_init();

	setup_IDT_entry (&idt[0x08], 0x08, (dword)&_int_08_hand, ACS_INT, 0);
	setup_IDT_entry (&idt[0x09], 0x08, (dword)&_int_09_hand, ACS_INT, 0);
	setup_IDT_entry (&idt[0x74], 0x08, (dword)&_int_74_hand, ACS_INT, 0);
	setup_IDT_entry (&idt[0x80], 0x08, (dword)&_int_80_hand, ACS_INT, 0);
	

	/* IDTR Setting */ 

	idtr.base = 0;  
	idtr.base +=(dword) &idt;
	idtr.limit = sizeof(idt)-1;
	
	_lidt(&idtr);

	/* Interrupt unmasking */
	
	_cli();

	_maskPIC1(0xF8);           /*0XF8*/
	_maskPIC2(0xEF);		/*0XEF*/
	
	_sti();

	video_init();
	timertick_init();
	rtc_init();
	mouse_init();
	shell_run();
}
Ejemplo n.º 4
0
int main(int argc, char *argv[]) {
    video_init(0);
    audio_init(argc, argv);
    game_init();

    double last = glfwGetTime();

    while (running) {
        double current = glfwGetTime();
        int delta = (current - last) * 1000;
        if (delta < MIN_DELTA) {
            glfwSleep((MIN_DELTA-delta)/1000.0);
            continue;
        }

        last = current;
        now += delta;
        if (delta > MAX_DELTA)
            continue;

        game_tick(delta);
    }

    audio_shutdown();
    video_shutdown();
    return EXIT_SUCCESS;
}
Ejemplo n.º 5
0
void PICvision_init(void) {
    HardwareConfig();
    timers_init(TICK_FREQ);
    video_init();
    sound_init(1000/TICK_FREQ);
    splash_screen();
}//f()
Ejemplo n.º 6
0
int drv_video_init(void)
{
    int error, devices = 1 ;
    struct stdio_dev vgadev ;
    if (video_inited) return 1;
    video_inited = 1;
    video_init();
    memset (&vgadev, 0, sizeof(vgadev));

    strcpy(vgadev.name, VIDEO_NAME);
    vgadev.flags =  DEV_FLAGS_OUTPUT | DEV_FLAGS_SYSTEM;
    vgadev.putc = video_putc;
    vgadev.puts = video_puts;
    vgadev.getc = NULL;
    vgadev.tstc = NULL;
    vgadev.start = video_start;

    error = stdio_register (&vgadev);

    if (error == 0)
    {
	char *s = getenv("stdout");
	if (s && strcmp(s, VIDEO_NAME)==0)
	{
	    if (overwrite_console()) return 1;
	    error = console_assign(stdout, VIDEO_NAME);
	    if (error == 0) return 1;
	    else return error;
	}
	return 1;
    }

    return error;
}
Ejemplo n.º 7
0
//==Part1:Control
int dtvideo_init (void **video_priv, dtvideo_para_t * para, void *parent)
{
    int ret = 0;
    dtvideo_context_t *vctx = (dtvideo_context_t *) malloc (sizeof (dtvideo_context_t));
    if (!vctx)
    {
        dt_error (TAG, "[%s:%d] video init failed \n", __FUNCTION__, __LINE__);
        ret = -1;
        goto ERR0;
    }
    memcpy (&vctx->video_para, para, sizeof (dtvideo_para_t));
    vctx->video_para.extradata_size = para->extradata_size;
    memcpy (&(vctx->video_para.extradata[0]), &(para->extradata[0]), para->extradata_size);

    //we need to set parent early
    vctx->parent = parent;
    ret = video_init (vctx);
    if (ret < 0)
    {
        dt_error (TAG, "[%s:%d] dtvideo_mgt_init failed \n", __FUNCTION__, __LINE__);
        ret = -1;
        goto ERR1;
    }
    *video_priv = (void *) vctx;
    return ret;
  ERR1:
    free (vctx);
  ERR0:
    return ret;
}
Ejemplo n.º 8
0
void initmodules(const string basedir)
{
	log4me_init(LOG_EMU_NONE);
#ifdef WIN32
	string redirect = pathcombc(strdups(basedir), "output.txt");
	log4me_redirectoutput(CSTR(redirect));
	strfree(redirect);
#endif

    LIBXML_TEST_VERSION;

    clock_init();

    // initialize SDL video
    if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK)<0) {
        log4me_error(LOG_EMU_SDL, "Unable to init SDL: %s\n", SDL_GetError());
        exit(EXIT_FAILURE);
    }
    // make sure SDL cleans up before exit
    pushexit(SDL_Quit);

    video_init();
    input_init();

    seticon(getcurrentwindow());
}
Ejemplo n.º 9
0
void appInit()
{
	int status;

	gAppAlive = 1;

	// navigation
	if (!nav_thread) {
      //vp_os_thread_create( thread_navdata_loop, 0, &nav_thread);
	}

	// video stream
	if (!stream_thread) {
      vp_os_thread_create( thread_stream_loop, 0, &stream_thread);
	}

	// AT cmds loop
	if (!at_thread) {
      //vp_os_thread_create( thread_at_cmds_loop, 0, &at_thread);
	}

#ifdef BUILD_OGLES
	// video rendering
	video_init();
#endif
}
Ejemplo n.º 10
0
void osd_common_t::init_subsystems()
{
	if (!video_init())
	{
		video_exit();
		osd_printf_error("video_init: Initialization failed!\n\n\n");
		fflush(stderr);
		fflush(stdout);
		exit(-1);
	}

	input_init();
	// we need pause callbacks
	machine().add_notifier(MACHINE_NOTIFY_PAUSE, machine_notify_delegate(FUNC(osd_common_t::input_pause), this));
	machine().add_notifier(MACHINE_NOTIFY_RESUME, machine_notify_delegate(FUNC(osd_common_t::input_resume), this));

	output_init();

	m_font_module = select_module_options<font_module *>(options(), OSD_FONT_PROVIDER);

	m_sound = select_module_options<sound_module *>(options(), OSD_SOUND_PROVIDER);
	m_sound->m_sample_rate = options().sample_rate();
	m_sound->m_audio_latency = options().audio_latency();

	m_debugger = select_module_options<debug_module *>(options(), OSD_DEBUG_PROVIDER);

	select_module_options<netdev_module *>(options(), OSD_NETDEV_PROVIDER);

	m_midi = select_module_options<midi_module *>(options(), OSD_MIDI_PROVIDER);

	m_mod_man.init(options());

}
Ejemplo n.º 11
0
int main(int argc, const char * argv[]) {
    SDL_Event event;

    if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) != 0) {
        printf("SDL_Init failed\n");
        return(1);
    }

    if(video_init() != 0) {
        SDL_Quit();
        return(2);
    }
    
    gui_init();

    while(quit == 0) {
        gui_draw();
        while(SDL_PollEvent(&event)) {
            if(event.type == SDL_QUIT) {
                quit++;
            }
        }
        video_frameend();
    }
    
    gui_kill();

    video_kill();
    SDL_Quit();
    return(0);
}
Ejemplo n.º 12
0
int BIKPlayer::doPlay()
{
	int done = 0;

	//bink is always truecolor
	g_truecolor = 1;

	frame_wait = 0;
	timer_last_sec = 0;
	video_frameskip = 0;

	if (sound_init( core->GetAudioDrv()->CanPlay())) {
		//sound couldn't be initialized
		return 1;
	}

	//last parameter is to enable YUV overlay
	outputwidth = (int) header.width;
	outputheight= (int) header.height;
	video->InitMovieScreen(outputwidth,outputheight, true);

	if (video_init(outputwidth,outputheight)) {
		return 2;
	}

	while (!done && next_frame()) {
		done = video->PollMovieEvents();
	}

	return 0;
}
Ejemplo n.º 13
0
int video_console_init(void)
{
	video_init();
	if (console)
		console_add_output_driver(&cons);
	return 0;
}
Ejemplo n.º 14
0
void
cons_init()
{
	memset(&cons, 0x0, sizeof(cons));
	serial_init();
	video_init();
	spinlock_init(&cons_lk);
}
Ejemplo n.º 15
0
int video_console_init(void)
{
	int ret = video_init();
	if (ret)
		return ret;
	console_add_output_driver(&cons);
	return 0;
}
Ejemplo n.º 16
0
void
video_config_init(void) {
  screen_mask = 1 << (((int)phys_text_base-0xA0000)/4096);

  video_init();

  reserve_video_memory();
}
Ejemplo n.º 17
0
void
becninit(struct consdev *cp)
{

	video_init((u_char *)cp->address);
	kbdreset();
	kbd(1);		/* read out ugly data */
}
Ejemplo n.º 18
0
void gtkui_cb_video_refresh() {
	// Refresh the Video output after changes
	if (playing) {
		opengl_cleanup();
		video_init();
	}
	else { video_set_params(); }
	gtkui_resize();
}
Ejemplo n.º 19
0
int drv_video_init(void)
{
	int error, devices = 1;
	struct stdio_dev videodev;

	u8 *dst;
	u32 fbmem_size = LCD_X_RES * LCD_Y_RES * LCD_PIXEL_SIZE + ACTIVE_VIDEO_MEM_OFFSET;

	dst = malloc(fbmem_size);

	if (dst == NULL) {
		printf("Failed to alloc FB memory\n");
		return -1;
	}

#ifdef EASYLOGO_ENABLE_GZIP
	unsigned char *data = EASYLOGO_DECOMP_BUFFER;
	unsigned long src_len = EASYLOGO_ENABLE_GZIP;
	error = gunzip(data, bfin_logo.size, bfin_logo.data, &src_len);
	bfin_logo.data = data;
#elif defined(EASYLOGO_ENABLE_LZMA)
	unsigned char *data = EASYLOGO_DECOMP_BUFFER;
	SizeT lzma_len = bfin_logo.size;
	error = lzmaBuffToBuffDecompress(data, &lzma_len,
		bfin_logo.data, EASYLOGO_ENABLE_LZMA);
	bfin_logo.data = data;
#else
	error = 0;
#endif

	if (error) {
		puts("Failed to decompress logo\n");
		free(dst);
		return -1;
	}

	memset(dst + ACTIVE_VIDEO_MEM_OFFSET, bfin_logo.data[0], fbmem_size - ACTIVE_VIDEO_MEM_OFFSET);

	dma_bitblit(dst + ACTIVE_VIDEO_MEM_OFFSET, &bfin_logo,
			(LCD_X_RES - bfin_logo.width) / 2,
			(LCD_Y_RES - bfin_logo.height) / 2);

	video_init(dst);		/* Video initialization */

	memset(&videodev, 0, sizeof(videodev));

	strcpy(videodev.name, "video");
	videodev.ext = DEV_EXT_VIDEO;	/* Video extensions */
	videodev.flags = DEV_FLAGS_SYSTEM;	/* No Output */
	videodev.putc = video_putc;	/* 'putc' function */
	videodev.puts = video_puts;	/* 'puts' function */

	error = stdio_register(&videodev);

	return (error == 0) ? devices : error;
}
Ejemplo n.º 20
0
int main(int argc, char *argv[])
{
	int err;

	err = video_init(640, 480);
	if(err)
		error("Failed to initialize video: %s", geterrmsg());

	exit(EXIT_SUCCESS);
}
Ejemplo n.º 21
0
int main(void)
{
    video_init();
    camera_init();
    tilemap_init();
    plan(4);
    test_basic_output();
    todo();
    note("exercise file reading");
    end_todo;
    done_testing();
}
Ejemplo n.º 22
0
int
main(int argc, char *argv[])
{
	options_init();
	options_deal(argc, argv);
	video_init();
	screen_init();
	screen_mainloop();
	screen_quit();
	video_quit();
	exit(EXIT_SUCCESS);
}
Ejemplo n.º 23
0
int openbios(void)
{
#ifdef CONFIG_DEBUG_CONSOLE
#ifdef CONFIG_DEBUG_CONSOLE_SERIAL
	uart_init(CONFIG_SERIAL_PORT, CONFIG_SERIAL_SPEED);
#endif
	/* Clear the screen.  */
	cls();
#endif

        collect_sys_info(&sys_info);

        dict = (unsigned char *)sys_info.dict_start;
        dicthead = (cell)sys_info.dict_end;
        last = sys_info.dict_last;
        dictlimit = sys_info.dict_limit;

	forth_init();

	relocate(&sys_info);

#ifdef CONFIG_DEBUG_CONSOLE_VGA
	video_init();
#endif
#ifdef CONFIG_DEBUG_BOOT
	printk("forth started.\n");
	printk("initializing memory...");
#endif

	init_memory();

#ifdef CONFIG_DEBUG_BOOT
	printk("done\n");
#endif

	PUSH_xt( bind_noname_func(arch_init) );
	fword("PREPOST-initializer");

	PC = (ucell)findword("initialize-of");

	if (!PC) {
		printk("panic: no dictionary entry point.\n");
		return -1;
	}
#ifdef CONFIG_DEBUG_DICTIONARY
	printk("done (%d bytes).\n", dicthead);
	printk("Jumping to dictionary...\n");
#endif

	enterforth((xt_t)PC);

	return 0;
}
Ejemplo n.º 24
0
Archivo: video.c Proyecto: scs/u-boot
int drv_video_init(void)
{
	device_t videodev;

	video_init((void *)NTSC_FRAME_ADDR);

	memset(&videodev, 0, sizeof(videodev));
	strcpy(videodev.name, "video");
	videodev.ext = DEV_EXT_VIDEO;
	videodev.flags = DEV_FLAGS_SYSTEM;

	return device_register(&videodev);
}
Ejemplo n.º 25
0
// initialize the console devices
void
cons_init(void)
{
	if (!cpu_onboot())	// only do once, on the boot CPU
		return;

	video_init();
	kbd_init();
	serial_init();

	if (!serial_exists)
		warn("Serial port does not exist!\n");
}
Ejemplo n.º 26
0
void appInit(void)
{
   __android_log_print( ANDROID_LOG_INFO, "ARDrone", "Enter in appInit\n" );
	
   // video rendering
	video_init();
//    int status;

  //  get_drone_ip();

	gAppAlive = 1;
	START_THREAD( mobile_main, NULL);
}
Ejemplo n.º 27
0
static void *video_ext_init(const video_info_t *video, const input_driver_t **input, void **input_data)
{
   ext_t *ext = (ext_t*)calloc(1, sizeof(*ext));
   if (!ext)
      return NULL;

   const rarch_video_driver_t *(*video_init)(void) = NULL;

   if (!(*g_settings.video.external_driver))
   {
      RARCH_ERR("External driver needs video_external_driver path to be set.\n");
      goto error;
   }

   g_lib = dylib_load(g_settings.video.external_driver);
   if (!g_lib)
   {
      RARCH_ERR("Failed to open library: \"%s\"\n", g_settings.video.external_driver);
      goto error;
   }

   video_init = (const rarch_video_driver_t *(*)(void))dylib_proc(g_lib, "rarch_video_init");
   if (!video_init)
      video_init = (const rarch_video_driver_t *(*)(void))dylib_proc(g_lib, "ssnes_video_init"); // Compat. Will be dropped on ABI break.

   if (!video_init)
   {
      RARCH_ERR("Couldn't find function rarch_video_init in library ...\n");
      goto error;
   }

   ext->driver = video_init();
   if (!ext->driver)
   {
      RARCH_ERR("External driver returned invalid driver handle.\n");
      goto error;
   }

   if (!setup_video(ext, video, input, input_data))
   {
      RARCH_ERR("Failed to start driver.\n");
      goto error;
   }

   g_video_dead = false;
   return ext;

error:
   video_ext_free(ext);
   return NULL;
}
Ejemplo n.º 28
0
void demo(void *fdt, uint32_t el)
{
	int nodeoffset;
	char *fbparam;
	uint64_t base;
	uint64_t size;
	uint32_t color;
	const char *cmdline;
	extern void *image_start;
	extern void *image_end;

	/*
	 * Parse /chosen/bootargs for the real base
	 * of tegra framebuffer.
	 */
	nodeoffset = fdt_path_offset(fdt,
				     "/chosen");
	if (nodeoffset < 0) {
		goto cont;
	}

	cmdline = fdt_getprop(fdt, nodeoffset,
			      "bootargs", NULL);
	if (cmdline == NULL) {
		goto cont;
	}
	fbparam = strstr(cmdline, "tegra_fbmem=");
	if (parse_memloc(fbparam + 12, &size, &base) == 0) {
		fb_base = (void *) base;
	}

cont:
	video_init(fb_base);
	printk("We are at EL%u\n", el);
	printk("We are 0x%lx bytes at %p\n",
	       (uint64_t) &image_end -
	       (uint64_t) &image_start,
	       &image_start);

	/*
	 * Draw some lines diagonal lines in the bottom half of screen.
	 *
	 * Green: we're at EL2.
	 * White: we're at EL1.
	 */
	color = el == 2 ? 0xff00ff00 : 0xffffffff;
	bres(0, FB_ROWS / 2, FB_COLS - 1, FB_ROWS - 1, color);
	bres(FB_COLS - 1, FB_ROWS / 2, 0, FB_ROWS - 1, color);
	bres(1, FB_ROWS / 2, FB_COLS - 1, FB_ROWS - 2, color);
	bres(FB_COLS - 2, FB_ROWS / 2, 0, FB_ROWS - 2, color);
}
Ejemplo n.º 29
0
int main(int argc, char* argv[]) {
  int i,j = 0;
  unsigned int frame = 0;
  char *rom_file = NULL;
  int rom_size = 0;
  double z80_cycles = 0;

  if (argc < 2) {
    fprintf(stderr, "Usage: %s ROM_FILE\n", argv[0]);
    return 1;
  }

  rom_file = argv[1];
  memory_init();
  rom_size = memory_load(rom_file);

  if (rom_size < 0) {
    fprintf(stderr, "Couldn't read ROM file %s\n", rom_file);
    return 1;
  }

  printf("Read ROM %s (%d bytes)\n", rom_file, rom_size);

  io_init();
  video_init();
  input_init();
  vpu_init();

  Z80Reset(&z80_state);
  z80_state.pc = 0;

  while (input_quit() == 0) {
    z80_cycles += Z80Emulate(&z80_state, Z80_CYCLES_PER_STEP);

    vpu_draw_screen();

    video_flip();
    video_wait_frame();

    input_process();

    Z80NonMaskableInterrupt (&z80_state);

    frame++;
  }

  printf("Ran %d frames and %f Z80 cycles.\n", frame, z80_cycles);

  return 0;
}
Ejemplo n.º 30
0
/*
 * init sdl2 render
 * args:
 *    width - overlay width
 *    height - overlay height
 *    flags - window flags:
 *              0- none
 *              1- fullscreen
 *              2- maximized
 *
 * asserts:
 *
 * returns: error code (0 ok)
 */
 int init_render_sdl2(int width, int height, int flags)
 {
	int err = video_init(width, height, flags);

	if(err)
	{
		fprintf(stderr, "RENDER: Couldn't init the SDL2 rendering engine\n");
		return -1;
	}

	assert(rending_texture != NULL);

	return 0;
 }