您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ vref函数代码示例

51自学网 2021-06-03 09:48:46
  C++
这篇教程C++ vref函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中vref函数的典型用法代码示例。如果您正苦于以下问题:C++ vref函数的具体用法?C++ vref怎么用?C++ vref使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了vref函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: devfs_getroot

vnode_t *devfs_getroot(vfs_t *fs){    devfs_data_t *devfs = fs->vfs_private;    if(!devfs->rootvnode) {        _get_vnode(devfs_rootinode, &(devfs->rootvnode), fs);    } else vref(devfs->rootvnode);    return devfs->rootvnode;}
开发者ID:akat1,项目名称:impala,代码行数:9,


示例2: Z80

void ladyfrog_state::ladyfrog(machine_config &config){	/* basic machine hardware */	Z80(config, m_maincpu, XTAL(8'000'000)/2);	m_maincpu->set_addrmap(AS_PROGRAM, &ladyfrog_state::ladyfrog_map);	m_maincpu->set_vblank_int("screen", FUNC(ladyfrog_state::irq0_line_hold));	Z80(config, m_audiocpu, XTAL(8'000'000)/2);	m_audiocpu->set_addrmap(AS_PROGRAM, &ladyfrog_state::ladyfrog_sound_map);	m_audiocpu->set_periodic_int(FUNC(ladyfrog_state::irq0_line_hold), attotime::from_hz(2*60));	config.m_minimum_quantum = attotime::from_hz(6000);	/* video hardware */	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));//  screen.set_refresh_hz(60);//  screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));//  screen.set_size(32*8, 32*8);//  screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); // black borders in ladyfrog gameplay are correct	screen.set_raw(XTAL(8'000'000), 510, 0, 256, 262, 2*8, 30*8); // pixel clock appears to run at 8 MHz	screen.set_screen_update(FUNC(ladyfrog_state::screen_update_ladyfrog));	screen.set_palette(m_palette);	GFXDECODE(config, m_gfxdecode, m_palette, gfx_ladyfrog);	PALETTE(config, m_palette).set_format(palette_device::xBGR_444, 512);	/* sound hardware */	SPEAKER(config, "mono").front_center();	GENERIC_LATCH_8(config, m_soundlatch);	ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(8'000'000)/4));	aysnd.port_a_write_callback().set(FUNC(ladyfrog_state::unk_w));	aysnd.port_b_write_callback().set(FUNC(ladyfrog_state::unk_w));	aysnd.add_route(ALL_OUTPUTS, "mono", 0.15);	MSM5232(config, m_msm, XTAL(8'000'000)/4);	m_msm->set_capacitors(0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6);	m_msm->add_route(0, "mono", 1.0);   // pin 28  2'-1	m_msm->add_route(1, "mono", 1.0);   // pin 29  4'-1	m_msm->add_route(2, "mono", 1.0);   // pin 30  8'-1	m_msm->add_route(3, "mono", 1.0);   // pin 31 16'-1	m_msm->add_route(4, "mono", 1.0);   // pin 36  2'-2	m_msm->add_route(5, "mono", 1.0);   // pin 35  4'-2	m_msm->add_route(6, "mono", 1.0);   // pin 34  8'-2	m_msm->add_route(7, "mono", 1.0);   // pin 33 16'-2	// pin 1 SOLO  8'       not mapped	// pin 2 SOLO 16'       not mapped	// pin 22 Noise Output  not mapped	DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "mono", 0.25); // unknown DAC	voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));	vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);	vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);}
开发者ID:fesh0r,项目名称:mame-full,代码行数:55,


示例3: p9fs_root

static intp9fs_root(struct mount *mp, int lkflags, struct vnode **vpp){	struct p9fsmount *p9mp = VFSTOP9(mp);	struct p9fs_node *np = &p9mp->p9_session.p9s_rootnp;	*vpp = np->p9n_vnode;	vref(*vpp);	vn_lock(*vpp, lkflags);	return (0);}
开发者ID:wca,项目名称:p9fs,代码行数:12,


示例4: do_chdir

