예제 #1
0
파일: midi.c 프로젝트: AmirAbrams/haiku
void
midi_interrupt_op(
	int32 op,
	void * data)
{
	midi_dev * port = (midi_dev *)data;
	ddprintf(("port = %p\n", port));
	if (op == B_MPU_401_ENABLE_CARD_INT) {
		cpu_status cp;
		ddprintf(("cmedia_pci: B_MPU_401_ENABLE_CARD_INT\n"));
		cp = disable_interrupts();
		acquire_spinlock(&port->card->hardware);
		increment_interrupt_handler(port->card);
		set_direct(port->card, 0x01, 0x00, 0x80);
		set_indirect(port->card, 0x2A, 0x04, 0xff);
		release_spinlock(&port->card->hardware);
		restore_interrupts(cp);
	}
	else if (op == B_MPU_401_DISABLE_CARD_INT) {
		/* turn off MPU interrupts */
		cpu_status cp;
		ddprintf(("cmedia_pci: B_MPU_401_DISABLE_CARD_INT\n"));
		cp = disable_interrupts();
		acquire_spinlock(&port->card->hardware);
		set_direct(port->card, 0x01, 0x80, 0x80);
		/* remove interrupt handler if necessary */
		decrement_interrupt_handler(port->card);
		release_spinlock(&port->card->hardware);
		restore_interrupts(cp);
	}
	ddprintf(("cmedia_pci: midi_interrupt_op() done\n"));
}
예제 #2
0
void	mousemove(t_graph *g, SDL_Event event)
{
  (g->angle)[TETA] += 0.1 * event.motion.xrel;
  (g->angle)[PHI] -= 0.1 * event.motion.yrel;
  if ((g->angle)[PHI] > 89.0)
    (g->angle)[PHI] = 89.0;
  if ((g->angle)[PHI] < -89.0)
    (g->angle)[PHI] = -89.0;
  set_direct(g->to, g->left, g->angle);
}