void pack_init (WavpackContext *wpc) { WavpackStream *wps = &wpc->stream; uint32_t flags = wps->wphdr.flags; struct decorr_pass *dpp; const signed char *term_string; int ti; wps->sample_index = 0; CLEAR (wps->decorr_passes); if (wpc->config.flags & CONFIG_HIGH_FLAG) term_string = high_terms; else if (wpc->config.flags & CONFIG_FAST_FLAG) term_string = fast_terms; else term_string = default_terms; for (dpp = wps->decorr_passes, ti = 0; term_string [ti]; ti++) if (term_string [ti] >= 0 || (flags & CROSS_DECORR)) { dpp->term = term_string [ti]; dpp++->delta = 2; } else if (!(flags & MONO_FLAG)) { dpp->term = -3; dpp++->delta = 2; } wps->num_terms = dpp - wps->decorr_passes; init_words (wps); }
void pack_init (WavpackContext *wpc) { WavpackStream *wps = &wpc->stream; uint32_t flags = wps->wphdr.flags; const signed char *term_string; struct decorr_pass *dpp; int ti; wps->sample_index = 0; CLEAR (wps->decorr_passes); CLEAR (wps->dc); if (wpc->config.flags & CONFIG_VERY_HIGH_FLAG) term_string = very_high_terms; else if (wpc->config.flags & CONFIG_HIGH_FLAG) term_string = high_terms; else if (wpc->config.flags & CONFIG_FAST_FLAG) term_string = fast_terms; else term_string = default_terms; for (dpp = wps->decorr_passes, ti = 0; ti < (int) strlen((char *) term_string); ti++) { if (term_string [ti] >= 0) { dpp->term = term_string [ti]; dpp++->delta = 2; } } wps->num_terms = dpp - wps->decorr_passes; init_words (wps); }
int main(void) { init_words(); hash_init(&hsh, word_hash, word_compare); test_add_remove(0); test_add_remove(HASH_INSERT_PREHASHED); hash_destroy(&hsh); return 0; }
int agi_init() { int ec, i; debug(2, "initializing"); debug(2, "game.ver = 0x%x", game.ver); /* reset all flags to false and all variables to 0 */ for (i = 0; i < MAX_FLAGS; i++) game.flags[i] = 0; for (i = 0; i < MAX_VARS; i++) game.vars[i] = 0; /* clear all resources and events */ for (i = 0; i < MAX_DIRS; i++) { memset(&game.views[i], 0, sizeof(struct agi_view)); memset(&game.pictures[i], 0, sizeof(struct agi_picture)); memset(&game.logics[i], 0, sizeof(struct agi_logic)); memset(&game.sounds[i], 0, sizeof(struct agi_sound)); } /* clear view table */ for (i = 0; i < MAX_VIEWTABLE; i++) memset(&game.view_table[i], 0, sizeof(struct vt_entry)); init_words(); menu = new Menu(); init_pri_table(); /* clear string buffer */ for (i = 0; i < MAX_STRINGS; i++) game.strings[i][0] = 0; /* setup emulation */ switch (loader->int_version >> 12) { case 2: report("Emulating Sierra AGI v%x.%03x\n", (int)(loader->int_version >> 12) & 0xF, (int)(loader->int_version) & 0xFFF); break; case 3: report("Emulating Sierra AGI v%x.002.%03x\n", (int)(loader->int_version >> 12) & 0xF, (int)(loader->int_version) & 0xFFF); break; } game.game_flags |= opt.amiga ? ID_AMIGA : 0; game.game_flags |= opt.agds ? ID_AGDS : 0; if (game.game_flags & ID_AMIGA) report("Amiga padded game detected.\n"); if (game.game_flags & ID_AGDS) report("AGDS mode enabled.\n"); ec = loader->init(); /* load vol files, etc */ if (ec == err_OK) ec = loader->load_objects(OBJECTS); /* note: demogs has no words.tok */ if (ec == err_OK) ec = loader->load_words(WORDS); /* FIXME: load IIgs instruments and samples */ /* load_instruments("kq.sys16"); */ /* Load logic 0 into memory */ if (ec == err_OK) ec = loader->load_resource(rLOGIC, 0); return ec; }