intdo_chdir(const char *path){	/* NOT_YET_IMPLEMENTED("VFS: do_chdir"); */	/*GS: path should point to something */	KASSERT(path);    dbg(DBG_PRINT, "(GRADING2C) (vfs_syscall.c) (do_chdir)/n");	    /*GS: Check if a path too long. */	if(strlen(path) > MAXPATHLEN)	{		dbg(DBG_PRINT, "(GRADING2C 1.n) (vfs_syscall.c) (do_chdir) path too long, return -ENAMETOOLONG/n");		return -ENAMETOOLONG;	}	/*GS: This returns in newcwd the vnode requested by the other parameters.	 *    and ups the refcount to the new cwd*/	vnode_t *newcwd = NULL;	int retVal = open_namev(path, O_RDONLY, &newcwd, curproc->p_cwd);	/* GS: NOTE! - need to confirm open_namev error values after implemented */	if( retVal < 0 )	{		dbg(DBG_PRINT, "(GRADING2B) (vfs_syscall.c) (do_chdir) error open_namev, cannot open, return error/n");		return retVal;	}	/*GS: check if the path does not exist.*/	/*if( newcwd == NULL )	{		dbg(DBG_PRINT, "(GRADING2C) (vfs_syscall.c) (do_chdir) path does not exist, return -ENOENT/n");		return -ENOENT;	}*/	/*GS: Check if a component of path is not a directory.*/	if (!S_ISDIR(newcwd->vn_mode))	{		/*GS: need to down the count back*/		vput(newcwd);		dbg(DBG_PRINT, "(GRADING2B) component of path is not a directory, return -ENOTDIR/n");		return -ENOTDIR;    }	/*GS: Down the refcount to the old cwd - vput() */	vput(curproc->p_cwd);	/*GS: Make the named directory the current process's cwd */	curproc->p_cwd = newcwd;	vref(curproc->p_cwd);	vput(newcwd);	return 0;}
开发者ID:ruochenliao,项目名称:hello-world,代码行数:53,


示例5: vnode_pager_reference

/* * Add a ref to a vnode's existing VM object, return the object or * NULL if the vnode did not have one.  This does not create the * object (we can't since we don't know what the proper blocksize/boff * is to match the VFS's use of the buffer cache). */vm_object_tvnode_pager_reference(struct vnode *vp){	vm_object_t object;	/*	 * Prevent race condition when allocating the object. This	 * can happen with NFS vnodes since the nfsnode isn't locked.	 *	 * Serialize potential vnode/object teardowns and interlocks	 */	lwkt_gettoken(&vp->v_token);	while (vp->v_flag & VOLOCK) {		vsetflags(vp, VOWANT);		tsleep(vp, 0, "vnpobj", 0);	}	vsetflags(vp, VOLOCK);	lwkt_reltoken(&vp->v_token);	/*	 * Prevent race conditions against deallocation of the VM	 * object.	 */	while ((object = vp->v_object) != NULL) {		vm_object_hold(object);		if ((object->flags & OBJ_DEAD) == 0)			break;		vm_object_dead_sleep(object, "vadead");		vm_object_drop(object);	}	/*	 * The object is expected to exist, the caller will handle	 * NULL returns if it does not.	 */	if (object) {		object->ref_count++;		vref(vp);	}	lwkt_gettoken(&vp->v_token);	vclrflags(vp, VOLOCK);	if (vp->v_flag & VOWANT) {		vclrflags(vp, VOWANT);		wakeup(vp);	}	lwkt_reltoken(&vp->v_token);	if (object)		vm_object_drop(object);	return (object);}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:58,


示例6: union_lock_upper

static __inlinestruct vnode *union_lock_upper(struct union_node *un, struct thread *td){	struct vnode *uppervp;	if ((uppervp = un->un_uppervp) != NULL) {		vref(uppervp);		vn_lock(uppervp, LK_EXCLUSIVE | LK_CANRECURSE | LK_RETRY);	}	KASSERT((uppervp == NULL || uppervp->v_sysref.refcnt > 0), ("uppervp usecount is 0"));	return(uppervp);}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:13,


示例7: lval

static AST lval() {    Token *t = &tok;    AST a=0;    AST a1=0,a2=0;    a1 = vref();    if (t->sym == '[') {	a2 = exprs();	a = make_AST(nLVAL, a1, a2, 0, 0);    } else	a = a1;    return a;}
开发者ID:tungvx,项目名称:FSE,代码行数:13,


