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

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

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

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

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

示例1: compute_duration

void ttl74123_device::start_pulse(){	attotime duration = compute_duration();	if(timer_running())	{		/* retriggering, but not if we are called to quickly */		attotime delay_time = attotime_make(0, ATTOSECONDS_PER_SECOND * m_config.m_cap * 220);		if(attotime_compare(timer_timeelapsed(m_timer), delay_time) >= 0)		{			timer_adjust_oneshot(m_timer, duration, 0);			if (LOG) logerror("74123 %s:  Retriggering pulse.  Duration: %f/n", tag(), attotime_to_double(duration));		}		else		{			if (LOG) logerror("74123 %s:  Retriggering failed./n", tag());		}	}	else	{		/* starting */		timer_adjust_oneshot(m_timer, duration, 0);		set_output();		if (LOG) logerror("74123 %s:  Starting pulse.  Duration: %f/n", tag(), attotime_to_double(duration));	}}
开发者ID:johkelly,项目名称:MAME_hi,代码行数:30,


示例2: DEVICE_RESET

static DEVICE_RESET(duart68681){	duart68681_state *duart68681 = get_safe_token(device);	emu_timer *save0, *save1;	duart68681->ACR = 0;  /* Interrupt Vector Register */	duart68681->IVR = 0x0f;  /* Interrupt Vector Register */	duart68681->IMR = 0;  /* Interrupt Mask Register */	duart68681->ISR = 0;  /* Interrupt Status Register */	duart68681->OPCR = 0; /* Output Port Conf. Register */	duart68681->OPR = 0;  /* Output Port Register */	duart68681->CTR.d = 0;  /* Counter/Timer Preset Value */	duart68681->IP_last_state = 0;  /* last state of IP bits */	// "reset clears internal registers (SRA, SRB, IMR, ISR, OPR, OPCR) puts OP0-7 in the high state, stops the counter/timer, and puts channels a/b in the inactive state"	save0 = duart68681->channel[0].tx_timer;	save1 = duart68681->channel[1].tx_timer;	memset(duart68681->channel, 0, sizeof(duart68681->channel));	duart68681->channel[0].tx_timer = save0;	duart68681->channel[1].tx_timer = save1;	if (duart68681->duart_config->output_port_write)		duart68681->duart_config->output_port_write(duart68681->device, duart68681->OPR ^ 0xff);	// reset timers	timer_adjust_oneshot(duart68681->channel[0].tx_timer, attotime_never, 0);	timer_adjust_oneshot(duart68681->channel[1].tx_timer, attotime_never, 1);}
开发者ID:johkelly,项目名称:MAME_hi,代码行数:27,


示例3: devcb_call_write_line

void via6522_device::shift(){	if (SO_O2_CONTROL(m_acr) || SO_T2_CONTROL(m_acr))	{		m_out_cb2 = (m_sr >> 7) & 1;		m_sr =  (m_sr << 1) | m_out_cb2;		devcb_call_write_line(&m_out_cb2_func, m_out_cb2);		m_in_cb1=1;		/* this should be one cycle wide */		devcb_call_write_line(&m_out_cb1_func, 0);		devcb_call_write_line(&m_out_cb1_func, 1);		m_shift_counter = (m_shift_counter + 1) % 8;		if (m_shift_counter)        {			if (SO_O2_CONTROL(m_acr)) {				timer_adjust_oneshot(m_shift_timer, cycles_to_time(2), 0);			} else {				timer_adjust_oneshot(m_shift_timer, cycles_to_time((m_t2ll + 2)*2), 0);			}        }		else		{			if (!(m_ifr & INT_SR))            {				set_int(INT_SR);            }		}	}
开发者ID:johkelly,项目名称:MAME_hi,代码行数:33,


示例4: start_pulse

static void start_pulse(const device_config *device){	ttl74123_t *chip = get_safe_token(device);	attotime duration = compute_duration(chip);	if (timer_running(chip))	{		/* retriggering, but not if we are called to quickly */		attotime delay_time = attotime_make(0, ATTOSECONDS_PER_SECOND * chip->intf->cap * 220);		if (attotime_compare(timer_timeelapsed(chip->timer), delay_time) >= 0)		{			timer_adjust_oneshot(chip->timer, duration, 0);			if (LOG) logerror("74123 %s:  Retriggering pulse.  Duration: %f/n", device->tag, attotime_to_double(duration));		}		else		{			if (LOG) logerror("74123 %s:  Retriggering failed./n", device->tag);		}	}	else	{		/* starting */		timer_adjust_oneshot(chip->timer, duration, 0);		set_output(device);		if (LOG) logerror("74123 %s:  Starting pulse.  Duration: %f/n", device->tag, attotime_to_double(duration));	}}
开发者ID:nitrologic,项目名称:emu,代码行数:32,


示例5: TIMER_CALLBACK

static TIMER_CALLBACK( vidc_vblank ){	archimedes_request_irq_a(machine, ARCHIMEDES_IRQA_VBL);	// set up for next vbl	timer_adjust_oneshot(vbl_timer, video_screen_get_time_until_pos(machine->primary_screen, vidc_regs[0xb4], 0), 0);}
开发者ID:nitrologic,项目名称:emu,代码行数:7,


示例6: spacefev_start_red_cannon

void spacefev_start_red_cannon( running_machine *machine ){	n8080_state *state = (n8080_state *)machine->driver_data;	state->spacefev_red_cannon = 1;	timer_adjust_oneshot(state->cannon_timer, ATTOTIME_IN_USEC(550 * 68 * 10), 0);}
开发者ID:AltimorTASDK,项目名称:shmupmametgm,代码行数:7,


示例7: TIMER_CALLBACK

static TIMER_CALLBACK( spacefev_stop_red_cannon ){	n8080_state *state = (n8080_state *)machine->driver_data;	state->spacefev_red_cannon = 0;	timer_adjust_oneshot(state->cannon_timer, attotime_never, 0);}
开发者ID:AltimorTASDK,项目名称:shmupmametgm,代码行数:7,


示例8: switch

void timer_device::device_reset(){	// type based configuration	switch (m_config.m_type)	{		case timer_device_config::TIMER_TYPE_GENERIC:		case timer_device_config::TIMER_TYPE_PERIODIC:		{			// convert the period into attotime			attotime period = attotime_never;			if (m_config.m_period > 0)			{				period = UINT64_ATTOTIME_TO_ATTOTIME(m_config.m_period);				// convert the start_delay into attotime				attotime start_delay = attotime_zero;				if (m_config.m_start_delay > 0)					start_delay = UINT64_ATTOTIME_TO_ATTOTIME(m_config.m_start_delay);				// allocate and start the backing timer				timer_adjust_periodic(m_timer, start_delay, m_config.m_param, period);			}			break;		}		case timer_device_config::TIMER_TYPE_SCANLINE:			if (m_screen == NULL)				fatalerror("timer '%s': unable to find screen '%s'/n", tag(), m_config.m_screen);			// set the timer to to fire immediately			m_first_time = true;			timer_adjust_oneshot(m_timer, attotime_zero, m_config.m_param);			break;	}}
开发者ID:DarrenBranford,项目名称:MAME4iOS,代码行数:35,


示例9: msm5205_playmode

static void msm5205_playmode(msm5205_state *voice,int select){	static const int prescaler_table[4] = {96,48,64,0};	int prescaler = prescaler_table[select & 3];	int bitwidth = (select & 4) ? 4 : 3;	if( voice->prescaler != prescaler )	{		stream_update(voice->stream);		voice->prescaler = prescaler;		/* timer set */		if( prescaler )		{			attotime period = attotime_mul(ATTOTIME_IN_HZ(voice->clock), prescaler);			timer_adjust_periodic(voice->timer, period, 0, period);		}		else			timer_adjust_oneshot(voice->timer, attotime_never, 0);	}	if( voice->bitwidth != bitwidth )	{		stream_update(voice->stream);		voice->bitwidth = bitwidth;	}}
开发者ID:DarrenBranford,项目名称:MAME4iOS,代码行数:29,


示例10: TIMER_CALLBACK

static TIMER_CALLBACK( cursor_callback ){	if (lockon_main_inten)		cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, 0xff);	timer_adjust_oneshot(cursor_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0);}
开发者ID:nitrologic,项目名称:emu,代码行数:7,


示例11: TIMER_CALLBACK

static TIMER_CALLBACK( pr8210_bit_callback ){	attotime duration = ATTOTIME_IN_MSEC(30);	const device_config *laserdisc = ptr;	UINT8 bitsleft = param >> 16;	UINT8 data = param;	/* if we have bits, process */	if (bitsleft != 0)	{		/* assert the line and set a timer for deassertion */	   	laserdisc_line_w(laserdisc, LASERDISC_LINE_CONTROL, ASSERT_LINE);		timer_set(machine, ATTOTIME_IN_USEC(250), ptr, 0, pr8210_bit_off_callback);		/* space 0 bits apart by 1msec, and 1 bits by 2msec */		duration = attotime_mul(ATTOTIME_IN_MSEC(1), (data & 0x80) ? 2 : 1);		data <<= 1;		bitsleft--;	}	/* if we're out of bits, queue up the next command */	else if (bitsleft == 0 && pr8210_command_buffer_in != pr8210_command_buffer_out)	{		data = pr8210_command_buffer[pr8210_command_buffer_out++ % ARRAY_LENGTH(pr8210_command_buffer)];		bitsleft = 12;	}	timer_adjust_oneshot(pr8210_bit_timer, duration, (bitsleft << 16) | data);}
开发者ID:nitrologic,项目名称:emu,代码行数:28,


示例12: schedule_next_irq

INLINE void schedule_next_irq(running_machine *machine, int curscanline){    /* IRQ is clocked by /32V, so every 64 scanlines */    curscanline = (curscanline + 64) & 255;    /* next one at the start of this scanline */    timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(machine->primary_screen, curscanline, 0), curscanline);}
开发者ID:cdenix,项目名称:ps3-mame-0125,代码行数:8,


示例13: f3853_timer_start

static void f3853_timer_start(running_device *device, UINT8 value){	f3853_t	*f3853 = get_safe_token( device );	attotime period = (value != 0xff) ? attotime_mul(ATTOTIME_IN_HZ(device->clock), f3853_value_to_cycle[value]*31) : attotime_never;	timer_adjust_oneshot(f3853->timer, period, 0);}
开发者ID:AltimorTASDK,项目名称:shmupmametgm,代码行数:8,


示例14: MACHINE_RESET

static MACHINE_RESET( atetris ){	/* reset the slapstic */	slapstic_reset();	current_bank = slapstic_bank() & 1;	reset_bank();	/* start interrupts going (32V clocked by 16V) */	timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 48, 0), 48);}
开发者ID:Paulodx,项目名称:sdl-mame-wii,代码行数:10,


