/* ----------------------------------------------------------------------------------- */ void gameover_main(char *message){ int8u c; display_off(); palette_store( 0, fopen("bmp/title.pal"), 16); palette_store(16, fopen("bmp/sp_castle.pal"), 16); vram_store(0x0000, fopen("bmp/sp_castle.ptn"), 0x2000); vram_store(0x2000, fopen("bmp/title.ptn"), 0x1000); vram_store(0x3000, fopen("bmp/font.ptn"), 0x800); pattern_fill(0x3800, 0, BG_HIGH, 32 * 24 * 2); print_init(); store_pattern_name_buffer(10); print(message, 10); store_pattern_name_buffer(9); print("1P SCORE XXXX0 ", 8); pattern_name_buffer[17 << 1] = VRAM_NUMBER + score_ints[3]; pattern_name_buffer[18 << 1] = VRAM_NUMBER + score_ints[2]; pattern_name_buffer[19 << 1] = VRAM_NUMBER + score_ints[1]; pattern_name_buffer[20 << 1] = VRAM_NUMBER + score_ints[0]; store_pattern_name_buffer(11); if(players_count == 2){ print("2P SCORE XXXX0 ", 8); pattern_name_buffer[17 << 1] = VRAM_NUMBER + score_ints[7]; pattern_name_buffer[18 << 1] = VRAM_NUMBER + score_ints[6]; pattern_name_buffer[19 << 1] = VRAM_NUMBER + score_ints[5]; pattern_name_buffer[20 << 1] = VRAM_NUMBER + score_ints[4]; store_pattern_name_buffer(13); } actors_clear(); scroll_y = 0; print_init(); display_on(); psg_set_bgm(fopen("sound/over.sn7"), FALSE); for(c = 6; c != 0; c--){ for(frame_count = 0; frame_count < 60; frame_count++){ sprites_clear(); vsync_wait(); sprites_store(); scroll_store(); psg_play(); } } psg_stop(); }
void editor_init(void) { Text *txt = text_load(NULL); vga_init(); print_init(); view_main_window(); editor.root = GetMenu(CHINESE); if(!(editor.root)){ messagebox_manager("load menu failed."); getch(); text_free(txt); exit(1); } view_main_menu(editor.root); if(!txt){ messagebox_manager("open empty file failed."); } editor.cli = clipborad_init(); initmouse(); fprintf(stderr,"logging...\n"); showmouseptr(); editor.txt = txt; editor.mode = MENU; }
int print_str(char *s, unsigned int len) { // if (!COS_IN_ARGREG(s) || !COS_IN_ARGREG(s + len)) { if (1) { static char foo[MAX_LEN]; snprintf(foo, MAX_LEN, "print argument out of bounds: %x", (unsigned int)s); cos_print(foo, 0); return -1; } s[len+1] = '\0'; #ifdef COS_PRINT_SHELL assert(!print_init()); if (sharedbuf.b) { int amnt; amnt = cringbuf_produce(&sharedbuf, s, len); assert(amnt >= 0); cos_trans_cntl(COS_TRANS_TRIGGER, COS_TRANS_SERVICE_PRINT, 0, 0); } #endif #ifdef COS_PRINT_DMESG cos_print(buf_ptr, len); #endif return 0; }
int Print::start_print(HWND ohwnd,HINSTANCE hThis) { hdc = GetDC(ohwnd); memDC = CreateCompatibleDC(hdc); print_init(&printdlg, ohwnd, hThis); if(!PrintDlg(&printdlg)) return 0; docinfo.cbSize = sizeof(DOCINFO); docinfo.lpszDocName = "Printing bitmaps"; docinfo.lpszOutput = NULL; docinfo.lpszDatatype = NULL; docinfo.fwType = 0; if(!(GetDeviceCaps(printdlg.hDC, RASTERCAPS) & (RC_BITBLT | RC_STRETCHBLT|RC_BITMAP64 | RC_DI_BITMAP| RC_DIBTODEV |RC_PALETTE |RC_SCALING |RC_STRETCHBLT|RC_STRETCHDIB))) { /* MessageBox(ohwnd, "Cannot Print Raster Images", "Error", MB_OK); */ return NULL; } StartDoc(printdlg.hDC, &docinfo); //## begin zhoubin 000406 printer_mem_dc = CreateCompatibleDC(printdlg.hDC); //## end zhoubin 000406 return 1; }
//开机初始化 void All_Init( void ) { const uint32_t NewDeviationAddr = 0x4000; /* BootLoad引导程序时,必须在Main中添加,同时更改“魔术棒--Target选项卡的ROM偏移地址” */ NVIC_SetVectorTable(NVIC_VectTab_FLASH,NewDeviationAddr); /* 外设初始化 */ lcd_init(); rtc_init(); led_init(); uart3_init(BAUD_38400); print_init(); //波特率19200 timeout_init(); TIM5_TimeoutInit(); link_init(); tf_init(); eep_init(); delay_init_t2(); beep_init(); SysTick_Config(SYSTICK_10MS); // PrintSystemParameter(); //串口打印系统参数信息,用于调试 #ifdef ENABLE_BEEP BEEP_START(); #endif set_page(system_init); }
void gnm_init (void) { static gboolean inited = FALSE; if (inited) return; inited = TRUE; libgoffice_init (); _gnm_register_resource (); if (gdk_screen_get_default ()) { /* Only when we have a gui. */ gtk_icon_theme_add_resource_path (gtk_icon_theme_get_default (), "/org/gnumeric/gnumeric/icons"); } gnm_register_ui_files (); go_plugin_service_define ("function_group", &gnm_plugin_service_function_group_get_type); go_plugin_service_define ("ui", &gnm_plugin_service_ui_get_type); go_plugin_service_define ("solver", &gnm_plugin_service_solver_get_type); go_plugin_loader_module_register_version ("gnumeric", GNM_VERSION_FULL); g_object_new (GNM_APP_TYPE, NULL); mathfunc_init (); gnm_style_init (); gnm_conf_init (); gnm_color_init (); gnm_font_init (); /* requires config */ value_init (); parse_util_init (); _gnm_expr_init (); gnm_sheet_cell_init (); clipboard_init (); dependent_types_init (); gnm_rendered_value_init (); functions_init (); print_init (); gnm_autofill_init (); sheet_objects_init (); _gnm_hlink_init (); /* The statically linked in file formats */ gnm_xml_sax_read_init (); gnm_xml_sax_write_init (); stf_init (); /* Make sure that images will be displayed with the correct resolution, see #628472 */ go_image_set_default_dpi (gnm_app_display_dpi_get (TRUE), gnm_app_display_dpi_get (FALSE)); }
int main(int argc, const char **argv) { int opt; #if 0 if (argc != 2) { fprintf(stderr, "Usage: motlle `smottle`\n"); exit(2); } sscanf(argv[1], "%p", &load_address); #endif for (;;) switch (getopt(argc, argv, "+d")) { case 'd': debug_lvl = 2; break; case '?': break; case -1: goto done; } done: signal(SIGALRM, silly_sig); garbage_init(); interpret_init(); stack_init(); runtime_init(); call_init(); parser_init(); compile_init(); mcompile_init(); context_init(); ports_init(); if (optind < argc) make_global_state(argc - optind, argv + optind); else make_global_state(0, NULL); mudio_init(); print_init(); if (optind < argc) mload(argv[optind]); else push_repl(); for (;;) motlle_run1(); }
/* ----------------------------------------------------------------------------------- */ void basic_init_for_intro(){ display_off(); actors_clear(); palette_store( 0, fopen("bmp/title.pal"), 16); palette_store(16, fopen("bmp/sp_castle.pal"), 16); vram_store(0x0000, fopen("bmp/sp_castle.ptn"), 0x2000); vram_store(0x2000, fopen("bmp/title.ptn"), 0x1800); vram_store(0x3800, fopen("map/intro.map"), (32 * 24 * 2)); map_make_pointer(STAGE_COUNT, 0); frame_count = 0; print_init(); display_on(); }
void mudlle_init(void) { garbage_init(); global_init(); strbuf_init(); print_init(); stack_init(); module_init(); runtime_init(); compile_init(); mcompile_init(); interpret_init(); error_init(); ports_init(); context_init(); }
/** * This function prepares the content to be printed. The current browser content * is duplicated and resized, printer initialization is called. * * \param content The content to be printed * \param printer The printer interface for the printer to be used * \param settings The settings for printing to use * \param height updated to the height of the printed content * \return true if successful, false otherwise */ bool print_set_up(hlcache_handle *content, const struct printer *printer, struct print_settings *settings, double *height) { printed_content = print_init(content, settings); if (printed_content == NULL) return false; print_apply_settings(printed_content, settings); if (height) *height = content_get_height(printed_content); printer->print_begin(settings); done_height = 0; return true; }
int main(int argc, char *argv[]) { print_init(); if(argc < 4) { printf("Usage: server [first addr] [first port] [last port]\n"); } first_name = argv[1]; port_first = atoi(argv[2]); port_last = atoi(argv[3]); sensor_timeout = DEF_SENSOR_TIMEOUT; sensor_period = DEF_SENSOR_PERIOD; if(initialize_sockets() < 0) { return -1; } initilize_sockaddr(); if(bind(sock_last, (struct sockaddr*) &last_addr, sizeof(last_addr)) < 0) { print_error("Failed to bind socket"); return -1; } print_success("Server launched"); if(initialize_thread() < 0) { print_error("Failed to init thread"); return -1; } if(pthread_create(&reconf_thread, NULL, reconf_fun, NULL) != 0) { return -1; } last_loop(); pthread_join(first_thread, NULL); return 0; }
/*------------------------------------------------------------ * Function Name : All_Init * Description : 全局初始化 * Input : None * Output : None * Return : None *------------------------------------------------------------*/ void All_Init( void ) { NVIC_Configuration(); /* 配置优先级分组 */ bsp_InitTimer(); /* 定时器初始化 */ key_init(); /* 按键初始化 */ print_init(); /* 打印机初始化 */ uart1_init(38400); /* 通讯串口初始化 */ rtc_init(); /* 时钟初始化 */ lcd_init(); /* LCD初始化 */ font_init(); /* 字体初始化 */ SysTick_Init(); /* 滴答定时器初始化 */ bsp_InitSFlash(); /* 外置 FLASH 初始化 */ USB_Init(); /* USB初始化 */ Ethernet_Init(); /* LWIP初始化 */ #ifdef ENABLE_BEEP BEEP_START(); #endif SetPage(SYS_INIT); }
static void on_bus_acquired (GDBusConnection *connection, const gchar *name, gpointer user_data) { GError *error = NULL; if (!file_chooser_init (connection, &error)) { g_warning ("error: %s\n", error->message); g_clear_error (&error); } if (!app_chooser_init (connection, &error)) { g_warning ("error: %s\n", error->message); g_clear_error (&error); } if (!print_init (connection, &error)) { g_warning ("error: %s\n", error->message); g_clear_error (&error); } if (!screenshot_init (connection, &error)) { g_warning ("error: %s\n", error->message); g_clear_error (&error); } if (!notification_init (connection, &error)) { g_warning ("error: %s\n", error->message); g_clear_error (&error); } }
int main( int argc, char * argv[]) { if (argc != 8){ fprintf(stderr, "use: GenLogStrips name #packages #cities #planes #locs_per_city #trucks_per_city #goals\n"); exit(1); } name = argv[1]; npackages = atoi(argv[2]); ncities = atoi(argv[3]); nplanes = atoi(argv[4]); nlocs = atoi(argv[5]); ntrucks = atoi(argv[6]); ngoals = atoi(argv[7]); gettimeofday(&tv,&tzp); seed = (( tv.tv_sec & 0177 ) * 1000000) + tv.tv_usec; srandom(seed); print_header(); print_init(); print_final(); return 0; }
int main(int argc, char **argv) { int ch; const char *conffile; conffile = CONFFILE; while ((ch = getopt(argc, argv, "f:v")) != -1) { switch (ch) { case 'f': conffile = optarg; break; case 'v': verbose++; break; default: usage(); /* NOTREACHED */ } } bzero(&config, sizeof(config)); config.print.feedlines = -1; config.print.cchide_customer = 1; config.print.ccsig_customer = 1; bzero(&header, sizeof(header)); if (parse_config(conffile)) exit(1); /* set database files */ if (config.database.custdb == NULL) if ((config.database.custdb = strdup(config.database.alldb ? config.database.alldb : CUSTDBFILE)) == NULL) err(1, "cannot set customer database file"); if (config.database.menudb == NULL) if ((config.database.menudb = strdup(config.database.alldb ? config.database.alldb : MENUDBFILE)) == NULL) err(1, "cannot set menu database file"); if (config.database.orderdb == NULL) if ((config.database.orderdb = strdup(config.database.alldb ? config.database.alldb : ORDERDBFILE)) == NULL) err(1, "cannot set order database file"); if (config.print.feedlines < 0) config.print.feedlines = PRINT_FEED_LINES; if (licence_init() == -1) errx(1, "cannot proceed without licence"); event_init(); module_init(); rule_init(); input_init(); print_init(); form_init(); display_init(); status_init(); menu_init(); customer_init(); special_init(); payment_init(); window_init(); order_init(); display_refresh(); signal(SIGPIPE, SIG_IGN); if (event_dispatch() == -1) err(1, "terminated abnormally"); if (exitcode != 0 && exitmsg == NULL) exitmsg = strdup(status.status); order_exit(); window_exit(); payment_exit(); special_exit(); customer_exit(); menu_exit(); status_exit(); display_exit(); form_exit(); print_exit(); input_exit(); rule_exit(); module_exit(); if (exitcode && exitmsg != NULL) errx(exitcode, "%s", exitmsg); else fprintf(stdout, "exiting normally\n"); exit(0); }
/* ----------------------------------------------------------------------------------- */ void ending_main(){ int8u actor_no; int8u scene_counter; char *text; int8u text_row; int8u c; actors_clear(); actor_no = ENDING_ACTOR_START; scene_counter = 1; text = ending_text; scroll_y = 0; /* clear bottom 4 rows */ print_init(); for(c = 24; c < 28; c++){ vsync_wait(); store_pattern_name_buffer(c); } psg_set_bgm(fopen("sound/summer.sn7"), TRUE); while(373){ sprites_clear(); port_read(); /* generate text */ text_row = scroll_y >> 3; text_row--; scene_counter--; if(scene_counter == 0){ scene_counter = 255; text_row--; c = print(text, 4); if(c < 2) break; text += c; }else{ print_init(); } /* actors */ if(scene_counter == 1){ if(actor_no <= ENDING_ACTOR_END){ switch(actor_no){ case ACTOR_PLAYER: player_create(0); actors_speed_y[0] = 32 - 32; break; case ACTOR_NINJA: ninja_create(0); break; case ACTOR_NINJA_CAKE: actors_type[0] = ACTOR_NINJA_CAKE; break; case ACTOR_BOAR: boar_create(0); break; case ACTOR_DARUMA: daruma_create(0); break; case ACTOR_TENGU: tengu_create(0); break; case ACTOR_HIME: hime_create(0); break; case ACTOR_BIRD: bird_create(0); break; case ACTOR_FLOG: flog_create(0); break; case ACTOR_GOAST: goast_create(0); actors_y[0] = 192; actors_x[0] = 250; break; case ACTOR_NASU: nasu_create(0); break; } }else{ actors_type[0] = ACTOR_NULL; } actor_no++; } /* scroll */ if(frame_count & 0x01){ scroll_y++; if(scroll_y > 224){ scroll_y = 0; } } /* updates */ actors_update(); vsync_wait(); sprites_store(); store_pattern_name_buffer(text_row); scroll_store(); psg_play(); frame_count++; } psg_stop(); }
void init() { clk_init(); uart_init(UART_B9600); print_init(uart_send, uart_send_byte); }
static void setup(void) { print_init(); net_init(); SetConsoleCtrlHandler(on_signal, TRUE); }