示例8: M6803

void bally_cheap_squeak_device::device_add_mconfig(machine_config &config){	M6803(config, m_cpu, DERIVED_CLOCK(1, 1));	m_cpu->set_addrmap(AS_PROGRAM, &bally_cheap_squeak_device::cheap_squeak_map);	m_cpu->out_p1_cb().set(FUNC(bally_cheap_squeak_device::out_p1_cb));	m_cpu->in_p2_cb().set(FUNC(bally_cheap_squeak_device::in_p2_cb));	m_cpu->out_p2_cb().set(FUNC(bally_cheap_squeak_device::out_p2_cb));	ZN429E(config, "dac", 0).add_route(ALL_OUTPUTS, *this, 1.00, AUTO_ALLOC_INPUT, 0);		voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));		vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);		vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);}
开发者ID:fesh0r,项目名称:mame-full,代码行数:13,


示例9: union_lock_other

static __inlinestruct vnode *union_lock_other(struct union_node *un, struct thread *td){	struct vnode *vp;	if (un->un_uppervp != NULL) {		vp = union_lock_upper(un, td);	} else if ((vp = un->un_lowervp) != NULL) {		vref(vp);		vn_lock(vp, LK_EXCLUSIVE | LK_CANRECURSE | LK_RETRY);	}	return(vp);}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:14,


示例10: I80186

