Exemplo n.º 1
0
static void delayed_sound_w(int param)
{
	main_to_sound_data = param;
	main_to_sound_ready = 1;
	cpu_triggerint(1);

	/* use a timer to make long transfers faster */
	timer_set(TIME_IN_USEC(50), 0, 0);
}
Exemplo n.º 2
0
static TIMER_CALLBACK( delayed_sound_w )
{
	main_to_sound_data = param;
	main_to_sound_ready = 1;
	cpu_triggerint(cputag_get_cpu(machine, "audiocpu"));

	/* use a timer to make long transfers faster */
	timer_set(machine, ATTOTIME_IN_USEC(50), NULL, 0, 0);
}
Exemplo n.º 3
0
static TIMER_CALLBACK( delayed_sound_w )
{
	main_to_sound_data = param;
	main_to_sound_ready = 1;
	cpu_triggerint(1);

	/* use a timer to make long transfers faster */
	timer_set(ATTOTIME_IN_USEC(50), NULL, 0, 0);
}
Exemplo n.º 4
0
static void cpu_empty_event_queue(int cpunum)
{
	int i;

	/* swap to the CPU's context */
	cpuintrf_push_context(cpunum);

	/* loop over all events */
	for (i = 0; i < irq_event_index[cpunum]; i++)
	{
		INT32 irq_event = irq_event_queue[cpunum][i];
		int state = irq_event & 0xff;
		int irqline = (irq_event >> 8) & 0xff;
		int vector = irq_event >> 16;

		LOG(("cpu_empty_event_queue %d,%d,%d\n",cpunum,irqline,state));

	/* set the IRQ line state and vector */
	if (irqline >= 0 && irqline < MAX_IRQ_LINES)
	{
		irq_line_state[cpunum][irqline] = state;
			irq_line_vector[cpunum][irqline] = vector;
	}

	/* switch off the requested state */
	switch (state)
	{
		case PULSE_LINE:
			activecpu_set_irq_line(irqline, INTERNAL_ASSERT_LINE);
			activecpu_set_irq_line(irqline, INTERNAL_CLEAR_LINE);
			break;

		case HOLD_LINE:
		case ASSERT_LINE:
			activecpu_set_irq_line(irqline, INTERNAL_ASSERT_LINE);
			break;

		case CLEAR_LINE:
			activecpu_set_irq_line(irqline, INTERNAL_CLEAR_LINE);
			break;

		default:
			logerror("cpu_manualirqcallback cpu #%d, line %d, unknown state %d\n", cpunum, irqline, state);
	}

	/* generate a trigger to unsuspend any CPUs waiting on the interrupt */
	if (state != CLEAR_LINE)
		cpu_triggerint(cpunum);
}

	/* swap back */
	cpuintrf_pop_context();

	/* reset counter */
	irq_event_index[cpunum] = 0;
}
Exemplo n.º 5
0
static void end_spin(int param)
{
	cpu_triggerint(0);
}
Exemplo n.º 6
0
static TIMER_CALLBACK( cpunum_empty_event_queue )
{
	int cpunum = param & 0xff;
	int line = param >> 8;
	int i;

	/* swap to the CPU's context */
	cpuintrf_push_context(cpunum);

	/* loop over all events */
	for (i = 0; i < input_event_index[cpunum][line]; i++)
	{
		INT32 input_event = input_event_queue[cpunum][line][i];
		int state = input_event & 0xff;
		int vector = input_event >> 8;

		LOG(("cpunum_empty_event_queue %d,%d,%d\n",cpunum,line,state));

		/* set the input line state and vector */
		input_line_state[cpunum][line] = state;
		input_line_vector[cpunum][line] = vector;

		/* special case: RESET */
		if (line == INPUT_LINE_RESET)
		{
			/* if we're asserting the line, just halt the CPU */
			if (state == ASSERT_LINE)
				cpunum_suspend(cpunum, SUSPEND_REASON_RESET, 1);
			else
			{
				/* if we're clearing the line that was previously asserted, or if we're just */
				/* pulsing the line, reset the CPU */
				if ((state == CLEAR_LINE && cpunum_is_suspended(cpunum, SUSPEND_REASON_RESET)) || state == PULSE_LINE)
					cpunum_reset(cpunum);

				/* if we're clearing the line, make sure the CPU is not halted */
				cpunum_resume(cpunum, SUSPEND_REASON_RESET);
			}
		}

		/* special case: HALT */
		else if (line == INPUT_LINE_HALT)
		{
			/* if asserting, halt the CPU */
			if (state == ASSERT_LINE)
				cpunum_suspend(cpunum, SUSPEND_REASON_HALT, 1);

			/* if clearing, unhalt the CPU */
			else if (state == CLEAR_LINE)
				cpunum_resume(cpunum, SUSPEND_REASON_HALT);
		}

		/* all other cases */
		else
		{
			/* switch off the requested state */
			switch (state)
			{
				case PULSE_LINE:
					/* temporary: PULSE_LINE only makes sense for NMI lines on Z80 */
					assert(machine->drv->cpu[cpunum].type != CPU_Z80 || line == INPUT_LINE_NMI);
					activecpu_set_input_line(line, INTERNAL_ASSERT_LINE);
					activecpu_set_input_line(line, INTERNAL_CLEAR_LINE);
					break;

				case HOLD_LINE:
				case ASSERT_LINE:
					activecpu_set_input_line(line, INTERNAL_ASSERT_LINE);
					break;

				case CLEAR_LINE:
					activecpu_set_input_line(line, INTERNAL_CLEAR_LINE);
					break;

				default:
					logerror("cpunum_empty_event_queue cpu #%d, line %d, unknown state %d\n", cpunum, line, state);
			}

			/* generate a trigger to unsuspend any CPUs waiting on the interrupt */
			if (state != CLEAR_LINE)
				cpu_triggerint(cpunum);
		}
	}

	/* swap back */
	cpuintrf_pop_context();

	/* reset counter */
	input_event_index[cpunum][line] = 0;
}