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 ); }
static int quicktimedrv_save(screenshot_t *screenshot, const char *filename) { // align and center video video_width = screenshot->width; video_height = screenshot->height; video_width = (video_width + 15) & ~15; video_height = (video_height + 15) & ~15; video_xoff = (video_width - screenshot->width) >> 1; video_yoff = (video_height - screenshot->height) >> 1; // create cfstring from filename CFStringRef path = CFStringCreateWithCString(NULL, filename, kCFStringEncodingUTF8); if (path == NULL) { log_debug("quicktime: error creating CFString!"); return -1; } // create data reference Handle dataRef; OSType dataRefType; OSErr theError = QTNewDataReferenceFromFullPathCFString( path, kQTNativeDefaultPathStyle, 0, &dataRef, &dataRefType); if (theError) { log_debug("quicktime: error creating data reference for '%s'", filename); return -1; } // Create a movie for this file (data ref) theError = CreateMovieStorage( dataRef, dataRefType, 'TVOD', smCurrentScript, createMovieFileDeleteCurFile, &dataHandler, &movie); if (theError) { log_debug("quicktime: error creating movie storage for '%s'", filename); return -1; } // dispose of the data reference handle - we no longer need it DisposeHandle(dataRef); // define time scale and host clock divider divider = (TimeScale)CVGetHostClockFrequency() / timeScale; // setup video if (setup_video() != noErr) { return -1; } // setup audio if (audio_codec != -1) { soundmovie_start(&quicktime_soundmovie_funcs); } // set initial time stamp timestamp = CVGetCurrentHostTime() / divider; return 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; }
int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, unsigned long initrd_addr, unsigned long initrd_size) { struct setup_header *hdr = &setup_base->hdr; int bootproto = get_boot_protocol(hdr); setup_base->e820_entries = install_e820_map( ARRAY_SIZE(setup_base->e820_map), setup_base->e820_map); if (bootproto == 0x0100) { setup_base->screen_info.cl_magic = COMMAND_LINE_MAGIC; setup_base->screen_info.cl_offset = COMMAND_LINE_OFFSET; } if (bootproto >= 0x0200) { hdr->type_of_loader = 8; if (initrd_addr) { printf("Initial RAM disk at linear address " "0x%08lx, size %ld bytes\n", initrd_addr, initrd_size); hdr->ramdisk_image = initrd_addr; hdr->ramdisk_size = initrd_size; } } if (bootproto >= 0x0201) { hdr->heap_end_ptr = HEAP_END_OFFSET; hdr->loadflags |= HEAP_FLAG; } if (cmd_line) { if (bootproto >= 0x0202) { hdr->cmd_line_ptr = (uintptr_t)cmd_line; } else if (bootproto >= 0x0200) { setup_base->screen_info.cl_magic = COMMAND_LINE_MAGIC; setup_base->screen_info.cl_offset = (uintptr_t)cmd_line - (uintptr_t)setup_base; hdr->setup_move_size = 0x9100; } /* build command line at COMMAND_LINE_OFFSET */ build_command_line(cmd_line, auto_boot); } setup_video(&setup_base->screen_info); return 0; }
int init(int bpp) { char wm_caption[20]; fprintf(stdout, "Epiar %s\n", epiar_version); fprintf(stdout, "http://www.epiar.net/\n"); fprintf(stdout, "\nPlease report all bugs at http://bugs.epiar.net/\n\n"); setup_video(screen_width, screen_height, bpp, fullscreen); init_colors(); /* basically sets up common Uint32s to avoid calls to SDL_MapRGB() */ /* load the main archive file (used throughout epiar) */ if ((epiar_eaf = eaf_open_file(apply_game_path("epiar.eaf"))) == NULL) printf("Couldn't open epiar.eaf file.\n"); if ((main_eaf = eaf_open_file(apply_game_path("main.eaf"))) == NULL) printf("Couldn't open epiar.eaf file.\n"); init_audio(); init_music(); SDL_ShowCursor(0); sprintf(wm_caption, "Epiar [%s]", epiar_version); SDL_WM_SetCaption(wm_caption, wm_caption); load_input_cfg(); init_trig(); init_playlist(); gui_init(); init_plugins(); srand(time(NULL)); return (0); }