void wsf_80186_sound_device::device_add_mconfig(machine_config &config){	I80186(config, m_audiocpu, 16_MHz_XTAL);	m_audiocpu->set_addrmap(AS_PROGRAM, &wsf_80186_sound_device::leland_80186_map_program);	m_audiocpu->set_addrmap(AS_IO, &wsf_80186_sound_device::ataxx_80186_map_io);	m_audiocpu->chip_select_callback().set(FUNC(leland_80186_sound_device::peripheral_ctrl));	m_audiocpu->tmrout0_handler().set(FUNC(leland_80186_sound_device::i80186_tmr0_w));	m_audiocpu->tmrout1_handler().set(FUNC(leland_80186_sound_device::i80186_tmr1_w));	SPEAKER(config, "speaker").front_center();	for (int i = 0; i < 4; i++)	{		AD7524(config, m_dac[i], 0).add_route(ALL_OUTPUTS, "speaker", 0.2); // unknown DAC		DAC_8BIT_BINARY_WEIGHTED(config, m_dacvol[i], 0); // unknown DAC	}	AD7533(config, "dac9", 0).add_route(ALL_OUTPUTS, "speaker", 1.0); // unknown DAC	m_dacvol[0]->add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT);	m_dacvol[0]->add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT); // unknown DAC	m_dacvol[1]->add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT);	m_dacvol[1]->add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT); // unknown DAC	m_dacvol[2]->add_route(0, "dac3", 1.0, DAC_VREF_POS_INPUT);	m_dacvol[2]->add_route(0, "dac3", -1.0, DAC_VREF_NEG_INPUT); // unknown DAC	m_dacvol[3]->add_route(0, "dac4", 1.0, DAC_VREF_POS_INPUT);	m_dacvol[3]->add_route(0, "dac4", -1.0, DAC_VREF_NEG_INPUT); // unknown DAC	voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));	vref.set_output(5.0);	vref.add_route(0, "dac1vol", 1.0, DAC_VREF_POS_INPUT);	vref.add_route(0, "dac2vol", 1.0, DAC_VREF_POS_INPUT);	vref.add_route(0, "dac3vol", 1.0, DAC_VREF_POS_INPUT);	vref.add_route(0, "dac4vol", 1.0, DAC_VREF_POS_INPUT);	vref.add_route(0, "dac9", 1.0, DAC_VREF_POS_INPUT);	vref.add_route(0, "dac9", -1.0, DAC_VREF_NEG_INPUT);	/* sound hardware */	YM2151(config, m_ymsnd, 4000000);	m_ymsnd->add_route(0, "speaker", 0.40);	m_ymsnd->add_route(1, "speaker", 0.40);	PIT8254(config, m_pit[0], 0);	m_pit[0]->set_clk<0>(4000000);	m_pit[0]->out_handler<0>().set(m_audiocpu, FUNC(i80186_cpu_device::drq0_w));	m_pit[0]->set_clk<1>(4000000);	m_pit[0]->out_handler<1>().set(m_audiocpu, FUNC(i80186_cpu_device::drq1_w));	m_pit[0]->set_clk<2>(4000000);	m_pit[0]->out_handler<2>().set(FUNC(leland_80186_sound_device::pit0_2_w));	GENERIC_LATCH_16(config, m_soundlatch);}
开发者ID:PugsyMAME,项目名称:mame,代码行数:50,


示例11: KONAMI1

void sbasketb_state::sbasketb(machine_config &config){	/* basic machine hardware */	KONAMI1(config, m_maincpu, 1400000);        /* 1.400 MHz ??? */	m_maincpu->set_addrmap(AS_PROGRAM, &sbasketb_state::sbasketb_map);	Z80(config, m_audiocpu, XTAL(14'318'181) / 4); /* 3.5795 MHz */	m_audiocpu->set_addrmap(AS_PROGRAM, &sbasketb_state::sbasketb_sound_map);	ls259_device &mainlatch(LS259(config, "mainlatch")); // B3	mainlatch.q_out_cb<0>().set(FUNC(sbasketb_state::flipscreen_w)); // FLIP	mainlatch.q_out_cb<1>().set(FUNC(sbasketb_state::irq_mask_w)); // INTST	mainlatch.q_out_cb<2>().set_nop(); // MUT - not used?	mainlatch.q_out_cb<3>().set(FUNC(sbasketb_state::coin_counter_1_w)); // COIN 1	mainlatch.q_out_cb<4>().set(FUNC(sbasketb_state::coin_counter_2_w)); // COIN 2	mainlatch.q_out_cb<5>().set(FUNC(sbasketb_state::spriteram_select_w)); // OBJ CHE	mainlatch.q_out_cb<6>().set_nop(); // END - not used	WATCHDOG_TIMER(config, "watchdog");	/* video hardware */	SCREEN(config, m_screen, SCREEN_TYPE_RASTER);	m_screen->set_refresh_hz(60);	m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));	m_screen->set_size(32*8, 32*8);	m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1);	m_screen->set_screen_update(FUNC(sbasketb_state::screen_update_sbasketb));	m_screen->set_palette(m_palette);	m_screen->screen_vblank().set(FUNC(sbasketb_state::vblank_irq));	GFXDECODE(config, m_gfxdecode, m_palette, gfx_sbasketb);	PALETTE(config, m_palette, FUNC(sbasketb_state::sbasketb_palette), 16*16+16*16*16, 256);	/* sound hardware */	SPEAKER(config, "speaker").front_center();	GENERIC_LATCH_8(config, "soundlatch");	TRACKFLD_AUDIO(config, m_soundbrd, 0, m_audiocpu, m_vlm);	DAC_8BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.4); // unknown DAC	voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));	vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);	vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);	SN76489(config, m_sn, XTAL(14'318'181) / 8).add_route(ALL_OUTPUTS, "speaker", 1.0);	VLM5030(config, m_vlm, XTAL(3'579'545)).add_route(ALL_OUTPUTS, "speaker", 1.0); /* Schematics say 3.58MHz, but board uses 3.579545MHz xtal */}
开发者ID:fesh0r,项目名称:mame-full,代码行数:49,


示例12: union_ref_upper

static __inlinestruct vnode *union_ref_upper(struct union_node *un){	struct vnode *uppervp;	if ((uppervp = un->un_uppervp) != NULL) {		vref(uppervp);		if (uppervp->v_flag & VRECLAIMED) {			vrele(uppervp);			return (NULLVP);		}	}	return (uppervp);}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:15,


示例13: M6502

GFXDECODE_END/************************************* * *  Machine driver * *************************************/void matmania_state::matmania(machine_config &config){	/* basic machine hardware */	M6502(config, m_maincpu, 1500000);  /* 1.5 MHz ???? */	m_maincpu->set_addrmap(AS_PROGRAM, &matmania_state::matmania_map);	m_maincpu->set_vblank_int("screen", FUNC(matmania_state::irq0_line_hold));	M6502(config, m_audiocpu, 1200000); /* 1.2 MHz ???? */	m_audiocpu->set_addrmap(AS_PROGRAM, &matmania_state::matmania_sound_map);	m_audiocpu->set_periodic_int(FUNC(matmania_state::nmi_line_pulse), attotime::from_hz(15*60)); /* ???? */	config.m_minimum_quantum = attotime::from_hz(6000);	/* video hardware */	SCREEN(config, m_screen, SCREEN_TYPE_RASTER);	m_screen->set_refresh_hz(60);	m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */	m_screen->set_size(32*8, 32*8);	m_screen->set_visarea(0*8, 32*8-1, 1*8, 31*8-1);	m_screen->set_screen_update(FUNC(matmania_state::screen_update_matmania));	m_screen->set_palette(m_palette);	GFXDECODE(config, m_gfxdecode, m_palette, gfx_matmania);	PALETTE(config, m_palette, FUNC(matmania_state::matmania_palette), 64 + 16);	/* sound hardware */	SPEAKER(config, "speaker").front_center();	GENERIC_LATCH_8(config, m_soundlatch);	AY8910(config, "ay1", 1500000).add_route(ALL_OUTPUTS, "speaker", 0.3);	AY8910(config, "ay2", 1500000).add_route(ALL_OUTPUTS, "speaker", 0.3);	DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.4); // unknown DAC	voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));	vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);	vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);}
开发者ID:SailorSat,项目名称:cabmame,代码行数:48,


示例14: M68000

void midway_cheap_squeak_deluxe_device::device_add_mconfig(machine_config &config){	M68000(config, m_cpu, DERIVED_CLOCK(1, 2));	m_cpu->set_addrmap(AS_PROGRAM, &midway_cheap_squeak_deluxe_device::csdeluxe_map);	PIA6821(config, m_pia, 0);	m_pia->writepa_handler().set(FUNC(midway_cheap_squeak_deluxe_device::porta_w));	m_pia->writepb_handler().set(FUNC(midway_cheap_squeak_deluxe_device::portb_w));	m_pia->irqa_handler().set(FUNC(midway_cheap_squeak_deluxe_device::irq_w));	m_pia->irqb_handler().set(FUNC(midway_cheap_squeak_deluxe_device::irq_w));	AD7533(config, m_dac, 0).add_route(ALL_OUTPUTS, *this, 1.0);	voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));	vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);	vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);}
开发者ID:SailorSat,项目名称:cabmame,代码行数:16,