示例15: adjust_display_position_interrupt_timer

static void adjust_display_position_interrupt_timer(running_machine *machine){	if ((display_counter + 1) != 0)	{		attotime period = attotime_mul(ATTOTIME_IN_HZ(NEOGEO_PIXEL_CLOCK), display_counter + 1);		if (LOG_VIDEO_SYSTEM) logerror("adjust_display_position_interrupt_timer  current y: %02x  current x: %02x   target y: %x  target x: %x/n", video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen), (display_counter + 1) / NEOGEO_HTOTAL, (display_counter + 1) % NEOGEO_HTOTAL);		timer_adjust_oneshot(display_position_interrupt_timer, period, 0);	}}
开发者ID:nitrologic,项目名称:emu,代码行数:10,


示例16: schedule_next_irq

INLINE void schedule_next_irq(running_machine *machine, int curscanline){	cloud9_state *state = (cloud9_state *)machine->driver_data;	/* IRQ is clocked by /32V, so every 64 scanlines */	curscanline = (curscanline + 64) & 255;	/* next one at the start of this scanline */	timer_adjust_oneshot(state->irq_timer, machine->primary_screen->time_until_pos(curscanline), curscanline);}
开发者ID:hstampfl,项目名称:mame2010-libretro,代码行数:10,


示例17: TIMER_CALLBACK

