int main( int argc, char* argv[] ) {
	atexit(on_exit);

	OggPlayer ogg("../sample video/trailer_400p.ogg",AF_S16,2,44100,VF_BGRA);
	if(ogg.fail()) {
		SDL_SetError("Could not open ../sample video/trailer_400p.ogg");
		return -1;
	}

	SDL_Surface *screen;
	if(!init_audio((void*)&ogg) || !(screen=init_video(ogg.width(),ogg.height())))
		  return -2;

	ogg.play();

	bool running=true;
	while( ogg.playing() && running ) {
		SDL_Event event;
		while(SDL_PollEvent(&event))
			if(event.type==SDL_QUIT){ running = false; }

	    SDL_LockSurface( screen );
		ogg.video_read((char*)screen->pixels,screen->pitch);
	    SDL_UnlockSurface( screen );
		SDL_Flip(screen);
		SDL_Delay(0);
	}
	return 0;
}
Example #2
0
void kmain(u32 init_stack) {
    init_esp_start = init_stack;
    init_video();
    puts_color_str("Booting Panda OS ...\n", 0x0B);

    cli();
    time_init();
    gdt_init();
    idt_init();
    kb_init();
    mm_init();
    buf_init();
    file_init();
    inode_init();
    ide_init();
    task_init();
    timer_init();
    sysc_init();

    spawn(init_user);
    sti();
    init = 0;
    while(1) {
        if(!init) {
            printk("kernel running ...\n");
            init = 1;
        }
        sti();
        sched();
    }
}
Example #3
0
int main(int argc, char* argv[])
{
	bool rv;
	cv::Mat capture_img, canvas_img;

	rv = init_video(0);
	//rv = init_image("source.png");
	//rv = init_movie("source.m4v");
	if (rv == false) return -1;

	while(true) {
		capture(capture_img);
		process(capture_img);

		capture_img.copyTo(canvas_img);
		debug_draw(canvas_img);
		cv::imshow("result", canvas_img);

		int c = cv::waitKey(1);
		if (c == 27) {
			break;
		}
	}

	finish();

	cv::destroyAllWindows();

	return 0;
}
Example #4
0
int init(void)
{
  if (init_video() != 0)
    {
      fprintf(stderr, "Failed to initialize video\n");
      return -1;
    }

  if (init_script() != 0)
    {
      fprintf(stderr, "Failed to initialize scripting engine\n");
      return -1;
    }

  if (init_gfx() != 0)
    {
      fprintf(stderr, "Failed to initialize graphics\n");
      return -1;
    }

  if (init_audio() != 0)
    {
      fprintf(stderr, "Failed to initialize audio\n");
      return -1;
    }

  if (init_sdl() != 0)
    {
      fprintf(stderr, "Failed to initialize SDL\n");
      return -1;
    }

  return 0;
}
Example #5
0
static void
arch_init( void )
{
	openbios_init();
	modules_init();
#ifdef CONFIG_DRIVER_PCI
        arch = &default_pci_host;
	ob_pci_init();
#endif
#ifdef CONFIG_DRIVER_IDE
	setup_timers();
	ob_ide_init("/pci/isa", 0x1f0, 0x3f4, 0x170, 0x374);
#endif
#ifdef CONFIG_DRIVER_FLOPPY
	ob_floppy_init("/isa", "floppy0", 0x3f0, 0);
#endif
#ifdef CONFIG_XBOX
	setup_video(0x3C00000, phys_to_virt(0x3C00000));

	/* Force video to 32-bit depth */
	VIDEO_DICT_VALUE(video.depth) = 32;

	init_video();
	node_methods_init();
#endif
	device_end();
	bind_func("platform-boot", boot );
	bind_func("(go)", go );
}
void
OptionsMenu::menu_action(MenuItem* item)
{
  switch (item->id) {
    case MNID_FULLSCREEN:
      if(config->use_fullscreen != options_menu->is_toggled(MNID_FULLSCREEN)) {
        config->use_fullscreen = !config->use_fullscreen;
        init_video();
        config->save();
      }
      break;
    case MNID_SOUND:
      if(config->sound_enabled != options_menu->is_toggled(MNID_SOUND)) {
        config->sound_enabled = !config->sound_enabled;
        sound_manager->enable_sound(config->sound_enabled);
        config->save();
      }
      break;
    case MNID_MUSIC:
      if(config->music_enabled != options_menu->is_toggled(MNID_MUSIC)) {
        config->music_enabled = !config->music_enabled;
        sound_manager->enable_music(config->music_enabled);
        config->save();
      }
      break;
    default:
      break;
  }
}
Example #7
0
int main( int argc, char* argv[] ) {
	atexit(on_exit);

	OggPlayer ogg("../sample video/trailer_400p.ogg",AF_S16,2,44100,VF_BGRA);
	if(ogg.fail()) {
		SDL_SetError("Could not open ../sample video/trailer_400p.ogg");
		return -2;
	}

	if(!init_audio((void*)&ogg) || !init_video(ogg.width(),ogg.height()))
		return -3;

	glewInit();

	if (!GLEW_VERSION_2_0){
		SDL_SetError("OpenGL 2.0 not supported");
		return -1;
	}

	YUVFrame yuv_frame(ogg);

	ogg.play();

	bool running=true;

	while( ogg.playing() && running ) {
		SDL_Event event;
		while(SDL_PollEvent(&event)){
			if(event.type==SDL_QUIT || event.type==SDL_KEYDOWN){ running = false; }
		}
		yuv_frame.render();
		SDL_GL_SwapBuffers();
	}
	return 0;
}
Example #8
0
int tty_ctrl_initialize(struct tty_ctrl *ctrl)
{
    int ret;

    ctrl->kbd_fd = open_io_driver("/dev/kbd", O_RDONLY);
    if (ctrl->kbd_fd < 0)
        return ctrl->video_fd;

    ctrl->video_fd = open_io_driver("/dev/video", O_WRONLY);
    if (ctrl->video_fd < 0)
        return ctrl->video_fd;

    ret = init_slaves(ctrl, 1);
    if (ret < 0)
        return ret;

    ret = init_video(ctrl);
    if (ret < 0)
        return ret;

    ret = init_input_thread(ctrl);
    if (ret < 0)
        return ret;

    return 0;
}
Example #9
0
void kmain(unsigned long magic, multiboot_info_t * mbi)
{
   if (magic != MULTIBOOT_BOOTLOADER_MAGIC)
   {
      printk ("Invalid magic number: 0x%x\n", (unsigned) magic);
      return;
   }

   gdt_install();
   idt_install();
   
   init_video();
   isrs_install();
   irq_install();
   timer_install();
   
   sys_setup(mbi);

   test_inode();
   
   __asm__ __volatile__ ("sti");

   printk("EgGS:hello there!\n");

//   int i = 10 / 0;

   for (;;);
}
Example #10
0
File: main.c Project: callaa/luola
int main (int argc, char *argv[]) {
    int rval, r;
    /* Parse command line arguments */
    init_startup_options ();
    if (argc > 1) {
        for (r = 1; r < argc; r++) {
            if (strcmp (argv[r], "--help") == 0) {
                print_help ();
                return 0;
            } else if (strcmp (argv[r], "--version") == 0)
                show_version ();
            else if ((r = parse_argument (r, argc, argv)) == 0)
                return 0;
        }
    }
    /* Check if luola's home directory exists and create it if necessary */
    check_homedir ();

    /* Seed the random number generator */
    srand (time (NULL));

    /* Initialize */
    init_sdl ();
    init_video ();

    if (luola_options.sounds)
        init_audio ();

    if(init_font()) return 1;
    if(load_data()) return 1;

    scan_levels(0);
    scan_levels(1);
    if (game_settings.levels == NULL)
        no_levels_found ();

    init_level();
    init_hotseat();
    if (luola_options.mbg_anim)
        init_demos ();

    /* Set sound effect volume */
    audio_setsndvolume(game_settings.sound_vol);

    /* Enable key repeat (useful in menus. Will be disabled during game) */
    SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,SDL_DEFAULT_REPEAT_INTERVAL);

    /* Enter game loop */
    while (1) {
        /* Intro screen */
        rval = game_menu_screen ();
        if (rval == INTRO_RVAL_EXIT)
            break;
        /* Play ! */
        if (rval == INTRO_RVAL_STARTGAME)
            hotseat_game ();
    }
    return 0;
}
Example #11
0
int main( int argc, const char* argv[] )
{
	init_video();
	loop();
	delete_buffers();

	return 0;
}
Example #12
0
int kernel_main() {
    init_gdt();
    init_idt();
    init_video();

    setcolor(make_color(COLOR_GREEN, COLOR_BLACK));
    printf("Hello, World!");
    newline(5);
    setcolor(make_color(COLOR_ORANGE, COLOR_BLACK));
    printf("                          ,--.\n");
    printf("                   _/ <`-'\n");
    printf("               ,-.' \\--\\_\n");
    printf("              ((`-.__\\   )\n");
    printf("               \\`'    @ (_\n");
    printf("               (        (_)\n");
    printf("              ,'`-._(`-._/\n");
    printf("           ,-'    )&&) ))\n");
    printf("        ,-'      /&&&%-'\n");
    printf("      ,' __  ,- {&&&&/\n");
    printf("     / ,'  \\|   |\\&&'\\\n");
    printf("    (       |   |' \\  `--.\n");
    printf("(%--'\\   ,--.\\   `-.`-._)))\n");
    printf(" `---'`-/__)))`-._)))\n\n");

    int count = 0;

    //Some delay before bouncing
    while (count < 10) {
        sleep(100000000);
        count++;
    }
    count = 0;
    while (true) {

        while (count < 5) {
            sleep(100000000);
            scrolldown();
            count++;
        }

        while (count < 10) {
            sleep(100000000);
            scrollup();
            count++;

        }

        if (count % 10 == 0) {
            count = 0;
        }

    }
    printf("Exiting...");


    return 0;
}
Example #13
0
void laserdisc_device::device_start()
{
	// initialize the various pieces
	init_disc();
	init_video();
	init_audio();

	// register callbacks
	config_register(machine(), "laserdisc", config_saveload_delegate(FUNC(laserdisc_device::config_load), this), config_saveload_delegate(FUNC(laserdisc_device::config_save), this));
}
Example #14
0
void init_n64()
{
	init_interrupts();
	
	init_video();
	set_video();
	dfs_init(DFS_DEFAULT_LOCATION);
	controller_init();
	timer_init();
}
Example #15
0
void harddriv_state::device_start()
{
	//atarigen_state::machine_start();

	/* predetermine memory regions */
	m_adsp_pgm_memory_word = (uint16_t *)(reinterpret_cast<uint8_t *>(m_adsp_pgm_memory.target()) + 1);

	init_video();

}
Example #16
0
void AgiEngine::initialize() {
	memset(&opt, 0, sizeof(struct agi_options));
	opt.gamerun = GAMERUN_RUNGAME;
	opt.hires = true;

	// TODO: Some sound emulation modes do not fit our current music
	//       drivers, and I'm not sure what they are. For now, they might
	//       as well be called "PC Speaker" and "Not PC Speaker".

	switch (MidiDriver::detectMusicDriver(MDT_PCSPK)) {
	case MD_PCSPK:
		opt.soundemu = SOUND_EMU_PC;
		break;
	default:
		opt.soundemu = SOUND_EMU_NONE;
		break;
	}

	if (ConfMan.hasKey("render_mode"))
		opt.renderMode = Common::parseRenderMode(ConfMan.get("render_mode").c_str());

	_console = new Console(this);

	init_machine();

	game.color_fg = 15;
	game.color_bg = 0;

	*game.name = 0;

	game.sbuf = (uint8 *) calloc(_WIDTH, _HEIGHT);
	game.hires = (uint8 *) calloc(_WIDTH * 2, _HEIGHT);

	_sprites = new SpritesMan;
	_text = new TextMan;
	init_video();

	tick_timer = 0;
	_timer->installTimerProc(agi_timer_function_low, 10 * 1000, NULL);

	game.ver = -1;		/* Don't display the conf file warning */

	debugC(2, kDebugLevelMain, "Detect game");
	if (agi_detect_game() == err_OK) {
		game.state = STATE_LOADED;
		debugC(2, kDebugLevelMain, "game loaded");
	} else {
		report("Could not open AGI game");
	}

	debugC(2, kDebugLevelMain, "Init sound");
	init_sound();
	g_agi_music = new AGIMusic(_mixer);
}
Example #17
0
void harddriv_state::device_start()
{
	//atarigen_state::machine_start();

	/* predetermine memory regions */
	m_sim_memory = (UINT16 *)memregion("user1")->base();
	m_sim_memory_size = memregion("user1")->bytes() / 2;
	m_adsp_pgm_memory_word = (UINT16 *)(reinterpret_cast<UINT8 *>(m_adsp_pgm_memory.target()) + 1);

	init_video();

}
Example #18
0
File: main.c Project: gladkikh/OS
int main()
{
    int i = 0;

    init_video();
    puts ("Hello!!!");

    while(1)
    {

    }
}
Example #19
0
void start_kernel(){
	setup_memory();
	init_video();
	flush_tlb();
	int *s = (int *)video.fb;
	int i;
	for(i = 0; i < video.width * video.height; ++i){
		*(s + i) = 0x3242;
		}
	while(1){}

}
Example #20
0
File: main.c Project: deadbok/aMOS
int main(void)
{
	printstr("OK\n");
	if (init_video())
	{
		return(1);
	}

	printstr("    Resetting disk...");
	if (print_error(disk_reset(loader_setup.boot_drive), disk_errors, N_DISK_ERRORS, TRUE))
	{
		return(1);
	}

	printstr("    Getting disk info...");
	if (print_error(disk_info_standard(loader_setup.boot_drive,
									   &disk_geometry.cylinder,
									   &disk_geometry.head,
									   &disk_geometry.sector),
					 disk_errors, N_DISK_ERRORS, TRUE))
	{
		return(1);
	}

	printstr("...OK\n");

	printstr("Loading HIKernel (");
	putl(loader_setup.kernel_sectors, 10);
	printstr(" sectors)...\n");

	if (print_error(read_kernel(), disk_errors, N_DISK_ERRORS, TRUE))
	{
		return(1);
	}

	printstr("Killing floppy motor...\n");
	stop_floppy();

	printstr("Starting the BOSS...");

	engage();

	update_cursor();
	printstr("\nBack in the aMOS loader\n");
	printstr("Can't play that funky music, giving it up\n");
	printstr("Let down and hanging around\n");
	for (;;) {}

	return(0);
}
Example #21
0
static int init_mode(int new_mode, const char *paletname) {
    Uint32 mode_flags;
    const SDL_VideoInfo *vi;
    int las, las2;
    int w = (new_mode == SVGA_MODE) ? 800 : 320;
    int h = (new_mode == SVGA_MODE) ? 600 : 200;

    init_video();

    mode_flags = SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_HWPALETTE;

    if (!draw_with_vircr_mode)
        mode_flags |= SDL_ANYFORMAT;
    //if (wantfullscreen)
     //   mode_flags |= SDL_FULLSCREEN;

    if (draw_with_vircr_mode && pixel_multiplier > 1)
        wfree(vircr);

    pixel_multiplier = (new_mode == SVGA_MODE) ? pixel_multiplier_svga : pixel_multiplier_vga;

    video_state.surface = SDL_SetVideoMode(w * pixel_multiplier, h * pixel_multiplier, 8, mode_flags);
    assert(video_state.surface);

    if (draw_with_vircr_mode) {
        if (pixel_multiplier > 1) {
            vircr = (uint8_t *) walloc(w * h);
        } else {
            vircr = (uint8_t *) video_state.surface->pixels;
        }
    }
    /* else vircr is preallocated in init_video */
    vi = SDL_GetVideoInfo();
    video_state.haverealpalette = (vi->vfmt->palette != NULL);

    dksopen(paletname);

    dksread(ruutu.normaalipaletti, sizeof(ruutu.normaalipaletti));
    for (las = 0; las < 256; las++)
        for (las2 = 0; las2 < 3; las2++)
            ruutu.paletti[las][las2] = ruutu.normaalipaletti[las][las2];

    dksclose();

    setpal_range(ruutu.paletti, 0, 256);
    all_bitmaps_refresh();

    current_mode = new_mode;
    return 1;
}
Example #22
0
void laserdisc_device::device_start()
{
	// if we have a palette and it's not started, wait for it
	if (m_overlay_palette != nullptr && !m_overlay_palette->started())
		throw device_missing_dependencies();

	// initialize the various pieces
	init_disc();
	init_video();
	init_audio();

	// register callbacks
	machine().configuration().config_register("laserdisc", config_saveload_delegate(FUNC(laserdisc_device::config_load), this), config_saveload_delegate(FUNC(laserdisc_device::config_save), this));
}
Example #23
0
File: main.c Project: djays/TIK
int main()
{
    gdt_setup();    
    idt_setup();
    isr_setup();
    init_video();
    irq_setup();
    __asm__ __volatile__ ("sti");
    timer_setup();
    keyboard_setup();
    puts(" Welcome to TIK! \n");
    for (;;);
    
    return 0;
}
Example #24
0
kmain() 
{
/* Inicializa */

    init_interrupts();
    init_video();
    init_stdio();

    keyboard_queue_initialize();
    
    set_language(ENGLISH);
    set_terminal(0);

    loop();
}
Example #25
0
void laserdisc_device::device_start()
{
	// ensure that our screen is started first
	m_screen = machine().device<screen_device>(m_screen_name);
	assert(m_screen != NULL);
	if (!m_screen->started())
		throw device_missing_dependencies();

	// initialize the various pieces
	init_disc();
	init_video();
	init_audio();

	// register callbacks
	config_register(machine(), "laserdisc", config_saveload_delegate(FUNC(laserdisc_device::config_load), this), config_saveload_delegate(FUNC(laserdisc_device::config_save), this));
}
Example #26
0
int main(int argc, char **argv)
{
    SDL_Event *event = av_mallocz(sizeof(SDL_Event));
    Content *content = av_mallocz(sizeof(Content));
    Media *video = av_mallocz(sizeof(Media));
    Media *audio = av_mallocz(sizeof(Media));
    State *state = av_mallocz(sizeof(State));
    SDL_Thread *video_decode_tid1;
    SDL_Thread *video_decode_tid2;
    SDL_Thread *read_pkt_tid;
    SDL_Thread *refresh_tid;
//    InitPool(2);
    state->content = content;
    state->video = video;
    state->audio = audio;
    init_video(video);
    if(argc < 2) {
	LOGE("Usage : play <content>");
	exit(1);
    }
    av_register_all();
    if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER)) {
	LOGE("fail to initialize SDL");
	exit(1);
    }
    av_strlcpy(content->name, argv[1], sizeof(content->name));
    LOGE("addr : %x", video->frame_buf);
    get_content_info(content);
    LOGI("finding streams");
    find_av_streams(content, video, audio);
    LOGI("finding decoder");
    find_decoder(video);
    video->get_info(video);
    LOGI("creating reading thread...");
    read_pkt_tid = SDL_CreateThread(queue_av_pkt, "read", state);
    LOGI("initing screen");
    init_screen(video);