示例15: silent_load

void silent_load(NODE *arg, char *prefix){    FILE *tmp_stream;    NODE *tmp_line, *exec_list;    char load_path[200];    NODE *st = valnode__caseobj(Startup);    int sv_val_status = val_status;    /* This procedure is called three ways:     *    silent_load(NIL,*argv)	loads *argv     *    silent_load(proc,logolib)     loads logolib/proc     *    silent_load(proc,NULL)	loads proc.lg     * The "/" or ".lg" is supplied by this procedure as needed.     */    if (prefix == NULL && arg == NIL) return;    strcpy(load_path, (prefix == NULL ? "" : prefix));    if (arg != NIL) {	arg = cnv_node_to_strnode(arg);	if (arg == UNBOUND) return;#ifdef unix	if (prefix != NULL) strcat(load_path, "/");#endif	noparitylow_strnzcpy(load_path + (int)strlen(load_path),			     getstrptr(arg), getstrlen(arg));	if (prefix == NULL) strcat(load_path, ".lg");	gcref(arg);    }    tmp_stream = loadstream;    tmp_line = vref(current_line);    loadstream = fopen(load_path, "r");    if (loadstream != NULL) {	while (!feof(loadstream) && NOT_THROWING) {	    current_line = reref(current_line, reader(loadstream, ""));	    exec_list =parser(current_line, TRUE);	    val_status = 0;	    if (exec_list != NIL) eval_driver(exec_list);	}	fclose(loadstream);	runstartup(st);	val_status = sv_val_status;    } else if (arg == NIL) ndprintf(stdout,"File not found: %t/n", prefix);    loadstream = tmp_stream;    deref(current_line);    current_line = tmp_line;}
开发者ID:unusual-thoughts,项目名称:freebsd-1.x-ports,代码行数:46,


示例16: MC6809E

void wpcsnd_device::device_add_mconfig(machine_config &config){	MC6809E(config, m_cpu, XTAL(8'000'000) / 4); // MC68B09E	m_cpu->set_addrmap(AS_PROGRAM, &wpcsnd_device::wpcsnd_map);	config.m_minimum_quantum = attotime::from_hz(50);	YM2151(config, m_ym2151, 3580000);	m_ym2151->irq_handler().set(FUNC(wpcsnd_device::ym2151_irq_w));	m_ym2151->add_route(ALL_OUTPUTS, *this, 0.25);	AD7524(config, "dac", 0).add_route(ALL_OUTPUTS, *this, 0.25);	voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));	vref.set_output(5.0);	vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);	vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);	HC55516(config, m_hc55516, 0).add_route(ALL_OUTPUTS, *this, 0.5);}
开发者ID:k2-git,项目名称:mame,代码行数:18,


示例17: layerfs_root

intlayerfs_root(struct mount *mp, struct vnode **vpp){	struct vnode *vp;	vp = MOUNTTOLAYERMOUNT(mp)->layerm_rootvp;	if (vp == NULL) {		*vpp = NULL;		return EINVAL;	}	/*	 * Return root vnode with locked and with a reference held.	 */	vref(vp);	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);	*vpp = vp;	return 0;}
开发者ID:ryo,项目名称:netbsd-src,代码行数:18,


示例18: M6502

void gottlieb_sound_r0_device::device_add_mconfig(machine_config &config){	// audio CPU	M6502(config, m_audiocpu, SOUND1_CLOCK/4); // M6503 - clock is a gate, a resistor and a capacitor. Freq unknown.	m_audiocpu->set_addrmap(AS_PROGRAM, &gottlieb_sound_r0_device::gottlieb_sound_r0_map);	// I/O configuration	MOS6530(config, m_r6530, SOUND1_CLOCK/4); // unknown - same as cpu	m_r6530->out_pa_callback().set("dac", FUNC(dac_byte_interface::data_w));	m_r6530->in_pb_callback().set(FUNC(gottlieb_sound_r0_device::r6530b_r));	// sound devices	DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, *this, 0.25); // unknown DAC	voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));	vref.set_output(5.0);	vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);	vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);}
开发者ID:k2-git,项目名称:mame,代码行数:18,


示例19: fileload

void fileload(char *temp)   {   FILE *tmp;   NODE *tmp_line, *exec_list, *arg;   NODE *st = valnode__caseobj(Startup);   int sv_val_status = val_status;   int IsDirtySave;   int save_yield_flag;   arg = make_strnode(temp, NULL, strlen(temp), STRING, strnzcpy);   IsDirtySave = IsDirty;   tmp = loadstream;   tmp_line = vref(current_line);   loadstream = open_file(arg, "r");   if (loadstream != NULL)      {      save_yield_flag = yield_flag;      yield_flag = 0;      lsetcursorwait();      while (!feof(loadstream) && NOT_THROWING)         {         current_line = reref(current_line, reader(loadstream, ""));         exec_list = parser(current_line, TRUE);         val_status = 0;         if (exec_list != NIL) eval_driver(exec_list);         }      fclose(loadstream);      lsetcursorarrow();      yield_flag = save_yield_flag;      runstartup(st);      val_status = sv_val_status;      }   else      err_logo(FILE_ERROR, make_static_strnode("Could not open file"));   loadstream = tmp;   deref(current_line);   current_line = tmp_line;   IsDirty = IsDirtySave;   }
开发者ID:longbai,项目名称:MSW-Logo,代码行数:44,


示例20: new_vmcmd

voidnew_vmcmd(struct exec_vmcmd_set *evsp,    int (*proc)(struct proc *, struct exec_vmcmd *), u_long len, u_long addr,    struct vnode *vp, u_long offset, u_int prot, int flags){	struct exec_vmcmd    *vcp;	if (evsp->evs_used >= evsp->evs_cnt)		vmcmdset_extend(evsp);	vcp = &evsp->evs_cmds[evsp->evs_used++];	vcp->ev_proc = proc;	vcp->ev_len = len;	vcp->ev_addr = addr;	if ((vcp->ev_vp = vp) != NULL)		vref(vp);	vcp->ev_offset = offset;	vcp->ev_prot = prot;	vcp->ev_flags = flags;}
开发者ID:ajinkya93,项目名称:OpenBSD,代码行数:19,


示例21: ufs_extattr_enable_with_open

/* * Enable an EA using the passed file system, backing vnode, attribute name, * namespace, and proc.  Will perform a VOP_OPEN() on the vp, so expects vp * to be locked when passed in.  The vnode will be returned unlocked, * regardless of success/failure of the function.  As a result, the caller * will always need to vrele(), but not vput(). */static intufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp,    int attrnamespace, const char *attrname, struct proc *p){	int error;	error = VOP_OPEN(vp, FREAD|FWRITE, p->p_ucred, p);	if (error) {		printf("ufs_extattr_enable_with_open.VOP_OPEN(): failed "		    "with %d/n", error);		VOP_UNLOCK(vp, 0, p);		return (error);	}#if 0	/* - XXX */	/*	 * XXX: Note, should VOP_CLOSE() if vfs_object_create() fails, but due	 * to a similar piece of code in vn_open(), we don't.	 */	if (vn_canvmio(vp) == TRUE)		if ((error = vfs_object_create(vp, p, p->p_ucred)) != 0) {			/*			 * XXX: bug replicated from vn_open(): should			 * VOP_CLOSE() here.			 */			VOP_UNLOCK(vp, 0, p);			return (error);		}#endif	vp->v_writecount++;	vref(vp);	VOP_UNLOCK(vp, 0, p);	error = ufs_extattr_enable(ump, attrnamespace, attrname, vp, p);	if (error != 0)		vn_close(vp, FREAD|FWRITE, p->p_ucred, p);	return (error);}
开发者ID:MarginC,项目名称:kame,代码行数:49,


示例22: I8088

void mephisto_pinball_state::mephisto(machine_config &config){	/* basic machine hardware */	I8088(config, m_maincpu, XTAL(18'000'000)/3);	m_maincpu->set_addrmap(AS_PROGRAM, &mephisto_pinball_state::mephisto_map);	//m_maincpu->set_irq_acknowledge_callback("muart", FUNC(i8256_device::inta_cb));	NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);	//i8256_device &muart(I8256(config, "muart", XTAL(18'000'000)/3));	//muart.irq_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0);	//muart.txd_handler().set_inputline("audiocpu", MCS51_RX_LINE);	I8155(config, "ic20", XTAL(18'000'000)/6);	//i8155_device &i8155_1(I8155(config, "ic20", XTAL(18'000'000)/6));	//i8155_1.out_to_callback().set("muart", FUNC(i8256_device::write_txc));	I8155(config, "ic9", XTAL(18'000'000)/6);	//i8155_device &i8155_2(I8155(config, "ic9", XTAL(18'000'000)/6));	//i8155_2.out_to_callback().set(FUNC(mephisto_pinball_state::clk_shift_w));	i8051_device &soundcpu(I8051(config, "soundcpu", XTAL(12'000'000)));	soundcpu.set_addrmap(AS_PROGRAM, &mephisto_pinball_state::mephisto_8051_map); // EA tied high for external program ROM	soundcpu.set_addrmap(AS_IO, &mephisto_pinball_state::mephisto_8051_io);	soundcpu.port_in_cb<1>().set(FUNC(mephisto_pinball_state::ay8910_read));	soundcpu.port_out_cb<1>().set(FUNC(mephisto_pinball_state::ay8910_write));	soundcpu.port_out_cb<3>().set(FUNC(mephisto_pinball_state::t0_t1_w));	soundcpu.serial_rx_cb().set_constant(0); // from MUART	SPEAKER(config, "mono").front_center();	AY8910(config, m_aysnd, XTAL(12'000'000)/8);	m_aysnd->port_a_write_callback().set(FUNC(mephisto_pinball_state::ay8910_columns_w));	m_aysnd->port_b_read_callback().set(FUNC(mephisto_pinball_state::ay8910_inputs_r));	m_aysnd->add_route(ALL_OUTPUTS, "mono", 0.5);	DAC08(config, "dac", 0).add_route(ALL_OUTPUTS, "mono", 0.5);	voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));	vref.set_output(5.0);	vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);	vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);}
开发者ID:k2-git,项目名称:mame,代码行数:42,


示例23: s4

void s4_state::s4a(machine_config &config){	s4(config);	/* Add the soundcard */	M6808(config, m_audiocpu, 3580000);	m_audiocpu->set_addrmap(AS_PROGRAM, &s4_state::s4_audio_map);	MCFG_MACHINE_RESET_OVERRIDE(s4_state, s4a)	SPEAKER(config, "speaker").front_center();	MC1408(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.5);	voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));	vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);	vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);	PIA6821(config, m_pias, 0);	m_pias->readpb_handler().set(FUNC(s4_state::sound_r));	m_pias->writepa_handler().set("dac", FUNC(dac_byte_interface::data_w));	m_pias->irqa_handler().set_inputline("audiocpu", M6808_IRQ_LINE);	m_pias->irqb_handler().set_inputline("audiocpu", M6808_IRQ_LINE);}
开发者ID:SailorSat,项目名称:cabmame,代码行数:20,