static TIMER_CALLBACK( ds2401_reset ){	int which = param;	struct ds2401_chip *c = &ds2401[ which ];	verboselog( machine, 1, "ds2401_reset(%d)/n", which );	c->state = STATE_RESET;	timer_adjust_oneshot( c->timer, attotime_never, which );}
开发者ID:nitrologic,项目名称:emu,代码行数:10,


示例18: timer_adjust_oneshot

void running_machine::schedule_soft_reset(){	timer_adjust_oneshot(m_soft_reset_timer, attotime_zero, 0);	// we can't be paused since the timer needs to fire	resume();	// if we're executing, abort out immediately	m_scheduler.eat_all_cycles();}
开发者ID:hstampfl,项目名称:mame2010-libretro,代码行数:10,


示例19: count_states

INLINE void count_states(int states){	attotime state_time = attotime_make(0, attotime_to_attoseconds(MICRO_STATE_CLOCK_PERIOD) * states);	if (!micro.timer)	{		timer_adjust_oneshot(micro.timer, attotime_never, 0);		micro.timer_active = 1;		micro.endtime = state_time;	}	else if (attotime_compare(timer_timeelapsed(micro.timer), micro.endtime) > 0)	{		timer_adjust_oneshot(micro.timer, attotime_never, 0);		micro.timer_active = 1;		micro.endtime = state_time;	}	else		micro.endtime = attotime_add(micro.endtime, state_time);}
开发者ID:Paulodx,项目名称:sdl-mame-wii,代码行数:19,


示例20: WRITE32_HANDLER

static WRITE32_HANDLER( namcofl_paletteram_w ){	COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);	if ((offset == 0x1808/4) && ACCESSING_BITS_16_31)	{		UINT16 v = space->machine->generic.paletteram.u32[offset] >> 16;		UINT16 triggerscanline=(((v>>8)&0xff)|((v&0xff)<<8))-(32+1);		timer_adjust_oneshot(raster_interrupt_timer, space->machine->primary_screen->time_until_pos(triggerscanline), 0);	}
开发者ID:libretro,项目名称:mame2010-libretro,代码行数:11,


示例21: TIMER_CALLBACK

static TIMER_CALLBACK( tms34061_interrupt ){    /* set timer for next frame */    timer_adjust_oneshot(tms34061.timer, video_screen_get_frame_period(tms34061.screen), 0);    /* set the interrupt bit in the status reg */    tms34061.regs[TMS34061_STATUS] |= 1;    /* update the interrupt state */    update_interrupts();}
开发者ID:cdenix,项目名称:ps3-mame-0125,代码行数:11,


示例22: TIMER_CALLBACK

static TIMER_CALLBACK( display_position_vblank_callback ){	if (display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_VBLANK)	{		if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_VBLANK ");		adjust_display_position_interrupt_timer(machine);	}	/* set timer for next screen */	timer_adjust_oneshot(display_position_vblank_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), 0);}
开发者ID:nitrologic,项目名称:emu,代码行数:11,


示例23: a310_set_timer

static void a310_set_timer(int tmr){	double freq;	if(ioc_timercnt[tmr] != 0) // FIXME: dmdtouch does a divide by zero?	{		freq = 2000000.0 / (double)ioc_timercnt[tmr];	//  logerror("IOC: starting timer %d, %d ticks, freq %f Hz/n", tmr, ioc_timercnt[tmr], freq);		timer_adjust_oneshot(timer[tmr], ATTOTIME_IN_HZ(freq), tmr);	}}
开发者ID:nitrologic,项目名称:emu,代码行数:11,


示例24: MACHINE_RESET

static MACHINE_RESET( magmax ){	timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 64, 0), 64);#if 0	{		int i;		for (i=0; i<9; i++)			logerror("SOUND Chan#%i name=%s/n", i, mixer_get_name(i) );	}#endif}
开发者ID:AltimorTASDK,项目名称:shmupmametgm,代码行数:12,


示例25: retro_log

void running_machine::schedule_soft_reset(){    retro_log(RETRO_LOG_INFO, "[MAME 2010] schedule_soft_reset for current MAME machine./n");    	timer_adjust_oneshot(m_soft_reset_timer, attotime_zero, 0);	/* we can't be paused since the timer needs to fire */	resume();	/* if we're executing, abort out immediately */	m_scheduler.eat_all_cycles();}
开发者ID:libretro,项目名称:mame2010-libretro,代码行数:12,


示例26: adjust_display_position_interrupt_timer

static void adjust_display_position_interrupt_timer( running_machine *machine ){	neogeo_state *state = (neogeo_state *)machine->driver_data;	if ((state->display_counter + 1) != 0)	{		attotime period = attotime_mul(ATTOTIME_IN_HZ(NEOGEO_PIXEL_CLOCK), state->display_counter + 1);		if (LOG_VIDEO_SYSTEM) logerror("adjust_display_position_interrupt_timer  current y: %02x  current x: %02x   target y: %x  target x: %x/n", machine->primary_screen->vpos(), machine->primary_screen->hpos(), (state->display_counter + 1) / NEOGEO_HTOTAL, (state->display_counter + 1) % NEOGEO_HTOTAL);		timer_adjust_oneshot(state->display_position_interrupt_timer, period, 0);	}}
开发者ID:libretro,项目名称:mame2010-libretro,代码行数:12,


示例27: TimerHandler

/* TimerHandler from fm.c */static void TimerHandler(void *param,int c,attotime period){	ym3526_state *info = (ym3526_state *)param;	if( attotime_compare(period, attotime_zero) == 0 )	{	/* Reset FM Timer */		timer_enable(info->timer[c], 0);	}	else	{	/* Start FM Timer */		timer_adjust_oneshot(info->timer[c], period, 0);	}}
开发者ID:AltimorTASDK,项目名称:shmupmametgm,代码行数:13,


示例28: ds2401_write

void ds2401_write( running_machine *machine, int which, int data ){	struct ds2401_chip *c = &ds2401[ which ];	verboselog( machine, 1, "ds2401_write( %d, %d )/n", which, data );	if( data == 0 && c->rx != 0 )	{		switch( c->state )		{		case STATE_IDLE:			break;		case STATE_COMMAND:			verboselog( machine, 2, "ds2401_write(%d) state_command/n", which );			timer_adjust_oneshot( c->timer, c->t_samp, which );			break;		case STATE_READROM:			if( c->bit == 0 )			{				c->shift = c->data[ 7 - c->byte ];				verboselog( machine, 1, "ds2401_write(%d) <- data %02x/n", which, c->shift );			}			c->tx = c->shift & 1;			c->shift >>= 1;			c->bit++;			if( c->bit == 8 )			{				c->bit = 0;				c->byte++;			}			verboselog( machine, 2, "ds2401_write(%d) state_readrom %d/n", which, c->tx );			timer_adjust_oneshot( c->timer, c->t_rdv, which );			break;		default:			verboselog( machine, 0, "ds2401_write(%d) state not handled: %d/n", which, c->state );			break;		}		timer_adjust_oneshot( c->reset_timer, c->t_rstl, which );	}	else if( data == 1 && c->rx == 0 )
开发者ID:nitrologic,项目名称:emu,代码行数:40,


示例29: TIMER_CALLBACK

static TIMER_CALLBACK( interrupt_gen ){	int scanline = param;	/* assert/deassert the interrupt */	cputag_set_input_line(machine, "maincpu", 0, (scanline & 32) ? ASSERT_LINE : CLEAR_LINE);	/* set the next timer */	scanline += 32;	if (scanline >= 256)		scanline -= 256;	timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);}
开发者ID:Paulodx,项目名称:sdl-mame-wii,代码行数:13,



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


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