static PluginData * open_plugin (const char * path, const LADSPA_Descriptor * desc) { const char * slash = strrchr (path, G_DIR_SEPARATOR); g_return_val_if_fail (slash && slash[1], NULL); g_return_val_if_fail (desc->Label && desc->Name, NULL); PluginData * plugin = g_slice_new (PluginData); plugin->path = g_strdup (slash + 1); plugin->desc = desc; plugin->controls = index_new (); plugin->in_ports = g_array_new (0, 0, sizeof (int)); plugin->out_ports = g_array_new (0, 0, sizeof (int)); plugin->selected = 0; for (int i = 0; i < desc->PortCount; i ++) { if (LADSPA_IS_PORT_CONTROL (desc->PortDescriptors[i])) { ControlData * control = parse_control (desc, i); if (control) index_append (plugin->controls, control); } else if (LADSPA_IS_PORT_AUDIO (desc->PortDescriptors[i]) && LADSPA_IS_PORT_INPUT (desc->PortDescriptors[i])) g_array_append_val (plugin->in_ports, i); else if (LADSPA_IS_PORT_AUDIO (desc->PortDescriptors[i]) && LADSPA_IS_PORT_OUTPUT (desc->PortDescriptors[i])) g_array_append_val (plugin->out_ports, i); } return plugin; }
ROM_END static STATE_POSTLOAD( ninjaw_postload ) { parse_control(machine); reset_sound_region(machine); }
static WRITE16_HANDLER( cpua_ctrl_w ) { if ((data &0xff00) && ((data &0xff) == 0)) data = data >> 8; /* for Wgp */ cpua_ctrl = data; parse_control(space->machine); logerror("CPU #0 PC %06x: write %04x to cpu control\n",cpu_get_pc(space->cpu),data); }
static WRITE16_HANDLER( cpua_ctrl_w ) /* assumes Z80 sandwiched between 68Ks */ { if ((data &0xff00) && ((data &0xff) == 0)) data = data >> 8; /* for Wgp */ cpua_ctrl = data; parse_control(); logerror("CPU #0 PC %06x: write %04x to cpu control\n",activecpu_get_pc(),data); }
static WRITE16_HANDLER( cpua_ctrl_w ) { ninjaw_state *state = space->machine->driver_data<ninjaw_state>(); if ((data &0xff00) && ((data &0xff) == 0)) data = data >> 8; state->cpua_ctrl = data; parse_control(space->machine); logerror("CPU #0 PC %06x: write %04x to cpu control\n", cpu_get_pc(space->cpu), data); }
static WRITE16_HANDLER( cpua_ctrl_w ) { topspeed_state *state = space->machine().driver_data<topspeed_state>(); if ((data & 0xff00) && ((data & 0xff) == 0)) data = data >> 8; /* for Wgp */ state->m_cpua_ctrl = data; parse_control(space->machine()); logerror("CPU #0 PC %06x: write %04x to cpu control\n", cpu_get_pc(&space->device()), data); }
/* taitoic.c TC0100SCN routines expect scr stuff to be in second gfx slot */ static GFXDECODE_START( wgp ) GFXDECODE_ENTRY( "gfx3", 0x0, wgp_tilelayout, 0, 256 ) /* sprites */ GFXDECODE_ENTRY( "gfx1", 0x0, charlayout, 0, 256 ) /* sprites & playfield */ GFXDECODE_ENTRY( "gfx2", 0x0, wgp_tile2layout, 0, 256 ) /* piv */ GFXDECODE_END /*********************************************************** MACHINE DRIVERS Wgp has high interleaving to prevent "common ram error". However sync to vblank is lacking, which is causing the graphics glitches. ***********************************************************/ void wgp_state::wgp_postload() { parse_control(); }
// Todo: small update to read also from HTTP interface in order to // allow remote config push void read_config(char *docname) { xmlDocPtr doc; xmlNodePtr cur; doc = xmlParseFile(docname); if (doc == NULL ) { fatal_error("Configuration was not parsed successfully."); return; } cur = xmlDocGetRootElement(doc); if (cur == NULL) { fatal_error("No content found in XML"); xmlFreeDoc(doc); return; } if (xmlStrcmp(cur->name, (const xmlChar *) "config")) { fatal_error("Config is not formatted correct: root node != config"); xmlFreeDoc(doc); return; } cur = cur->xmlChildrenNode; while (cur != NULL) { if ((!xmlStrcmp(cur->name, (const xmlChar *)"general"))){ parse_general (doc, cur); } if ((!xmlStrcmp(cur->name, (const xmlChar *)"logging"))){ parse_logging (doc, cur); } if ((!xmlStrcmp(cur->name, (const xmlChar *)"control_thread"))){ parse_control (doc, cur); } cur = cur->next; } xmlFreeDoc(doc); return; }
static STATE_POSTLOAD( topspeed_postload ) { parse_control(machine); reset_sound_region(machine); }
static void wgp_postload(running_machine &machine) { parse_control(machine); reset_sound_region(machine); }
/* ==================================================== */ int main(int argc, char *argv[]) { char filename[80]; int i, nheav,nhyd; initialize_pcmodel(); // set basic defaults initialize(); // set structure defaults initialize_control(); // set control file defaults initialize_gmmx(); // set search defaults // check command line for filename if (argc > 1) strcpy(filename,argv[1]); else { strcpy(filename,"conpcm"); // printf("Enter control filename:"); // gets(filename); } // parse control file parse_control(filename); // generate error or logfile name if (control.mode == SEARCH) { strcpy(Openbox.fname,control.infile); strcpy(gmmx_data.finame,control.infile); strcpy(gmmx_data.foname,control.outfile); minim_control.field = control.ffield; minim_control.method = control.optmet; if (control.addconst) { minim_control.added_const = TRUE; strcpy(minim_control.added_name,control.addparfile); } if (control.gbsa) { pot.use_solv = TRUE; solvent.type = 1; } pcmfin(1,0); // check_str(); // decide on charges to use if (control.ffield == MM3) minim_values.ndc = 0; if (control.getcharge) { if (control.getcharge == 1) { if (control.ffield == MM3) { minim_values.ndc = 4; } } else if (control.getcharge == 2) { // use gasteiger use_gast_chrg = TRUE; } else if (control.getcharge == 3) { // use external use_external_chrg = TRUE; } } // find_rings(); nheav = 0; nhyd = 0; for (i=1; i <= natom; i++) { if (atom[i].atomnum != 1 && atom[i].atomnum != 2) nheav++; else nhyd++; } if (gmmx_data.kstop == 0) gmmx_data.kstop = 5; if (gmmx_data.kmin == 0) gmmx_data.kmin = 5*nheav; if (gmmx_data.kdup == 0) { gmmx_data.kdup = 5*nheav/2; if (gmmx_data.kdup > 50) gmmx_data.kdup = 50; } run_gmmx(); } else if (control.mode == OPTIMIZE || control.mode == SINGLE) { gmmx.run = FALSE; Openbox.ftype = control.inftype; Savebox.ftype = control.outftype; strcpy(Openbox.fname,control.infile); check_numfile(control.inftype,control.infile); for (i=1; i <= files.nfiles; i++) { initialize(); if (control.inftype == FTYPE_PCM) pcmfin(i,0); else if (control.inftype == FTYPE_MM3) mm32mod(i,0); minim_control.field = control.ffield; minim_control.method = control.optmet; strcpy(Savebox.fname,control.outfile); if (control.addconst) { minim_control.added_const = TRUE; strcpy(minim_control.added_name,control.addparfile); } if (control.gbsa) { pot.use_solv = TRUE; solvent.type = 1; } // decide on charges to use if (control.ffield == MM3) minim_values.ndc = 0; if (control.getcharge) { if (control.getcharge == 1) { if (control.ffield == MM3) { minim_values.ndc = 4; } } else if (control.getcharge == 2) { // use gasteiger use_gast_chrg = TRUE; } else if (control.getcharge == 3) { // use external use_external_chrg = TRUE; } } if (control.mode == OPTIMIZE) mmxsub(0); else mmxsub(1); if (i == 1) files.append = FALSE; else files.append = TRUE; pcmfout(1); } } // quit fclose(pcmoutfile); exit(0); return TRUE; }
static STATE_POSTLOAD( wgp_postload ) { parse_control(); reset_sound_region(); }
void wgp_state::wgp_postload() { parse_control(); reset_sound_region(); }