示例24: lookupnameat

intlookupnameat(char *dirname, enum uio_seg seg, enum symfollow follow,    vnode_t **dirvpp, vnode_t **compvpp, vnode_t *startvp){	struct nameidata nd;	int error, ltype;	ASSERT(dirvpp == NULL);	vref(startvp);	ltype = VOP_ISLOCKED(startvp);	VOP_UNLOCK(startvp, 0);	NDINIT_ATVP(&nd, LOOKUP, LOCKLEAF | MPSAFE | follow, seg, dirname,	    startvp, curthread);	error = namei(&nd);	*compvpp = nd.ni_vp;	NDFREE(&nd, NDF_ONLY_PNBUF);	vn_lock(startvp, ltype | LK_RETRY);	return (error);}
开发者ID:151706061,项目名称:osv,代码行数:20,


示例25: M68000

void wildpkr_state::tabpkr(machine_config &config){	/* basic machine hardware */	M68000(config, m_maincpu, XTAL(24'000'000) / 2);	m_maincpu->set_addrmap(AS_PROGRAM, &wildpkr_state::tabpkr_map);	m_maincpu->set_periodic_int(FUNC(wildpkr_state::irq3_line_assert), attotime::from_hz(60*256));	m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &wildpkr_state::cpu_space_map);	NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); // DS1220Y	MC68681(config, m_duart, 3686400);	m_duart->irq_cb().set_inputline(m_maincpu, M68K_IRQ_2, ASSERT_LINE);	DS2401(config, m_id, 0);	CLOCK(config, m_dac_clock, 1500000); // base rate derived from program code	m_dac_clock->signal_handler().set_inputline(m_maincpu, M68K_IRQ_5, ASSERT_LINE);	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));	screen.set_refresh_hz(60);	screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500));	screen.set_size(384, 280);	screen.set_visarea(0, 384-1, 0, 280-1);	screen.set_screen_update("acrtc", FUNC(hd63484_device::update_screen));	screen.set_palette("palette");	screen.screen_vblank().set_inputline(m_maincpu, M68K_IRQ_4, ASSERT_LINE);	HD63484(config, "acrtc", 0).set_addrmap(0, &wildpkr_state::hd63484_map);	ramdac_device &ramdac(RAMDAC(config, "ramdac", 0, "palette"));	ramdac.set_addrmap(0, &wildpkr_state::ramdac_map);	PALETTE(config, "palette", FUNC(wildpkr_state::wildpkr_palette), 256);	/* sound hardware */	SPEAKER(config, "mono").front_center();	AD557(config, m_dac, 0).add_route(ALL_OUTPUTS, "mono", 0.50);	voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));	vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);	vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);}
开发者ID:fesh0r,项目名称:mame-full,代码行数:41,



注:本文中的vref函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ vreg_disable函数代码示例
C++ vr_get_data函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。