//    LOGI("alloc frame");
    alloc_frame(video);
    LOGI("alloc all the frame");
//    alloc_all_frame(video);
    LOGI("creating decode thread1...");
    video_decode_tid1 = SDL_CreateThread(decode_video, "decode1", video);    
    refresh(state, 50);
    event_handle(event);
    return 0;
}
Example #27
0
void main()
{
	gdt_install(3) ;
	init_video(&sc) ;  
	idt_install() ; 
	isrs_install() ; 
	irq_install() ; 
	timer_install() ; 
	keyboard_install() ;
	__asm__ __volatile__ ("sti"); 
	int state = 0 ; 
	screen sc  ;  
	//puts(&sc, "Hello world in new functions\n") ; 
	print_int(&sc, state) ;  
	/* Since there is no support for newlines in terminal_putchar yet, \n will
	   produce some VGA specific character instead. This is normal. */
}
Example #28
0
	void init_builtin_commands() {
		LOG_D("command/init") << "Populating command map";
		init_app();
		init_audio();
		init_automation();
		init_edit();
		init_grid();
		init_help();
		init_keyframe();
		init_recent();
		init_subtitle();
		init_time();
		init_timecode();
		init_tool();
		init_video();
		init_visual_tools();
	}
Example #29
0
void init(void)
{
    init_video();
    init_mm();
    init_trap();
    init_irq();
    init_8259a();
    init_keyboard();
    init_timer();
    init_harddisk();
    init_mouse();

    io_sti();
    init_resource();

    do_test();
}
Example #30
0
File: game.c Project: AGFeldman/nos
/* This is the entry-point for the game! */
void c_start(void) {
    // Initialize video, interrupt, timer, and keyboard subsystems
    init_video();
    init_interrupts();
    init_timer();
    init_keyboard();

    // Initialize game state
    init_player();
    init_guns();
    win = 0;
    draw_world();
    draw_player();

    enable_interrupts();

    mainloop();
}